/* AuditDocs Flow — Paleta oficial: Oro #D4AF5A · Vino #7A1E3A · Vino profundo #4E1024 · Grafito #1C1A20 · Marfil #F7F5F2 · Tipografía Sora */
:root {
  --vino: #7A1E3A; --vino-2: #4E1024; --vino-3: #A33358; --rosa: #E07A9B; --rosa-soft: #F6E3EA;
  --oro: #D4AF5A; --oro-2: #B8923A; --grafito: #1C1A20; --grafito-2: #2A2730; --marfil: #F7F5F2;
  --bg: #F7F5F2; --surface: #FFFFFF; --surface-2: #FBFAF8; --line: #E8E3DE; --line-2: #D9D2CB;
  --text: #1C1A20; --text-2: #5B5560; --text-3: #8C8590;
  --ok: #1F8A5B; --ok-bg: #E3F4EC; --warn: #B7791F; --warn-bg: #FDF1DC; --bad: #C0352B; --bad-bg: #FBE6E4;
  --info: #2F5FA7; --info-bg: #E5EDF9; --mute-bg: #EFECE9;
  --accent: var(--vino); --accent-text: #fff;
  --shadow: 0 1px 2px rgba(28,26,32,.06), 0 6px 24px rgba(28,26,32,.06);
  --shadow-lg: 0 20px 60px rgba(28,26,32,.22);
  --r: 16px; --r-sm: 10px;
  --side-w: 256px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131116; --surface: #1C1A20; --surface-2: #221F27; --line: #2E2A33; --line-2: #3A3540;
    --text: #F3EEF0; --text-2: #BDB4BC; --text-3: #8A818B; --rosa-soft: #3A1A27;
    --ok: #4CC38A; --ok-bg: #133325; --warn: #E8B04B; --warn-bg: #3A2C12; --bad: #F07067; --bad-bg: #3D1714;
    --info: #7FA8F0; --info-bg: #17253D; --mute-bg: #2A2730; --accent: #C2456F;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 24px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131116; --surface: #1C1A20; --surface-2: #221F27; --line: #2E2A33; --line-2: #3A3540;
  --text: #F3EEF0; --text-2: #BDB4BC; --text-3: #8A818B; --rosa-soft: #3A1A27;
  --ok: #4CC38A; --ok-bg: #133325; --warn: #E8B04B; --warn-bg: #3A2C12; --bad: #F07067; --bad-bg: #3D1714;
  --info: #7FA8F0; --info-bg: #17253D; --mute-bg: #2A2730; --accent: #C2456F;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 24px rgba(0,0,0,.25); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
.muted { color: var(--text-2); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; } .b { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Boot */
.boot { min-height: 100vh; display: grid; place-items: center; gap: 18px; align-content: center; }
.boot img { width: 72px; border-radius: 18px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--vino); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: .15s; }
.btn:hover { border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--vino-3), var(--vino) 55%, var(--vino-2)); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(122,30,58,.3); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--mute-bg); }
.btn.ok { background: var(--ok); color: #fff; border-color: transparent; }
.btn.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: transparent; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn.icon { width: 40px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg, .ico { width: 18px; height: 18px; flex: none; }
.btn.sm svg { width: 16px; height: 16px; }

/* Formularios */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.input, select.input, textarea.input { width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); outline: none; transition: .15s; }
textarea.input { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.check input { width: 18px; height: 18px; accent-color: var(--vino); }
.chips-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: -6px; margin-bottom: 14px; }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { position: relative; overflow: hidden; background: radial-gradient(1200px 600px at 10% 10%, #A33358 0%, transparent 60%), linear-gradient(150deg, #7A1E3A 0%, #4E1024 55%, #1C1A20 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art::before { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, transparent, var(--oro), transparent); z-index: 2; }
.login-art::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, transparent, #000 40%, transparent); }
.login-art > * { position: relative; z-index: 1; }
.login-art img { width: 280px; }
.login-art h1 { font-size: clamp(28px, 3.4vw, 44px); font-weight: 800; max-width: 560px; }
.login-art h1 em { font-style: normal; color: #F4A6BF; }
.feat { display: grid; gap: 14px; margin-top: 28px; max-width: 520px; }
.feat div { display: flex; gap: 14px; align-items: flex-start; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); padding: 14px 16px; border-radius: 14px; backdrop-filter: blur(6px); }
.feat svg { width: 22px; height: 22px; flex: none; color: var(--oro); margin-top: 1px; }
.feat b { display: block; font-size: 14px; } .feat span { font-size: 12.5px; opacity: .8; }
.login-form { display: grid; place-items: center; padding: 32px 20px; background: var(--bg); }
.login-card { width: 100%; max-width: 400px; }
.login-card .logo { width: 290px; margin: 0 auto 28px; }
.login-card h2 { font-size: 22px; margin-bottom: 4px; }
.login-card .btn.primary { width: 100%; height: 48px; font-size: 15px; margin-top: 6px; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-light { display: none; } :root:not([data-theme="light"]) .logo-dark { display: block; } }
:root[data-theme="dark"] .logo-light { display: none; } :root[data-theme="dark"] .logo-dark { display: block; }

/* Layout */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--grafito); color: #EDE6EA; display: flex; flex-direction: column; padding: 22px 14px; gap: 6px; }
.side .brand { padding: 4px 8px 22px; } .side .brand img { width: 200px; }
.nav { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: #CFC5CB; font-weight: 500; cursor: pointer; transition: .15s; }
.nav:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav.on { background: linear-gradient(135deg, rgba(194,69,111,.35), rgba(122,30,58,.5)); color: #fff; box-shadow: inset 3px 0 0 var(--oro), inset 0 0 0 1px rgba(255,255,255,.08); }
.nav.on svg { color: var(--oro); }
.nav svg { width: 20px; height: 20px; }
.nav .pill { margin-left: auto; }
.side .sec { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #8F8590; padding: 16px 12px 6px; }
.side .aud-link { font-size: 13px; padding: 8px 12px; }
.side .aud-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .me { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.05); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: linear-gradient(135deg, var(--vino-3), var(--vino-2)); color: #fff; flex: none; }
.avatar.cli { background: linear-gradient(135deg, #5B6B8C, #2F3A52); }
.side .me .n { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.2; } .side .me .r { font-size: 11.5px; color: #A79DA6; }
.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 18px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .crumb { font-size: 12px; color: var(--text-3); font-weight: 500; display: block; }
.content { padding: 24px 28px 80px; max-width: 1400px; }
.mobile-top, .bottom-nav { display: none; }

/* Tarjetas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card.pad { padding: 20px; }
.card h3 { font-size: 15px; font-weight: 700; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 16px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi .l { font-size: 12px; color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.kpi .l i { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--rosa-soft); color: var(--accent); }
.kpi .l i svg { width: 16px; height: 16px; }
.kpi .v { font-size: 28px; font-weight: 800; margin-top: 8px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--text-3); }
.kpi-ring { display: flex; align-items: center; gap: 16px; grid-column: span 2; }
@media (max-width: 860px) { .kpi-ring { grid-column: 1 / -1; } }
.kpi.ok .l i { background: var(--ok-bg); color: var(--ok); } .kpi.warn .l i { background: var(--warn-bg); color: var(--warn); } .kpi.info .l i { background: var(--info-bg); color: var(--info); }

/* Barras de progreso */
.bar { height: 10px; border-radius: 99px; background: var(--mute-bg); overflow: hidden; position: relative; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--vino-3), var(--vino)); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.bar.ok > span { background: linear-gradient(90deg, #36B37E, var(--ok)); }
.bar.thin { height: 6px; }
.bar.stack { display: flex; } .bar.stack > span { border-radius: 0; }

/* Anillo */
.ring { position: relative; display: grid; place-items: center; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .t { position: absolute; text-align: center; line-height: 1.05; }
.ring .t b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; display: block; } .ring .t span { font-size: 10.5px; color: var(--text-2); font-weight: 500; }
.ring circle { transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }

/* Píldoras de estado */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--mute-bg); color: var(--text-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.nodot::before { display: none; }
.pill.pendiente { background: var(--mute-bg); color: var(--text-2); }
.pill.en_revision { background: var(--info-bg); color: var(--info); }
.pill.aprobado { background: var(--ok-bg); color: var(--ok); }
.pill.observado { background: var(--warn-bg); color: var(--warn); }
.pill.no_aplica { background: var(--mute-bg); color: var(--text-3); text-decoration: line-through; }
.pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.info { background: var(--info-bg); color: var(--info); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }

/* Tarjetas de encargos (panel) */
.aud-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.aud-card { padding: 20px; cursor: pointer; transition: .2s; display: grid; gap: 16px; position: relative; overflow: hidden; }
.aud-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.aud-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--oro), var(--vino) 40%, var(--vino-2)); }
.aud-card .emp { font-size: 16.5px; font-weight: 700; } .aud-card .proj { font-size: 12.5px; color: var(--text-2); }
.cd-mini { display: flex; gap: 6px; }
.cd-mini div { flex: 1; text-align: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 4px; }
.cd-mini b { font-size: 18px; font-weight: 800; display: block; font-variant-numeric: tabular-nums; } .cd-mini span { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.pace { display: grid; gap: 6px; font-size: 12px; }
.pace .row span:last-child { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 56px 20px; color: var(--text-2); }
.empty svg { width: 56px; height: 56px; color: var(--line-2); margin: 0 auto 12px; }

/* Héroe del encargo */
.hero { border-radius: 22px; padding: 26px; color: #fff; position: relative; overflow: hidden; background: radial-gradient(800px 400px at 0% 0%, #A33358, transparent 60%), linear-gradient(135deg, #7A1E3A, #4E1024 60%, #1C1A20); box-shadow: 0 16px 40px rgba(78,16,36,.35); margin-bottom: 20px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 300px; height: 300px; border-radius: 50%; border: 50px solid rgba(212,175,90,.07); }
.hero::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--oro), transparent); opacity: .7; }
.hero > * { position: relative; z-index: 1; }
.hero .tag { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--oro); font-weight: 600; }
.hero h2 { font-size: clamp(20px, 2.4vw, 28px); font-weight: 800; margin: 6px 0 4px; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; opacity: .85; margin-top: 10px; }
.hero .meta span { display: inline-flex; align-items: center; gap: 6px; } .hero .meta svg { width: 15px; height: 15px; }
.countdown { display: grid; gap: 10px; }
.countdown .lbl { font-size: 12px; opacity: .8; display: flex; align-items: center; gap: 8px; }
.cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cd div { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 10px 6px; text-align: center; backdrop-filter: blur(6px); }
.cd b { display: block; font-size: clamp(24px, 3vw, 34px); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cd span { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.cd.over div { background: rgba(240,112,103,.18); border-color: rgba(240,112,103,.4); }
.tbar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.15); position: relative; overflow: visible; }
.tbar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, #F4A6BF, #fff); }
.tbar i { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #1C1A20; border: 2px solid var(--oro); }
.tbar i.done { background: var(--oro); }
.tlegend { display: flex; justify-content: space-between; font-size: 11px; opacity: .75; }
.hero .ok-flag { display: inline-flex; gap: 8px; align-items: center; background: rgba(76,195,138,.18); border: 1px solid rgba(76,195,138,.4); padding: 10px 14px; border-radius: 12px; font-weight: 600; }

/* Pestañas */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 9px 16px; border-radius: 10px; font-weight: 600; font-size: 13px; color: var(--text-2); cursor: pointer; white-space: nowrap; border: 0; background: none; display: inline-flex; gap: 8px; align-items: center; }
.tab.on { background: var(--grafito); color: #fff; }
:root[data-theme="dark"] .tab.on { background: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tab.on { background: var(--accent); } }

/* Barra de herramientas */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.search { position: relative; flex: 1; min-width: 220px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--text-3); }
.search .input { padding-left: 40px; height: 42px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.fchip { height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.fchip b { font-weight: 700; color: var(--text-3); }
.fchip.on { background: var(--grafito); color: #fff; border-color: var(--grafito); } .fchip.on b { color: var(--oro); }

/* Requisitos */
.cat { margin-bottom: 22px; }
.cat-h { display: flex; align-items: center; gap: 12px; padding: 4px 4px 10px; }
.cat-h h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); font-weight: 700; }
.cat-h .bar { flex: 1; max-width: 220px; height: 6px; margin-left: auto; }
.cat-h .c { font-size: 12px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.reqs { display: grid; gap: 10px; }
.req { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: .15s; position: relative; }
.req:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow); }
.req.drag { border: 2px dashed var(--accent); background: var(--rosa-soft); }
.req .n { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--mute-bg); color: var(--text-2); font-variant-numeric: tabular-nums; }
.req.st-en_revision .n { background: var(--info-bg); color: var(--info); }
.req.st-aprobado .n { background: var(--ok-bg); color: var(--ok); }
.req.st-observado .n { background: var(--warn-bg); color: var(--warn); }
.req.st-no_aplica { opacity: .62; }
.req .t { font-weight: 600; font-size: 14px; }
.req .d { font-size: 12.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.req .m { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 11.5px; color: var(--text-3); }
.req .m span { display: inline-flex; align-items: center; gap: 5px; } .req .m svg { width: 13px; height: 13px; }
.req .side-i { display: flex; align-items: center; gap: 10px; }
.cnt { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-2); position: relative; }
.cnt svg { width: 17px; height: 17px; }
.cnt .badge { position: absolute; top: -9px; right: -11px; min-width: 17px; height: 17px; font-size: 10px; padding: 0 4px; }
.tplt { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 8px; background: var(--rosa-soft); color: var(--accent); }
.tplt.miss { background: var(--warn-bg); color: var(--warn); }
.tplt svg { width: 13px; height: 13px; }
.quick-up { opacity: 0; transition: .15s; }
.req:hover .quick-up { opacity: 1; }

/* Panel lateral del requisito */
.drawer-bg { position: fixed; inset: 0; background: rgba(20,16,22,.45); backdrop-filter: blur(3px); z-index: 60; animation: fade .2s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(1080px, 96vw); background: var(--bg); z-index: 61; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide .28s cubic-bezier(.2,.8,.2,1); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.drawer-h { padding: 18px 22px; border-bottom: 1px solid var(--line); background: var(--surface); display: flex; gap: 14px; align-items: flex-start; }
.drawer-h .n { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, var(--vino-3), var(--vino-2)); color: #fff; box-shadow: inset 0 0 0 2px var(--oro); display: grid; place-items: center; font-weight: 800; font-size: 16px; flex: none; }
.drawer-h h2 { font-size: 17px; font-weight: 700; }
.drawer-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 400px; }
.drawer-main { overflow-y: auto; padding: 20px 22px 40px; display: grid; gap: 18px; align-content: start; }
.drawer-chat { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.sec-t { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--text-2); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.sec-t svg { width: 16px; height: 16px; color: var(--accent); }
.desc { font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 14px 16px; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.meta-grid div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.meta-grid label { font-size: 11px; color: var(--text-3); display: block; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.meta-grid b { font-size: 13px; font-weight: 600; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.steps div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; font-size: 12px; display: flex; gap: 8px; align-items: center; }
.steps b { width: 24px; height: 24px; border-radius: 50%; background: var(--rosa-soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; flex: none; }
.tplbox { background: linear-gradient(135deg, var(--rosa-soft), var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); border-radius: 16px; padding: 16px; }

/* Zona de carga */
.drop { border: 2px dashed var(--line-2); border-radius: 16px; padding: 26px 18px; text-align: center; background: var(--surface); cursor: pointer; transition: .15s; }
.drop:hover, .drop.on { border-color: var(--accent); background: var(--rosa-soft); }
.drop .ic { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--vino-3), var(--vino-2)); color: #fff; box-shadow: 0 8px 20px rgba(122,30,58,.3); }
.drop .ic svg { width: 26px; height: 26px; }
.drop b { font-size: 15px; display: block; }
.fmts { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.fmts span { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; letter-spacing: .04em; }
.f-pdf { background: #FBE6E4; color: #B42318; } .f-img { background: #E5F3F0; color: #0E7A63; } .f-doc { background: #E5EDF9; color: #2F5FA7; } .f-xls { background: #E3F4EC; color: #1F7A4C; } .f-ppt { background: #FDEBDD; color: #B5541B; }
.queue { display: grid; gap: 8px; margin-top: 10px; }
.qi { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 12.5px; }
.qi .bar { height: 5px; margin-top: 5px; }
.qi.err { border-color: var(--bad); } .qi.err .st { color: var(--bad); } .qi.done .st { color: var(--ok); }
.files { display: grid; gap: 8px; }
.file { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.ficon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 10.5px; font-weight: 800; letter-spacing: .03em; flex: none; }
.file .nm { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .acts { display: flex; gap: 4px; }
.thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); }
.actions-bar { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }

/* Chat */
.chat-h { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat-h b { font-size: 14px; }
.msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.msg { max-width: 86%; display: grid; gap: 3px; }
.msg .bub { padding: 10px 13px; border-radius: 16px 16px 16px 4px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; white-space: pre-wrap; word-wrap: break-word; }
.msg .who { font-size: 11px; color: var(--text-3); font-weight: 600; padding: 0 4px; }
.msg.me { align-self: flex-end; } .msg.me .who { text-align: right; }
.msg.me .bub { background: linear-gradient(135deg, var(--vino-3), var(--vino)); color: #fff; border: 0; border-radius: 16px 16px 4px 16px; }
.msg.aud:not(.me) .bub { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.msg.sys { align-self: center; max-width: 100%; }
.msg.sys .bub { background: none; border: 0; padding: 2px 10px; font-size: 11.5px; color: var(--text-3); text-align: center; }
.chat-in { padding: 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: flex-end; }
.chat-in textarea { flex: 1; min-height: 44px; max-height: 140px; height: 44px; resize: none; padding: 11px 14px; }
.chat-empty { margin: auto; text-align: center; color: var(--text-3); font-size: 13px; padding: 20px; }
.chat-empty svg { width: 40px; height: 40px; margin: 0 auto 8px; color: var(--line-2); }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(20,16,22,.5); backdrop-filter: blur(3px); z-index: 80; display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); animation: pop .22s cubic-bezier(.2,.8,.2,1); }
.modal.wide { max-width: 760px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.modal-h { padding: 20px 22px 0; display: flex; align-items: center; gap: 12px; }
.modal-h h3 { font-size: 18px; font-weight: 700; flex: 1; }
.modal-b { padding: 18px 22px; }
.modal-f { padding: 0 22px 20px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* Toasts */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 8px; }
.toast { background: var(--grafito); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; gap: 10px; align-items: center; max-width: 380px; animation: pop .2s; }
.toast.err { background: var(--bad); } .toast.ok { background: #176B47; }
.toast svg { width: 18px; height: 18px; flex: none; }

/* Tablas */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.t td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }

/* Cronograma */
.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 28px 1fr auto; gap: 14px; position: relative; padding-bottom: 18px; }
.tl::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); background: var(--surface); }
.tl.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.tl.late .dot { border-color: var(--bad); color: var(--bad); }
.tl .dot svg { width: 14px; height: 14px; }
.tl b { font-size: 14px; } .tl .when { font-size: 12px; color: var(--text-2); }

/* Actividad */
.feed { display: grid; gap: 2px; }
.ev { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 10px 6px; border-radius: 10px; }
.ev:hover { background: var(--surface-2); }
.ev .i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--mute-bg); color: var(--text-2); }
.ev .i svg { width: 16px; height: 16px; }
.ev.carga .i { background: var(--info-bg); color: var(--info); } .ev.estado .i { background: var(--ok-bg); color: var(--ok); } .ev.mensaje .i { background: var(--rosa-soft); color: var(--accent); } .ev.plantilla .i { background: var(--warn-bg); color: var(--warn); }

/* Gráficos */
.charts { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .ax { font-size: 10px; fill: var(--text-3); font-family: Sora, sans-serif; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--text-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; } .legend i { width: 10px; height: 10px; border-radius: 3px; }
.catbars { display: grid; gap: 12px; }
.catbars .row span:last-child { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12px; }

/* Responsive */
@media (max-width: 1100px) {
  .drawer-body { grid-template-columns: 1fr; overflow-y: auto; }
  .drawer-main { overflow: visible; }
  .drawer-chat { border-left: 0; border-top: 1px solid var(--line); min-height: 480px; }
  .hero { grid-template-columns: 1fr; }
  .charts { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 28px 20px; min-height: auto; }
  .login-art img { width: 200px; }
  .login-art .feat { display: none; }
  .login-art h1 { font-size: 24px; margin-top: 18px; }
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .top { padding: 12px 16px; }
  .top .desk { display: none; }
  .content { padding: 16px 16px 96px; }
  .mobile-brand { display: block !important; width: 34px; border-radius: 9px; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: var(--grafito); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .bottom-nav a { flex: 1; display: grid; justify-items: center; gap: 2px; font-size: 10.5px; color: #B8AEB6; padding: 6px 0; border-radius: 10px; position: relative; }
  .bottom-nav a.on { color: #fff; background: rgba(194,69,111,.3); }
  .bottom-nav svg { width: 22px; height: 22px; }
  .bottom-nav .badge { position: absolute; top: 2px; left: 55%; height: 16px; min-width: 16px; font-size: 9.5px; }
  .aud-grid { grid-template-columns: 1fr; }
  .hero { padding: 20px; border-radius: 18px; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 12px 14px; } .kpi .v { font-size: 22px; }
  .req { grid-template-columns: auto 1fr; gap: 12px; padding: 12px; }
  .req .side-i { grid-column: 1 / -1; justify-content: flex-start; padding-left: 54px; flex-wrap: wrap; }
  .quick-up { opacity: 1; }
  .drawer { width: 100vw; }
  .drawer-h { padding: 14px 16px; }
  .drawer-main { padding: 16px; }
  .steps { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .cat-h .bar { max-width: 90px; }
  .modal-bg { place-items: end center; padding: 0; }
  .modal { border-radius: 20px 20px 0 0; max-height: 92vh; }
  #toasts { left: 12px; right: 12px; bottom: 84px; }
  .hide-m { display: none !important; }
}
.mobile-brand { display: none; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
