/* ============================================================
   GCD PORTAL — Sistema de Estilos (Rediseño completo)
   Gestión Clínica Digital SpA · Portal Corporativo Interno
   Stack: HTML5 + CSS3 puro · sin frameworks
   ------------------------------------------------------------
   Un solo archivo. Compatible 100% con el HTML existente.
   Estructura:
     1.  Fuentes + Reset + Variables
     2.  Topbar / Brand / Usuario
     3.  Layout + Sidebar
     4.  Page header
     5.  Stats
     6.  Cards + Grids
     7.  Buttons
     8.  Badges + Estados documentales + Tipos de archivo + Tags
     9.  Tablas (incl. auditoría)
     10. Filtros + Buscador global
     11. Modal
     12. Forms + Upload + Progress
     13. Empty states
     14. Quick links + Activity list
     15. Bitácora
     16. Versionado · Proyectos · Productos · Tareas
     17. Galería de marca (grid/tabla)
     18. Toasts + Spinner + Skeleton
     19. Login
     20. Responsive
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── 1. RESET + VARIABLES ────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Superficies */
  --bg:            #0A0F1C;
  --bg-card:       #111827;
  --bg-card-2:     #0E1626;   /* superficie anidada (thead, inputs) */
  --bg-sidebar:    #0D1321;
  --bg-hover:      #1A2332;
  --bg-active:     #1E293B;

  /* Acentos */
  --accent:        #3B82F6;
  --accent-hover:  #2563EB;
  --accent-soft:   rgba(59,130,246,0.12);
  --accent-ring:   rgba(59,130,246,0.28);
  --primary:       #1E3A5F;

  /* Texto */
  --text:          #F8FAFC;
  --text-muted:    #94A3B8;
  --text-dim:      #64748B;

  /* Bordes */
  --border:        #1E293B;
  --border-light:  #243B5C;

  /* Semánticos */
  --success:       #10B981;
  --warning:       #F59E0B;
  --danger:        #EF4444;
  --info:          #60A5FA;
  --orange:        #F97316;
  --purple:        #8B5CF6;

  /* Métrica */
  --sidebar-w:     240px;
  --topbar-h:      56px;
  --radius:        8px;
  --radius-lg:     12px;
  --radius-sm:     6px;

  /* Sombras */
  --shadow-sm:     0 1px 2px rgba(0,0,0,0.30);
  --shadow-md:     0 6px 22px rgba(0,0,0,0.38);
  --shadow-lg:     0 24px 60px rgba(0,0,0,0.50);

  --ease:          0.16s cubic-bezier(0.4, 0, 0.2, 1);
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
  letter-spacing: -0.05px;
}

::selection { background: var(--accent-ring); color: #fff; }

/* Scrollbars sutiles y oscuros */
* { scrollbar-width: thin; scrollbar-color: var(--bg-active) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #2c3a52; background-clip: content-box; }

a { color: inherit; }

/* ── 2. TOPBAR ───────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: linear-gradient(180deg, #0F1626, var(--bg-sidebar));
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 0;
  z-index: 100;
  backdrop-filter: saturate(140%);
}

.topbar-brand {
  width: var(--sidebar-w);
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-right: 1px solid var(--border);
  height: 100%;
  flex-shrink: 0;
  text-decoration: none;
  transition: background var(--ease);
}
.topbar-brand:hover { background: rgba(255,255,255,0.015); }

.brand-logo {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, #4C8DFF, var(--accent-hover));
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; color: #fff; letter-spacing: 0.3px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(59,130,246,0.35), inset 0 1px 0 rgba(255,255,255,0.22);
}

.brand-name { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.2; letter-spacing: -0.2px; }
.brand-sub  { font-size: 10px; color: var(--text-muted); font-weight: 500; }

.topbar-right {
  display: flex; align-items: center; gap: 16px;
  flex: 1;
  padding-left: 24px;
}

.topbar-title { font-size: 14px; font-weight: 600; color: var(--text); flex: 1; letter-spacing: -0.2px; }

.topbar-user { display: flex; align-items: center; gap: 10px; }

.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #14253c);
  border: 1.5px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #9EC2FF;
  text-transform: uppercase;
}

.user-info { text-align: right; line-height: 1.25; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-role { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

.btn-signout {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 6px 13px; border-radius: var(--radius);
  cursor: pointer; font-size: 12px; font-weight: 500; font-family: inherit;
  transition: all var(--ease);
}
.btn-signout:hover { border-color: var(--danger); color: var(--danger); background: rgba(239,68,68,0.06); }

/* ── 3. LAYOUT + SIDEBAR ─────────────────────────────────── */
.layout {
  display: flex;
  padding-top: var(--topbar-h);
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 14px 12px 24px;
  display: flex; flex-direction: column; gap: 2px;
  position: fixed;
  top: var(--topbar-h); bottom: 0; left: 0;
  overflow-y: auto;
  z-index: 90;
}

.sidebar-section {
  margin: 16px 0 5px 0;
  padding: 0 10px;
  font-size: 10px; font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.sidebar-section:first-child { margin-top: 4px; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--radius);
  color: var(--text-muted); text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: all var(--ease); position: relative;
}
.nav-item:hover  { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item.active::before {
  content: '';
  position: absolute; left: -12px; top: 18%; bottom: 18%;
  width: 3px; background: var(--accent);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 10px rgba(59,130,246,0.6);
}

.nav-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--accent-soft); color: var(--accent);
  font-size: 9px; font-weight: 700;
  padding: 2px 7px; border-radius: 10px;
}

.nav-soon {
  margin-left: auto;
  font-size: 9px; font-weight: 600; color: var(--text-dim);
  background: var(--bg-hover);
  padding: 2px 7px; border-radius: 10px;
  letter-spacing: 0.3px;
}

/* ── 4. MAIN + PAGE HEADER ───────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 28px 32px;
  max-width: 1500px;
}

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px;
  flex-wrap: wrap;
}
.page-header-left h1 {
  font-size: 21px; font-weight: 700;
  color: var(--text); letter-spacing: -0.4px;
}
.page-header-left p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── 5. STATS ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  transition: all var(--ease); position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}
.stat-card:hover { border-color: var(--border-light); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.stat-icon {
  width: 46px; height: 46px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.stat-icon.blue   { background: rgba(59,130,246,0.12);  box-shadow: inset 0 0 0 1px rgba(59,130,246,0.18); }
.stat-icon.green  { background: rgba(16,185,129,0.12);  box-shadow: inset 0 0 0 1px rgba(16,185,129,0.18); }
.stat-icon.yellow { background: rgba(245,158,11,0.12);  box-shadow: inset 0 0 0 1px rgba(245,158,11,0.18); }
.stat-icon.purple { background: rgba(139,92,246,0.12);  box-shadow: inset 0 0 0 1px rgba(139,92,246,0.18); }
.stat-icon.red    { background: rgba(239,68,68,0.12);   box-shadow: inset 0 0 0 1px rgba(239,68,68,0.18); }

.stat-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 5px; font-weight: 500; }

/* ── 6. CARDS + GRIDS ────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}

.card-header {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-header h2 { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: -0.2px; }
.card-body { padding: 16px 20px; }

/* ── 7. BUTTONS ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all var(--ease);
  border: 1px solid transparent; font-family: inherit;
  text-decoration: none; white-space: nowrap; line-height: 1;
}
.btn:active { transform: translateY(0.5px); }

.btn-primary   { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.16); }
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--bg-hover); color: var(--text);
  border-color: var(--border-light);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: var(--bg-active); }

.btn-danger {
  background: rgba(239,68,68,0.1); color: var(--danger);
  border-color: rgba(239,68,68,0.3);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn-sm  { padding: 5px 11px; font-size: 12px; }
.btn-icon { padding: 6px; width: 30px; height: 30px; justify-content: center; border-radius: var(--radius-sm); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── 8. BADGES · ESTADOS · TIPOS · TAGS ──────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; line-height: 1.4;
  white-space: nowrap;
}
.badge-blue   { background: rgba(59,130,246,0.15);  color: #7CB0FF; }
.badge-green  { background: rgba(16,185,129,0.15);  color: #34D399; }
.badge-yellow { background: rgba(245,158,11,0.15);  color: #FBBF24; }
.badge-red    { background: rgba(239,68,68,0.15);   color: #F87171; }
.badge-gray   { background: rgba(148,163,184,0.14); color: #A8B5C6; }
.badge-purple { background: rgba(139,92,246,0.15);  color: #A78BFA; }
.badge-orange { background: rgba(249,115,22,0.15);  color: #FB923C; }

/* Punto opcional dentro de badge: <span class="badge ..."><i class="dot"></i> txt</span> */
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* Estados documentales — usar como .estado .estado-vigente (o .badge .estado-vigente) */
.estado {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.estado::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.estado-borrador   { background: rgba(245,158,11,0.13); color: #FBBF24; }
.estado-vigente    { background: rgba(16,185,129,0.13); color: #34D399; }
.estado-pendiente  { background: rgba(96,165,250,0.14); color: #93C5FD; }
.estado-aprobado   { background: rgba(59,130,246,0.15); color: #7CB0FF; }
.estado-reemplazado{ background: rgba(249,115,22,0.14); color: #FB923C; }
.estado-obsoleto   { background: rgba(239,68,68,0.14);  color: #F87171; }

/* Badges por tipo de archivo (etiqueta cuadrada con extensión) */
.ftype {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; padding: 2px 6px; border-radius: 5px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.4px;
  text-transform: uppercase;
}
.ftype-pdf  { background: rgba(239,68,68,0.16);  color: #F87171; }
.ftype-doc, .ftype-docx { background: rgba(59,130,246,0.16); color: #7CB0FF; }
.ftype-xls, .ftype-xlsx { background: rgba(16,185,129,0.16); color: #34D399; }
.ftype-ppt, .ftype-pptx { background: rgba(249,115,22,0.16); color: #FB923C; }
.ftype-png, .ftype-jpg, .ftype-jpeg, .ftype-svg, .ftype-img { background: rgba(139,92,246,0.16); color: #A78BFA; }
.ftype-zip, .ftype-rar  { background: rgba(148,163,184,0.16); color: #A8B5C6; }
.ftype-txt, .ftype-md   { background: rgba(100,116,139,0.18); color: #94A3B8; }

/* Tags / chips */
.tag, .chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 500;
  background: rgba(148,163,184,0.10);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.tag:hover, .chip:hover { color: var(--text); border-color: var(--border-light); }
.chip-close { cursor: pointer; opacity: 0.6; font-size: 12px; }
.chip-close:hover { opacity: 1; }

/* Prioridades */
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.prio::before { content: ''; width: 7px; height: 7px; border-radius: 50%; }
.prio-alta   { color: #F87171; } .prio-alta::before   { background: var(--danger); }
.prio-media  { color: #FBBF24; } .prio-media::before  { background: var(--warning); }
.prio-baja   { color: #94A3B8; } .prio-baja::before   { background: var(--text-dim); }

/* ── 9. TABLAS ───────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
}
table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg-card-2); }
th {
  padding: 11px 16px; text-align: left;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 13px 16px; font-size: 13px; color: var(--text);
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: var(--bg-hover); }

/* Variante compacta (auditoría) */
.table-compact th { padding: 9px 14px; }
.table-compact td { padding: 9px 14px; font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }
.nowrap     { white-space: nowrap; }

/* ── 10. FILTROS + BUSCADOR GLOBAL ───────────────────────── */
.filters-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search-wrap .ico {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 14px; pointer-events: none;
}
.input-search {
  width: 100%; padding: 9px 12px 9px 34px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: 13px;
  outline: none; font-family: inherit; transition: all var(--ease);
}
.input-search::placeholder { color: var(--text-dim); }
.input-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.filter-select {
  padding: 9px 12px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-size: 13px;
  outline: none; cursor: pointer; font-family: inherit; transition: all var(--ease);
}
.filter-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Vista toggle (tabla / grid) para Marca */
.view-toggle { display: inline-flex; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 2px; gap: 2px; }
.view-toggle button {
  border: none; background: transparent; color: var(--text-muted);
  padding: 6px 12px; border-radius: 6px; cursor: pointer; font-family: inherit;
  font-size: 12px; font-weight: 600; transition: all var(--ease);
}
.view-toggle button.active { background: var(--accent-soft); color: var(--accent); }

/* Buscador global — spotlight */
.spotlight { max-width: 720px; margin: 8px auto 0; }
.spotlight-input-wrap { position: relative; }
.spotlight-input-wrap .ico {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  font-size: 20px; color: var(--text-muted); pointer-events: none;
}
.spotlight-input {
  width: 100%; padding: 18px 22px 18px 56px;
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); color: var(--text);
  font-size: 18px; font-family: inherit; outline: none;
  box-shadow: var(--shadow-md); transition: all var(--ease);
}
.spotlight-input::placeholder { color: var(--text-dim); }
.spotlight-input:focus { border-color: var(--accent); box-shadow: var(--shadow-md), 0 0 0 4px var(--accent-soft); }

.result-group { margin-top: 26px; }
.result-group-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text-dim);
  padding: 0 4px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--border);
}
.result-group-header .count {
  margin-left: auto; background: var(--bg-hover); color: var(--text-muted);
  padding: 1px 8px; border-radius: 10px; font-size: 10px; letter-spacing: 0;
}
.result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--radius);
  text-decoration: none; color: var(--text);
  transition: background var(--ease); cursor: pointer;
}
.result-item:hover { background: var(--bg-hover); }
.result-icon { font-size: 18px; width: 26px; text-align: center; flex-shrink: 0; }
.result-main { flex: 1; min-width: 0; }
.result-title { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-sub { font-size: 11px; color: var(--text-dim); margin-top: 1px; }
.result-meta { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ── 11. MODAL ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(3,7,15,0.75);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none; transition: opacity 0.2s;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); width: 100%; max-width: 540px;
  max-height: 92vh; overflow-y: auto;
  transform: scale(0.96) translateY(6px); transition: transform 0.2s;
  box-shadow: var(--shadow-lg);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--bg-card); z-index: 1;
}
.modal-header h3 { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.2px; }
.modal-close {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 18px; cursor: pointer; line-height: 1;
  width: 28px; height: 28px; border-radius: var(--radius-sm); font-family: inherit;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text); }
.modal-body   { padding: 22px; }
.modal-footer {
  padding: 16px 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  position: sticky; bottom: 0; background: var(--bg-card);
}
.modal-lg { max-width: 760px; }

/* ── 12. FORMS + UPLOAD + PROGRESS ───────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--text-muted); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: 9px 12px;
  background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-size: 13px; outline: none; font-family: inherit;
  transition: all var(--ease);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-dim); }
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-group textarea { resize: vertical; min-height: 76px; line-height: 1.55; }
.form-group input[type="date"] { color-scheme: dark; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 11px; color: var(--text-dim); margin-top: 5px; }

/* Upload */
.upload-area {
  border: 2px dashed var(--border-light); border-radius: var(--radius);
  padding: 30px; text-align: center; cursor: pointer;
  transition: all var(--ease); position: relative;
  background: rgba(255,255,255,0.008);
}
.upload-area:hover,
.upload-area.dragover { border-color: var(--accent); background: rgba(59,130,246,0.05); }
.upload-area input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-icon { font-size: 30px; margin-bottom: 8px; opacity: 0.9; }
.upload-text { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.upload-hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.upload-filename { font-size: 12px; color: var(--accent); margin-top: 10px; font-weight: 600; }

/* Progress */
.progress-wrap { background: var(--bg); border-radius: 5px; height: 6px; overflow: hidden; margin-top: 10px; }
.progress-bar  {
  height: 100%; border-radius: 5px; transition: width 0.35s ease; width: 0%;
  background: linear-gradient(90deg, var(--accent), #60A5FA);
  background-size: 200% 100%;
  animation: progress-shimmer 1.2s linear infinite;
}
@keyframes progress-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Progreso genérico (proyectos) */
.progress { background: var(--bg-active); border-radius: 6px; height: 7px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), #5EEAD4); }

/* ── 13. EMPTY STATE + SKELETON ──────────────────────────── */
.empty-state { text-align: center; padding: 52px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 38px; margin-bottom: 10px; opacity: 0.7; }
.empty-state-text { font-size: 14px; font-weight: 600; color: var(--text); }
.empty-state-hint { font-size: 12px; color: var(--text-dim); margin-top: 5px; }

.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-active) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%; animation: sk 1.3s ease-in-out infinite; border-radius: 6px;
}
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── 14. QUICK LINKS + ACTIVITY ──────────────────────────── */
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-link {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 14px; background: var(--bg-hover);
  border-radius: var(--radius); color: var(--text);
  text-decoration: none; font-size: 13px; font-weight: 500;
  border: 1px solid transparent; transition: all var(--ease);
}
.quick-link span { font-size: 16px; }
.quick-link:hover { border-color: var(--accent); color: var(--accent); transform: translateX(2px); background: var(--bg-active); }

.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0; margin-top: 6px;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.activity-text {
  font-size: 13px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px;
}
.activity-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ── 15. BITÁCORA ────────────────────────────────────────── */
.bitacora-list { display: flex; flex-direction: column; gap: 12px; }
.bitacora-date-sep {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px;
  margin: 8px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.bitacora-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg); padding: 16px 20px;
  transition: all var(--ease);
}
.bitacora-item:hover { border-color: var(--border-light); border-left-color: var(--accent); background: #131C2E; }
.bitacora-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 7px;
}
.bitacora-title { font-size: 14px; font-weight: 600; color: var(--text); }
.bitacora-date  { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.bitacora-desc  { font-size: 13px; color: var(--text-muted); line-height: 1.55; }
.bitacora-meta  { display: flex; align-items: center; gap: 10px; margin-top: 11px; flex-wrap: wrap; }

/* ── 16. VERSIONADO · PROYECTOS · PRODUCTOS · TAREAS ─────── */
/* Historial de versiones */
.version-list { display: flex; flex-direction: column; }
.version-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 16px; border-bottom: 1px solid var(--border); position: relative;
}
.version-item:last-child { border-bottom: none; }
.version-tag {
  font-size: 12px; font-weight: 800; color: var(--text-muted);
  background: var(--bg-hover); padding: 3px 9px; border-radius: 6px;
  font-variant-numeric: tabular-nums; flex-shrink: 0; min-width: 48px; text-align: center;
}
.version-item.current { background: rgba(16,185,129,0.05); }
.version-item.current .version-tag { background: rgba(16,185,129,0.16); color: #34D399; }
.version-body { flex: 1; min-width: 0; }
.version-comment { font-size: 13px; color: var(--text); }
.version-meta { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.version-current-badge { font-size: 10px; font-weight: 700; color: var(--success); text-transform: uppercase; letter-spacing: 0.5px; }

/* Tarjeta de proyecto */
.project-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  transition: all var(--ease); display: flex; flex-direction: column; gap: 14px;
}
.project-card:hover { border-color: var(--border-light); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.project-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.project-name { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.2px; }
.project-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; margin-top: 3px; }
.project-progress-row { display: flex; align-items: center; gap: 10px; }
.project-progress-row .progress { flex: 1; }
.project-progress-pct { font-size: 12px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.project-foot { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--text-dim); flex-wrap: wrap; }
.project-foot .meta-item { display: flex; align-items: center; gap: 5px; }

/* Estados de proyecto (alias de badges semánticos) */
.estado-activo     { background: rgba(16,185,129,0.14); color: #34D399; }
.estado-pausado    { background: rgba(245,158,11,0.14); color: #FBBF24; }
.estado-completado { background: rgba(59,130,246,0.15); color: #7CB0FF; }
.estado-cancelado  { background: rgba(239,68,68,0.14);  color: #F87171; }

/* Ficha de producto */
.product-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.product-head {
  display: flex; align-items: center; gap: 16px; padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(59,130,246,0.05), transparent);
}
.product-logo {
  width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 900; color: #fff;
  background: linear-gradient(135deg, #4C8DFF, var(--accent-hover));
  box-shadow: 0 4px 14px rgba(59,130,246,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
  letter-spacing: 0.5px;
}
.product-title { font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: -0.3px; }
.product-tagline { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.product-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 24px; }
.product-section-title {
  font-size: 11px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 12px;
}
.feature-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.feature-list li { list-style: none; display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text); }
.feature-list li::before { content: '✓'; color: var(--success); font-weight: 800; font-size: 12px; }

/* Timeline (roadmap / changelog) */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ''; position: absolute; left: -23px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg-card); border: 2px solid var(--text-dim);
}
.timeline-item.done::before    { border-color: var(--success); background: var(--success); box-shadow: 0 0 0 3px rgba(16,185,129,0.15); }
.timeline-item.current::before { border-color: var(--accent);  background: var(--accent);  box-shadow: 0 0 0 3px var(--accent-soft); }
.timeline-title { font-size: 13px; font-weight: 600; color: var(--text); }
.timeline-meta  { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* Lista de tareas */
.task-list { display: flex; flex-direction: column; }
.task-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; border-bottom: 1px solid var(--border);
}
.task-item:last-child { border-bottom: none; }
.task-check {
  width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0;
  border: 1.5px solid var(--border-light); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: transparent; transition: all var(--ease);
}
.task-check:hover { border-color: var(--accent); }
.task-item.done .task-check { background: var(--success); border-color: var(--success); color: #fff; }
.task-item.done .task-title { color: var(--text-dim); text-decoration: line-through; }
.task-title { flex: 1; font-size: 13px; color: var(--text); }
.task-meta { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.task-assignee { font-size: 11px; color: var(--text-muted); }

/* Detalle: secciones laterales */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
.subcard { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.subcard-head { padding: 13px 18px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; }
.subcard-body { padding: 14px 18px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv-key { color: var(--text-muted); }
.kv-val { color: var(--text); font-weight: 500; text-align: right; }

/* ── 17. GALERÍA DE MARCA ────────────────────────────────── */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.media-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; transition: all var(--ease); cursor: pointer;
}
.media-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.media-thumb {
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
  background: repeating-conic-gradient(#0C1322 0% 25%, #0E1626 0% 50%) 50% / 22px 22px;
  font-size: 34px; color: var(--text-dim); position: relative;
}
.media-info { padding: 10px 12px; }
.media-name { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ── 18. TOASTS + SPINNER ────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 18px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; color: #fff;
  box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 9px;
  animation: toast-in 0.22s cubic-bezier(0.2,0.8,0.2,1); max-width: 340px;
  border: 1px solid rgba(255,255,255,0.10);
}
.toast::before { font-size: 14px; }
.toast.success { background: #0E2A22; color: #6EE7B7; border-color: rgba(16,185,129,0.4); }
.toast.success::before { content: '✓'; }
.toast.error   { background: #2A1416; color: #FCA5A5; border-color: rgba(239,68,68,0.4); }
.toast.error::before { content: '✕'; }
.toast.info    { background: #0F1E33; color: #93C5FD; border-color: rgba(59,130,246,0.4); }
.toast.info::before { content: 'ℹ'; }
@keyframes toast-in { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.spinner {
  display: inline-block; width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-lg { width: 30px; height: 30px; border-width: 3px; border-top-color: var(--accent); border-color: var(--bg-active); }
@keyframes spin { to { transform: rotate(360deg); } }
.page-loader { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 70px 20px; color: var(--text-muted); }

/* ── 19. LOGIN ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; background: var(--bg); position: relative; overflow: hidden;
}
.login-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 18% 40%, rgba(30,58,95,0.55) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 85% 25%, rgba(59,130,246,0.16) 0%, transparent 55%),
    radial-gradient(ellipse 70% 60% at 60% 110%, rgba(59,130,246,0.08) 0%, transparent 60%);
}
.login-bg::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 0%, transparent 75%);
}
.login-card {
  position: relative; background: var(--bg-card);
  border: 1px solid var(--border-light); border-radius: 16px;
  padding: 40px; width: 390px;
  box-shadow: var(--shadow-lg);
}
.login-logo { display: flex; align-items: center; gap: 13px; margin-bottom: 28px; }
.login-logo .logo-box {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #4C8DFF, var(--accent-hover));
  border-radius: 11px; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900; color: #fff; letter-spacing: 0.4px;
  box-shadow: 0 4px 14px rgba(59,130,246,0.4), inset 0 1px 0 rgba(255,255,255,0.22);
}
.login-logo-text h1 { font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: -0.2px; }
.login-logo-text p  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.login-heading { font-size: 21px; font-weight: 700; color: var(--text); margin-bottom: 4px; letter-spacing: -0.3px; }
.login-sub     { font-size: 13px; color: var(--text-muted); margin-bottom: 26px; }
.login-form .form-group { margin-bottom: 14px; }
.login-form .form-group label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--text-muted); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.login-form input {
  width: 100%; padding: 11px 14px;
  background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-size: 14px; outline: none; font-family: inherit; transition: all var(--ease);
}
.login-form input::placeholder { color: var(--text-dim); }
.login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn-login {
  width: 100%; padding: 12px; background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 700; cursor: pointer; margin-top: 8px;
  transition: background var(--ease); font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.16);
}
.btn-login:hover    { background: var(--accent-hover); }
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; }
.login-error { color: var(--danger); font-size: 12px; text-align: center; margin-top: 12px; min-height: 18px; }

/* ── 20. UTILIDADES + RESPONSIVE ─────────────────────────── */
[hidden] { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-0 { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: 20px; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .feature-list { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 16px; }
  .topbar-brand { width: auto; border-right: none; }
  .topbar-title { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .quick-links { grid-template-columns: 1fr; }
  .feature-list { grid-template-columns: 1fr; }
  .table-wrap { font-size: 12px; }
  .spotlight-input { font-size: 16px; padding: 15px 18px 15px 48px; }
}
