/* ============================================================
   Manitos — admin dashboard UI
   Paleta lima + carbón. Outfit (display) · Manrope (UI) · JetBrains Mono (datos)
   ============================================================ */
:root {
  --bg:        #141414;
  --surface:   #1a1a1a;
  --card:      #1f1f1f;
  --card-2:    #242424;
  --raised:    #2a2a2a;
  --border:    rgba(255,255,255,.07);
  --border-2:  rgba(255,255,255,.12);

  --lime:      #a4d65e;
  --lime-hi:   #b6e56e;
  --lime-soft: rgba(164,214,94,.13);
  --lime-line: rgba(164,214,94,.34);
  --on-lime:   #14240a;

  --text:  #f3f3f0;
  --muted: #a2a2a0;
  --faint: #6e6e6c;

  --amber: #f5b756; --amber-soft: rgba(245,183,86,.14);
  --blue:  #76a9ff; --blue-soft:  rgba(118,169,255,.14);
  --green: #5fd38a; --green-soft: rgba(95,211,138,.14);
  --red:   #f2776e; --red-soft:   rgba(242,119,110,.14);

  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow:    0 10px 34px rgba(0,0,0,.4);
  --shadow-sm: 0 4px 16px rgba(0,0,0,.3);

  --font-display: "Outfit", system-ui, sans-serif;
  --font-sans: "Manrope", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 540px at 8% -12%, rgba(164,214,94,.10), transparent 58%),
    radial-gradient(760px 520px at 102% -6%, rgba(164,214,94,.045), transparent 56%),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--lime); text-decoration: none; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); letter-spacing: -.02em; }
::selection { background: var(--lime); color: var(--on-lime); }
:focus-visible { outline: 2px solid var(--lime-line); outline-offset: 2px; }

/* scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #333; border: 3px solid transparent; background-clip: padding-box; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #444; background-clip: padding-box; }

/* ============================ App shell ============================ */
.app { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 16px;
  background: linear-gradient(180deg, #1c1c1c, #181818);
  border-right: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.brand-logo { height: 34px; width: 34px; border-radius: 9px; object-fit: cover; box-shadow: 0 0 0 1px var(--border-2); }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; color: var(--text); letter-spacing: -.03em; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 600; font-size: .92rem;
  transition: background .15s, color .15s; cursor: pointer;
}
.nav-item svg { width: 18px; height: 18px; flex: 0 0 auto; }
.nav-item:hover { background: rgba(255,255,255,.045); color: var(--text); }
.nav-item.active { background: var(--lime-soft); color: var(--lime); box-shadow: inset 0 0 0 1px var(--lime-line); }
.nav-item.is-soon { cursor: default; color: var(--faint); }
.nav-item.is-soon:hover { background: none; color: var(--faint); }
.soon { margin-left: auto; font-style: normal; font-family: var(--font-mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; padding: 2px 7px; border-radius: 99px; background: rgba(255,255,255,.05); color: var(--faint); }
.nav-label { margin: 22px 12px 8px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); }

.sidebar-foot { margin-top: auto; padding-top: 18px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 9px 10px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.avatar { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: var(--lime); color: var(--on-lime); font-weight: 800; font-size: .9rem; }
.user-name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip form { margin-left: auto; display: flex; }
.icon-btn { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; transition: .15s; }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--red-soft); color: var(--red); }
.version { display: block; margin: 12px 4px 0; font-family: var(--font-mono); font-size: .7rem; color: var(--faint); }

.content { min-width: 0; }
.content-inner { max-width: 1080px; margin: 0 auto; padding: 40px 44px 88px; }

/* ============================ Page header ============================ */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 30px; animation: fadeUp .5s ease both; }
.page-eyebrow { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .04em; color: var(--lime); margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.page-eyebrow a { color: var(--muted); }
.page-eyebrow a:hover { color: var(--lime); }
.page-title { font-size: 2.1rem; font-weight: 700; }
.page-sub { color: var(--muted); margin-top: 7px; font-size: .98rem; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; flex: 0 0 auto; }

.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: .88rem; }
.back-link:hover { color: var(--lime); }
.back-link svg { width: 15px; height: 15px; }

/* ============================ Stat cards ============================ */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 30px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; animation: fadeUp .5s ease both; }
.stat:nth-child(2){animation-delay:.04s} .stat:nth-child(3){animation-delay:.08s} .stat:nth-child(4){animation-delay:.12s}
.stat-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.stat-label .ic { width: 15px; height: 15px; color: var(--faint); }
.stat-value { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; margin-top: 12px; line-height: 1; letter-spacing: -.03em; }
.stat--accent { position: relative; overflow: hidden; }
.stat--accent::after { content: ""; position: absolute; inset: 0; background: radial-gradient(420px 160px at 100% 0, var(--lime-soft), transparent 60%); pointer-events: none; }
.stat--accent .stat-value { color: var(--lime); }

/* ============================ Cards grid ============================ */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.project-card {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; overflow: hidden; color: var(--text);
  transition: transform .18s ease, border-color .18s, box-shadow .18s;
  animation: fadeUp .5s ease both;
}
.project-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--lime); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.project-card:hover { transform: translateY(-3px); border-color: var(--border-2); box-shadow: var(--shadow); }
.project-card:hover::before { transform: scaleX(1); }
.pc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pc-title { font-size: 1.18rem; font-weight: 700; letter-spacing: -.01em; }
.pc-domain { font-family: var(--font-mono); font-size: .82rem; color: var(--lime); margin-top: 3px; word-break: break-all; }
.pc-meta { display: flex; align-items: center; gap: 8px; color: var(--faint); font-family: var(--font-mono); font-size: .76rem; }
.pc-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 4px; }
.pc-go { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .82rem; font-weight: 600; transition: .15s; }
.project-card:hover .pc-go { color: var(--lime); }
.pc-spend { font-family: var(--font-mono); font-size: .8rem; font-weight: 700; color: var(--lime); background: var(--lime-soft); border: 1px solid var(--lime-line); border-radius: 999px; padding: 2px 9px; }
.spend-chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: .82rem; font-weight: 700; color: var(--lime); background: var(--lime-soft); border: 1px solid var(--lime-line); border-radius: 999px; padding: 6px 12px; }
.pc-go svg { width: 15px; height: 15px; transition: transform .18s; }
.project-card:hover .pc-go svg { transform: translateX(3px); }

/* ============================ Badges ============================ */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 11px 4px 9px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; letter-spacing: .01em;
  border: 1px solid transparent; white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px transparent; }
.badge[data-status="BORRADOR"] { color: #c6c6c4; background: rgba(255,255,255,.06); }
.badge[data-status="RECREANDO"] { color: var(--amber); background: var(--amber-soft); border-color: rgba(245,183,86,.3); }
.badge[data-status="RECREANDO"] .badge-dot { animation: pulse-dot 1.4s ease-in-out infinite; }
.badge[data-status="RECREADO"] { color: var(--lime); background: var(--lime-soft); border-color: var(--lime-line); }
.badge[data-status="ENVIADO"] { color: var(--blue); background: var(--blue-soft); border-color: rgba(118,169,255,.3); }
.badge[data-status="VENDIDO"] { color: var(--green); background: var(--green-soft); border-color: rgba(95,211,138,.3); }
.badge[data-status="ERROR"] { color: var(--red); background: var(--red-soft); border-color: rgba(242,119,110,.3); }

/* ============================ Buttons ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-weight: 700; font-size: .9rem; line-height: 1;
  padding: 11px 17px; border-radius: 11px; border: 1px solid transparent;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: var(--lime); color: var(--on-lime); }
.btn--primary:hover { background: var(--lime-hi); box-shadow: 0 6px 20px rgba(164,214,94,.28); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border-2); }
.btn--ghost:hover { border-color: var(--lime-line); color: var(--lime); background: var(--lime-soft); }
.btn--danger { background: transparent; color: var(--red); border-color: rgba(242,119,110,.42); }
.btn--danger:hover { background: var(--red-soft); }
.btn--sm { padding: 8px 13px; font-size: .83rem; border-radius: 9px; }
.btn[disabled], .btn.is-disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn[disabled]:active { transform: none; }

/* ============================ Panels / sections ============================ */
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px 28px; animation: fadeUp .5s ease both; }
.panel + .panel { margin-top: 18px; }
.section { padding: 22px 0; border-top: 1px solid var(--border); }
.section:first-child { padding-top: 0; border-top: 0; }
.section-head { margin-bottom: 18px; }
.section-title { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.section-title .ic { width: 17px; height: 17px; color: var(--lime); }
.section-desc { color: var(--muted); font-size: .88rem; margin-top: 4px; }

/* ============================ Forms ============================ */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field > label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 7px; color: #dcdcda; }
form :is(input[type=text], input[type=url], input[type=number], input[type=password], input[type=email], input:not([type]), textarea, select) {
  width: 100%; padding: 11px 13px;
  background: var(--raised); color: var(--text);
  border: 1px solid var(--border-2); border-radius: 11px;
  font: inherit; font-size: .92rem; transition: border-color .15s, box-shadow .15s;
}
form :is(input, textarea, select)::placeholder { color: var(--faint); }
form :is(input, textarea, select):focus { outline: none; border-color: var(--lime-line); box-shadow: 0 0 0 3px var(--lime-soft); }
form :is(input, textarea):disabled, form select:disabled { opacity: .55; cursor: not-allowed; }
input[name="slug"] { font-family: var(--font-mono); color: var(--lime); }
textarea { resize: vertical; min-height: 100px; line-height: 1.55; }
select {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a2a2a0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 38px;
}
.hint { color: var(--faint); font-size: .8rem; margin-top: 6px; }
.field-error, ul.errorlist { color: var(--red); font-size: .82rem; margin: 6px 0 0; padding: 0; list-style: none; }
.field.has-error :is(input, textarea, select) { border-color: rgba(242,119,110,.55); }

.field-row { display: grid; grid-template-columns: 1fr 130px; gap: 12px; align-items: start; }
.field-row .field { margin-bottom: 0; }

/* style guideline chips */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; }
.check {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 12px 14px; background: var(--raised);
  border: 1px solid var(--border-2); border-radius: 12px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.check:hover { border-color: var(--lime-line); }
.check:has(input:checked) { border-color: var(--lime-line); background: var(--lime-soft); }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box { width: 19px; height: 19px; flex: 0 0 auto; display: grid; place-items: center; border: 1.6px solid var(--border-2); border-radius: 6px; transition: .15s; }
.check .box svg { width: 12px; height: 12px; color: var(--on-lime); opacity: 0; transition: opacity .12s; }
.check input:checked ~ .box { background: var(--lime); border-color: var(--lime); }
.check input:checked ~ .box svg { opacity: 1; }
.check .name { font-weight: 600; font-size: .88rem; }

.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border); }

/* ============================ Actions / status panel ============================ */
.action-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.action-bar .spacer { flex: 1; }
.status-line { margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: .88rem; }
.error-note { margin-top: 12px; padding: 11px 14px; border-radius: 11px; background: var(--red-soft); border: 1px solid rgba(242,119,110,.3); color: #f3a59e; font-size: .86rem; }
.error-note code { font-family: var(--font-mono); color: var(--red); }

/* ============================ Editor visual (bloques en el sidebar) ============================ */
/* El editor ocupa todo el ancho: el contenido pierde el max-width y casi todo el padding. */
.content-inner--editor { max-width: none; padding: 14px 18px; }
.veditor-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }

/* Panel de bloques dentro del sidebar principal */
.sidebar-blocks { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; }
.sidebar-blocks .vblocks { overflow: auto; flex: 1; min-height: 0; padding-right: 2px; }
.rail-head { display: flex; align-items: center; justify-content: space-between; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin-top: 4px; }
.add-block-panel { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.add-block-panel label { font-size: .8rem; font-weight: 600; color: #d8d8d8; }
.add-block-panel[hidden] { display: none; }

.vblocks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.vblock { display: flex; align-items: center; gap: 8px; padding: 9px 10px; background: var(--card); border: 1px solid var(--border); border-radius: 11px; cursor: pointer; transition: border-color .15s, background .15s; }
.vblock:hover { border-color: var(--border-2); }
.vblock.active { border-color: var(--lime-line); background: var(--lime-soft); }
.vblock.dragging { opacity: .5; }
.vblock-grip { color: var(--faint); cursor: grab; display: flex; flex: 0 0 auto; }
.vblock-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.vblock-label { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vblock-type { font-family: var(--font-mono); font-size: .68rem; color: var(--faint); }
.vblock-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; flex: 0 0 auto; }
.vblock:hover .vblock-actions, .vblock.active .vblock-actions { opacity: 1; }
.vblock-act { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.vblock-act:hover { background: var(--raised); color: var(--text); }
.vblock-act.danger:hover { background: var(--red-soft); color: var(--red); }
.vblocks-empty { color: var(--muted); font-size: .86rem; padding: 14px; border: 1px dashed var(--border-2); border-radius: 12px; }

.veditor-canvas { position: relative; }
.editor-preview { position: relative; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: #fff; height: calc(100vh - 92px); min-height: 480px; box-shadow: var(--shadow); }
.editor-preview iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }

/* Consola del visor en vivo, superpuesta sobre el canvas mientras la IA trabaja */
.console--overlay { position: absolute; inset: 0; z-index: 6; border-radius: 16px; display: flex; flex-direction: column; }
.console--overlay .console-body { flex: 1; overflow: auto; }
.console--overlay .rc-stream pre { max-height: none; }
.editor-hint { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: rgba(20,20,20,.9); color: #f3f3f0; border: 1px solid var(--border-2); font-size: .78rem; font-weight: 600; box-shadow: var(--shadow-sm); pointer-events: none; transition: background .2s, color .2s; max-width: 90%; }
.editor-hint.flash { background: var(--lime); color: var(--on-lime); border-color: var(--lime); }

.ai-bar { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(620px, 88%); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; background: rgba(26,26,26,.96); backdrop-filter: blur(8px); border: 1px solid var(--border-2); border-radius: 14px; box-shadow: var(--shadow); }
.ai-bar-target { font-size: .74rem; font-weight: 700; color: var(--lime); background: var(--lime-soft); border: 1px solid var(--lime-line); padding: 4px 10px; border-radius: 999px; white-space: nowrap; flex: 0 0 auto; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.ai-bar form { display: flex; align-items: center; gap: 8px; flex: 1; }
.ai-bar input[type=text] { flex: 1; background: transparent; border: 0; color: var(--text); font: inherit; font-size: .9rem; padding: 6px 0; }
.ai-bar input[type=text]:focus { outline: none; box-shadow: none; }
.ai-bar .btn { flex: 0 0 auto; padding: 9px 11px; }
.ai-pill { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .76rem; font-weight: 700; color: var(--muted); background: var(--raised); border: 1px solid var(--border-2); border-radius: 999px; padding: 6px 11px; cursor: pointer; flex: 0 0 auto; transition: .15s; }
.ai-pill svg { width: 14px; height: 14px; }
.ai-pill:hover { border-color: var(--lime-line); color: var(--lime); }
.ai-pill.active { background: var(--lime-soft); color: var(--lime); border-color: var(--lime-line); }
.ai-pill[disabled] { opacity: .4; cursor: not-allowed; }
.ai-bar-target.is-img { color: var(--on-lime); background: var(--lime); border-color: var(--lime); }
.ai-clear { flex: 0 0 auto; width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--raised); color: var(--muted); cursor: pointer; font-size: .78rem; }
.ai-clear:hover { background: var(--red-soft); color: var(--red); }

@media (max-width: 920px) {
  .editor-preview { height: 70vh; min-height: 360px; }
}

/* ============================ Consola en vivo ============================ */
.console { margin-top: 18px; border: 1px solid var(--border-2); border-radius: 14px; overflow: hidden; background: #151515; animation: fadeUp .4s ease both; }
.console[hidden] { display: none; }
.console-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #1f1f1f; border-bottom: 1px solid var(--border); }
.console-bar .dots { display: flex; gap: 6px; }
.console-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: #3a3a3a; }
.console-bar .title { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); }
.console-bar .live { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .08em; color: var(--amber); }
.console-bar .live .badge-dot { background: var(--amber); animation: pulse-dot 1.4s ease-in-out infinite; }
.console-body { padding: 14px 16px; display: grid; gap: 14px; }
.rc-phases { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.rc-phase { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--muted); transition: color .2s; }
.rc-phase .tick { width: 19px; height: 19px; flex: 0 0 auto; display: grid; place-items: center; border: 1.6px solid var(--border-2); border-radius: 50%; color: transparent; transition: .2s; }
.rc-phase.current { color: var(--text); }
.rc-phase.current .tick { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.rc-phase.done { color: var(--text); }
.rc-phase.done .tick { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.rc-stream { border: 1px solid var(--border); border-radius: 10px; background: #111; overflow: hidden; }
.rc-stream-label { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.rc-stream pre { margin: 0; padding: 12px; max-height: 220px; overflow: auto; font-family: var(--font-mono); font-size: .78rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
#rc-thinking { color: #c2c2a4; }
#rc-thinking:empty::after { content: "esperando…"; color: var(--faint); }
#rc-output { color: #cfe89f; }
#rc-output:empty::after { content: "esperando…"; color: var(--faint); }

/* danger zone */
.danger-zone { margin-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border: 1px solid rgba(242,119,110,.28); border-radius: var(--radius); background: linear-gradient(90deg, var(--red-soft), transparent); }
.danger-zone .dz-text { font-size: .9rem; }
.danger-zone .dz-text strong { display: block; color: var(--red); font-weight: 700; margin-bottom: 2px; }

/* ============================ Alerts ============================ */
.alerts { display: flex; flex-direction: column; gap: 9px; margin-bottom: 24px; }
.alert { display: flex; align-items: center; gap: 11px; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); font-size: .92rem; animation: fadeUp .4s ease both; }
.alert-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.alert[data-level~="success"] { border-color: var(--lime-line); background: var(--lime-soft); }
.alert[data-level~="success"] .alert-dot { background: var(--lime); }
.alert[data-level~="error"] { border-color: rgba(242,119,110,.4); background: var(--red-soft); }
.alert[data-level~="error"] .alert-dot { background: var(--red); }
.alert[data-level~="warning"] { border-color: rgba(245,183,86,.4); background: var(--amber-soft); }
.alert[data-level~="warning"] .alert-dot { background: var(--amber); }
.alert[data-level~="info"] .alert-dot { background: var(--blue); }

/* ============================ Empty state ============================ */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 60px 30px; border: 1px dashed var(--border-2); border-radius: var(--radius-lg); animation: fadeUp .5s ease both; }
.empty-ic { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: var(--lime-soft); color: var(--lime); margin-bottom: 6px; }
.empty-ic svg { width: 26px; height: 26px; }
.empty h3 { font-size: 1.2rem; }
.empty p { color: var(--muted); margin: 0 0 14px; max-width: 360px; }

/* ============================ Auth ============================ */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.auth-alerts { width: 100%; max-width: 400px; margin-bottom: 14px; }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 38px 34px; box-shadow: var(--shadow); animation: fadeUp .5s ease both; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 26px; }
.auth-brand img { height: 48px; width: 48px; border-radius: 12px; box-shadow: 0 0 0 1px var(--border-2); }
.auth-brand .brand-name { font-size: 1.6rem; }
.auth-title { text-align: center; font-size: 1.15rem; font-weight: 700; }
.auth-sub { text-align: center; color: var(--muted); font-size: .9rem; margin: 6px 0 24px; }
.auth-card .btn { width: 100%; margin-top: 6px; }

/* ============================ Animations ============================ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@keyframes pulse-dot { 0%, 100% { box-shadow: 0 0 0 0 currentColor; } 50% { box-shadow: 0 0 0 4px transparent; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ============================ Responsive ============================ */
@media (max-width: 920px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; gap: 12px; padding: 12px 16px; overflow-x: auto; }
  .brand { padding: 0 8px 0 0; flex: 0 0 auto; }
  .brand-name { display: none; }
  .nav { flex-direction: row; }
  .nav--ghost, .nav-label, .sidebar-foot .version { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; }
  .nav-item span.soon { display: none; }
  .content-inner { padding: 24px 18px 64px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-direction: column; }
  .field-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .page-title { font-size: 1.7rem; }
  .stat-value { font-size: 1.8rem; }
}
