/* Growth CRM · macOS dark. Sin dependencias externas. */
:root {
  --bg: #1c1c1e; --bg-2: #232325; --panel: #2c2c2e; --panel-2: #363638; --panel-3: #3a3a3c;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14);
  --text: #f5f5f7; --text-2: #aeaeb2; --text-3: #8e8e93;
  --blue: #0a84ff; --green: #30d158; --red: #ff453a; --orange: #ff9f0a; --purple: #bf5af2; --teal: #64d2ff; --yellow: #ffd60a; --pink: #ff6482;
  /* serie categórica validada para fondo oscuro */
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #9085e9; --s7: #e66767;
  --r: 12px; --r-lg: 16px; --sb: 244px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; } ::-webkit-scrollbar-track { background: transparent; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); } .muted2 { color: var(--text-2); }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.end { justify-content: flex-end; } .col { display: flex; flex-direction: column; gap: 8px; } .grow { flex: 1; min-width: 0; }
.gap-4 { gap: 4px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .mt { margin-top: 12px; } .mt-lg { margin-top: 20px; } .mb { margin-bottom: 12px; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
svg.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- splash ---------- */
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); }
.splash-logo { width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(135deg, #64d2ff, #0a84ff); display: grid; place-items: center; font-size: 30px; font-weight: 700; color: #fff; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--sb) 1fr; height: 100%; }
.sidebar { background: rgba(36,36,38,.86); backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: calc(14px + var(--safe-t)) 10px 12px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.brand-logo { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #64d2ff, #0a84ff); display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 15px; }
.nav-group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 8px; color: var(--text); font-weight: 500; cursor: pointer; text-decoration: none; }
.nav a:hover { background: rgba(255,255,255,.06); }
.nav a.on { background: var(--blue); color: #fff; }
.nav a .ic { opacity: .9; }
.nav .pill { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px; }
.nav a.on .pill { background: rgba(255,255,255,.28); }
.side-foot { margin-top: auto; padding-top: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.user-chip:hover { background: rgba(255,255,255,.06); }
.main { display: flex; flex-direction: column; min-width: 0; height: 100%; }
.topbar { display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--safe-t)) 24px 10px; background: rgba(28,28,30,.8); backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5); border-bottom: 1px solid var(--line); z-index: 5; }
.topbar h1 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.search-btn { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 6px 12px; min-width: 260px; color: var(--text-3); cursor: pointer; }
.search-btn kbd { margin-left: auto; font: 11px var(--font); background: var(--panel-2); border-radius: 5px; padding: 1px 6px; color: var(--text-2); }
.icon-btn { position: relative; background: transparent; border: 0; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; cursor: pointer; color: var(--text-2); }
.icon-btn:hover { background: rgba(255,255,255,.08); color: var(--text); }
.icon-btn .dot { position: absolute; top: 3px; right: 3px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; min-width: 16px; height: 16px; line-height: 16px; text-align: center; padding: 0 4px; }
.content { flex: 1; overflow-y: auto; padding: 22px 24px 40px; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
.page { max-width: 1320px; margin: 0 auto; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.page-head p { color: var(--text-3); margin-top: 2px; }
.tabbar { display: none; }

/* ---------- controles ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 9px; padding: 7px 14px; font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .12s, transform .06s; }
.btn:hover { background: var(--panel-3); text-decoration: none; } .btn:active { transform: scale(.98); }
.btn.primary { background: var(--blue); border-color: transparent; color: #fff; } .btn.primary:hover { background: #3b9bff; }
.btn.danger { color: var(--red); } .btn.danger.solid { background: var(--red); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); } .btn.ghost:hover { background: rgba(255,255,255,.07); color: var(--text); }
.btn.sm { padding: 4px 10px; font-size: 13px; border-radius: 8px; } .btn.lg { padding: 11px 18px; font-size: 15px; border-radius: 11px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.input, .select, textarea.input { width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 11px; outline: none; transition: border-color .12s, box-shadow .12s; }
.input:focus, .select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,132,255,.25); }
.select { appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238e8e93' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.select.sm, .input.sm { padding: 5px 10px; font-size: 13px; width: auto; }
textarea.input { resize: vertical; min-height: 80px; line-height: 1.5; }
.field { display: flex; flex-direction: column; gap: 5px; } .field > label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
input[type=checkbox] { accent-color: var(--blue); width: 16px; height: 16px; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; gap: 2px; max-width: 100%; overflow-x: auto; }
.seg button { background: transparent; border: 0; padding: 5px 12px; border-radius: 7px; color: var(--text-2); font-weight: 550; cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--panel-3); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.seg button .n { color: var(--text-3); margin-left: 4px; font-size: 12px; }
.chip { display: inline-flex; align-items: center; gap: 5px; background: var(--panel-2); border-radius: 20px; padding: 2px 10px; font-size: 12px; font-weight: 550; color: var(--text-2); }
.chip button { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; line-height: 1; }
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; background: rgba(142,142,147,.2); color: #c7c7cc; white-space: nowrap; }
.badge.green { background: rgba(48,209,88,.16); color: #5be07d; } .badge.red { background: rgba(255,69,58,.16); color: #ff7a72; } .badge.orange { background: rgba(255,159,10,.16); color: #ffb340; }
.badge.blue { background: rgba(10,132,255,.18); color: #5cadff; } .badge.purple { background: rgba(191,90,242,.18); color: #d58bf7; } .badge.teal { background: rgba(100,210,255,.16); color: #7fdcff; } .badge.yellow { background: rgba(255,214,10,.16); color: #ffe04d; }

/* ---------- tarjetas ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; min-width: 0; }
.card.flat { background: transparent; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-h h3 { font-size: 14px; font-weight: 650; letter-spacing: -.005em; } .card-h .sub { color: var(--text-3); font-size: 12px; }
.grid { display: grid; gap: 14px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .g-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.kpi .lbl { color: var(--text-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi .val { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.kpi .sub { font-size: 12px; color: var(--text-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kpi .spark { position: absolute; right: 0; bottom: 0; left: 0; height: 38px; opacity: .9; pointer-events: none; }
.delta { font-weight: 650; font-size: 12px; display: inline-flex; align-items: center; gap: 2px; } .delta.up { color: var(--green); } .delta.down { color: var(--red); } .delta.flat { color: var(--text-3); }
.insights { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.insight { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.insight i { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex: none; } .insight.bien i { background: var(--green); } .insight.aviso i { background: var(--orange); }

/* ---------- tablas ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: rgba(255,255,255,.02); position: sticky; top: 0; }
.tbl th.sort { cursor: pointer; user-select: none; } .tbl th.sort:hover { color: var(--text); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .1s; } .tbl tbody tr.click { cursor: pointer; } .tbl tbody tr:hover { background: rgba(255,255,255,.035); }
.tbl td.r, .tbl th.r { text-align: right; }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 0; } .cell-user .t { min-width: 0; } .cell-user .t b { display: block; font-weight: 600; } .cell-user .t span { color: var(--text-3); font-size: 12px; display: block; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex: none; background: var(--panel-3); }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; } .avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px; color: var(--text-3); font-size: 13px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 360px; } .toolbar .search .ic { position: absolute; left: 10px; top: 9px; color: var(--text-3); width: 16px; height: 16px; } .toolbar .search .input { padding-left: 32px; }
.bulkbar { display: flex; align-items: center; gap: 8px; background: var(--blue); color: #fff; border-radius: 11px; padding: 8px 12px; margin-bottom: 12px; flex-wrap: wrap; } .bulkbar .btn { background: rgba(255,255,255,.18); border: 0; color: #fff; } .bulkbar .select { background-color: rgba(255,255,255,.18); border: 0; color: #fff; }
.score { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; } .score i { width: 8px; height: 8px; border-radius: 50%; }
.bar-mini { height: 6px; border-radius: 3px; background: var(--panel-3); overflow: hidden; min-width: 70px; } .bar-mini > i { display: block; height: 100%; border-radius: 3px; background: var(--blue); }
.empty { text-align: center; color: var(--text-3); padding: 40px 16px; } .empty .ic { width: 34px; height: 34px; margin-bottom: 8px; opacity: .6; }
.skeleton { background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 37%, var(--panel) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 10px; } @keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.alert { border-radius: 11px; padding: 10px 14px; background: rgba(255,159,10,.12); color: #ffc15a; border: 1px solid rgba(255,159,10,.25); font-size: 13px; } .alert.err { background: rgba(255,69,58,.12); color: #ff8a82; border-color: rgba(255,69,58,.28); } .alert.ok { background: rgba(48,209,88,.12); color: #6ee08c; border-color: rgba(48,209,88,.25); } .alert.info { background: rgba(10,132,255,.12); color: #7bbcff; border-color: rgba(10,132,255,.25); }

/* ---------- listas / timeline ---------- */
.list > .item { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); } .list > .item:last-child { border-bottom: 0; } .list > .item.click { cursor: pointer; } .list > .item.click:hover { background: rgba(255,255,255,.03); }
.timeline { position: relative; padding-left: 22px; } .timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); }
.tl-item { position: relative; padding: 0 0 16px; } .tl-item::before { content: ""; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); border: 2px solid var(--panel); }
.tl-item.compra::before { background: var(--green); } .tl-item.nota::before { background: var(--yellow); } .tl-item.duda::before { background: var(--orange); } .tl-item.acceso::before { background: var(--purple); } .tl-item.recurso::before { background: var(--teal); } .tl-item.actividad::before { background: var(--text-3); }
.tl-item b { font-weight: 600; } .tl-item .when { color: var(--text-3); font-size: 12px; }

/* ---------- modal / drawer / toast / cmdk ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(3px); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeo .15s; } @keyframes fadeo { from { opacity: 0; } }
.modal { background: rgba(44,44,46,.97); border: 1px solid var(--line-2); border-radius: 16px; width: 100%; max-width: 560px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: pop .18s cubic-bezier(.2,.9,.3,1.2); }
.modal.wide { max-width: 760px; } .modal.narrow { max-width: 420px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 8px; } .modal-h h3 { font-size: 17px; font-weight: 650; }
.modal-b { padding: 8px 20px 16px; overflow-y: auto; } .modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--bg-2); border-left: 1px solid var(--line-2); z-index: 51; overflow-y: auto; padding: calc(18px + var(--safe-t)) 20px 30px; animation: slide .22s ease-out; box-shadow: -20px 0 60px rgba(0,0,0,.5); } @keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.toasts { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #3a3a3c; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: pop .2s; max-width: 90vw; pointer-events: auto; } .toast.err { background: #5a1f1c; border-color: rgba(255,69,58,.5); } .toast.ok::before { content: "✓ "; color: var(--green); font-weight: 700; }
.cmdk { width: 100%; max-width: 620px; background: rgba(44,44,46,.98); border: 1px solid var(--line-2); border-radius: 16px; overflow: hidden; box-shadow: 0 30px 90px rgba(0,0,0,.65); align-self: flex-start; margin-top: 12vh; animation: pop .15s; }
.cmdk input { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 16px 18px; font-size: 17px; outline: none; }
.cmdk-list { max-height: 52vh; overflow-y: auto; padding: 6px; } .cmdk-sec { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 10px 12px 4px; }
.cmdk-it { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 9px; cursor: pointer; } .cmdk-it.on { background: var(--blue); } .cmdk-it small { color: var(--text-3); } .cmdk-it.on small { color: rgba(255,255,255,.75); }
.pop { position: fixed; z-index: 60; background: rgba(44,44,46,.98); border: 1px solid var(--line-2); border-radius: 13px; box-shadow: 0 20px 60px rgba(0,0,0,.55); min-width: 260px; max-width: 360px; max-height: 70vh; overflow-y: auto; animation: pop .14s; }
.pop .item { display: flex; gap: 10px; padding: 10px 14px; cursor: pointer; align-items: center; } .pop .item:hover { background: rgba(255,255,255,.06); }

/* ---------- gráficos ---------- */
.chart { position: relative; width: 100%; } .chart svg { display: block; width: 100%; overflow: visible; }
.chart text { fill: var(--text-3); font: 11px var(--font); } .chart .grid-l { stroke: var(--line); stroke-width: 1; } .chart .axis-l { stroke: var(--line-2); }
.tip { position: absolute; z-index: 4; pointer-events: none; background: rgba(20,20,22,.96); border: 1px solid var(--line-2); border-radius: 9px; padding: 7px 10px; font-size: 12px; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,.5); transform: translate(-50%, -100%); opacity: 0; transition: opacity .08s; } .tip.on { opacity: 1; } .tip b { font-weight: 650; } .tip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.legend { display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--text-2); } .legend span { display: inline-flex; align-items: center; gap: 6px; } .legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; } .donut-wrap .chart { width: 150px; flex: none; } .donut-legend { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 7px; font-size: 13px; } .donut-legend div { display: flex; align-items: center; gap: 8px; } .donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; } .donut-legend em { margin-left: auto; font-style: normal; color: var(--text-2); }
.hbar { display: flex; flex-direction: column; gap: 9px; } .hbar-r { display: grid; grid-template-columns: minmax(80px, 34%) 1fr 54px; gap: 10px; align-items: center; font-size: 13px; } .hbar-r .tr { height: 10px; background: var(--panel-3); border-radius: 5px; overflow: hidden; } .hbar-r .tr i { display: block; height: 100%; border-radius: 5px; } .hbar-r em { font-style: normal; text-align: right; color: var(--text-2); }
.ring-wrap { position: relative; display: grid; place-items: center; } .ring-wrap .mid { position: absolute; text-align: center; } .ring-wrap .mid b { font-size: 22px; font-weight: 700; display: block; line-height: 1.1; }
.stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; } .stack i { display: block; height: 100%; }

/* ---------- pipeline ---------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; min-height: 60vh; scroll-snap-type: x proximity; }
.kcol { flex: 0 0 280px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 260px); scroll-snap-align: start; } .kcol.over { outline: 2px dashed var(--blue); outline-offset: -3px; }
.kcol-h { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; font-weight: 650; } .kcol-h i { width: 9px; height: 9px; border-radius: 50%; } .kcol-h .sum { margin-left: auto; color: var(--text-3); font-weight: 500; font-size: 12px; }
.kcol-b { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 40px; flex: 1; }
.deal { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; cursor: grab; user-select: none; } .deal:hover { border-color: var(--line-2); } .deal.drag { opacity: .4; }
.deal b { font-weight: 600; display: block; margin-bottom: 4px; } .deal .meta { display: flex; justify-content: space-between; align-items: center; color: var(--text-3); font-size: 12px; margin-top: 6px; }
.deal .val { font-weight: 700; color: var(--text); } .stale { color: var(--orange); }

/* ---------- calendario ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--panel); }
.cal-h { padding: 8px; text-align: center; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.02); }
.cal-d { min-height: 104px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; overflow: hidden; } .cal-d:nth-child(7n) { border-right: 0; } .cal-d:hover { background: rgba(255,255,255,.03); } .cal-d.out { opacity: .4; }
.cal-d .dn { font-size: 12px; font-weight: 600; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; margin-bottom: 3px; } .cal-d.today .dn { background: var(--red); color: #fff; }
.ev { font-size: 11.5px; padding: 2px 6px; border-radius: 5px; margin-bottom: 2px; background: rgba(10,132,255,.22); color: #9fcdff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid var(--blue); cursor: pointer; } .ev.t { background: rgba(255,159,10,.16); color: #ffc15a; border-color: var(--orange); } .ev.llamada { border-color: var(--green); background: rgba(48,209,88,.16); color: #7ae795; } .ev.clase { border-color: var(--purple); background: rgba(191,90,242,.18); color: #dba2f8; }
.more { font-size: 11px; color: var(--text-3); padding-left: 4px; }
.agenda .day { font-weight: 650; margin: 16px 0 6px; color: var(--text-2); }

/* ---------- inbox ---------- */
.inbox { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 14px; height: calc(100vh - 210px); min-height: 420px; }
.inbox-list { overflow-y: auto; padding: 4px; } .inbox-list .item { padding: 12px; border-radius: 11px; cursor: pointer; display: flex; gap: 10px; border: 1px solid transparent; } .inbox-list .item:hover { background: rgba(255,255,255,.04); } .inbox-list .item.on { background: rgba(10,132,255,.16); border-color: rgba(10,132,255,.4); }
.unread { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); flex: none; margin-top: 6px; }
.thread { display: flex; flex-direction: column; height: 100%; } .thread-b { flex: 1; overflow-y: auto; padding: 8px 4px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 78%; padding: 9px 14px; border-radius: 18px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; } .bubble small { display: block; opacity: .65; font-size: 11px; margin-top: 4px; }
.bubble.alumno { align-self: flex-start; background: var(--panel-3); border-bottom-left-radius: 5px; } .bubble.admin { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 5px; } .bubble.sistema { align-self: center; background: transparent; color: var(--text-3); font-size: 12px; }
.composer { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }

/* ---------- login ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px; background: radial-gradient(1000px 600px at 50% -10%, rgba(10,132,255,.18), transparent 60%), var(--bg); overflow-y: auto; }
.auth-card { width: 100%; max-width: 380px; background: rgba(44,44,46,.7); backdrop-filter: blur(30px); border: 1px solid var(--line-2); border-radius: 22px; padding: 32px 28px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.auth-card .brand-logo { width: 60px; height: 60px; border-radius: 15px; font-size: 28px; margin: 0 auto 18px; } .auth-card h1 { text-align: center; font-size: 22px; letter-spacing: -.02em; } .auth-card p.sub { text-align: center; color: var(--text-3); margin: 4px 0 22px; }

.progress-ring { transform: rotate(-90deg); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 13px; } .kv dt { color: var(--text-3); } .kv dd { margin: 0; min-width: 0; word-break: break-word; }
.sep { height: 1px; background: var(--line); margin: 14px 0; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg-2) 30%); padding-top: 16px; }
.link-box { background: var(--bg-2); border: 1px dashed var(--line-2); border-radius: 10px; padding: 10px 12px; font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; user-select: all; }

/* ---------- móvil ---------- */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g-main { grid-template-columns: 1fr; } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  body { overflow: hidden; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: calc(8px + var(--safe-t)) 14px 8px; } .topbar h1 { font-size: 16px; } .search-btn { min-width: 0; padding: 7px; } .search-btn span, .search-btn kbd { display: none; }
  .content { padding: 14px 14px calc(88px + var(--safe-b)); }
  .page-head h2 { font-size: 22px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(36,36,38,.9); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 550; color: var(--text-3); padding: 4px 0; position: relative; cursor: pointer; text-decoration: none; } .tabbar a.on { color: var(--blue); } .tabbar a .ic { width: 23px; height: 23px; }
  .tabbar .pill { position: absolute; top: 0; left: 55%; background: var(--red); color: #fff; font-size: 10px; border-radius: 9px; padding: 0 5px; font-weight: 700; }
  .g2, .g3, .g4, .g-6 { grid-template-columns: 1fr 1fr; } .g2.stack-m, .g3.stack-m { grid-template-columns: 1fr; }
  .kpi .val { font-size: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .overlay { align-items: flex-end; padding: 0; } .modal { max-width: none; border-radius: 18px 18px 0 0; max-height: 94vh; animation: up .22s ease-out; padding-bottom: var(--safe-b); } @keyframes up { from { transform: translateY(40px); opacity: 0; } }
  .cmdk { margin-top: 0; max-width: none; border-radius: 0 0 18px 18px; align-self: flex-start; }
  .drawer { width: 100vw; }
  .inbox { grid-template-columns: 1fr; height: auto; } .inbox .thread-card { position: fixed; inset: 0; z-index: 40; border-radius: 0; padding-top: calc(12px + var(--safe-t)); } .thread { height: calc(100vh - 40px); }
  .tbl.cards thead { display: none; } .tbl.cards, .tbl.cards tbody, .tbl.cards tr, .tbl.cards td { display: block; width: 100%; } .tbl.cards tr { padding: 12px 14px; border-bottom: 1px solid var(--line); } .tbl.cards td { padding: 2px 0; border: 0; } .tbl.cards td.hide-m { display: none; }
  .cal-d { min-height: 62px; padding: 3px; } .cal-d .ev { display: none; } .cal-d .dots { display: flex; gap: 2px; flex-wrap: wrap; }
  .kcol { flex-basis: 84vw; max-height: none; }
  .hbar-r { grid-template-columns: minmax(70px, 38%) 1fr 44px; }
  .toasts { bottom: calc(86px + var(--safe-b)); }
}
.cal-d .dots { display: none; } .cal-d .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
@media (max-width: 860px) { .cal-d .dots { display: flex; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .sidebar, .topbar, .tabbar { display: none !important; } body { overflow: visible; background: #fff; color: #000; } .content { overflow: visible; } }

/* ---------- ajustes finales ---------- */
.mobile-only { display: none; }
@media (max-width: 860px) { .mobile-only { display: grid; } .search-btn span { display: none; } .search-btn kbd { display: none; } .inbox .ph { display: none; } }
a.btn { text-decoration: none; }

.kpi.has-spark { padding-bottom: 50px; }
.select.sm { padding-right: 28px; }
.score { white-space: nowrap; }
#app { height: 100%; }
.shell { grid-template-rows: minmax(0, 1fr); overflow: hidden; } .main { min-height: 0; } .sidebar { min-height: 0; }
.inbox > div { min-height: 0; } .inbox > div > .card { height: 100%; } .thread-card .thread { height: 100%; }
@media (max-width: 860px) { .inbox > div > .card { height: auto; } .inbox .thread-card { height: 100%; } }
