/* ============================================================
   NEXUS WORKSPACE — Hoja de estilos
   Tema oscuro/claro · glassmorphism · animaciones
   ============================================================ */

/* === Tema CLARO (por defecto) · paleta del logo Siteck === */
:root {
  --bg: #eef4fb;
  --bg-2: #ffffff;
  --surface: rgba(255,255,255,.78);
  --surface-2: #f3f7fc;
  --border: rgba(14,118,188,.14);
  --text: #11283d;
  --text-dim: #5c6b7d;
  --primary: #0E76BC;     /* azul Siteck */
  --primary-2: #0a5e9c;   /* azul oscuro */
  --accent: #FBCB07;      /* amarillo Siteck */
  --success: #16a34a;
  --warning: #f5a623;
  --danger: #e23b3b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 12px 38px rgba(14,118,188,.16);
  --glass-blur: blur(16px);
  --grad: linear-gradient(135deg, #0E76BC, #1e8fd5 55%, #0a5e9c);
  --grad-accent: linear-gradient(135deg, #FBCB07, #f5a623);
}

/* === Tema OSCURO (alternativo, conmutable con el botón) === */
[data-theme="dark"] {
  --bg: #0b1220;
  --bg-2: #121a2b;
  --surface: rgba(255,255,255,.05);
  --surface-2: rgba(255,255,255,.07);
  --border: rgba(255,255,255,.10);
  --text: #e8eef7;
  --text-dim: #9aa6b8;
  --primary: #2b95df;
  --primary-2: #0E76BC;
  --accent: #FBCB07;
  --shadow: 0 12px 40px rgba(0,0,0,.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}
/* Halos de fondo animados */
body::before, body::after {
  content: ''; position: fixed; z-index: 0; border-radius: 50%;
  filter: blur(90px); opacity: .35; pointer-events: none;
  animation: float 18s ease-in-out infinite;
}
body::before { width: 480px; height: 480px; background: var(--primary); top: -140px; left: -90px; opacity: .18; }
body::after  { width: 420px; height: 420px; background: var(--accent); bottom: -130px; right: -70px; animation-delay: -8s; opacity: .22; }
@keyframes float {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(40px,30px) scale(1.12); }
}

a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2;
      stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Layout general ---------- */
.app-shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 248px; flex-shrink: 0; padding: 22px 16px;
  background: var(--surface); backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 10px 8px 22px; }
.brand-img { max-width: 168px; width: 100%; height: auto; display: block; }
[data-theme="dark"] .brand-img { background: #fff; border-radius: 12px; padding: 8px 10px; }
.brand-logo {
  font-size: 26px; background: var(--grad); -webkit-background-clip: text;
  background-clip: text; color: transparent; animation: spin 8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -.3px; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border-radius: var(--radius-sm); color: var(--text-dim);
  font-weight: 500; font-size: 14.5px; position: relative;
  transition: all .2s ease;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); transform: translateX(3px); }
.nav-item.active { color: #fff; background: var(--grad); box-shadow: 0 8px 22px rgba(99,102,241,.4); }
.nav-item.active svg { stroke: #fff; }
.nav-item.logout:hover { color: var(--danger); }
.sidebar-footer { border-top: 1px solid var(--border); padding-top: 10px; }
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 40; backdrop-filter: blur(2px);
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 16px 28px;
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: var(--glass-blur); border-bottom: 1px solid var(--border);
}
.topbar-title { font-size: 20px; font-weight: 700; letter-spacing: -.4px; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; transition: all .2s;
}
.icon-btn:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }
.menu-toggle { display: none; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; }
.avatar.has-photo { background-size: cover; background-position: center; background-repeat: no-repeat; color: transparent; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta small { color: var(--text-dim); font-size: 11.5px; }

/* ---------- Contenido ---------- */
.content { padding: 28px; max-width: 1280px; width: 100%; margin: 0 auto; }
/* Solo opacidad: evita crear un contenedor de posicionamiento que descentre los modales */
.fade-in { animation: contentIn .45s ease both; }
@keyframes contentIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 24px; }
.page-head h2 { font-size: 26px; font-weight: 800; letter-spacing: -.6px; }
.page-head .spacer { flex: 1; }
.muted { color: var(--text-dim); }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); margin-bottom: 16px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--primary); }
.crumbs span { opacity: .5; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px;
  border-radius: 12px; font-weight: 600; font-size: 14px; cursor: pointer;
  border: 1px solid transparent; transition: all .2s; background: var(--surface-2);
  color: var(--text); white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 22px rgba(99,102,241,.35); }
.btn-primary:hover { box-shadow: 0 12px 28px rgba(99,102,241,.5); }
.btn-ghost { background: var(--surface-2); border-color: var(--border); }
.btn-danger { background: rgba(239,68,68,.12); color: var(--danger); border-color: rgba(239,68,68,.3); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ---------- Tarjetas / grid ---------- */
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.card {
  background: var(--surface); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; position: relative; overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
  animation: fadeUp .5s ease both;
}
.card:hover {
  transform: translateY(-8px) scale(1.05);
  border-color: var(--primary);
  box-shadow: 0 22px 50px rgba(14,118,188,.30), 0 0 0 3px rgba(14,118,188,.20);
}
.card-link { cursor: pointer; }
.card-link:hover { z-index: 3; }
.card-link:active { transform: translateY(-4px) scale(1.02); }
.card .accent-bar { position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--grad); }
.card-link { cursor: pointer; }
.card h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; letter-spacing: -.3px; }
.card p { color: var(--text-dim); font-size: 13.5px; line-height: 1.55; }
.card-row { display: flex; align-items: center; gap: 12px; }
.card-icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  color: #fff; flex-shrink: 0; font-weight: 800; font-size: 18px;
}
.card-meta { display: flex; align-items: center; gap: 14px; margin-top: 14px;
  padding-top: 14px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-dim); flex-wrap: wrap; }
.card-meta .mi { display: inline-flex; align-items: center; gap: 5px; }
.card-meta svg { width: 15px; height: 15px; }

/* Stagger de aparición */
.grid .card:nth-child(1){animation-delay:.02s}.grid .card:nth-child(2){animation-delay:.06s}
.grid .card:nth-child(3){animation-delay:.10s}.grid .card:nth-child(4){animation-delay:.14s}
.grid .card:nth-child(5){animation-delay:.18s}.grid .card:nth-child(6){animation-delay:.22s}
.grid .card:nth-child(7){animation-delay:.26s}.grid .card:nth-child(8){animation-delay:.30s}

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 16px; margin-bottom: 28px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; backdrop-filter: var(--glass-blur); position: relative; overflow: hidden; }
.stat .big { font-size: 32px; font-weight: 800; letter-spacing: -1px; }
.stat .lbl { color: var(--text-dim); font-size: 13px; margin-top: 2px; }
.stat .ic { position: absolute; right: 14px; top: 14px; opacity: .25; }
.stat .ic svg { width: 30px; height: 30px; }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px;
  border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.pendiente, .badge.activo   { background: rgba(14,118,188,.14); color: #0a5e9c; }
.badge.en_progreso, .badge.en_pausa { background: rgba(245,166,35,.18); color: #b9740b; }
.badge.completada, .badge.completado { background: rgba(22,163,74,.15); color: #137a39; }
.badge.alta { background: rgba(226,59,59,.14); color: #c22a2a; }
.badge.media { background: rgba(245,166,35,.18); color: #b9740b; }
.badge.baja { background: rgba(22,163,74,.15); color: #137a39; }
[data-theme="dark"] .badge.pendiente, [data-theme="dark"] .badge.activo { color: #7cc0f0; }
[data-theme="dark"] .badge.en_progreso, [data-theme="dark"] .badge.en_pausa, [data-theme="dark"] .badge.media { color: #fcd34d; }
[data-theme="dark"] .badge.completada, [data-theme="dark"] .badge.completado, [data-theme="dark"] .badge.baja { color: #6ee7b7; }
[data-theme="dark"] .badge.alta { color: #fca5a5; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 22px; flex-wrap: wrap; }
.tab { padding: 10px 16px; font-weight: 600; font-size: 14px; color: var(--text-dim);
  cursor: pointer; border-bottom: 2px solid transparent; transition: all .2s; display: inline-flex; align-items: center; gap: 7px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--primary); }
.tab .count { background: var(--surface-2); border-radius: 999px; padding: 1px 8px; font-size: 11px; }
.tab-panel { display: none; animation: fadeUp .4s ease both; }
.tab-panel.active { display: block; }

/* ---------- Tablas ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: var(--glass-blur); }
/* sin overflow:hidden para que el avatar pueda agrandarse y mostrar su nombre */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-dim); padding: 14px 18px; border-bottom: 1px solid var(--border); }
td { padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 14px; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .18s, box-shadow .18s; }
tbody tr:hover { background: color-mix(in srgb, var(--primary) 9%, var(--surface-2)); box-shadow: inset 4px 0 0 var(--primary); }

/* ---------- Formularios ---------- */
.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.input, .textarea, .select {
  width: 100%; padding: 11px 14px; border-radius: 11px; font-size: 14px; font-family: inherit;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text); transition: all .2s;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.18); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5,7,15,.65); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; z-index: 1000; padding: 24px 16px;
}
.modal-backdrop.open { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 20px;
  width: 100%; max-width: 560px; box-shadow: var(--shadow); animation: pop .3s cubic-bezier(.2,.9,.3,1.2) both;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
}
.modal.wide { max-width: 920px; }
@keyframes pop { from { opacity: 0; transform: scale(.92) translateY(20px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-head h3 { font-size: 18px; font-weight: 700; }
.modal-body { padding: 20px 24px; overflow-y: auto; }
/* Formularios compactos dentro de modales para que no se corten */
.modal-body .form-grid { gap: 13px; }
.modal-body .textarea { min-height: 76px; }
.modal-close { background: var(--surface-2); border: 1px solid var(--border); width: 34px; height: 34px;
  border-radius: 9px; color: var(--text); cursor: pointer; display: grid; place-items: center; }
.modal-close:hover { background: var(--danger); color: #fff; }

/* ---------- Toast ---------- */
.toast { position: fixed; top: 80px; right: 28px; z-index: 200; padding: 14px 20px;
  border-radius: 12px; font-weight: 600; font-size: 14px; color: #fff; box-shadow: var(--shadow);
  animation: slideIn .4s ease both; }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 70px 20px; color: var(--text-dim); }
.empty .em-ic { font-size: 52px; margin-bottom: 14px; opacity: .5; }
.empty h3 { color: var(--text); margin-bottom: 6px; }

/* ---------- Notas / pizarra ---------- */
.note-card { min-height: 150px; display: flex; flex-direction: column; }
.note-card .note-body { flex: 1; font-size: 14px; color: var(--text); line-height: 1.5;
  max-height: 160px; overflow: hidden; }
.note-card .note-draw img { width: 100%; border-radius: 10px; background: #fff; }
.handwriting { font-family: 'Caveat', cursive; font-size: 23px; line-height: 1.35; color: var(--text); }
.font-patrick { font-family: 'Patrick Hand', cursive; font-size: 19px; }
.font-shadows { font-family: 'Shadows Into Light', cursive; font-size: 20px; }

/* Lienzo de dibujo */
.draw-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px;
  padding: 12px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--border); }
.draw-toolbar .swatch { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: transform .15s; }
.draw-toolbar .swatch:hover { transform: scale(1.18); }
.draw-toolbar .swatch.sel { border-color: #fff; box-shadow: 0 0 0 2px var(--primary); }
.canvas-wrap { border: 2px dashed var(--border); border-radius: 14px; overflow: hidden; background: #fdfdfd; }
#drawCanvas { display: block; width: 100%; touch-action: none; cursor: crosshair; }
.range { width: 110px; accent-color: var(--primary); }

/* Adjuntos */
.attach-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.attach { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
.attach img { width: 40px; height: 40px; object-fit: cover; border-radius: 7px; }
.attach a:hover { color: var(--primary); }

/* Checkbox tarea */
.task-row { display: flex; align-items: center; gap: 12px; }
.check { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border);
  display: grid; place-items: center; cursor: pointer; flex-shrink: 0; transition: all .2s; }
.check.done { background: var(--success); border-color: var(--success); }
.check svg { width: 14px; height: 14px; stroke: #fff; opacity: 0; transition: opacity .2s; }
.check.done svg { opacity: 1; }
.task-title.done { text-decoration: line-through; color: var(--text-dim); }
a.task-title { transition: color .15s; }
a.task-title:hover { color: var(--primary); }

/* ---------- Login ---------- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.auth-card { width: 100%; max-width: 410px; background: var(--surface); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border); border-radius: 24px; padding: 40px 34px; box-shadow: var(--shadow);
  animation: pop .5s cubic-bezier(.2,.9,.3,1.2) both; }
.auth-card .brand { justify-content: center; padding-bottom: 8px; }
.auth-card h2 { text-align: center; font-size: 23px; font-weight: 800; margin-bottom: 4px; }
.auth-card .sub { text-align: center; color: var(--text-dim); font-size: 14px; margin-bottom: 26px; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 4px; }
.auth-hint { margin-top: 20px; padding: 12px; background: var(--surface-2); border-radius: 11px;
  font-size: 12.5px; color: var(--text-dim); text-align: center; line-height: 1.6; }
.auth-error { background: rgba(239,68,68,.14); color: #fca5a5; border: 1px solid rgba(239,68,68,.3);
  padding: 11px 14px; border-radius: 11px; font-size: 13.5px; margin-bottom: 18px; }

/* ---------- Util ---------- */
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gap-lg { gap: 18px; }
.mt { margin-top: 18px; }
.mt-lg { margin-top: 28px; }
.hidden { display: none !important; }
.text-grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.avatars { display: flex; padding: 3px 0; }
.avatars .avatar { margin-left: -8px; border: 2px solid var(--bg); position: relative;
  transition: transform .2s cubic-bezier(.2,.9,.3,1.3), box-shadow .2s; cursor: default; }
.avatars .avatar:first-child { margin-left: 0; }
.avatars .avatar:hover { transform: scale(1.6); z-index: 6; box-shadow: 0 6px 18px rgba(0,0,0,.32); }
/* Etiqueta con el nombre al pasar el mouse */
.avatars .avatar[data-name]:hover::after {
  content: attr(data-name); position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%); background: #11283d; color: #fff; padding: 4px 9px;
  border-radius: 7px; font-size: 10px; font-weight: 700; white-space: nowrap; letter-spacing: .2px;
  z-index: 20; pointer-events: none; box-shadow: 0 6px 16px rgba(0,0,0,.3);
}
.section-title { font-size: 16px; font-weight: 700; margin: 26px 0 14px; display: flex; align-items: center; gap: 9px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%);
    transition: transform .3s ease; }
  .sidebar.open { transform: none; }
  .sidebar.open ~ .sidebar-backdrop, .sidebar-backdrop.show { display: block; }
  .menu-toggle { display: grid; }
  .form-grid.two { grid-template-columns: 1fr; }
  .content { padding: 20px 16px; }
  .topbar { padding: 14px 16px; }
  .user-meta { display: none; }
}

/* ---------- Editor de notas (responsivo) ---------- */
.note-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.note-title { flex: 1; min-width: 200px; font-size: 20px; font-weight: 700; }
.note-head-actions { display: flex; align-items: center; gap: 10px; }
.note-color { width: 48px; height: 44px; padding: 5px; flex-shrink: 0; }
.note-rel { margin-bottom: 20px; }
.note-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.note-field { display: flex; flex-direction: column; }
.note-field .textarea { flex: 1; min-height: 360px; font-size: 17px; line-height: 1.5; }
.note-font { width: auto; }
.draw-toolbar { overflow-x: auto; }

@media (max-width: 860px) {
  .note-editor { grid-template-columns: 1fr; }
  .note-field .textarea { min-height: 220px; }
  .note-head-actions { width: 100%; justify-content: flex-end; }
  .note-title { min-width: 100%; }
}
@media (max-width: 520px) {
  .draw-toolbar { gap: 8px; padding: 10px; }
  .draw-toolbar .swatch { width: 22px; height: 22px; }
  .range { width: 80px; }
  .btn { padding: 9px 14px; }
  .page-head h2 { font-size: 22px; }
  table { font-size: 13px; }
  th, td { padding: 10px 12px; }
}

/* ============================================================
   MODO ENFOQUE (focus.php)
   ============================================================ */
.focus-progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 100; }
.focus-progress span { display: block; height: 100%; width: 0; background: var(--grad);
  animation: focusbar 300s linear forwards; }
@keyframes focusbar { to { width: 100%; } }

.focus-wrap { max-width: 1400px; margin: 0 auto; padding: 26px 28px 60px; position: relative; z-index: 1; }
.focus-bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding-bottom: 22px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.focus-brand { display: flex; align-items: center; gap: 14px; }
.focus-brand img { height: 46px; width: auto; }
.focus-brand h1 { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.focus-brand .muted { font-size: 13px; text-transform: capitalize; }
.focus-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; flex-wrap: wrap; }
.focus-count { font-weight: 700; color: var(--primary); font-size: 15px; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px; gap: 4px; }
.seg-btn { padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--text-dim); transition: all .2s; }
.seg-btn.active { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(14,118,188,.35); }

.focus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.focus-card { background: var(--surface); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border); border-left: 5px solid var(--p, var(--primary));
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  animation: fadeUp .5s ease both; transition: transform .2s; }
.focus-card:hover { transform: translateY(-6px) scale(1.045); box-shadow: 0 22px 50px rgba(14,118,188,.28), 0 0 0 3px rgba(14,118,188,.18); }
.focus-card-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.focus-card h3 { font-size: 18px; font-weight: 700; letter-spacing: -.3px; }
.focus-card p { margin-top: 6px; font-size: 13.5px; line-height: 1.5; }
.focus-meta { display: flex; flex-direction: column; gap: 4px; margin: 14px 0; font-size: 13px; color: var(--text-dim); }
.focus-foot { display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; font-weight: 600; }
.overdue { color: var(--danger); font-weight: 700; }
.focus-hint { text-align: center; margin-top: 34px; font-size: 13px; }

.focus-refresh { position: fixed; inset: 0; z-index: 200; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(8px);
  font-weight: 700; font-size: 17px; }
.focus-refresh.show { display: flex; animation: fadeIn .3s ease; }
.spinner { width: 48px; height: 48px; border-radius: 50%;
  border: 5px solid rgba(14,118,188,.18); border-top-color: var(--primary); animation: spin .8s linear infinite; }

@media (max-width: 600px) {
  .focus-wrap { padding: 18px 16px 50px; }
  .focus-actions { width: 100%; margin-left: 0; }
  .focus-brand h1 { font-size: 20px; }
}

/* ---------- Selector rápido de estado ---------- */
.status-pick {
  appearance: none; -webkit-appearance: none; border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 30px 6px 14px; font-size: 12.5px; font-weight: 700;
  font-family: inherit; cursor: pointer; transition: all .2s;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 9px center;
}
.status-pick:hover { filter: brightness(.97); transform: translateY(-1px); }
.status-pick:focus { outline: none; box-shadow: 0 0 0 3px rgba(14,118,188,.18); }
.status-pick.st-pendiente   { background-color: rgba(14,118,188,.14); color: #0a5e9c; border-color: rgba(14,118,188,.25); }
.status-pick.st-en_progreso { background-color: rgba(245,166,35,.18); color: #b9740b; border-color: rgba(245,166,35,.3); }
.status-pick.st-completada  { background-color: rgba(22,163,74,.15); color: #137a39; border-color: rgba(22,163,74,.3); }
.status-pick option { color: #1f2937; background: #fff; }
.status-pick.pulse { animation: stpulse .55s ease; }
@keyframes stpulse { 0%{transform:scale(1)} 45%{transform:scale(1.09)} 100%{transform:scale(1)} }
[data-theme="dark"] .status-pick.st-pendiente   { color: #7cc0f0; }
[data-theme="dark"] .status-pick.st-en_progreso { color: #fcd34d; }
[data-theme="dark"] .status-pick.st-completada  { color: #6ee7b7; }
