/* ============================================
   ABBE LEASING — Sistema de Diseño v2.1
   Premium, moderno, profesional
   Tipografía: Plus Jakarta Sans + JetBrains Mono
   Iconos: Lucide (SVG inline en HTML)
   Light + Dark mode (toggle en topbar)
============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  /* Paleta KENTE — púrpura */
  /* Primary: KENTE PURPLE #5B2E83 (RGB 91/46/131, CMYK 31/65/0/49) */
  /* Accent:  KAI VIOLET   #8064A8 (RGB 128/100/168, CMYK 24/40/0/34) */
  --hub-primary: #5B2E83;
  --hub-primary-50: #FAF6FD;
  --hub-primary-100: #F2E9F9;
  --hub-primary-200: #E0CDF2;
  --hub-primary-300: #C5A6E5;
  --hub-primary-400: #9B7BC9;
  --hub-primary-500: #5B2E83;
  --hub-primary-600: #4F2672;
  --hub-primary-700: #421E5F;
  --hub-primary-800: #36174F;
  --hub-primary-900: #2A1140;

  --hub-accent: #8064A8;
  --hub-accent-soft: #F2E9F9;
  --hub-text: #0F172A;
  --hub-text-soft: #475569;
  --hub-text-muted: #94A3B8;

  --hub-bg: #F8FAFC;
  --hub-bg-elevated: #FFFFFF;
  --hub-card: #FFFFFF;
  --hub-border: #E2E8F0;
  --hub-border-light: #F1F5F9;
  --hub-border-strong: #CBD5E1;

  --hub-success: #10B981;
  --hub-success-soft: #ECFDF5;
  --hub-warning: #F59E0B;
  --hub-warning-soft: #FFFBEB;
  --hub-danger: #EF4444;
  --hub-danger-soft: #FEF2F2;
  --hub-info: #3B82F6;
  --hub-info-soft: #EFF6FF;
  --hub-purple: #8B5CF6;
  --hub-purple-soft: #F5F3FF;

  /* Sombras premium con capas */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.10), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 25px 50px -12px rgba(15, 23, 42, 0.20);
  --shadow-inner: inset 0 2px 4px 0 rgba(15, 23, 42, 0.04);

  /* Sombras con color Abbe */
  --shadow-primary: 0 8px 24px -4px rgba(91, 46, 131, 0.30);
  --shadow-primary-lg: 0 16px 40px -8px rgba(91, 46, 131, 0.40);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Tipografía */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* Transiciones */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Topbar transparente específico */
  --hub-topbar-bg: rgba(255, 255, 255, 0.85);
  --hub-overlay: rgba(255, 255, 255, 0.6);
}

/* ============================================
   DARK MODE — Paleta nocturna para la plataforma
============================================ */
[data-theme="dark"] {
  --hub-primary: #B89AD5;
  --hub-primary-50: #1A0B2E;
  --hub-primary-100: #2A1140;
  --hub-primary-200: #36174F;
  --hub-primary-300: #421E5F;
  --hub-primary-400: #5B2E83;
  --hub-primary-500: #8064A8;
  --hub-primary-600: #9B7BC9;
  --hub-primary-700: #B89AD5;
  --hub-primary-800: #D1BBE5;
  --hub-primary-900: #E8DDF2;

  --hub-accent: #C5A6E5;
  --hub-accent-soft: #2A1140;
  --hub-text: #F1F5F9;
  --hub-text-soft: #94A3B8;
  --hub-text-muted: #64748B;

  --hub-bg: #0A0E1A;
  --hub-bg-elevated: #131826;
  --hub-card: #131826;
  --hub-border: #1F2937;
  --hub-border-light: #1A2235;
  --hub-border-strong: #334155;

  --hub-success: #34D399;
  --hub-success-soft: #022C22;
  --hub-warning: #FBBF24;
  --hub-warning-soft: #2D1F00;
  --hub-danger: #F87171;
  --hub-danger-soft: #2D0A0A;
  --hub-info: #60A5FA;
  --hub-info-soft: #0A1F3D;
  --hub-purple: #A78BFA;
  --hub-purple-soft: #1F1838;

  --hub-topbar-bg: rgba(10, 14, 26, 0.85);
  --hub-overlay: rgba(19, 24, 38, 0.6);

  /* Sombras más sutiles en dark mode */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.3);

  --shadow-primary: 0 8px 24px -4px rgba(94, 234, 212, 0.25);
  --shadow-primary-lg: 0 16px 40px -8px rgba(94, 234, 212, 0.35);
}

/* Smooth transition para cambio de tema */
body, .topbar, .card, .kpi, .btn, .badge, .ticket-state, .filter-pill, .filter-bar,
.kanban-col, .kanban-card, .search-box, .notif-btn, .user-chip, .empty,
.tab-btn, .filter-select, .ticket-row, .kpi-trend, .kpi-sub,
.heat-map, .cat-row, .tooltip, .empty-icon, .admin-tab, .catalog-card,
.flow-pill, .activity-item, .progress-bar, .progress-bar-fill,
.attachment, .timeline, .comment, .empty-title, .input, textarea {
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease),
              border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

* { box-sizing: border-box; }

/* Default SVG: tamaño refinado y consistente */
svg { width: 16px; height: 16px; stroke-width: 1.75; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font-sans);
  color: var(--hub-text);
  background: var(--hub-bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
}

a { color: var(--hub-primary-700); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--hub-primary-800); text-decoration: none; }

::selection { background: var(--hub-primary-200); color: var(--hub-primary-900); }

/* ============== TOPBAR ============== */
.topbar {
  background: var(--hub-topbar-bg, rgba(255, 255, 255, 0.85));
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hub-border);
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--hub-accent);
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand img {
  width: 30px; height: 30px;
  background: var(--hub-primary-500);
  border-radius: 8px;
  padding: 4px;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(91, 46, 131, 0.30);
}
.brand-text { line-height: 1.2; }
.brand-name { font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub {
  font-size: 10px;
  color: var(--hub-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 1px;
}
.topnav { display: flex; gap: 2px; margin-left: 16px; flex: 1; overflow-x: auto; scrollbar-width: thin; }
.topnav::-webkit-scrollbar { height: 3px; }
.topnav::-webkit-scrollbar-thumb { background: var(--hub-border); border-radius: 2px; }
.topnav a {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--hub-text-soft);
  font-weight: 500;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s var(--ease);
}
.topnav a:hover {
  background: var(--hub-bg);
  color: var(--hub-text);
  text-decoration: none;
}
.topnav a.active {
  background: var(--hub-primary-50);
  color: var(--hub-primary-700);
  font-weight: 600;
}
.topnav a svg { width: 16px; height: 16px; stroke-width: 2.25; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.search-box {
  background: var(--hub-bg);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 12px 8px 36px;
  display: flex;
  align-items: center;
  width: 260px;
  font-size: 13px;
  color: var(--hub-text-muted);
  position: relative;
  transition: all 0.15s var(--ease);
}
.search-box:focus-within {
  background: var(--hub-card);
  border-color: var(--hub-border);
  box-shadow: var(--shadow);
}
.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--hub-text);
  width: 100%;
}
.search-box input::placeholder { color: var(--hub-text-muted); }
.search-box .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--hub-text-muted);
}
.search-box kbd {
  background: var(--hub-card);
  border: 1px solid var(--hub-border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--hub-text-muted);
}
.notif-btn {
  position: relative;
  width: 36px; height: 36px;
  background: var(--hub-bg);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--hub-text-soft);
  border: 1px solid transparent;
  transition: all 0.15s var(--ease);
  text-decoration: none;
}
.notif-btn:hover { background: var(--hub-card); border-color: var(--hub-border); }
.notif-btn svg { width: 18px; height: 18px; stroke-width: 2; }

/* ============== THEME TOGGLE ============== */
.theme-toggle {
  width: 36px; height: 36px;
  background: var(--hub-bg);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--hub-text-soft);
  border: 1px solid transparent;
  transition: all 0.25s var(--ease-bounce);
}
.theme-toggle:hover {
  background: var(--hub-card);
  border-color: var(--hub-border);
  color: var(--hub-primary-500);
  transform: rotate(20deg);
}
.theme-toggle svg { width: 18px; height: 18px; stroke-width: 2; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle:hover { transform: rotate(-20deg); }
.notif-badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--hub-danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: var(--radius-full);
  min-width: 16px;
  text-align: center;
  border: 2px solid var(--hub-bg-elevated);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  background: var(--hub-bg);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  text-decoration: none;
  color: inherit;
}
.user-chip:hover { background: var(--hub-card); border-color: var(--hub-border); text-decoration: none; }
.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--hub-primary-500);
    color: white;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
    overflow: hidden;
}
.avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: none;
}
.user-chip:hover .avatar { box-shadow: 0 0 0 2px var(--hub-primary-200); }
[data-theme="dark"] .user-chip:hover .avatar { box-shadow: 0 0 0 2px rgba(91, 46, 131, 0.35); }

/* === USER MENU DROPDOWN === */
.user-menu-wrapper { position: relative; }
.user-menu-chevron { width: 14px; height: 14px; color: var(--hub-text-muted); margin-left: 2px; transition: transform 0.15s; flex-shrink: 0; }
.user-menu-wrapper.open .user-menu-chevron { transform: rotate(180deg); color: var(--hub-primary-600); }
.user-menu-wrapper.open .user-chip { background: var(--hub-bg); border-color: var(--hub-border); }

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: var(--hub-card);
    border: 1px solid var(--hub-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
    overflow: hidden;
    padding: 6px 0;
}
.user-menu-dropdown.show { display: block; }
.user-menu-header {
    padding: 12px 14px 10px 14px;
    border-bottom: 1px solid var(--hub-border-light);
    margin-bottom: 6px;
}
.user-menu-name { font-size: 13px; font-weight: 700; color: var(--hub-text); }
.user-menu-email { font-size: 11.5px; color: var(--hub-text-muted); margin-top: 2px; word-break: break-all; }
.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: var(--hub-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.1s;
}
.user-menu-item:hover { background: var(--hub-bg); }
.user-menu-item svg { width: 16px; height: 16px; color: var(--hub-text-muted); flex-shrink: 0; }
.user-menu-item:hover svg { color: var(--hub-primary-600); }
.user-menu-divider { height: 1px; background: var(--hub-border-light); margin: 6px 0; }
.user-menu-form { margin: 0; padding: 0; display: block; }
.user-menu-logout { color: var(--hub-danger); }
.user-menu-logout svg { color: var(--hub-danger); }
.user-menu-logout:hover { background: var(--hub-danger-soft); }
.user-menu-logout:hover svg { color: var(--hub-danger); }  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hub-primary-400), var(--hub-primary-600));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 11.5px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  letter-spacing: -0.01em;
}
.user-info { line-height: 1.2; }
.user-name { font-size: 13px; font-weight: 600; color: var(--hub-text); }
.user-role { font-size: 10.5px; color: var(--hub-text-muted); margin-top: 1px; }

/* ============== LAYOUT ============== */
.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 40px 80px;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}
.page-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  color: var(--hub-accent);
  letter-spacing: -0.02em;
}
.page-subtitle {
  color: var(--hub-text-soft);
  font-size: 14.5px;
  margin: 6px 0 0;
}

/* ============== CARDS ============== */
.card {
  background: var(--hub-card);
  border: 1px solid var(--hub-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s var(--ease);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hub-border-light);
}
.card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--hub-accent);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}
.card-title .more {
  font-size: 12px;
  color: var(--hub-primary-700);
  font-weight: 600;
  margin-left: auto;
}

/* ============== KPI ============== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.kpi {
  background: var(--hub-card);
  border: 1px solid var(--hub-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s var(--ease);
}
.kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--hub-primary-500);
  opacity: 0.85;
}
.kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.kpi-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hub-text-soft);
  font-weight: 600;
  margin-bottom: 10px;
}
.kpi-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--hub-accent);
  line-height: 1;
  letter-spacing: -0.02em;
  font-feature-settings: 'tnum';
}
.kpi-trend {
  font-size: 11.5px;
  margin-top: 8px;
  color: var(--hub-success);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.kpi-trend.down { color: var(--hub-danger); }
.kpi-trend svg { width: 12px; height: 12px; }
.kpi-sub { font-size: 12px; color: var(--hub-text-muted); margin-top: 4px; }

/* ============== BUTTONS ============== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  text-decoration: none;
  transition: all 0.15s var(--ease);
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.btn svg { width: 16px; height: 16px; stroke-width: 2.25; }
.btn-primary {
  background: var(--hub-primary-500);
  color: white;
  border-color: var(--hub-primary-500);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-primary:hover {
  background: var(--hub-primary-600);
  border-color: var(--hub-primary-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-primary);
  color: white;
}
.btn-ghost {
  background: var(--hub-card);
  color: var(--hub-text);
  border-color: var(--hub-border);
}
.btn-ghost:hover {
  border-color: var(--hub-primary-300);
  background: var(--hub-primary-50);
  color: var(--hub-primary-700);
}
.btn-danger {
  background: var(--hub-card);
  color: var(--hub-danger);
  border-color: var(--hub-border);
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 22px; font-size: 14px; }

/* ============== BADGES ============== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--hub-bg);
  color: var(--hub-text-soft);
  letter-spacing: -0.005em;
}
.badge svg { width: 12px; height: 12px; stroke-width: 2.5; }
.badge-urgent { background: var(--hub-danger-soft); color: var(--hub-danger); }
.badge-high { background: var(--hub-warning-soft); color: var(--hub-warning); }
.badge-medium { background: var(--hub-info-soft); color: var(--hub-info); }
.badge-low { background: var(--hub-success-soft); color: var(--hub-success); }
.badge-info { background: var(--hub-primary-50); color: var(--hub-primary-700); }

/* ============== TICKET STATES ============== */
.ticket-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.ticket-state svg { width: 12px; height: 12px; stroke-width: 2.5; }
.state-borrador { background: var(--hub-border-light); color: #475569; }
.state-validacion { background: var(--hub-warning-soft); color: var(--hub-warning); }
.state-backlog { background: var(--hub-info-soft); color: var(--hub-info); }
.state-ejecucion { background: var(--hub-primary-50); color: var(--hub-primary-700); }
.state-aprobacion { background: var(--hub-purple-soft); color: var(--hub-purple); }
.state-cerrado { background: var(--hub-success-soft); color: var(--hub-success); }

/* ============== TABLES ============== */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.table th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hub-text-muted);
  padding: 10px 14px;
  border-bottom: 1.5px solid var(--hub-border);
  background: var(--hub-bg);
}
.table th:first-child { border-top-left-radius: var(--radius); }
.table th:last-child { border-top-right-radius: var(--radius); }
.table td {
  padding: 14px;
  border-bottom: 1px solid var(--hub-border-light);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr { transition: background 0.1s var(--ease); }
.table tbody tr:hover td { background: var(--hub-primary-50); }

/* ============== FORMS ============== */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--hub-text);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}
.form-label .req { color: var(--hub-danger); }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--hub-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--hub-text);
  background: var(--hub-card);
  transition: all 0.15s var(--ease);
}
.form-control:focus {
  outline: none;
  border-color: var(--hub-primary-500);
  box-shadow: 0 0 0 3px var(--hub-primary-100);
}
.form-help { font-size: 11.5px; color: var(--hub-text-muted); margin-top: 5px; }
textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control { cursor: pointer; }

/* ============== AVATARS ============== */
.avatar-sm { width: 24px; height: 24px; font-size: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--hub-primary-400), var(--hub-primary-600)); color: white; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.avatar-md { width: 32px; height: 32px; font-size: 12px; border-radius: 50%; background: linear-gradient(135deg, var(--hub-primary-400), var(--hub-primary-600)); color: white; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; border-radius: 50%; background: linear-gradient(135deg, var(--hub-primary-400), var(--hub-primary-600)); color: white; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.avatar-purple { background: linear-gradient(135deg, #A78BFA, #7C3AED); }
.avatar-blue { background: linear-gradient(135deg, #60A5FA, #2563EB); }
.avatar-orange { background: linear-gradient(135deg, #FB923C, #EA580C); }
.avatar-pink { background: linear-gradient(135deg, #F472B6, #DB2777); }
.avatar-gray { background: linear-gradient(135deg, #94A3B8, #475569); }

/* ============== UTILITIES ============== */
.row { display: flex; gap: 18px; }
.col { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--hub-text-muted); }
.text-soft { color: var(--hub-text-soft); }
.text-accent { color: var(--hub-accent); }
.text-primary { color: var(--hub-primary-700); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.font-bold { font-weight: 700; }
.font-semi { font-weight: 600; }
.mono { font-family: var(--font-mono); }

/* ============== KANBAN ============== */
.kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
}
.kanban-col {
  background: var(--hub-border-light);
  border-radius: var(--radius-lg);
  padding: 14px;
  min-height: 500px;
  border: 1px solid var(--hub-border-light);
}
.kanban-col-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hub-text-soft);
  margin-bottom: 12px;
  padding: 0 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kanban-col-title svg { width: 14px; height: 14px; stroke-width: 2.25; }
.kanban-col-count {
  background: var(--hub-card);
  padding: 2px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--hub-text-soft);
  font-weight: 600;
  font-feature-settings: 'tnum';
  border: 1px solid var(--hub-border-light);
}
.kanban-card {
  background: var(--hub-card);
  border: 1px solid var(--hub-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  box-shadow: var(--shadow-xs);
}
.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: var(--hub-primary-200);
}
.kanban-card-id {
  font-size: 10.5px;
  color: var(--hub-text-muted);
  font-weight: 600;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}
.kanban-card-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--hub-text);
  margin-bottom: 8px;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.kanban-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  color: var(--hub-text-muted);
}
.kanban-card-meta .badge { font-size: 10px; padding: 2px 7px; }
.kanban-card-meta .badge svg { width: 10px; height: 10px; }

/* ============== TIMELINE ============== */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline-item {
  position: relative;
  padding: 0 0 18px 30px;
  border-left: 2px solid var(--hub-border);
  margin-left: 9px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--hub-primary-500);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--hub-primary-500);
}
.timeline-item.pending::before {
  background: var(--hub-card);
  box-shadow: 0 0 0 2px var(--hub-border);
}
.timeline-time { font-size: 11.5px; color: var(--hub-text-muted); font-weight: 500; }
.timeline-title { font-size: 13px; font-weight: 600; color: var(--hub-text); margin-top: 3px; letter-spacing: -0.01em; }
.timeline-desc { font-size: 12.5px; color: var(--hub-text-soft); margin-top: 2px; }

/* ============== COMMENT ============== */
.comment {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--hub-border-light);
}
.comment:first-child { border-top: none; padding-top: 0; }
.comment-body { flex: 1; }
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-name { font-weight: 600; font-size: 13px; }
.comment-time { font-size: 11.5px; color: var(--hub-text-muted); }
.comment-text { font-size: 13px; color: var(--hub-text); line-height: 1.55; }

/* ============== CATALOG CARD ============== */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.catalog-card {
  background: var(--hub-card);
  border: 1.5px solid var(--hub-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-decoration: none;
  color: inherit;
  position: relative;
}
.catalog-card:hover {
  border-color: var(--hub-primary-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}
.catalog-card:hover .catalog-icon {
  background: var(--hub-primary-100);
}
.catalog-icon {
  width: 38px; height: 38px;
  background: var(--hub-primary-50);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  color: var(--hub-primary-700);
  transition: background 0.2s var(--ease);
}
.catalog-icon svg { width: 20px; height: 20px; stroke-width: 1.75; }
.catalog-title { font-size: 15.5px; font-weight: 700; color: var(--hub-accent); margin: 0 0 8px; letter-spacing: -0.01em; }
.catalog-desc { font-size: 13px; color: var(--hub-text-soft); line-height: 1.55; margin-bottom: 14px; }
.catalog-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; }
.catalog-sla {
  background: var(--hub-primary-50);
  color: var(--hub-primary-700);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-feature-settings: 'tnum';
}

/* ============== EMPTY STATE ============== */
.empty { text-align: center; padding: 60px 20px; color: var(--hub-text-muted); }
.empty-icon { width: 40px; height: 40px; margin: 0 auto 12px; opacity: 0.4; color: var(--hub-text-muted); display: block; }
.empty-title { font-size: 16px; color: var(--hub-text); margin-bottom: 6px; font-weight: 700; }

/* ============== PROTOTIPO BAR ============== */
.proto-bar {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--hub-accent);
  color: white;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  font-weight: 600;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.1);
  transition: transform 0.15s var(--ease);
}
.proto-bar:hover { background: var(--hub-accent-soft); transform: translateY(-1px); text-decoration: none; }
.proto-bar .dot {
  width: 8px; height: 8px;
  background: var(--hub-primary-400);
  border-radius: 50%;
  animation: pulse 2s var(--ease) infinite;
  box-shadow: 0 0 8px var(--hub-primary-400);
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.proto-label {
  position: fixed;
  top: 76px;
  right: 24px;
  background: var(--hub-card);
  border: 1px solid var(--hub-border);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--hub-primary-700);
  z-index: 100;
  box-shadow: var(--shadow);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============== ATTACHMENT ============== */
.attachment {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--hub-border);
  border-radius: var(--radius);
  background: var(--hub-bg);
  font-size: 13px;
  margin-bottom: 8px;
  transition: all 0.15s var(--ease);
}
.attachment:hover { background: var(--hub-card); border-color: var(--hub-primary-300); }
.attachment-icon {
  width: 36px; height: 36px;
  background: var(--hub-card);
  border: 1px solid var(--hub-border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--hub-text-soft);
}
.attachment-icon svg { width: 18px; height: 18px; }
.attachment-info { flex: 1; min-width: 0; }
.attachment-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-meta { font-size: 11.5px; color: var(--hub-text-muted); margin-top: 2px; }

/* ============== RESPONSIVE ============== */
@media (max-width: 900px) {
  .topnav { display: none; }
  .page { padding: 20px 16px 80px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .row { flex-direction: column; }
  .search-box { width: 160px; }
}

/* ============== ACTIVITY ITEM ============== */
.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hub-border-light);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--hub-primary-50);
  color: var(--hub-primary-700);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.activity-icon svg { width: 16px; height: 16px; stroke-width: 2.25; }
.activity-body { flex: 1; }
.activity-text { font-size: 13px; line-height: 1.5; }
.activity-text strong { color: var(--hub-accent); font-weight: 600; }
.activity-time { font-size: 11.5px; color: var(--hub-text-muted); margin-top: 3px; }

/* ============== SCROLLBAR ============== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--hub-border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--hub-text-muted); }

/* ============================================
   DARK MODE — Overrides específicos
   (la mayoría se manejan via variables CSS)
============================================ */
[data-theme="dark"] .kpi::before { opacity: 0.6; }
[data-theme="dark"] .proto-bar { border: 1px solid rgba(94, 234, 212, 0.2); }
[data-theme="dark"] .proto-label { color: var(--hub-primary-300); }
[data-theme="dark"] .kpi-trend svg path { stroke: currentColor; }
[data-theme="dark"] .topbar { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .kanban-col { box-shadow: inset 0 0 0 1px var(--hub-border); }
[data-theme="dark"] .empty { color: var(--hub-text-muted); }
[data-theme="dark"] .empty-icon { color: var(--hub-text-muted); }
[data-theme="dark"] .activity-icon { background: var(--hub-primary-100); }
[data-theme="dark"] .activity-icon svg { stroke: var(--hub-primary-300); }
[data-theme="dark"] .filter-pill { background: var(--hub-bg-elevated); }
[data-theme="dark"] .filter-pill:hover { background: var(--hub-primary-100); color: var(--hub-primary-200); }
[data-theme="dark"] .filter-pill.active { color: #0A0E1A; }
[data-theme="dark"] .btn-ghost { background: var(--hub-card); border-color: var(--hub-border); }
[data-theme="dark"] .btn-ghost:hover { background: var(--hub-primary-100); }
[data-theme="dark"] .btn-danger { background: var(--hub-card); }
[data-theme="dark"] .tab-btn { color: var(--hub-text-muted); }
[data-theme="dark"] .tab-btn.active { color: var(--hub-primary-300); }
[data-theme="dark"] .heatmap-day:hover { outline-color: var(--hub-primary-400); }
[data-theme="dark"] .bar-stack { background: var(--hub-border); }
[data-theme="dark"] .timeline-item::before { box-shadow: 0 0 0 2px var(--hub-primary-400); }
[data-theme="dark"] .search-box input { color: var(--hub-text); }
[data-theme="dark"] .search-box input::placeholder { color: var(--hub-text-muted); }
[data-theme="dark"] .search-box kbd { background: var(--hub-bg-elevated); color: var(--hub-text-muted); }
[data-theme="dark"] .search-box:focus-within { background: var(--hub-bg-elevated); }
[data-theme="dark"] .table th { color: var(--hub-text-muted); background: var(--hub-bg); }
[data-theme="dark"] .table tbody tr:hover td { background: var(--hub-primary-100); color: var(--hub-text); }
[data-theme="dark"] .form-control { background: var(--hub-bg-elevated); color: var(--hub-text); }
[data-theme="dark"] .form-control::placeholder { color: var(--hub-text-muted); }
[data-theme="dark"] textarea.form-control { background: var(--hub-bg-elevated); }
[data-theme="dark"] select.form-control { background: var(--hub-bg-elevated); }
[data-theme="dark"] .progress-bar { background: var(--hub-border); }
[data-theme="dark"] .cat-bar { background: var(--hub-border); }
[data-theme="dark"] .kpi-value { color: var(--hub-text); }
[data-theme="dark"] .card-title { color: var(--hub-text); }
[data-theme="dark"] .page-title { color: var(--hub-text); }
[data-theme="dark"] .audit-action { color: var(--hub-text-soft); }
[data-theme="dark"] .audit-action strong { color: var(--hub-text); }
[data-theme="dark"] .audit-target { color: var(--hub-primary-300); }
[data-theme="dark"] .admin-tab.active { color: #0A0E1A; }
[data-theme="dark"] .config-row .label { color: var(--hub-text); }
[data-theme="dark"] .ticket-row { color: var(--hub-text); }
[data-theme="dark"] .ticket-row > div { color: inherit; }
[data-theme="dark"] ::selection { background: var(--hub-primary-700); color: white; }
[data-theme="dark"] .text-accent { color: var(--hub-text); }
[data-theme="dark"] .text-primary { color: var(--hub-primary-300); }
[data-theme="dark"] .brand { color: var(--hub-text); }
[data-theme="dark"] .brand-name { color: var(--hub-text); }
[data-theme="dark"] .user-name { color: var(--hub-text); }

/* Color del header del brand en dark mode */
[data-theme="dark"] .brand img { background: var(--hub-primary-500); }

/* ========== FIXES DARK MODE ==========
 * Correcciones de contraste añadidas durante implementación
 * (no se modifican reglas del prototipo, sólo se añaden estas)
 * - Colores hard-coded de kanban-card-prio que no cambian con el tema
 * - .priority-option con background:white
 * - .kpi-label y .kpi-sub que en dark son muted
 * - .kanban-card-due, .delivery-title, .activity-time más legibles
 * - .filter-select y .filter-bar background en dark
 * - .progress-bar background ya cubierto pero refuerzo contraste
 * - .ticket-row header más visible
 * - .more link, .search-box, .badge-info en dark
 */
[data-theme="dark"] .kanban-card-prio.urgente { color: #FCA5A5; }
[data-theme="dark"] .kanban-card-prio.alta { color: #FCD34D; }
[data-theme="dark"] .kanban-card-prio.media { color: #93C5FD; }
[data-theme="dark"] .kanban-card-prio.baja { color: #6EE7B7; }

[data-theme="dark"] .priority-option { background: var(--hub-bg-elevated); }
[data-theme="dark"] .priority-option .psla { color: var(--hub-text-soft); }

[data-theme="dark"] .kpi-label { color: var(--hub-text-soft); }
[data-theme="dark"] .kpi-sub { color: var(--hub-text-soft); }
[data-theme="dark"] .kpi-trend { color: var(--hub-text-soft); }
[data-theme="dark"] .kpi-trend.down { color: #FCA5A5; }

[data-theme="dark"] .kanban-card-due { color: var(--hub-text-soft); }
[data-theme="dark"] .kanban-card-warn { color: #FCA5A5; }

[data-theme="dark"] .delivery-title { color: var(--hub-text-soft); }
[data-theme="dark"] .activity-time { color: var(--hub-text-soft); }

[data-theme="dark"] .filter-bar { background: var(--hub-card); }
[data-theme="dark"] .filter-select { background: var(--hub-bg-elevated); color: var(--hub-text); }
[data-theme="dark"] .filter-select:hover { border-color: var(--hub-primary-400); }

/* ========== DARK MODE READABILITY FIXES ==========
 * Contraste de labels universales (subtítulo topbar, secciones sidebar)
 * y overrides para cards con background:white hardcoded
 */
[data-theme="dark"] .brand-sub { color: var(--hub-text-soft); }
[data-theme="dark"] .sidebar-section-title { color: var(--hub-text-soft); }
[data-theme="dark"] .sidebar-item.active {
    background: rgba(91, 46, 131, 0.30);
    color: #FFFFFF;
}
[data-theme="dark"] .sidebar-item.active .badge {
    background: rgba(255, 255, 255, 0.18);
    color: #FFFFFF;
}
[data-theme="dark"] .req-type-option {
    background: var(--hub-card);
    border-color: var(--hub-border);
}
[data-theme="dark"] .req-type-option .rt-icon {
    background: var(--hub-bg-elevated);
    color: var(--hub-primary-300);
}
[data-theme="dark"] .req-type-option:hover {
    border-color: var(--hub-primary-400);
    background: var(--hub-bg-elevated);
}
[data-theme="dark"] .req-type-option.selected {
    background: rgba(91, 46, 131, 0.22);
    border-color: var(--hub-primary-500);
}
[data-theme="dark"] .req-type-option.selected .rt-icon {
    background: rgba(91, 46, 131, 0.25);
    color: #FFFFFF;
}
[data-theme="dark"] .service-option {
    background: var(--hub-card);
    border-color: var(--hub-border);
}
[data-theme="dark"] .service-option .icon {
    background: var(--hub-bg-elevated);
}
[data-theme="dark"] .service-option.selected {
    background: rgba(91, 46, 131, 0.22);
    border-color: var(--hub-primary-500);
}
[data-theme="dark"] .service-option.selected .icon {
    background: rgba(91, 46, 131, 0.30);
    color: #FFFFFF;
}
[data-theme="dark"] .lead-card {
    background: var(--hub-card);
    border-color: var(--hub-border);
}
[data-theme="dark"] .lead-card-name { color: var(--hub-text); }
[data-theme="dark"] .kanban-col { background: var(--hub-bg); border-color: var(--hub-border); }
[data-theme="dark"] .kanban-col-count {
    background: var(--hub-card);
    color: var(--hub-text);
}
[data-theme="dark"] .priority-row {
    background: var(--hub-card);
    border-color: var(--hub-border);
}
[data-theme="dark"] .priority-row .info span { color: var(--hub-text-soft); }
[data-theme="dark"] .toggle { background: var(--hub-card); border-color: var(--hub-border); }
[data-theme="dark"] .upload-zone { background: var(--hub-bg); border-color: var(--hub-border); }
[data-theme="dark"] .upload-zone .icon { background: var(--hub-card); border-color: var(--hub-border); }
[data-theme="dark"] .upload-zone:hover {
    background: rgba(91, 46, 131, 0.12);
    border-color: var(--hub-primary-500);
    color: var(--hub-primary-300);
}
[data-theme="dark"] .summary-tip {
    background: rgba(91, 46, 131, 0.18);
    color: var(--hub-text);
    border-left: 3px solid var(--hub-primary-500);
}
[data-theme="dark"] .filter-pill { color: var(--hub-text-soft); }
[data-theme="dark"] .filter-pill.active { color: #FFFFFF; }

[data-theme="dark"] .page-subtitle { color: var(--hub-text-soft); }

[data-theme="dark"] .more { color: var(--hub-primary-300); }
[data-theme="dark"] .more:hover { color: var(--hub-primary-400); }

[data-theme="dark"] .badge-info { color: var(--hub-primary-300); }

[data-theme="dark"] .ticket-state { color: var(--hub-text); }
[data-theme="dark"] .ticket-state.state-borrador { color: #94A3B8; }
[data-theme="dark"] .ticket-state.state-en_revision { color: #93C5FD; }
[data-theme="dark"] .ticket-state.state-en_ejecucion { color: #FCD34D; }
[data-theme="dark"] .ticket-state.state-en_validacion { color: #C4B5FD; }
[data-theme="dark"] .ticket-state.state-en_aprobacion { color: #6EE7B7; }
[data-theme="dark"] .ticket-state.state-cerrado { color: #94A3B8; }

[data-theme="dark"] .cal-nav button { background: var(--hub-bg-elevated); border-color: var(--hub-border); color: var(--hub-text-soft); }
[data-theme="dark"] .cal-nav button:hover { background: var(--hub-primary-100); color: var(--hub-text); }

[data-theme="dark"] .bar-chart .bar { background: linear-gradient(180deg, var(--hub-primary-400) 0%, var(--hub-primary-600) 100%); }

[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
  background: var(--hub-bg-elevated);
  color: var(--hub-text);
  border-color: var(--hub-border);
}

/* ============== REPORTES / FILTROS ============== */
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--hub-card);
  border: 1px solid var(--hub-border);
  border-radius: var(--radius);
  margin-bottom: 18px;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--hub-bg);
  border: 1px solid var(--hub-border);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--hub-text-soft);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  font-family: inherit;
}
.filter-pill:hover { background: var(--hub-primary-50); border-color: var(--hub-primary-300); color: var(--hub-primary-700); }
.filter-pill.active {
  background: var(--hub-primary-500);
  border-color: var(--hub-primary-500);
  color: white;
}
.filter-pill svg { width: 13px; height: 13px; }
.filter-divider {
  width: 1px;
  height: 18px;
  background: var(--hub-border);
  margin: 0 4px;
}
.filter-select {
  background: var(--hub-bg);
  border: 1px solid var(--hub-border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--hub-text);
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: all 0.15s var(--ease);
}
.filter-select:hover { border-color: var(--hub-primary-300); }
.filter-select:focus { border-color: var(--hub-primary-500); box-shadow: 0 0 0 3px var(--hub-primary-100); }
.filter-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hub-text-muted);
  font-weight: 700;
  margin-right: 4px;
}

/* ============== HEATMAP ============== */
.heatmap {
  display: grid;
  grid-template-columns: repeat(53, 1fr);
  gap: 2px;
  padding: 8px 0;
}
.heatmap-day {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--hub-border-light);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  position: relative;
}
.heatmap-day:hover {
  outline: 1.5px solid var(--hub-accent);
  outline-offset: 1px;
  z-index: 2;
}
.heatmap-day[data-level="1"] { background: rgba(94, 234, 212, 0.2); }
.heatmap-day[data-level="2"] { background: rgba(94, 234, 212, 0.5); }
.heatmap-day[data-level="3"] { background: var(--hub-primary-500); }
.heatmap-day[data-level="4"] { background: var(--hub-primary-700); }
.heatmap-day[data-level="0"] { background: var(--hub-border-light); }
.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--hub-text-muted);
  font-weight: 500;
}
.heatmap-legend .scale { display: inline-flex; gap: 2px; }
.heatmap-legend .scale span { width: 10px; height: 10px; border-radius: 2px; display: block; }

/* ============== BAR CHART (stacked) ============== */
.bar-chart {
  display: flex;
  gap: 12px;
  align-items: stretch;
  height: 220px;
  padding: 16px 8px 8px;
  position: relative;
}
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  min-width: 0;
}
.bar-stack {
  width: 60%;
  max-width: 40px;
  background: var(--hub-border-light);
  border-radius: 4px 4px 0 0;
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  min-height: 4px;
  transition: all 0.3s var(--ease);
}
.bar-col:hover .bar-stack { transform: scaleY(1.02); transform-origin: bottom; }
.bar-seg {
  width: 100%;
  position: relative;
  transition: all 0.2s var(--ease);
}
.bar-seg:hover { filter: brightness(1.1); }
.bar-label {
  font-size: 10.5px;
  color: var(--hub-text-muted);
  font-weight: 600;
  text-align: center;
  margin-top: 4px;
  font-family: var(--font-mono);
}
.bar-value {
  font-size: 10px;
  font-weight: 700;
  color: var(--hub-accent);
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* ============== DONUT / CATEGORÍAS ============== */
.cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--hub-border-light);
}
.cat-row:last-child { border-bottom: none; }
.cat-color {
  width: 10px; height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.cat-name { flex: 1; font-size: 13px; font-weight: 600; }
.cat-bar {
  flex: 2;
  height: 6px;
  background: var(--hub-border-light);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.cat-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s var(--ease); }
.cat-hours { font-size: 12px; font-weight: 700; color: var(--hub-accent); font-family: var(--font-mono); min-width: 56px; text-align: right; }
.cat-pct { font-size: 11px; color: var(--hub-text-muted); font-weight: 600; min-width: 38px; text-align: right; }

/* ============== TICKET ROW (en reporte) ============== */
.ticket-row {
  display: grid;
  grid-template-columns: 100px 1fr 110px 90px 80px 80px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hub-border-light);
  transition: background 0.1s var(--ease);
  font-size: 13px;
}
.ticket-row:hover { background: var(--hub-primary-50); }
.ticket-row:last-child { border-bottom: none; }

/* ============== TOOLTIP (para heatmap) ============== */
.tooltip {
  position: absolute;
  background: var(--hub-accent);
  color: white;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.15s var(--ease);
  z-index: 10;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}
.tooltip.show { opacity: 1; transform: translateY(0); }

/* ============== ESTILOS DE VISTAS ESPECÍFICAS ==============
 * Estos estilos estaban en <style> inline de los HTML del prototipo
 * (02_dashboard_marketing.html, 04_kanban.html, 06_crear_ticket.html, etc.)
 * y se centralizan aquí para que las vistas Blade los hereden.
 */

/* === ACTIVITY ITEM (dashboard) === */
.activity-item {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--hub-border-light);
  align-items: flex-start;
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--hub-primary-50); color: var(--hub-primary-700);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.activity-icon svg { width: 16px; height: 16px; stroke-width: 2.25; }
.activity-body { flex: 1; min-width: 0; }
.activity-text { font-size: 13px; line-height: 1.5; color: var(--hub-text); }
.activity-text strong { color: var(--hub-accent); font-weight: 600; }
.activity-time { font-size: 11.5px; color: var(--hub-text-muted); margin-top: 3px; }

/* === DELIVERY ITEM (dashboard) === */
.delivery-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--hub-border-light);
}
.delivery-item:last-child { border-bottom: none; }
.delivery-info { flex: 1; min-width: 0; }
.delivery-id { font-size: 12px; font-weight: 600; color: var(--hub-text); font-family: var(--font-mono); }
.delivery-title { font-size: 11.5px; color: var(--hub-text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* === MINI CHART (dashboard) === */
.mini-chart {
  display: flex; gap: 4px; align-items: flex-end; height: 56px; margin-top: 8px;
}
.mini-chart div {
  flex: 1;
  background: linear-gradient(180deg, var(--hub-primary-500) 0%, var(--hub-primary-300) 100%);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  position: relative;
  transition: all 0.2s var(--ease);
}
.mini-chart div:hover { transform: scaleY(1.05); transform-origin: bottom; }

/* === PROGRESS BAR === */
.progress-bar {
  height: 8px; background: var(--hub-border-light);
  border-radius: var(--radius-full); overflow: hidden; position: relative;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--hub-primary-400), var(--hub-primary-600));
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease);
}

/* === KANBAN COLUMN (kanban) === */
.kanban-card-prio {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10.5px; padding: 2px 7px; border-radius: 6px; font-weight: 600;
}
.kanban-card-prio.urgente { background: var(--hub-danger-soft); color: var(--hub-danger); }
.kanban-card-prio.alta { background: var(--hub-warning-soft); color: #B45309; }
.kanban-card-prio.media { background: var(--hub-info-soft); color: #1D4ED8; }
.kanban-card-prio.baja { background: var(--hub-success-soft); color: #047857; }
.kanban-card-warn {
  margin-top: 6px; font-size: 10.5px; color: var(--hub-danger);
  display: flex; align-items: center; gap: 4px; font-weight: 600;
}
.kanban-card-warn svg { width: 11px; height: 11px; }
.kanban-card-due {
  margin-top: 6px; font-size: 10.5px; color: var(--hub-text-muted);
  display: flex; align-items: center; gap: 4px;
}
.kanban-card-due svg { width: 11px; height: 11px; }
.kanban-card.alert { border-color: var(--hub-danger); border-width: 1.5px; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.06); }
.kanban-card.warn { border-color: var(--hub-primary-300); border-width: 1.5px; }

/* === PRIORITY SELECTOR (crear ticket) === */
.priority-selector { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 8px; }
.priority-option {
  padding: 14px 10px; border: 1.5px solid var(--hub-border); border-radius: var(--radius);
  text-align: center; cursor: pointer; background: white; transition: all 0.15s var(--ease);
}
.priority-option.selected { border-width: 2px; padding: 13px 9px; }
.priority-option.urgente { border-color: var(--hub-danger); }
.priority-option.urgente.selected { background: var(--hub-danger-soft); }
.priority-option.alta { border-color: var(--hub-warning); }
.priority-option.alta.selected { background: var(--hub-warning-soft); }
.priority-option.media { border-color: var(--hub-info); }
.priority-option.media.selected { background: var(--hub-info-soft); }
.priority-option.baja { border-color: var(--hub-success); }
.priority-option.baja.selected { background: var(--hub-success-soft); }
.priority-option .picon { font-size: 18px; margin-bottom: 4px; }
.priority-option .pname { font-size: 12.5px; font-weight: 700; }
.priority-option .psla { font-size: 10.5px; color: var(--hub-text-muted); margin-top: 2px; }

/* === KANBAN SCROLL === */
.kanban { overflow-x: auto; padding-bottom: 12px; }

/* Filter pills as links should look like buttons */
a.filter-pill { text-decoration: none; }

/* === SIDEBAR (Lateral izquierdo agrupado) === */
.sidebar {
    position: fixed;
    left: 0;
    top: 64px;
    width: 244px;
    height: calc(100vh - 64px);
    background: var(--hub-card);
    border-right: 1px solid var(--hub-border);
    padding: 16px 12px 12px 12px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 50;
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--hub-border); border-radius: 3px; }

.sidebar-special { margin-bottom: 8px; }
.sidebar-special a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: var(--radius);
    color: var(--hub-primary-700);
    background: linear-gradient(135deg, var(--hub-primary-50), transparent);
    text-decoration: none;
    font-weight: 700;
    font-size: 13.5px;
    border: 1px solid var(--hub-primary-200);
    transition: all 0.15s;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-special a:hover {
    background: linear-gradient(135deg, var(--hub-primary-100), var(--hub-primary-50));
    transform: translateX(2px);
    box-shadow: var(--shadow-sm);
}
.sidebar-special a.active {
    background: linear-gradient(135deg, var(--hub-primary-100), var(--hub-primary-50));
    color: var(--hub-primary-800);
    border-color: var(--hub-primary-400);
}
[data-theme="dark"] .sidebar-special a {
    background: linear-gradient(135deg, rgba(91, 46, 131, 0.18), rgba(91, 46, 131, 0.05));
    color: #FFFFFF;
    border-color: rgba(91, 46, 131, 0.35);
}
[data-theme="dark"] .sidebar-special a:hover {
    background: linear-gradient(135deg, rgba(91, 46, 131, 0.30), rgba(91, 46, 131, 0.10));
    color: #FFFFFF;
}
[data-theme="dark"] .sidebar-special a.active {
    background: linear-gradient(135deg, rgba(91, 46, 131, 0.35), rgba(91, 46, 131, 0.15));
    color: #FFFFFF;
    border-color: rgba(128, 100, 168, 0.50);
}
.sidebar-special svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 2.25; }

.sidebar-section { margin-top: 18px; }
.sidebar-section:first-of-type { margin-top: 6px; }
.sidebar-section-title {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--hub-text-muted);
    font-weight: 700;
    padding: 0 12px 8px 12px;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: var(--radius);
    color: var(--hub-text-soft);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 2px;
    transition: all 0.12s;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
}
.sidebar-item:hover {
    background: var(--hub-bg);
    color: var(--hub-text);
}
.sidebar-item.active {
    background: var(--hub-primary-50);
    color: var(--hub-primary-700);
    font-weight: 600;
}
[data-theme="dark"] .sidebar-item.active {
    background: rgba(91, 46, 131, 0.30);
    color: #FFFFFF;
}
[data-theme="dark"] .sidebar-item.active:hover {
    background: rgba(91, 46, 131, 0.40);
    color: #FFFFFF;
}
.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--hub-primary-500);
}
.sidebar-item svg { width: 17px; height: 17px; flex-shrink: 0; stroke-width: 2.25; }
.sidebar-item .label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sidebar-item .badge {
    font-size: 9.5px;
    padding: 2px 6px;
    border-radius: 8px;
    background: var(--hub-primary-100);
    color: var(--hub-primary-700);
    font-weight: 700;
    flex-shrink: 0;
}
[data-theme="dark"] .sidebar-item .badge {
    background: rgba(91, 46, 131, 0.22);
    color: var(--hub-primary-300);
}
.sidebar-item .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--hub-danger);
    flex-shrink: 0;
    margin-left: auto;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--hub-border-light);
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-toggle {
    background: var(--hub-bg);
    border: 1px solid var(--hub-border);
    color: var(--hub-text-soft);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.12s;
    flex-shrink: 0;
}
.sidebar-toggle:hover {
    background: var(--hub-primary-50);
    color: var(--hub-primary-700);
    border-color: var(--hub-primary-300);
}
[data-theme="dark"] .sidebar-toggle:hover {
    background: rgba(91, 46, 131, 0.15);
    color: var(--hub-primary-300);
}
.sidebar-toggle svg { width: 14px; height: 14px; }
.sidebar-footer-text {
    font-size: 11px;
    color: var(--hub-text-muted);
    white-space: nowrap;
    overflow: hidden;
}

/* === SIDEBAR COLAPSADO === */
body.sidebar-collapsed .sidebar { width: 68px; padding: 16px 8px 12px 8px; }
body.sidebar-collapsed .sidebar-special a { justify-content: center; padding: 11px 0; }
body.sidebar-collapsed .sidebar-section-title,
body.sidebar-collapsed .sidebar-item .label,
body.sidebar-collapsed .sidebar-special a .label,
body.sidebar-collapsed .sidebar-item .badge,
body.sidebar-collapsed .sidebar-item .dot,
body.sidebar-collapsed .sidebar-footer-text { display: none; }
body.sidebar-collapsed .sidebar-item,
body.sidebar-collapsed .sidebar-special a { justify-content: center; padding-left: 0; padding-right: 0; }
body.sidebar-collapsed .sidebar-item.active::before { left: -8px; }
body.sidebar-collapsed .page-wrap { margin-left: 68px; }

/* === PAGE WRAP (respeta sidebar) === */
.page-wrap {
    margin-left: 244px;
    min-height: calc(100vh - 64px);
    transition: margin-left 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.22s; }
    .sidebar.mobile-open { transform: translateX(0); box-shadow: var(--shadow-xl); }
    .page-wrap { margin-left: 0; }
    body.sidebar-collapsed .page-wrap { margin-left: 0; }
    .sidebar-mobile-trigger { display: flex !important; }
}

/* === TOPBAR ajustes para sidebar layout === */
.topbar { justify-content: space-between; gap: 16px; }
.topbar-right { margin-left: 0; }
.sidebar-mobile-trigger {
    display: none;
    background: none;
    border: 1px solid var(--hub-border);
    border-radius: var(--radius-sm);
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    color: var(--hub-text-soft);
    cursor: pointer;
}
.sidebar-mobile-trigger svg { width: 18px; height: 18px; }
@media (max-width: 900px) { .sidebar-mobile-trigger { display: flex; } }
