/* ============ PETER STUNT — TEMA: BLANCO · NEGRO · ROJO (Elegante / Serio) ============ */
:root {
  --bg: #f6f6f4;
  --bg2: #ffffff;
  --panel: #ffffff;
  --panel2: #f1f1ee;
  --line: #e3e3de;
  --line2: #c8c8c2;
  --ink: #0b0b0d;
  --ink2: #1c1c20;
  --red: #e10600;
  --red-dark: #b00500;
  --warn: #b57a00;
  --text: #141417;
  --dim: #6f6f6a;
  --ok: #0f7b4d;
  --err: #e10600;
  --font-d: "Archivo Black", "Arial Black", sans-serif;
  --font-u: "Space Grotesk", system-ui, sans-serif;
  --font-m: "JetBrains Mono", "Cascadia Code", monospace;
  --clip: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  --shadow: 0 18px 46px rgba(11, 11, 13, 0.08);
  --shadow-lg: 0 30px 70px rgba(11, 11, 13, 0.16);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(225, 6, 0, 0.045), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  color: var(--text);
  font-family: var(--font-u);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--red); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #cfcfc8; border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--red); }

.mono { font-family: var(--font-m); }
.big-d { font-family: var(--font-d); }

/* Título con contraste de color (elegante) */
.stroke-red {
  color: transparent;
  -webkit-text-stroke: 2px var(--red);
}
.stroke-ink {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
}

/* Blink */
.blink { animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ============ BOTONES ============ */
.btn {
  font-family: var(--font-m); font-weight: 700; letter-spacing: .12em; font-size: .76rem;
  padding: .9rem 1.5rem; cursor: pointer; border: 1px solid var(--ink);
  background: transparent; color: var(--ink); clip-path: var(--clip);
  transition: all .18s ease; display: inline-flex; align-items: center; gap: .55rem;
  text-transform: uppercase; white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(11,11,13,.12); }
.btn-red { background: var(--red); color: #fff; border-color: var(--red); box-shadow: 0 10px 26px rgba(225,6,0,.22); }
.btn-red:hover { background: var(--red-dark); border-color: var(--red-dark); box-shadow: 0 14px 32px rgba(225,6,0,.3); }
.btn-ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-ink:hover { background: var(--ink2); border-color: var(--ink2); box-shadow: 0 12px 28px rgba(11,11,13,.2); }
.btn-ghost:hover { border-color: var(--red); color: var(--red); box-shadow: 0 12px 24px rgba(225,6,0,.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* Etiqueta terminal / categoría (ahora seria) */
.tag {
  font-family: var(--font-m); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  padding: .24rem .55rem; border: 1px solid var(--line2); color: var(--dim);
  background: var(--bg2); display: inline-flex; align-items: center; gap: .4rem;
}
.tag::before { content: "››"; color: var(--red); font-weight: 700; }
.tag-red { color: var(--red); border-color: rgba(225,6,0,.4); background: rgba(225,6,0,.04); }
.tag-ink { color: var(--ink); border-color: var(--ink); background: var(--ink); }
.tag-ink::before { content: "▮"; color: #fff; }

/* Chips filtros */
.chips { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: 1.8rem; }
.chip {
  font-family: var(--font-m); font-size: .74rem; letter-spacing: .1em; cursor: pointer;
  padding: .6rem 1.05rem; background: var(--bg2); border: 1px solid var(--line2); color: var(--dim);
  transition: all .15s ease; text-transform: uppercase;
}
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 8px 18px rgba(11,11,13,.16); }
.chip.on:hover { color: #fff; }

/* Terminal (ventana, ahora b/n/rojo) */
.terminal {
  background: var(--ink); border: 1px solid rgba(255,255,255,.12); clip-path: var(--clip);
  box-shadow: var(--shadow-lg); font-family: var(--font-m); font-size: .8rem; line-height: 1.65;
}
.terminal-head {
  display: flex; align-items: center; gap: .5rem; padding: .6rem .9rem;
  border-bottom: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: #9d9da2;
}
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.red { background: #ff5f57; } .dot.yellow { background: #febc2e; } .dot.green { background: #28c840; }
.dot.black { background: var(--red); }
.terminal-body { padding: 1.05rem 1.15rem; white-space: pre-wrap; word-break: break-word; min-height: 140px; color: #e9e9ec; }
.terminal-body .p-line { display: block; }
.t-green { color: #4fd17b; } .t-cyan { color: #c9c9cf; } .t-hot { color: var(--red); } .t-dim { color: #8b8b91; } .t-warn { color: #ffc44d; }
.cursor { display: inline-block; width: .6em; height: 1.1em; background: #e9e9ec; vertical-align: text-bottom; animation: blink 1s steps(2) infinite; }

/* Overlays / drawers */
.overlay {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(11, 11, 13, 0.55); backdrop-filter: blur(8px);
  align-items: center; justify-content: center; padding: 1.2rem;
}
.overlay.open { display: flex; }
.modal {
  background: var(--bg2); border: 1px solid var(--line2); clip-path: var(--clip);
  width: min(780px, 100%); max-height: 92vh; overflow: auto; position: relative;
  box-shadow: var(--shadow-lg);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.4rem; border-bottom: 1px solid var(--line); position: sticky; top: 0;
  background: var(--bg2); z-index: 2;
}
.modal-head h3 { font-family: var(--font-m); font-weight: 700; letter-spacing: .06em; font-size: .86rem; }
.modal-head h3 .rtag { color: var(--red); }
.close {
  font-family: var(--font-m); background: transparent; border: 1px solid var(--line2); color: var(--dim);
  width: 34px; height: 34px; cursor: pointer; font-size: .95rem; transition: all .15s;
}
.close:hover { color: var(--red); border-color: var(--red); }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 100%); z-index: 110;
  background: var(--bg2); border-left: 1px solid var(--line2); display: none;
  transform: translateX(105%); flex-direction: column; transition: transform .28s ease;
  box-shadow: -24px 0 60px rgba(11,11,13,.18);
}
.drawer.open { display: flex; transform: translateX(0); }
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 105; background: rgba(11,11,13,.42);
  backdrop-filter: blur(3px); display: none;
}
.drawer-backdrop.open { display: block; }

/* Toasts */
.toasts { position: fixed; bottom: 1.2rem; right: 1.2rem; z-index: 200; display: flex; flex-direction: column; gap: .6rem; }
.toast {
  background: var(--bg2); border: 1px solid var(--line2); border-left: 4px solid var(--ink); clip-path: var(--clip);
  padding: .9rem 1.1rem; min-width: 260px; max-width: 380px; font-size: .84rem;
  animation: toastIn .25s ease; box-shadow: var(--shadow);
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
.toast.inf { border-left-color: var(--red); }
.toast .t-title { font-family: var(--font-d); font-size: .72rem; letter-spacing: .05em; display: block; margin-bottom: .25rem; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Inputs */
.field { margin-bottom: .95rem; }
.field label { display: block; font-family: var(--font-m); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: .35rem; }
.field input, .field select, .field textarea {
  width: 100%; background: #fff; border: 1px solid var(--line2); color: var(--text);
  padding: .75rem .9rem; font-family: var(--font-u); font-size: .92rem; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(11,11,13,.06); }
.field textarea { resize: vertical; min-height: 90px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .95rem; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .95rem; }

/* Badges */
.badge {
  font-family: var(--font-m); font-size: .64rem; letter-spacing: .09em; text-transform: uppercase;
  padding: .22rem .5rem; border: 1px solid var(--line2); color: var(--dim); background: var(--bg2);
}
.badge.paid, .badge.delivered { color: var(--ok); border-color: rgba(15,123,77,.35); background: rgba(15,123,77,.05); }
.badge.pending { color: #9a6a00; border-color: rgba(181,122,0,.35); background: rgba(181,122,0,.06); }
.badge.cancelled { color: var(--err); border-color: rgba(225,6,0,.35); background: rgba(225,6,0,.05); }
.badge.cyan { color: var(--ink); border-color: rgba(11,11,13,.3); background: rgba(11,11,13,.04); }

@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(225,6,0,.34); } 50% { box-shadow: 0 0 0 8px rgba(225,6,0,0); } }

@media (max-width: 640px) {
  .row2, .row3 { grid-template-columns: 1fr; }
}