/* ============================================================
   IA Productivity Suite — By TIDS Multimedia
   Estilos del panel (SaaS moderno, limpio y profesional)
   ============================================================ */

:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --text-soft: #697386;
  --border: #e6ebf2;
  --border-soft: #eef2f7;

  --primary: #0056b3;          /* Azul TIDS principal */
  --primary-dark: #00448f;
  --primary-soft: #e6f0fb;
  --accent: #e63946;           /* Rojo/acento TIDS */
  --accent-soft: #fdecef;
  --grad-primary: linear-gradient(135deg, #0056b3 0%, #3b82f6 100%);

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #e63946;
  --info: #3b82f6;

  --prod-productiva: #10b981;
  --prod-neutral: #f59e0b;
  --prod-distraccion: #e63946;
  --prod-sistema: #94a3b8;
  --prod-sinclasificar: #cbd5e1;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .05);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --sidebar-w: 252px;
}

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-weight: 700; letter-spacing: -.01em; }
code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  background: #eef1f8; padding: 1px 6px; border-radius: 6px; font-size: .85em;
}

/* ───────────── Estructura ───────────── */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, #111827 0%, #151923 100%);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand-logo {
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(135deg, #0056b3, #3b82f6);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 16px; letter-spacing: .5px;
  box-shadow: 0 4px 12px rgba(0, 86, 179, .4);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; color: #fff; font-size: 15px; }
.brand-sub { font-size: 11.5px; color: #8b93a7; }

.sidebar-nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px;
  color: #b9c0d4; font-weight: 500; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active {
  background: linear-gradient(135deg, rgba(0, 86, 179, .9), rgba(59, 130, 246, .85));
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 86, 179, .35);
}
.nav-item.active svg { opacity: 1; }

.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.nav-logout:hover { background: rgba(239, 68, 68, .15); color: #fecaca; }
.sidebar-version { text-align: center; font-size: 11px; color: #6b7280; padding-top: 10px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
}
.topbar-title h1 { font-size: 19px; }
.topbar-date { font-size: 12.5px; color: var(--text-muted); text-transform: capitalize; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-meta { text-align: right; line-height: 1.25; }
.user-name { display: block; font-weight: 600; font-size: 14px; }
.user-role { display: block; font-size: 11.5px; color: var(--text-muted); }
.user-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #0056b3, #3b82f6);
  color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.menu-toggle {
  display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text);
}

.content { padding: 26px 28px 40px; }
.content > section { margin-bottom: 22px; }
.content > section:last-child { margin-bottom: 0; }

/* ───────────── Mensajes flash ───────────── */
.flash-area { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.flash {
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px;
  border: 1px solid transparent;
}
.flash-success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.flash-error   { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.flash-info    { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }

/* ───────────── Tarjetas de estadística ───────────── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  display: flex; align-items: flex-start; gap: 14px;
}
.stat-icon {
  width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 23px; height: 23px; }
.icon-indigo { background: #e6f0fb; color: #0056b3; }
.icon-green  { background: #ecfdf5; color: #10b981; }
.icon-amber  { background: #fff7ed; color: #f59e0b; }
.icon-blue   { background: #eff6ff; color: #3b82f6; }
.stat-body { min-width: 0; }
.stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.stat-value-sm { font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub { font-size: 12px; color: var(--text-soft); margin-top: 2px; }

/* ───────────── Paneles ───────────── */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow);
}
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; }
.panel-title { font-size: 15.5px; }
.panel-hint { font-size: 12.5px; color: var(--text-soft); }
.panels-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ───────────── Gráficos ───────────── */
.chart-box { position: relative; height: 280px; }
.chart-box-donut { height: 220px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 16px; justify-content: center; }
.legend-item { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 7px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ───────────── Ranking de aplicaciones ───────────── */
.apps-list, .ranking-list { display: flex; flex-direction: column; gap: 14px; }
.app-row { display: flex; align-items: center; gap: 14px; }
.app-rank {
  width: 26px; height: 26px; border-radius: 8px; background: #f1f4f9; color: var(--text-muted);
  font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.app-info { flex: 1; min-width: 0; }
.app-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; align-items: baseline; }
.app-name { font-weight: 600; font-size: 14px; }
.app-time { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
.app-bar-track { height: 8px; background: #eef1f8; border-radius: 99px; overflow: hidden; }
.app-bar-track.small { height: 6px; margin-top: 6px; }
.app-bar-fill { height: 100%; border-radius: 99px; background: var(--primary); transition: width .4s ease; }
.app-bar-fill.prod-productiva   { background: var(--prod-productiva); }
.app-bar-fill.prod-neutral      { background: var(--prod-neutral); }
.app-bar-fill.prod-distraccion  { background: var(--prod-distraccion); }
.app-bar-fill.prod-sistema      { background: var(--prod-sistema); }
.app-bar-fill.prod-sinclasificar{ background: var(--prod-sinclasificar); }

/* ───────────── Ranking de empleados ───────────── */
.rank-row { display: flex; align-items: center; gap: 12px; }
.rank-pos {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; background: #f1f4f9; color: var(--text-muted);
}
.rank-pos.rank-1 { background: #fef3c7; color: #b45309; }
.rank-pos.rank-2 { background: #e5e7eb; color: #4b5563; }
.rank-pos.rank-3 { background: #fde7d3; color: #c2410c; }
.rank-info { flex: 1; min-width: 0; }
.rank-top { display: flex; justify-content: space-between; gap: 10px; }
.rank-name { font-weight: 600; font-size: 14px; }
.rank-time { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
.rank-sub { font-size: 12px; color: var(--text-soft); margin: 2px 0 4px; }

.emp-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #0056b3, #3b82f6); color: #fff;
  font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.emp-avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.emp-avatar.lg { width: 64px; height: 64px; font-size: 22px; }

.online-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--success); box-shadow: 0 0 0 3px rgba(16, 185, 129, .2);
}

/* ───────────── Tablas ───────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-soft); font-weight: 600; padding: 0 14px 12px; border-bottom: 1px solid var(--border);
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--border-soft); font-size: 14px; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafbfe; }
.ta-right { text-align: right; }
.nowrap { white-space: nowrap; color: var(--text-muted); font-size: 13px; }
.muted { color: var(--text-muted); }
.truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cell-emp { display: flex; align-items: center; gap: 10px; }
.cell-name { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--text-soft); }
.code-chip {
  font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; font-weight: 600;
  background: #e6f0fb; color: var(--primary-dark); padding: 3px 9px; border-radius: 7px;
}
.app-chip { background: #f1f4f9; padding: 4px 10px; border-radius: 7px; font-size: 13px; font-weight: 500; }
.empty { text-align: center; color: var(--text-soft); padding: 26px 10px; font-size: 14px; }

/* ───────────── Badges ───────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-online { background: #ecfdf5; color: #059669; }
.badge-offline { background: #f1f5f9; color: #64748b; }
.badge-active { background: #ecfdf5; color: #059669; }
.badge-inactive { background: #f1f5f9; color: #64748b; }
.badge-active-st { background: #e6f0fb; color: #00448f; }
.badge-idle { background: #fff7ed; color: #c2740a; }
.badge-prod-productiva   { background: #ecfdf5; color: #059669; }
.badge-prod-neutral      { background: #fff7ed; color: #c2740a; }
.badge-prod-distraccion  { background: #fef2f2; color: #dc2626; }
.badge-prod-sistema      { background: #f1f5f9; color: #64748b; }
.badge-prod-sinclasificar{ background: #f1f5f9; color: #94a3b8; }

/* ───────────── Botones ───────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(0, 86, 179, .25); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-light { background: #fff; color: var(--text); border-color: var(--border); }
.btn-light:hover { background: #f6f8fc; border-color: #d6dbe7; }
.btn-danger { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-success { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.btn-success:hover { background: #d1fae5; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ───────────── Página / acciones ───────────── */
.page-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.page-desc { color: var(--text-muted); font-size: 14px; }
.page-actions .btn-primary, .page-actions form { margin-left: auto; }
.page-actions .spacer { flex: 1; }
.row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; }
.inline-form { display: inline; }

/* ───────────── Formularios ───────────── */
.form-panel { max-width: 760px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group-full { grid-column: 1 / -1; }
.form-group label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.form-group input, .form-group select {
  padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text); transition: border .15s, box-shadow .15s;
}
.form-group input:focus, .form-group select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 86, 179, .15);
}
.form-hint { font-size: 12px; color: var(--text-soft); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.form-note { margin-top: 14px; font-size: 12.5px; color: var(--text-soft); }
.checkbox { flex-direction: row; align-items: center; gap: 9px; font-weight: 500; }

.filter-bar { padding: 16px 22px; }
.form-inline { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.form-inline .form-group { min-width: 200px; }
.form-inline .btn { margin-left: auto; }

/* ───────────── Detalle de empleado ───────────── */
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.detail-id { display: flex; align-items: center; gap: 18px; }
.detail-name { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.detail-meta { color: var(--text-muted); font-size: 14px; margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-status { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.detail-lastseen { font-size: 12.5px; color: var(--text-soft); }

/* ───────────── Privacidad ───────────── */
.privacy-intro h2 { font-size: 20px; margin-bottom: 10px; }
.privacy-intro p { color: var(--text-muted); max-width: 720px; }
.privacy-yes { border-top: 3px solid var(--success); }
.privacy-no { border-top: 3px solid var(--danger); }
.privacy-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.privacy-list li { padding-left: 4px; font-size: 14px; color: var(--text); }
.privacy-foot { margin-top: 14px; font-size: 13px; color: var(--text-soft); }

/* ───────────── Login / Auth ───────────── */
.auth-body { background: linear-gradient(135deg, #111827 0%, #0f172a 60%, #00448f 100%); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: #fff; width: 100%; max-width: 410px; border-radius: 20px; padding: 36px 34px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
.auth-brand { text-align: center; margin-bottom: 24px; }
.brand-logo-lg { width: 60px; height: 60px; border-radius: 16px; font-size: 22px; margin: 0 auto 14px; }
.auth-brand h1 { font-size: 21px; }
.auth-tagline { color: var(--text-muted); font-size: 13px; margin-top: 6px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.auth-form .form-group { gap: 7px; }
.auth-form .btn { margin-top: 6px; padding: 12px; }
.auth-demo { margin-top: 22px; padding: 14px 16px; background: #f6f8fc; border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-muted); }
.auth-demo strong { color: var(--text); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.auth-foot { color: rgba(255, 255, 255, .65); font-size: 12.5px; margin-top: 22px; }
.error-card { text-align: center; }
.error-code { font-size: 64px; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 8px; }

/* ───────────── Responsive ───────────── */
@media (max-width: 920px) {
  .panels-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar {
    position: fixed; left: calc(-1 * var(--sidebar-w)); top: 0; z-index: 60;
    transition: left .25s ease;
  }
  .app-shell.nav-open .sidebar { left: 0; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .4); }
  .menu-toggle { display: block; }
  .content { padding: 18px 16px 32px; }
  .topbar { padding: 12px 16px; }
  .user-meta { display: none; }
  .detail-status { text-align: left; align-items: flex-start; }
}

/* ============================================================
   V1.5 — Tema claro/oscuro, premium y componentes nuevos
   ============================================================ */

html { color-scheme: light dark; }
body, .stat-card, .panel, .topbar, .table td, .form-group input,
.form-group select, .btn-light, .app-bar-track {
  transition: background-color .25s ease, color .2s ease, border-color .2s ease,
              box-shadow .2s ease, transform .18s ease;
}

/* ---------- Tokens del TEMA OSCURO ---------- */
[data-theme="dark"] {
  --bg: #0b1020;
  --surface: #141c30;
  --surface-2: #0f1626;
  --text: #e7ebf4;
  --text-muted: #a3afc9;
  --text-soft: #71809e;
  --border: #243150;
  --border-soft: #1b2540;
  --primary: #3b82f6;
  --primary-dark: #0056b3;
  --primary-soft: #1f2340;
  --shadow: 0 1px 3px rgba(0, 0, 0, .45), 0 14px 34px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
}
[data-theme="dark"] body { background: var(--bg); color: var(--text); }
[data-theme="dark"] .app-rank,
[data-theme="dark"] .rank-pos,
[data-theme="dark"] .app-chip,
[data-theme="dark"] .app-bar-track,
[data-theme="dark"] .app-bar-track.small { background: #1e2840; color: var(--text-muted); }
[data-theme="dark"] .table tbody tr:hover { background: rgba(255, 255, 255, .035); }
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select { background: var(--surface-2); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .btn-light { background: #1a2338; color: var(--text); border-color: var(--border); }
[data-theme="dark"] .btn-light:hover { background: #222e48; border-color: #31436a; }
[data-theme="dark"] .code-chip { background: #1f2340; color: #c7ccff; }
[data-theme="dark"] .app-chip { color: var(--text); }
[data-theme="dark"] .topbar { background: rgba(15, 22, 38, .72); border-color: var(--border); }
[data-theme="dark"] .auth-demo { background: var(--surface-2); border-color: var(--border); }
[data-theme="dark"] .badge-offline,
[data-theme="dark"] .badge-inactive { background: #1e2840; color: #9aa6bf; }
[data-theme="dark"] .flash-success { background: rgba(16, 185, 129, .14); color: #6ee7b7; border-color: rgba(16, 185, 129, .3); }
[data-theme="dark"] .flash-error { background: rgba(239, 68, 68, .14); color: #fca5a5; border-color: rgba(239, 68, 68, .3); }
[data-theme="dark"] .flash-info { background: rgba(59, 130, 246, .14); color: #93c5fd; border-color: rgba(59, 130, 246, .3); }
[data-theme="dark"] .empty { color: var(--text-soft); }

/* ---------- Toques premium / microinteracciones ---------- */
.stat-card { position: relative; overflow: hidden; }
.stat-card::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, #0056b3, #3b82f6); opacity: 0; transition: opacity .2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(15, 23, 42, .13); }
.stat-card:hover::after { opacity: 1; }
[data-theme="dark"] .stat-card:hover { box-shadow: 0 16px 38px rgba(0, 0, 0, .55); border-color: #2f4068; }
.panel:hover { box-shadow: 0 10px 28px rgba(15, 23, 42, .08); }
[data-theme="dark"] .panel:hover { box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.app-row, .rank-row { transition: transform .15s ease; }
.app-row:hover, .rank-row:hover { transform: translateX(2px); }
.btn:active { transform: translateY(1px); }

/* ---------- Botón de tema ---------- */
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.theme-toggle:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-1px); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Logo de marca ---------- */
.brand-logo-img { height: 34px; width: auto; display: block; }
.brand-logo-fallback { } /* se usa el .brand-logo existente como respaldo */

/* ---------- Chip de modo demo + badges de nav ---------- */
.demo-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px 5px 12px;
  background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff;
  font-size: 11.5px; font-weight: 700; border-radius: 99px;
}
.demo-chip form { display: inline; }
.demo-chip button {
  border: none; background: rgba(255, 255, 255, .25); color: #fff; cursor: pointer;
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
}
.demo-chip button:hover { background: rgba(255, 255, 255, .4); }
.nav-badge {
  margin-left: auto; background: #ef4444; color: #fff; font-size: 11px;
  font-weight: 700; padding: 1px 8px; border-radius: 99px; min-width: 20px; text-align: center;
}

/* ---------- Interruptores (settings) ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid var(--border-soft);
}
.setting-text strong { font-size: 14px; font-weight: 600; display: block; }
.setting-text small { font-size: 12px; color: var(--text-soft); }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; background: #cbd5e1; border-radius: 99px;
  cursor: pointer; transition: background .2s;
}
.slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }
[data-theme="dark"] .slider { background: #36486b; }

/* ---------- Equipos / pendientes ---------- */
.alert-banner {
  display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, .14), rgba(249, 115, 22, .10));
  border: 1px solid rgba(245, 158, 11, .35); color: var(--text); font-size: 14px; margin-bottom: 18px;
}
.alert-banner svg { width: 22px; height: 22px; color: #f59e0b; flex-shrink: 0; }
.badge-pending { background: #fff7ed; color: #c2740a; }
.badge-unassigned { background: #fef2f2; color: #dc2626; }
.badge-paused { background: #f1f5f9; color: #64748b; }
[data-theme="dark"] .badge-pending { background: rgba(245, 158, 11, .15); color: #fbbf24; }
[data-theme="dark"] .badge-unassigned { background: rgba(239, 68, 68, .15); color: #fca5a5; }
.assign-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.assign-form select { padding: 7px 10px; }
.mono { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; color: var(--text-muted); }

/* ---------- Banner de insights (base IA) ---------- */
.insight-banner {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px 20px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(0, 86, 179, .12), rgba(59, 130, 246, .10));
  border: 1px solid rgba(0, 86, 179, .28); margin-bottom: 22px;
}
.ai-badge {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #0056b3, #3b82f6); display: flex; align-items: center;
  justify-content: center; font-size: 13px; box-shadow: 0 4px 12px rgba(0, 86, 179, .4);
}
.insight-text { font-size: 14px; color: var(--text); line-height: 1.55; }
.insight-text .insight-title { font-weight: 700; display: block; margin-bottom: 2px; }
.insight-text .muted { color: var(--text-muted); }

/* ---------- Historial de asignaciones ---------- */
.timeline { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.timeline li { display: flex; gap: 12px; align-items: flex-start; }
.timeline .dot-line { display: flex; flex-direction: column; align-items: center; }
.timeline .tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); margin-top: 5px; }
.timeline .tl-bar { width: 2px; flex: 1; background: var(--border); margin-top: 2px; }
.timeline .tl-body { font-size: 13.5px; }
.timeline .tl-when { font-size: 12px; color: var(--text-soft); }

@media (max-width: 760px) {
  .settings-grid { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- Logo TIDS (oficial) ---------- */
.sidebar-brand { flex-direction: column; align-items: flex-start; gap: 8px; }
.brand-logo-img { height: 40px; width: auto; max-width: 92%; display: block; }
.brand-caption { font-size: 12px; font-weight: 600; color: #8b93a7; letter-spacing: .02em; }

/* ---------- Foto, campos personalizados y búsqueda (ajustes) ---------- */
.emp-photo { object-fit: cover; border-radius: 50%; display: block; flex-shrink: 0; }
.emp-photo.sm { width: 30px; height: 30px; }
.emp-photo.lg { width: 64px; height: 64px; }

.photo-uploader { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; padding-bottom: 20px; border-bottom: 1px solid var(--border-soft); }
.photo-uploader .form-hint { display: block; margin-top: 8px; }

.form-subtitle { font-size: 14px; font-weight: 700; margin: 22px 0 12px; }
.form-subtitle small { font-weight: 500; color: var(--text-soft); }
.cf-row { display: flex; gap: 10px; margin-bottom: 10px; }
.cf-row input { flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: #fff; color: var(--text); font-family: inherit; }
.cf-row.cf-hidden { display: none; }
[data-theme="dark"] .cf-row input { background: var(--surface-2); border-color: var(--border); }
.cf-chip { background: var(--primary-soft); color: var(--primary-dark); padding: 3px 10px; border-radius: 8px; font-size: 13px; margin-right: 6px; display: inline-block; }
[data-theme="dark"] .cf-chip { background: #1f2340; color: #c7ccff; }
.detail-custom { margin-top: 6px; }

.toolbar { margin-bottom: 14px; }
.search-input { width: 100%; max-width: 440px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: #fff; color: var(--text); font-family: inherit; transition: border .15s, box-shadow .15s; }
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 86, 179, .15); }
[data-theme="dark"] .search-input { background: var(--surface-2); border-color: var(--border); }

/* ============================================================
   Asistente inicial, dashboard adaptativo y audio
   ============================================================ */
/* Wizard */
.wizard-progress { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 22px; }
.wz-dot { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; background: var(--surface); border: 2px solid var(--border); color: var(--text-soft); }
.wz-dot.active { background: linear-gradient(135deg, #0056b3, #3b82f6); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(0, 86, 179, .4); }
.wz-line { width: 48px; height: 2px; background: var(--border); }
.wizard-step { display: none; }
.wizard-step.active { display: block; }
.wizard-nav { display: flex; justify-content: space-between; margin-top: 22px; gap: 10px; }

/* Tarjetas de opción y días */
.radio-cards { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-card { flex: 1; min-width: 190px; border: 1px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; display: flex; align-items: center; gap: 10px; font-size: 14px; transition: all .15s; background: var(--surface); }
.radio-card:hover { border-color: var(--primary); }
.radio-card input { accent-color: var(--primary); }
.radio-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 86, 179, .15); }
.days-row { display: flex; gap: 8px; flex-wrap: wrap; }
.day-chip { border: 1px solid var(--border); border-radius: 10px; padding: 8px 11px; cursor: pointer; font-size: 13px; user-select: none; display: inline-flex; align-items: center; gap: 6px; }
.day-chip input { accent-color: var(--primary); }
.day-chip:has(input:checked) { background: var(--primary); color: #fff; border-color: transparent; }

/* Banner de contexto (dashboard adaptativo) */
.context-strip { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 10px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 18px; font-size: 13.5px; color: var(--text-muted); box-shadow: var(--shadow-sm); }
.ctx-item { white-space: nowrap; }
.ctx-edit { margin-left: auto; color: var(--primary); font-weight: 600; font-size: 13px; }

/* Dentro / fuera de jornada */
.after-hours { display: flex; gap: 16px; flex-wrap: wrap; }
.ah-block { flex: 1; min-width: 160px; background: var(--bg); border: 1px solid var(--border-soft); border-radius: 12px; padding: 16px; }
[data-theme="dark"] .ah-block { background: var(--surface-2); }
.ah-label { font-size: 12.5px; color: var(--text-muted); }
.ah-value { font-size: 24px; font-weight: 800; margin-top: 4px; }
.ah-pct { font-size: 12px; color: var(--warning); margin-top: 2px; }

/* Botón de audio */
.audio-btn { cursor: pointer; }
.insight-title .audio-btn { border: none; background: transparent; font-size: 16px; padding: 0 0 0 6px; line-height: 1; vertical-align: middle; }

/* ============================================================
   Branding premium TIDS — refinamientos + login split-screen
   ============================================================ */
/* Botones primarios con gradiente de marca */
.btn-primary { background: var(--grad-primary); border: none; box-shadow: 0 6px 16px rgba(0, 86, 179, .26); }
.btn-primary:hover { filter: brightness(1.06); background: var(--grad-primary); }
.ai-badge, .brand-logo, .user-avatar, .emp-avatar { background: var(--grad-primary); }

/* Acento rojo TIDS sutil en el logout */
.nav-logout:hover { background: rgba(230, 57, 70, .16); color: #fecdd3; }

/* ───────────── Login premium (panel de valor + card de acceso) ───────────── */
.login-page {
  min-height: 100vh; display: flex; position: relative;
  background: linear-gradient(135deg, #f7faff 0%, #eaf1fb 100%);
  color: var(--text); overflow: hidden;
}
.login-page::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 86, 179, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 86, 179, .045) 1px, transparent 1px);
  background-size: 30px 30px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 80%);
          mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 80%);
}
.login-left {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 48px clamp(28px, 5vw, 80px); position: relative; z-index: 1;
}
.login-pill {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  background: #fff; border: 1px solid var(--border); border-radius: 99px;
  padding: 7px 14px; font-size: 12px; font-weight: 700; color: var(--text-muted);
  letter-spacing: .04em; text-transform: uppercase; box-shadow: var(--shadow-sm);
}
.login-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); }
.login-logo-lg { height: 56px; width: auto; margin: 26px 0 22px; display: block; }
.login-headline {
  font-size: clamp(34px, 4vw, 52px); line-height: 1.05; font-weight: 800;
  letter-spacing: -.02em; max-width: 14ch; color: var(--text); margin-top: 28px;
}
.login-headline .hl-blue { color: var(--primary); }
.login-headline .hl-red { color: var(--accent); }
.login-sub { margin-top: 18px; color: var(--text-muted); font-size: 16px; max-width: 46ch; line-height: 1.6; }
.login-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 34px; max-width: 620px; }
.feature-card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px;
  box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-ic {
  width: 38px; height: 38px; border-radius: 11px; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.feature-ic svg { width: 20px; height: 20px; }
.feature-card h3 { font-size: 14px; }
.feature-card p { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; }

.login-right { width: 500px; max-width: 100%; display: flex; align-items: center; justify-content: center; padding: 32px 28px; position: relative; z-index: 1; }
.login-card {
  width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--border);
  border-radius: 22px; padding: 30px 30px 24px; box-shadow: 0 28px 70px rgba(15, 23, 42, .14);
}
.login-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.login-tag { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--success); background: #ecfdf5; padding: 5px 11px; border-radius: 99px; }
.login-ver { font-size: 11px; font-weight: 700; color: var(--text-soft); background: var(--bg); border: 1px solid var(--border); padding: 4px 9px; border-radius: 8px; }
.login-card-brand { text-align: center; margin-bottom: 18px; }
.login-card-brand img { height: 46px; margin: 0 auto 10px; display: block; }
.login-card-brand h1 { font-size: 20px; }
.login-card-brand p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.login-field { margin-bottom: 14px; }
.login-field-label { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.login-field-label small { color: var(--text-soft); font-weight: 600; letter-spacing: .03em; }
.login-input-wrap { position: relative; display: flex; align-items: center; }
.login-input-wrap svg.lead { position: absolute; left: 13px; width: 18px; height: 18px; color: var(--text-soft); }
.login-input-wrap input { width: 100%; padding: 12px 42px; border: 1px solid var(--border); border-radius: 12px; font-size: 14px; font-family: inherit; background: #fff; color: var(--text); transition: border .15s, box-shadow .15s; }
.login-input-wrap input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 86, 179, .14); }
.login-eye { position: absolute; right: 10px; background: none; border: none; cursor: pointer; color: var(--text-soft); padding: 6px; display: flex; }
.login-eye svg { width: 18px; height: 18px; }
.login-status { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin: 6px 2px 16px; }
.login-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); display: inline-block; margin-right: 6px; box-shadow: 0 0 0 3px rgba(16, 185, 129, .18); }
.login-chips { display: flex; gap: 10px; margin-top: 14px; }
.login-chip { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--text-muted); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 9px; }
.login-chip svg { width: 15px; height: 15px; }
.login-foot { text-align: center; font-size: 11.5px; color: var(--text-soft); margin-top: 18px; line-height: 1.5; }
.login-foot strong { color: var(--primary); }
.login-demo { margin-top: 14px; text-align: center; font-size: 12px; color: var(--text-muted); background: var(--primary-soft); border: 1px dashed rgba(0, 86, 179, .3); border-radius: 10px; padding: 9px; }
.login-demo code { background: rgba(255, 255, 255, .7); }
.login-agent { margin-top: 12px; text-align: center; }
.login-agent-btn { gap: 8px; font-size: 13.5px; }
.login-agent-btn svg { width: 17px; height: 17px; }
.login-agent-link { font-size: 12.5px; color: var(--text-muted); text-decoration: none; border-bottom: 1px dashed var(--border); padding-bottom: 1px; }
.login-agent-link:hover { color: var(--primary); border-color: var(--primary); }

@media (max-width: 900px) {
  .login-left { display: none; }
  .login-right { width: 100%; }
}

/* ============================================================
   Coherencia visual premium interna (mismo nivel que el login)
   ============================================================ */
/* Fondo premium: blobs de color TIDS + rejilla sutil (detrás de todo) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(440px circle at 82% 8%, rgba(0, 86, 179, .10), transparent 60%),
    radial-gradient(380px circle at 97% 64%, rgba(230, 57, 70, .06), transparent 60%),
    radial-gradient(460px circle at 55% 108%, rgba(59, 130, 246, .08), transparent 60%);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 86, 179, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 86, 179, .035) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(ellipse at 75% 0%, #000 18%, transparent 72%);
          mask-image: radial-gradient(ellipse at 75% 0%, #000 18%, transparent 72%);
}
[data-theme="dark"] body::before {
  background:
    radial-gradient(440px circle at 82% 8%, rgba(59, 130, 246, .12), transparent 60%),
    radial-gradient(380px circle at 97% 64%, rgba(230, 57, 70, .08), transparent 60%),
    radial-gradient(460px circle at 55% 108%, rgba(0, 86, 179, .14), transparent 60%);
}
/* El área principal deja ver el fondo; el sidebar se mantiene sólido */
.main { background: transparent; }

/* Tarjetas con glassmorphism elegante (sobre el fondo premium) */
.stat-card, .panel {
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
          backdrop-filter: blur(10px) saturate(140%);
  border-color: rgba(255, 255, 255, .7);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 12px 30px rgba(15, 23, 42, .07);
}
[data-theme="dark"] .stat-card, [data-theme="dark"] .panel {
  background: rgba(20, 28, 48, .72);
  border-color: rgba(255, 255, 255, .06);
}
.topbar { background: rgba(255, 255, 255, .72); }
[data-theme="dark"] .topbar { background: rgba(15, 22, 38, .72); }

/* Animación de entrada sutil (fade-up) */
@keyframes tidsFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.content > section { animation: tidsFadeUp .45s ease both; }
.content > section:nth-child(2) { animation-delay: .04s; }
.content > section:nth-child(3) { animation-delay: .08s; }
.content > section:nth-child(4) { animation-delay: .12s; }
.content > section:nth-child(n+5) { animation-delay: .15s; }

/* Título de página con gradiente sutil (con fallback seguro de color) */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .topbar-title h1 {
    background: linear-gradient(90deg, #0f172a 0%, #0056b3 120%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  }
  [data-theme="dark"] .topbar-title h1 {
    background: linear-gradient(90deg, #e7ecf4 0%, #3b82f6 130%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  }
}

/* "Sin clasificar" en rojo (requiere acción) */
.badge-prod-sinclasificar {
  background: rgba(230, 57, 70, .10); color: #e63946; border: 1px solid rgba(230, 57, 70, .22);
}
[data-theme="dark"] .badge-prod-sinclasificar {
  background: rgba(230, 57, 70, .16); color: #fca5b0; border-color: rgba(230, 57, 70, .3);
}
.cf-pending td { background: rgba(230, 57, 70, .045); }
.cf-pending td:first-child { box-shadow: inset 3px 0 0 #e63946; }
.alert-banner.alert-danger { background: linear-gradient(135deg, rgba(230, 57, 70, .12), rgba(230, 57, 70, .05)); border-color: rgba(230, 57, 70, .28); }
.alert-banner.alert-danger svg { color: #e63946; }

/* Menú de usuario (topbar) con cerrar sesión */
.topbar-user { position: relative; }
.user-trigger { display: flex; align-items: center; gap: 12px; background: none; border: none; cursor: pointer; padding: 4px 6px; border-radius: 12px; transition: background .15s; }
.user-trigger:hover { background: rgba(15, 23, 42, .05); }
[data-theme="dark"] .user-trigger:hover { background: rgba(255, 255, 255, .06); }
.user-dropdown { position: absolute; top: 56px; right: 0; width: 232px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .15s, transform .15s, visibility .15s; z-index: 60; }
.user-dropdown.open { opacity: 1; visibility: visible; transform: none; }
.ud-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border-soft); margin-bottom: 6px; }
.ud-head strong { display: block; font-size: 14px; }
.ud-head span { font-size: 12px; color: var(--text-muted); }
.ud-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--text); }
.ud-item svg { width: 18px; height: 18px; }
.ud-item:hover { background: var(--bg); }
.ud-logout { color: #e63946; }
.ud-logout:hover { background: rgba(230, 57, 70, .10); }

/* Efecto de partículas (canvas global) */
#particle-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 9998; }

@media (prefers-reduced-motion: reduce) {
  .content > section { animation: none; }
  .stat-card:hover, .panel:hover, .app-row:hover, .rank-row:hover, .feature-card:hover { transform: none; }
}

/* ============================================================
   Sidebar premium CLARO (glassmorphism) — coherente con el login
   ============================================================ */
:root {
  --side-bg: rgba(255, 255, 255, .72);
  --side-border: rgba(15, 23, 42, .08);
  --side-text: #475569;
  --side-strong: #0f172a;
  --side-muted: #97a2b4;
  --side-hover: rgba(15, 23, 42, .045);
  --side-chip: #ffffff;
  --side-chip-bd: #e6ebf2;
}
[data-theme="dark"] {
  --side-bg: rgba(17, 24, 39, .72);
  --side-border: rgba(255, 255, 255, .08);
  --side-text: #b9c0d4;
  --side-strong: #ffffff;
  --side-muted: #6b7280;
  --side-hover: rgba(255, 255, 255, .06);
  --side-chip: rgba(255, 255, 255, .06);
  --side-chip-bd: rgba(255, 255, 255, .10);
}
.sidebar {
  background: var(--side-bg);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
          backdrop-filter: blur(16px) saturate(160%);
  border-right: 1px solid var(--side-border);
  box-shadow: 1px 0 24px rgba(15, 23, 42, .04);
  color: var(--side-text);
}
.sidebar-brand { border-bottom: 1px solid var(--side-border); padding: 20px 18px; }
.brand-name { color: var(--side-strong); }
.brand-sub, .brand-caption { color: var(--side-muted); }

.sidebar-nav { padding: 12px 12px; gap: 5px; overflow-y: auto; }
.nav-section { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--side-muted); padding: 14px 14px 6px; }
.nav-section:first-child { padding-top: 6px; }

.nav-item {
  color: var(--side-text); font-weight: 600; font-size: 14.5px;
  padding: 8px 12px; border-radius: 14px; gap: 12px;
}
.nav-item svg {
  width: 34px; height: 34px; padding: 7px; flex-shrink: 0; opacity: 1;
  background: var(--side-chip); border: 1px solid var(--side-chip-bd);
  border-radius: 11px; color: var(--side-text); transition: all .15s;
}
.nav-item:hover { background: var(--side-hover); color: var(--side-strong); }
.nav-item:hover svg { color: var(--primary); border-color: rgba(0, 86, 179, .25); }
.nav-item.active {
  background: var(--grad-primary); color: #fff;
  box-shadow: 0 8px 20px rgba(0, 86, 179, .30);
}
.nav-item.active svg { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .28); color: #fff; }

.nav-badge { background: #e63946; box-shadow: 0 2px 6px rgba(230, 57, 70, .4); }
.nav-item.active .nav-badge { background: #fff; color: #e63946; box-shadow: none; }

.sidebar-footer { border-top: 1px solid var(--side-border); }
.nav-logout { color: var(--side-text); }
.nav-logout:hover { background: rgba(230, 57, 70, .10); color: #e63946; }
.nav-logout:hover svg { color: #e63946; border-color: rgba(230, 57, 70, .25); }
.sidebar-version { color: var(--side-muted); }

@media (max-width: 760px) {
  .app-shell.nav-open .sidebar { box-shadow: 0 0 0 100vmax rgba(15, 23, 42, .45); }
}

/* ============================================================
   Privacidad editable + evidencias (capturas por inactividad)
   ============================================================ */
.privacy-base, .privacy-preview {
  white-space: pre-wrap; background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; font-size: 13.5px; color: var(--text-muted); line-height: 1.55;
}
.privacy-preview { background: var(--primary-soft); border-color: rgba(0, 86, 179, .18); color: var(--text); }
textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: 14px; background: #fff; color: var(--text); resize: vertical;
}
textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 86, 179, .14); }
[data-theme="dark"] textarea { background: var(--surface-2); border-color: var(--border); }

.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.shot-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; }
.shot-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(15, 23, 42, .12); }
.shot-thumb { display: block; width: 100%; height: 140px; object-fit: cover; background: var(--bg); border-bottom: 1px solid var(--border-soft); }
.shot-body { padding: 12px 14px; }
.shot-body .shot-emp { font-weight: 700; font-size: 14px; }
.shot-body .shot-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }
.shot-idle { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 8px; }
