/* ==========================================================================
   Escu — sistema de diseño
   ========================================================================== */
:root {
  --bg: #f4f5fb;
  --bg-glow-1: rgba(99, 102, 241, .13);
  --bg-glow-2: rgba(236, 72, 153, .08);
  --surface: #ffffff;
  --surface-2: #f7f8fd;
  --surface-3: #eef0fa;
  --text: #0e1124;
  --text-2: #3a4064;
  --muted: #6b7296;
  --line: #e3e6f3;
  --line-2: #d3d8ec;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-3: #ec4899;
  --accent-soft: rgba(99, 102, 241, .10);
  --accent-ink: #4338ca;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #ec4899 120%);
  --ok: #059669;
  --ok-soft: rgba(16, 185, 129, .12);
  --warn: #b45309;
  --warn-soft: rgba(245, 158, 11, .14);
  --danger: #dc2626;
  --danger-soft: rgba(239, 68, 68, .10);
  --info: #0369a1;
  --info-soft: rgba(14, 165, 233, .12);
  --shadow-sm: 0 1px 2px rgba(16, 20, 50, .05);
  --shadow: 0 1px 2px rgba(16, 20, 50, .04), 0 10px 30px rgba(16, 20, 50, .07);
  --shadow-lg: 0 24px 60px rgba(30, 30, 80, .18);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar-w: 268px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #07080f;
  --bg-glow-1: rgba(99, 102, 241, .20);
  --bg-glow-2: rgba(236, 72, 153, .10);
  --surface: #0f1120;
  --surface-2: #141731;
  --surface-3: #1a1e3d;
  --text: #eceefc;
  --text-2: #c3c8e6;
  --muted: #8e95bd;
  --line: #1e2342;
  --line-2: #2a3057;
  --accent: #818cf8;
  --accent-soft: rgba(129, 140, 248, .14);
  --accent-ink: #a5b4fc;
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, .13);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .13);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .13);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, .13);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 34px rgba(0, 0, 0, .35);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, .6);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 8% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(800px 480px at 100% 0%, var(--bg-glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.015em; }
h1 { font-size: 28px; font-weight: 750; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 650; }
h4 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 .6em; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-3); padding: .1em .4em; border-radius: 6px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.ic { flex: none; vertical-align: -.2em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }
.t-right { text-align: right; }
.pad { padding: 20px; }
.text-warn { color: var(--warn); }
::selection { background: rgba(99, 102, 241, .28); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 22px;
  padding: 22px 16px 16px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--line);
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); padding: 4px 8px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad); color: #fff; box-shadow: 0 8px 22px rgba(99, 102, 241, .45);
}
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand-lg .brand-mark { width: 46px; height: 46px; border-radius: 14px; }
.brand-lg .brand-name { font-size: 24px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-label { margin: 16px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 550; position: relative; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
.nav a.is-active { background: var(--accent-soft); color: var(--accent-ink); }
.nav a.is-active::before {
  content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad);
}
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.user-card {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
}
.user-card:hover { text-decoration: none; border-color: var(--line-2); }
.user-card.is-active { border-color: var(--accent); }
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.user-meta strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { color: var(--muted); font-size: 12px; }
.avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; color: #fff; background: var(--grad);
}
.avatar-sm { width: 22px; height: 22px; font-size: 9px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 14px 32px 0; }
.topbar-spacer { flex: 1; }
.topbar-title { font-weight: 800; }
.content { padding: 14px 32px 56px; width: 100%; max-width: 1240px; margin: 0 auto; overflow-x: clip; }
.only-mobile { display: none !important; }
.scrim { display: none; }
.ic-dark { display: none; }
[data-theme="dark"] .ic-dark { display: inline; }
[data-theme="dark"] .ic-light { display: none; }

/* ---------- Superficies ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.card + .card, .card + .alert, .alert + .card { margin-top: 18px; }
.card h3 { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 10px 0 24px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 4px; font-size: 13px; font-weight: 650; color: var(--accent-ink); letter-spacing: .02em; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.two-col > .card + .card { margin-top: 0; }

/* ---------- Botones ---------- */
.btn {
  --h: 42px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 650; font-size: 14px; cursor: pointer; white-space: nowrap;
  color: var(--text); background: var(--surface-3);
  transition: transform .12s, box-shadow .2s, background .15s, border-color .15s, opacity .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { color: #fff; background: var(--grad); box-shadow: 0 8px 22px rgba(99, 102, 241, .38); }
.btn-primary:hover { box-shadow: 0 12px 28px rgba(99, 102, 241, .5); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { color: #fff; background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 8px 22px rgba(239, 68, 68, .35); }
.btn-danger-text { color: var(--danger); }
.btn-danger-text:hover { background: var(--danger-soft); }
.btn-lg { --h: 50px; padding: 0 24px; font-size: 15px; border-radius: 14px; }
.btn-sm { --h: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon { width: 42px; padding: 0; }

/* ---------- Formularios ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-narrow { max-width: 560px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-weight: 600; font-size: 13.5px; color: var(--text-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 14px; transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
input:disabled { opacity: .6; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.inline-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.form-foot { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.settings-grid > .card + .card { margin-top: 0; }

.chip-input { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; }
.chip-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
.chip-input input { flex: 1; min-width: 160px; border: 0; background: transparent; padding: 6px 8px; box-shadow: none !important; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: 13px; }
.chip button { all: unset; cursor: pointer; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; opacity: .7; }
.chip button:hover { opacity: 1; background: rgba(0, 0, 0, .1); }

/* ---------- Alertas / badges ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 14px; margin-bottom: 18px; font-weight: 500; border: 1px solid transparent; }
.alert .ic { margin-top: 2px; }
.alert-success { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert a { color: inherit; text-decoration: underline; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--surface-3); color: var(--text-2); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-team { background: var(--accent-soft); color: var(--accent-ink); }
.badge-rec { background: var(--danger-soft); color: var(--danger); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge-rec .dot { animation: blink 1.4s infinite; }

/* ---------- Dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat { display: flex; align-items: center; gap: 14px; padding: 18px; margin: 0 !important; }
.stat strong { display: block; font-size: 24px; font-weight: 750; line-height: 1.1; letter-spacing: -.02em; }
.stat small { color: var(--muted); font-weight: 550; }
.stat-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.search { flex: 1; min-width: 240px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; color: var(--muted); height: 46px; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search input { border: 0; background: transparent; box-shadow: none !important; padding: 0; height: 100%; }
.search-sm { height: 40px; min-width: 220px; max-width: 360px; }
.seg-tabs { display: inline-flex; padding: 4px; background: var(--surface-3); border-radius: 14px; gap: 2px; }
.seg-tabs a { padding: 8px 16px; border-radius: 10px; font-weight: 600; color: var(--text-2); font-size: 14px; }
.seg-tabs a:hover { text-decoration: none; color: var(--text); }
.seg-tabs a.is-active { background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow-sm); }

.meeting-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.meeting-card { display: flex; flex-direction: column; gap: 10px; color: var(--text); margin: 0 !important; transition: transform .18s, box-shadow .2s, border-color .2s; }
.meeting-card:hover { text-decoration: none; transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow-lg); }
.mc-top { display: flex; gap: 8px; flex-wrap: wrap; }
.mc-title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.mc-snippet { color: var(--text-2); font-size: 14px; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 4.4em; }
.mc-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line); }
.mc-meta .ic { margin-right: 3px; }
.mc-author { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.empty { text-align: center; padding: 56px 24px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 8px; }
.empty .btn { margin-top: 12px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 26px; }

/* ---------- Grabadora ---------- */
.rec { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; margin-top: 10px; }
.rec-main > .card + .card, .rec-side > .card + .card { margin-top: 18px; }
.card-head { margin-bottom: 18px; }
.card-head h2 { margin-bottom: 4px; }
.rec-stage { position: relative; overflow: hidden; text-align: center; padding: 26px 22px 28px; }
.rec-stage::before { content: ""; position: absolute; inset: 0; background: radial-gradient(500px 220px at 50% 0%, var(--accent-soft), transparent 70%); pointer-events: none; }
.rec.is-live .rec-stage { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); box-shadow: 0 0 0 4px var(--danger-soft), var(--shadow); }
.rec.is-live .rec-stage::before { background: radial-gradient(500px 220px at 50% 0%, var(--danger-soft), transparent 70%); }
.rec-top { position: relative; display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.rec-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; color: var(--muted); font-size: 14px; }
.rec.is-live .rec-status { color: var(--danger); }
.rec.is-live .rec-status .dot { animation: blink 1.2s infinite; }
.rec.is-paused .rec-status { color: var(--warn); }
.rec-timer { font-family: var(--mono); font-size: 44px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.wave { position: relative; width: 100%; height: 96px; display: block; margin: 6px 0 18px; }
.rec-controls { position: relative; display: flex; justify-content: center; align-items: center; min-height: 64px; }
.rec-btn {
  all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 14px;
  padding: 14px 32px 14px 16px; border-radius: 999px; color: #fff; font-weight: 700; font-size: 16px;
  background: var(--grad); box-shadow: 0 14px 34px rgba(99, 102, 241, .5); transition: transform .15s, box-shadow .2s;
}
.rec-btn:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 18px 40px rgba(99, 102, 241, .6); }
.rec-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.rec-btn:disabled { opacity: .6; cursor: wait; }
.rec-btn-ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .22); }
.rec-actions { display: flex; gap: 12px; }
.live-card { padding: 0; overflow: hidden; }
.live-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.live-head h3 { margin: 0; }
.speakers { display: flex; flex-wrap: wrap; gap: 8px; }
.speaker { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px; font-weight: 650; font-size: 13px; border: 1px solid var(--line-2); color: var(--text-2); transition: all .15s; }
.speaker:hover { background: var(--surface-3); }
.speaker kbd { font-family: var(--mono); font-size: 11px; opacity: .6; }
.speaker.is-active { color: #fff; border-color: transparent; background: var(--c, var(--accent)); box-shadow: 0 6px 16px color-mix(in srgb, var(--c, var(--accent)) 45%, transparent); }
.live { height: 380px; overflow-y: auto; padding: 18px 22px; scroll-behavior: smooth; }
.live-empty { text-align: center; margin-top: 120px; }
.lrow { display: grid; grid-template-columns: 52px 1fr; gap: 12px; padding: 8px 0; animation: rise .35s ease both; }
.lrow-time { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 3px; }
.lrow-who { display: inline-block; font-weight: 700; font-size: 13px; margin-right: 6px; color: var(--c, var(--accent-ink)); }
.lrow-text { color: var(--text); }
.live-interim { margin: 0; padding: 6px 0 6px 64px; color: var(--muted); font-style: italic; min-height: 1.6em; }
.status-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.status-list li { display: flex; align-items: center; gap: 10px; font-weight: 550; color: var(--text-2); }
.status-list em { margin-left: auto; font-style: normal; font-size: 13px; color: var(--muted); }
.sdot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); flex: none; }
.sdot.ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.sdot.warn { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.sdot.bad { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.tips ul { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 14px; display: flex; flex-direction: column; gap: 8px; }
.rec-side textarea { margin-top: 8px; }

/* ---------- Reunión ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 14px; margin: 10px 0 14px; }
.meeting-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.mh-main { flex: 1; min-width: 280px; }
.title-input { color: var(--text) !important; font-size: 28px !important; font-weight: 750 !important; letter-spacing: -.02em; background: transparent !important; border: 1px solid transparent !important; padding: 4px 10px !important; margin-left: -10px; border-radius: 12px; }
.title-input:hover { border-color: var(--line-2) !important; }
.title-input:focus { background: var(--surface) !important; border-color: var(--accent) !important; }
.mh-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; color: var(--muted); font-size: 14px; margin-top: 6px; }
.mh-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; padding: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-lg); display: none; z-index: 30; }
.menu-pop.is-open { display: block; animation: rise .15s ease both; }
.menu-pop a, .menu-pop button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-weight: 550; color: var(--text-2); }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.player { padding: 14px 18px; margin-bottom: 20px; }
.player audio { width: 100%; height: 44px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; font-weight: 650; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--accent-ink); border-bottom-color: var(--accent); }
.tab .count { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: rise .25s ease both; }

.summary { display: flex; flex-direction: column; gap: 18px; }
.summary-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sum-block { margin: 0 !important; }
.sum-lead { background: linear-gradient(180deg, var(--accent-soft), transparent 140%), var(--surface); }
.sum-lead p { font-size: 16.5px; line-height: 1.7; margin: 0; color: var(--text); }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.check-list li { position: relative; padding-left: 28px; color: var(--text-2); }
.check-list li::before { content: ""; position: absolute; left: 4px; top: .5em; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.check-list.ok li::before { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.check-list.warn li::before { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.topic + .topic { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.topic h4 { margin-bottom: 4px; }
.topic p { margin: 0; color: var(--text-2); }
.sum-wait, .sum-fail { text-align: center; }
.sum-wait .skeleton { margin: 12px auto 0; max-width: 560px; }
.spinner { width: 38px; height: 38px; margin: 0 auto 14px; border-radius: 50%; border: 4px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .9s linear infinite; }
.skeleton { height: 14px; border-radius: 8px; background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.sk-lg { height: 18px; } .sk-sm { width: 60%; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table-compact td, .table-compact th { padding: 9px 12px; font-size: 13.5px; }
.cell-user { display: flex; align-items: center; gap: 12px; }

.transcript-card { padding: 0; overflow: hidden; }
.transcript-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.transcript { max-height: 70vh; overflow-y: auto; padding: 8px 10px; }
.seg { display: grid; grid-template-columns: 62px 1fr; gap: 10px; padding: 10px 12px; border-radius: 12px; transition: background .15s; }
.seg:hover { background: var(--surface-2); }
.seg.is-playing { background: var(--accent-soft); }
.seg.is-hidden { display: none; }
.seg-time { all: unset; cursor: pointer; font-family: var(--mono); font-size: 12.5px; color: var(--accent-ink); padding-top: 3px; font-weight: 600; }
.seg-time:hover { text-decoration: underline; }
.seg-speaker { display: block; width: auto; max-width: 220px; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; margin-bottom: 2px; font-weight: 700; font-size: 13px; color: var(--accent-ink); border-radius: 6px; }
.seg-speaker:focus { background: var(--surface) !important; padding: 2px 6px !important; }
.seg-speaker-ro { display: block; font-weight: 700; font-size: 13px; color: var(--accent-ink); margin-bottom: 2px; }
.seg-text { margin: 0; outline: none; border-radius: 6px; }
.seg-text[contenteditable]:focus { background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); padding: 2px 6px; }
.seg.is-saved .seg-text { animation: flash-ok .9s ease; }
mark { background: rgba(250, 204, 21, .45); color: inherit; border-radius: 4px; padding: 0 2px; }

/* ---------- Diálogos y menús ---------- */
.dialog { border: 1px solid var(--line-2); border-radius: 20px; padding: 0; background: var(--surface); color: var(--text); width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(8, 10, 30, .55); backdrop-filter: blur(4px); }
.dialog-in { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ---------- Admin ---------- */
.kv { display: flex; flex-direction: column; }
.kv > div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.checks { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px 20px; }
.checks li { display: flex; gap: 10px; align-items: center; font-weight: 550; }
.checks li.ok { color: var(--ok); }
.checks li.bad { color: var(--danger); }
.checks li.ok span, .checks li.bad span { color: var(--text-2); }
.roles-help { margin-top: 18px; }

/* ---------- Invitados (login / instalador) ---------- */
body.guest { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.guest-wrap { width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.guest-wide { max-width: 640px; }
.guest-card { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 34px; box-shadow: var(--shadow-lg); }
.guest-title { font-size: 24px; margin-bottom: 6px; }
.guest-sub { margin-bottom: 22px; }
.guest-foot { color: var(--muted); font-size: 13px; margin: 0; }
.error-box { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.error-code { font-size: 64px; font-weight: 800; letter-spacing: -.04em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.guest-card .checks { grid-template-columns: 1fr; margin-bottom: 18px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 240px; max-width: 360px; padding: 13px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 550; box-shadow: var(--shadow-lg); animation: rise .25s ease both; }
.toast.error { background: #dc2626; color: #fff; }
.toast.success { background: #059669; color: #fff; }

/* ---------- Animaciones ---------- */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes flash-ok { 0% { background: var(--ok-soft); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }


/* ---------- Tareas, mapa mental y chat ---------- */
.task-list { display: flex; flex-direction: column; }
.task { display: flex; align-items: flex-start; gap: 14px; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task-check { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ok); flex: none; cursor: pointer; }
.task-body { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.task-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.task-src { font-size: 12.5px; color: var(--muted); }
.task.is-done .task-text { text-decoration: line-through; color: var(--muted); }
.task-add { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); }
.map-card { padding: 0; overflow: hidden; }
.map-tools { display: flex; align-items: center; gap: 10px; padding: 16px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.map-tools h3 { margin: 0; }
.map-wrap { overflow: auto; max-height: 72vh; padding: 20px; background: radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0 / 22px 22px; }
.map-wrap svg { display: block; }
.chat-card { display: flex; flex-direction: column; gap: 14px; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.chat-head h3 { margin: 0; }
.chat { min-height: 260px; max-height: 58vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px; }
.msg { display: flex; }
.msg-me { justify-content: flex-end; }
.msg-in { max-width: 82%; padding: 12px 16px; border-radius: 18px; line-height: 1.6; }
.msg-me .msg-in { background: var(--grad); color: #fff; border-bottom-right-radius: 6px; white-space: pre-wrap; }
.msg-ai .msg-in { background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg-in p { margin: 0 0 .5em; } .msg-in p:last-child { margin: 0; }
.msg-in ul { margin: .3em 0; padding-left: 20px; }
.msg-err { color: var(--danger); }
.ts { all: unset; cursor: pointer; font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); padding: 1px 7px; border-radius: 6px; margin: 0 2px; }
.ts:hover { text-decoration: underline; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest { all: unset; cursor: pointer; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.suggest:hover { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.chat-form { display: flex; gap: 10px; align-items: flex-end; }
.chat-form textarea { min-height: 46px; max-height: 140px; }
.typing { display: inline-flex; gap: 4px; } .typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.1s infinite; } .typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@media (max-width: 900px) { .task-add { grid-template-columns: 1fr; } .msg-in { max-width: 94%; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .rec { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .two-col, .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 290px; transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow-lg); background: var(--surface); }
  .sidebar.is-open { transform: none; }
  .scrim.is-open { display: block; position: fixed; inset: 0; background: rgba(8, 10, 30, .5); z-index: 35; }
  .only-mobile { display: inline-flex !important; }
  .topbar { padding: 12px 16px 0; }
  .content { padding: 12px 16px 48px; }
  h1 { font-size: 24px; }
  .form-grid, .field-row { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .meeting-grid { grid-template-columns: 1fr; }
  .rec-timer { font-size: 36px; }
  .live { height: 300px; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; gap: 10px; }
  .stat-ic { width: 38px; height: 38px; }
  .stat strong { font-size: 20px; }
  .guest-card { padding: 24px; }
  .rec-actions { flex-direction: column; width: 100%; }
}

/* ---------- Impresión (PDF) ---------- */
@media print {
  body { background: #fff !important; color: #000; font-size: 12px; }
  .sidebar, .topbar, .scrim, .toasts, .mh-actions, .back-link, .player, .tabs, .summary-tools, .transcript-tools, .btn, .alert { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; background: #fff !important; }
  .tab-panel { display: block !important; margin-bottom: 20px; }
  .transcript { max-height: none; overflow: visible; }
  .title-input { font-size: 22px; border: 0 !important; }
  .seg-speaker { color: #000; }
}

/* ---------- Separación de voces ---------- */
.voice-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 14px; margin: 0 18px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--accent-soft); }
.vmeter { position: relative; width: 140px; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.vmeter i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .09s linear; }
.vmeter b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--accent-3); left: 0; }
.vsens input { vertical-align: middle; width: 90px; }
.voices-card { display: grid; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.voices-card .field-row { align-items: end; }
.voices-card input[type=range] { width: 100%; }

.task-date { font: inherit; font-size: 12px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted, inherit); }
.task-date.is-over { border-color: #ef4444; color: #ef4444; }

/* Logo de la institución */
.brand-mark.has-logo { background: transparent; box-shadow: none; padding: 0; overflow: hidden; display: inline-grid; place-items: center; }
.brand-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
