/* ============================================================
   TictagHunter — Premium Light Dashboard v2
   Tictag Branding Digital © 2026
   Sidebar + Topbar layout · Plus Jakarta Sans
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  --bg-primary: #F8FAFC;
  --bg-secondary: #F1F5F9;
  --bg-tertiary: #E2E8F0;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --bg-input: #FFFFFF;
  --bg-input-focus: #FFFFFF;
  --bg-sidebar: #FFFFFF;
  --bg-topbar: #FFFFFF;
  --bg-elevated: #FFFFFF;

  --accent: #f1681e;
  --accent-light: #ff8a4c;
  --accent-dark: #d45a15;
  --accent-50: #FFF7ED;
  --accent-100: #FFEDD5;
  --accent-glow: rgba(241,104,30,0.15);
  --accent-glow-soft: rgba(241,104,30,0.08);
  --accent-gradient: linear-gradient(135deg, #f1681e, #ff8a4c);
  --accent-gradient-subtle: linear-gradient(135deg, rgba(241,104,30,0.08), rgba(255,138,76,0.03));

  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --text-accent: #f1681e;

  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --border-focus: #f1681e;

  --glass: rgba(255,255,255,0.8);
  --glass-border: rgba(0,0,0,0.06);
  --glass-strong: rgba(255,255,255,0.95);

  --success: #16A34A;
  --success-bg: #F0FDF4;
  --warning: #CA8A04;
  --warning-bg: #FEFCE8;
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
  --info: #2563EB;
  --info-bg: #EFF6FF;

  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;
  --border-radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  --transition-fast: all 0.15s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: all 0.4s cubic-bezier(0.4,0,0.2,1);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.04);
  --shadow-glow: 0 0 20px rgba(241,104,30,0.15);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);

  --topbar-height: 64px;
  --nav-height: 64px;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --status-bar-height: 0px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1,h2,h3,h4,h5,h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

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

/* ---------- App Layout (Grid) ---------- */
#app {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--topbar-height) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar content";
  min-height: 100vh;
  transition: grid-template-columns 0.3s ease;
}
#app.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) 1fr;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  grid-area: sidebar;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width 0.3s ease;
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed-width); }
.sidebar.collapsed .nav-text,
.sidebar.collapsed .sidebar__subtitle,
.sidebar.collapsed .sidebar__brand,
.sidebar.collapsed .sidebar__user-info,
.sidebar.collapsed .sidebar__user-name,
.sidebar.collapsed .sidebar__user-role,
.sidebar.collapsed .sidebar__section-label,
.sidebar.collapsed .ai-usage__label,
.sidebar.collapsed .sidebar__logout,
.sidebar.collapsed .badge-count { display: none !important; }
.sidebar.collapsed .sidebar__header { justify-content: center; padding: 16px 0; }
.sidebar.collapsed .sidebar__logo { margin: 0 auto; }
.sidebar.collapsed .sidebar__toggle { margin: 0 auto; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 10px; }
.sidebar.collapsed .nav-icon { margin: 0; }
.sidebar.collapsed .sidebar__user { justify-content: center; padding: 12px 0; }
.sidebar.collapsed .sidebar__ai-widget { padding: 8px; }
.sidebar.collapsed .nav-badge { position: absolute; top: 4px; right: 4px; }

.sidebar__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar__logo { width: 32px; height: 32px; flex-shrink: 0; }
.sidebar__brand { flex: 1; min-width: 0; }
.sidebar__title { font-size: 18px; font-weight: 800; color: var(--text-primary); display: block; line-height: 1.2; }
.sidebar__subtitle { font-size: 11px; color: var(--text-muted); display: block; }
.sidebar__toggle {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 4px; border-radius: 6px;
  transition: var(--transition-fast);
}
.sidebar__toggle:hover { color: var(--text-primary); background: var(--bg-secondary); }

.sidebar__nav {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}
.sidebar__section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 16px 12px 6px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--border-radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  text-align: left;
  font-family: inherit;
}
.nav-link:hover { background: var(--bg-secondary); color: var(--text-primary); }
.nav-link.active {
  background: var(--accent-50);
  color: var(--accent);
  font-weight: 600;
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-text { white-space: nowrap; }
.nav-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: auto;
}
.badge-count {
  font-size: 10px;
  font-weight: 700;
  background: var(--accent-50);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: auto;
}

/* AI Usage Widget */
.sidebar__ai-widget {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}
.ai-usage__bar {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.ai-usage__fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 3px;
  transition: width 0.5s ease;
}
.ai-usage__label { font-size: 11px; color: var(--text-muted); }

/* User Section */
.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.sidebar__user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.sidebar__user-info { flex: 1; min-width: 0; }
.sidebar__user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); display: block; }
.sidebar__user-role { font-size: 11px; color: var(--text-muted); display: block; }
.sidebar__logout {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 6px; border-radius: 6px;
  transition: var(--transition-fast);
}
.sidebar__logout:hover { color: var(--danger); background: var(--danger-bg); }

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3);
  z-index: 99;
}

/* ---------- TOPBAR ---------- */
.topbar {
  grid-area: topbar;
  position: sticky; top: 0;
  height: var(--topbar-height);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 50;
}
.topbar__left { display: flex; align-items: center; gap: 12px; }
.topbar__menu-btn {
  display: none;
  background: none; border: none;
  color: var(--text-secondary);
  cursor: pointer; padding: 6px; border-radius: 6px;
}
.topbar__menu-btn:hover { background: var(--bg-secondary); }
.topbar__title { font-size: 20px; font-weight: 700; color: var(--text-primary); margin: 0; }
.topbar__right { display: flex; align-items: center; gap: 16px; }
.topbar__status { display: flex; align-items: center; gap: 6px; }
.topbar__status-text { font-size: 12px; color: var(--text-muted); }
.topbar__clock { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.topbar__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
}

/* Status dot */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot--online { background: var(--success); box-shadow: 0 0 6px rgba(22,163,74,0.4); }
.status-dot--offline { background: var(--danger); }

/* ---------- MAIN CONTENT ---------- */
.main-content {
  grid-area: content;
  padding: 28px;
  min-height: 0;
  background: var(--bg-primary);
}

/* ---------- Views ---------- */
.view { display: none; animation: fadeSlideIn 0.3s ease; }
.view.active { display: block; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 24px;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}
.card:not(.card--no-hover):hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.card--accent { border-left: 3px solid var(--accent); }

/* Stat Cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card__icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 12px;
}
.stat-card__value {
  font-size: 2rem; font-weight: 700; line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.stat-card__label { font-size: 0.8rem; color: var(--text-secondary); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--border-radius-sm);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; border: none;
  transition: var(--transition-fast);
  white-space: nowrap;
}
.btn--primary {
  background: var(--accent-gradient); color: #fff;
  box-shadow: 0 2px 8px rgba(241,104,30,0.2);
}
.btn--primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn--secondary {
  background: var(--bg-card); color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn--secondary:hover { background: var(--bg-secondary); }
.btn--ghost {
  background: transparent; color: var(--text-secondary);
  border: 1px solid transparent;
}
.btn--ghost:hover { background: var(--bg-secondary); color: var(--text-primary); }
.btn--danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(220,38,38,0.2); }
.btn--danger:hover { background: var(--danger); color: #fff; }
.btn--success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(22,163,74,0.2); }
.btn--success:hover { background: var(--success); color: #fff; }
.btn--sm { padding: 6px 14px; font-size: 13px; }
.btn--lg { padding: 14px 28px; font-size: 16px; }
.btn--icon { padding: 8px; border-radius: var(--border-radius-sm); }
.btn--icon-lg { padding: 10px; }
.btn--loading { opacity: 0.7; pointer-events: none; }
.btn-group { display: flex; gap: 8px; }

/* ---------- Form Inputs ---------- */
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px;
  background: var(--bg-input); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--border-radius-sm);
  font-family: inherit; font-size: 14px;
  transition: var(--transition-fast);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(241,104,30,0.1);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-group { margin-bottom: 16px; }

/* ---------- Utility Classes ---------- */
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.w-full { width: 100%; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; }
.relative { position: relative; }

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-flex; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 100%; height: 100%; position: absolute; cursor: pointer; z-index: 2; margin: 0; }
.toggle-switch .toggle-track {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: #CBD5E1; border-radius: 12px;
  transition: var(--transition-fast);
}
.toggle-switch input:checked + .toggle-track { background: var(--accent); }
.toggle-switch .toggle-knob {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}
.toggle-switch input:checked ~ .toggle-knob { transform: translateX(20px); }

/* Checkbox */
.form-checkbox { appearance: none; width: 18px; height: 18px; border: 2px solid var(--border); border-radius: 4px; cursor: pointer; transition: var(--transition-fast); }
.form-checkbox:checked { background: var(--accent); border-color: var(--accent); }

/* ---------- Tables ---------- */
.table-container { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--border-radius); background: var(--bg-card); }
.table { width: 100%; border-collapse: collapse; }
.table thead { background: var(--bg-secondary); position: sticky; top: 0; z-index: 2; }
.table th {
  padding: 10px 16px; text-align: left;
  font-size: 0.73rem; font-weight: 600;
  color: var(--text-secondary); text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--accent); }
.table td {
  padding: 12px 16px;
  font-size: 0.85rem; color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.table tbody tr { animation: rowFadeIn 0.3s ease both; transition: var(--transition-fast); }
.table tbody tr:hover { background: var(--bg-secondary); }
.table tbody tr:last-child td { border-bottom: none; }
.cell-name { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 600; }
.cell-phone { font-family: 'JetBrains Mono', 'DM Mono', monospace; font-size: 0.8rem; letter-spacing: 0.02em; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.72rem; font-weight: 600;
  padding: 3px 10px; border-radius: var(--border-radius-full);
  white-space: nowrap;
}
.badge--success { background: var(--success-bg); color: #15803D; }
.badge--warning { background: var(--warning-bg); color: #A16207; }
.badge--danger { background: var(--danger-bg); color: #B91C1C; }
.badge--info { background: var(--info-bg); color: #1D4ED8; }
.badge--accent { background: var(--accent-50); color: var(--accent); }
.badge--neutral { background: var(--bg-secondary); color: var(--text-secondary); }
.badge--dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.badge--nuevo { background: #EFF6FF; color: #1D4ED8; }
.badge--nuevo.badge--dot::before { background: #3b82f6; }
.badge--contactado { background: #FFFBEB; color: #A16207; }
.badge--contactado.badge--dot::before { background: #f59e0b; }
.badge--interesado { background: var(--accent-50); color: var(--accent-dark); }
.badge--interesado.badge--dot::before { background: #f97316; }
.badge--propuesta { background: #FDF2F8; color: #9D174D; }
.badge--propuesta.badge--dot::before { background: #ec4899; }
.badge--cerrado { background: var(--success-bg); color: #15803D; }
.badge--cerrado.badge--dot::before { background: #22c55e; }
.badge--descartado { background: #F3F4F6; color: #6B7280; }
.badge--descartado.badge--dot::before { background: #6b7280; }
.web-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Stars Rating */
.stars { color: #eab308; font-size: 14px; }
.star-empty { opacity: 0.25; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  width: 90%; max-width: 680px; max-height: 85vh;
  overflow-y: auto;
  animation: modalIn 0.25s ease;
}
.modal--lg { max-width: 900px; }
.modal--sm { max-width: 480px; }
.modal__header {
  padding: 20px 24px 16px;
  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: 2;
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}
.modal__body { padding: 24px; }
.modal__footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Toasts ---------- */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 10000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--border-radius); padding: 14px 20px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--text-primary);
  min-width: 280px; max-width: 420px;
  animation: toastIn 0.3s ease;
  position: relative; overflow: hidden;
}
.toast--success { border-left: 4px solid var(--success); }
.toast--error { border-left: 4px solid var(--danger); }
.toast--warning { border-left: 4px solid var(--warning); }
.toast--info { border-left: 4px solid var(--info); }
.toast.toast-exit { animation: toastOut 0.3s ease forwards; }
.toast__progress {
  position: absolute; bottom: 0; left: 0; height: 3px;
  border-radius: 0 0 0 var(--border-radius);
  animation: toastProgress 4s linear forwards;
}
.toast--success .toast__progress { background: var(--success); }
.toast--error .toast__progress { background: var(--danger); }
.toast--warning .toast__progress { background: var(--warning); }
.toast--info .toast__progress { background: var(--info); }

/* ---------- Spinner ---------- */
.spinner {
  width: 24px; height: 24px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto;
}
.spinner--sm { width: 16px; height: 16px; border-width: 2px; }
.spinner--lg { width: 40px; height: 40px; }
.loading-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(248,250,252,0.8); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 10;
}

/* ---------- Progress Bar ---------- */
.progress-bar {
  height: 8px; background: var(--bg-secondary);
  border-radius: 4px; overflow: hidden;
}
.progress-bar__fill {
  height: 100%; background: var(--accent-gradient);
  border-radius: 4px; transition: width 0.5s ease;
  position: relative;
}

/* ---------- Skeleton ---------- */
.skeleton { background: var(--bg-secondary); border-radius: var(--border-radius-sm); animation: skeleton-pulse 1.5s ease infinite; }
.skeleton-text { height: 14px; width: 100%; margin-bottom: 8px; }
.skeleton-text-sm { height: 10px; width: 60%; }
.skeleton-circle { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-card { height: 120px; width: 100%; }
.skeleton-row { height: 48px; width: 100%; margin-bottom: 4px; }

.pipeline-selector { display: flex; gap: 6px; flex-wrap: wrap; }
.pipeline-selector button,
.pipeline-selector span,
.pipeline-selector .pipeline-option {
  padding: 6px 14px; border-radius: var(--border-radius-full);
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: var(--transition-fast);
  display: inline-flex; align-items: center;
}
.pipeline-selector button.active,
.pipeline-selector span.active,
.pipeline-selector .pipeline-option.active { background: var(--accent-50); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.pipeline-selector button:hover:not(.active),
.pipeline-selector span:hover:not(.active),
.pipeline-selector .pipeline-option:hover:not(.active) { background: var(--bg-secondary); }
.pipeline-selector .pipeline-option--add { border-color: rgba(22,163,74,0.3); color: var(--success); }
.pipeline-selector .pipeline-option--add:hover { background: var(--success-bg); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); }
.tabs .tab-btn {
  padding: 10px 20px; background: none; border: none;
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  cursor: pointer; position: relative; transition: var(--transition-fast);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tabs .tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .tab-btn:hover:not(.active) { color: var(--text-primary); }

/* ---------- Section Headers ---------- */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.section-header h2 { font-size: 1.4rem; color: var(--text-primary); }

/* ---------- Filters Row ---------- */
.filters-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters-row .form-input, .filters-row .form-select { padding: 7px 12px; font-size: 13px; max-width: 200px; }

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state__icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 15px; margin: 8px 0; }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 6px; padding: 16px 0; }
.pagination button {
  padding: 6px 12px; border: 1px solid var(--border);
  border-radius: var(--border-radius-sm); background: var(--bg-card);
  color: var(--text-secondary); font-size: 13px; cursor: pointer;
  transition: var(--transition-fast);
}
.pagination button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination button:hover:not(.active) { background: var(--bg-secondary); }

/* ---------- Search Form ---------- */
.search-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.search-form--full { grid-column: 1 / -1; }

/* Recent Searches */
.recent-search-list { list-style: none; }
.recent-search-item {
  padding: 10px 14px; border-radius: var(--border-radius-sm);
  cursor: pointer; transition: var(--transition-fast);
  display: flex; align-items: center; gap: 8px;
  color: var(--text-secondary); font-size: 14px;
}
.recent-search-item:hover { background: var(--bg-secondary); color: var(--text-primary); }

/* ---------- Email Preview ---------- */
.email-preview-content {
  background: #fff; color: #333; padding: 24px;
  border-radius: var(--border-radius-sm);
  font-family: inherit; line-height: 1.6;
}

/* ---------- Prompt Section ---------- */
.prompt-section {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px; line-height: 1.5;
  padding: 16px; border-radius: var(--border-radius-sm);
  background: var(--bg-secondary);
}
.prompt-section .section-brand { color: var(--accent); }
.prompt-section .section-data { color: var(--info); }
.prompt-section .section-style { color: var(--warning); }
.prompt-section .section-instruction { color: var(--success); }

/* ---------- Tech Badge ---------- */
.tech-badge {
  display: inline-flex; padding: 3px 10px; border-radius: 6px;
  font-size: 0.72rem; font-weight: 600;
  background: var(--bg-secondary); color: var(--text-secondary);
}
.tech-badge--framework { background: var(--info-bg); color: #1D4ED8; }
.tech-badge--cms { background: #F3E8FF; color: #7C3AED; }
.tech-badge--ecommerce { background: var(--warning-bg); color: #A16207; }
.tech-badge--old { background: var(--danger-bg); color: #B91C1C; }

/* ---------- Config Section ---------- */
.config-section { margin-bottom: 24px; }
.config-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: 12px; color: var(--text-primary); }
.config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }

/* ---------- Pricing Editor ---------- */
.pricing-editor { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.pricing-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--border-radius); padding: 20px;
}
.pricing-card .discount-badge {
  display: inline-block; padding: 2px 8px;
  border-radius: var(--border-radius-full);
  font-size: 0.7rem; font-weight: 600;
}
.pricing-card .discount-badge--gift { background: var(--success-bg); color: var(--success); }
.pricing-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }
.pricing-toggle-label { font-size: 13px; color: var(--text-primary); }

/* ---------- Promo Counter ---------- */
.promo-counter__value { font-size: 3.5rem; font-weight: 800; background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* ---------- Detail Grid ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-item { display: flex; flex-direction: column; gap: 4px; }
.detail-item__label { font-size: 0.73rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.detail-item__value { font-size: 0.9rem; color: var(--text-primary); }
.detail-item--full { grid-column: 1 / -1; }
.horario-grid { display: grid; grid-template-columns: 1fr; gap: 4px; }
.horario-day { display: flex; gap: 12px; align-items: center; font-size: 0.82rem; padding: 6px 0; border-bottom: 1px solid var(--border-light); }
.horario-day__name { width: 90px; font-weight: 600; color: var(--text-primary); }
.horario-day__hours { color: var(--text-secondary); }

/* ---------- Contact Bar & Chips ---------- */
.contact-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.contact-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: var(--border-radius-full);
  font-size: 0.75rem; font-weight: 500;
  cursor: pointer; transition: var(--transition-fast);
}
.contact-chip--email { background: var(--accent-50); color: var(--accent); }
.contact-chip--email:hover { background: var(--accent-100); }
.contact-chip--whatsapp { background: #F0FDF4; color: #16A34A; }
.contact-chip--whatsapp:hover { background: #DCFCE7; }
.contact-chip--missing { background: var(--bg-secondary); color: var(--text-muted); cursor: default; }
.contact-chip--danger { background: var(--danger-bg); color: var(--danger); }

/* ---------- Suggestions Dropdown ---------- */
.suggestions-dropdown {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  max-height: 220px; overflow-y: auto;
  box-shadow: var(--shadow-lg); z-index: 20;
}
.suggestions-dropdown li {
  padding: 10px 14px; cursor: pointer;
  transition: var(--transition-fast);
  font-size: 14px; color: var(--text-primary);
  list-style: none;
}
.suggestions-dropdown li:hover { background: var(--bg-secondary); }

/* ---------- Kanban Board ---------- */
.kanban-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 0; margin-bottom: 8px;
}
.kanban-toolbar__search {
  flex: 1; min-width: 200px; max-width: 360px;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--border); border-radius: var(--border-radius-sm);
  background: var(--bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.868-3.834zm-5.242.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat 12px center;
  font-size: 0.84rem; color: var(--text-primary);
  transition: var(--transition-fast);
}
.kanban-toolbar__search:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(241,104,30,0.12);
}
.kanban-toolbar__search::placeholder { color: var(--text-muted); }
.kanban-toolbar__select {
  padding: 9px 12px; min-width: 170px;
  border: 1px solid var(--border); border-radius: var(--border-radius-sm);
  background: var(--bg-card); font-size: 0.82rem; color: var(--text-primary);
  cursor: pointer; transition: var(--transition-fast);
}
.kanban-toolbar__select:focus {
  outline: none; border-color: var(--accent);
}
.kanban-board {
  display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 20px;
  min-height: 60vh;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.kanban-board::-webkit-scrollbar { height: 8px; }
.kanban-board::-webkit-scrollbar-track { background: transparent; }
.kanban-board::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.kanban-column {
  min-width: 260px; max-width: 290px; flex-shrink: 0;
  background: var(--bg-secondary); border-radius: 12px;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 220px);
  border: 1px solid var(--border-light, #f1f5f9);
  transition: box-shadow 0.2s;
}
.kanban-column:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.kanban-column__header {
  padding: 12px 14px; font-size: 0.8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  position: sticky; top: 0; z-index: 2;
  background: inherit; border-radius: 12px 12px 0 0;
}
.kanban-column__count {
  font-size: 0.7rem; font-weight: 700;
  padding: 2px 9px; border-radius: var(--border-radius-full);
  background: var(--bg-card);
  color: var(--text-secondary);
  min-width: 24px; text-align: center;
}
.kanban-column__cards {
  flex: 1; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.kanban-column__cards::-webkit-scrollbar { width: 4px; }
.kanban-column__cards::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.kanban-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px;
  cursor: grab; transition: var(--transition-fast);
  border-left: 3px solid transparent;
}
.kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kanban-card.dragging { opacity: 0.5; transform: rotate(2deg); }
.kanban-card.kanban-card--highlight {
  animation: kanbanHighlight 2s ease-out;
  box-shadow: 0 0 0 2px var(--accent), var(--shadow-md);
}
@keyframes kanbanHighlight {
  0% { box-shadow: 0 0 0 3px var(--accent), 0 0 20px rgba(241,104,30,0.3); transform: scale(1.02); }
  100% { box-shadow: 0 0 0 0px transparent; transform: scale(1); }
}
.kanban-card__name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.kanban-card__city { font-size: 0.72rem; color: var(--text-secondary); }
.kanban-card__meta { font-size: 0.68rem; color: var(--text-muted); margin-top: 8px; }

/* Kanban status colors */
.kanban-column[data-status="nuevo"] .kanban-column__header { border-bottom-color: #3b82f6; }
.kanban-column[data-status="nuevo"] .kanban-card { border-left-color: #3b82f6; }
.kanban-column[data-status="contactado"] .kanban-column__header { border-bottom-color: #f59e0b; }
.kanban-column[data-status="contactado"] .kanban-card { border-left-color: #f59e0b; }
.kanban-column[data-status="respondido"] .kanban-column__header { border-bottom-color: #8b5cf6; }
.kanban-column[data-status="respondido"] .kanban-card { border-left-color: #8b5cf6; }
.kanban-column[data-status="interesado"] .kanban-column__header { border-bottom-color: #f97316; }
.kanban-column[data-status="interesado"] .kanban-card { border-left-color: #f97316; }
.kanban-column[data-status="propuesta"] .kanban-column__header { border-bottom-color: #ec4899; }
.kanban-column[data-status="propuesta"] .kanban-card { border-left-color: #ec4899; }
.kanban-column[data-status="negociacion"] .kanban-column__header { border-bottom-color: #06b6d4; }
.kanban-column[data-status="negociacion"] .kanban-card { border-left-color: #06b6d4; }
.kanban-column[data-status="cerrado"] .kanban-column__header { border-bottom-color: #22c55e; }
.kanban-column[data-status="cerrado"] .kanban-card { border-left-color: #22c55e; }
.kanban-column[data-status="descartado"] .kanban-column__header { border-bottom-color: #6b7280; }
.kanban-column[data-status="descartado"] .kanban-card { border-left-color: #6b7280; }

/* Kanban reason modal — hidden overlay, shown with .active */
.kanban-reason-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}
.kanban-reason-modal.active {
  display: flex;
}
.kanban-reason-modal__box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 28px;
  box-shadow: var(--shadow-xl);
  max-width: 480px;
  width: 90%;
  animation: modalSlideIn 0.2s ease-out;
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* View Toggle (table/kanban) */
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--border-radius-sm); overflow: hidden; }
.view-toggle button {
  padding: 6px 14px; background: var(--bg-card); border: none;
  color: var(--text-secondary); font-size: 13px; cursor: pointer;
  transition: var(--transition-fast);
}
.view-toggle button.active { background: var(--accent); color: #fff; }

/* ---------- Email History ---------- */
.email-history-item {
  padding: 14px; border-bottom: 1px solid var(--border-light);
  cursor: pointer; transition: var(--transition-fast);
}
.email-history-item:hover { background: var(--bg-secondary); }
.email-iframe-wrapper { border: 1px solid var(--border); border-radius: var(--border-radius-sm); overflow: hidden; background: #fff; }
.email-iframe-wrapper iframe { width: 100%; border: none; min-height: 300px; }

/* ---------- Premium Inbox / Team Forum ---------- */
.inbox-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-height) - 40px);
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.02);
  border: 1px solid rgba(226, 232, 240, 0.8);
  overflow: hidden;
  position: relative;
}

.inbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  z-index: 10;
}

.inbox-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(90deg, #0F172A, #334155);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.inbox-header .section-subtitle {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: #64748B;
}

.inbox-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  background: #F8FAFC;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.inbox-tab {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748B;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.inbox-tab:hover {
  background: rgba(226, 232, 240, 0.5);
  color: #0F172A;
}

.inbox-tab.active {
  background: #fff;
  color: #f1681e;
  border-color: rgba(241, 104, 30, 0.2);
  box-shadow: 0 2px 8px rgba(241, 104, 30, 0.1);
}

.inbox-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: url('data:image/svg+xml;utf8,<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="%23CBD5E1" fill-opacity="0.4"/></svg>') repeat;
}

.inbox-date-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inbox-date-divider {
  text-align: center;
  margin: 10px 0;
  position: relative;
}

.inbox-date-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(226, 232, 240, 0.8), transparent);
  z-index: 0;
}

.inbox-date-divider span {
  position: relative;
  background: #f8fafc;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #94A3B8;
  border-radius: 12px;
  z-index: 1;
  border: 1px solid rgba(226, 232, 240, 0.6);
}

.inbox-msg {
  display: flex;
  gap: 12px;
  max-width: 85%;
  animation: slideUpIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.inbox-msg--me {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.inbox-msg--system {
  align-self: center;
  max-width: 90%;
}

.inbox-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 2px solid #fff;
}

.inbox-bubble {
  background: #fff;
  padding: 14px 18px;
  border-radius: 16px 16px 16px 4px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.02);
  border: 1px solid rgba(226, 232, 240, 0.6);
  position: relative;
  min-width: 120px;
}

.inbox-msg--me .inbox-bubble {
  background: linear-gradient(135deg, #f1681e, #ea580c);
  color: #fff;
  border-radius: 16px 16px 4px 16px;
  border: none;
  box-shadow: 0 4px 16px rgba(241, 104, 30, 0.2);
}

.inbox-msg--system .inbox-bubble {
  background: rgba(241, 245, 249, 0.8);
  border: 1px dashed rgba(203, 213, 225, 0.8);
  border-radius: 12px;
  text-align: center;
  color: #64748B;
  font-size: 0.85rem;
  padding: 10px 16px;
}

.inbox-msg-author {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748B;
  margin-bottom: 4px;
}

.inbox-msg--me .inbox-msg-author {
  display: none;
}

.inbox-msg-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #0F172A;
  white-space: pre-wrap;
  word-break: break-word;
}

.inbox-msg--me .inbox-msg-text {
  color: #fff;
}

.inbox-msg--system .inbox-msg-text {
  color: #64748B;
}

.inbox-lead-chip {
  display: inline-flex;
  align-items: center;
  background: rgba(241, 104, 30, 0.1);
  color: #f1681e;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid rgba(241, 104, 30, 0.2);
}

.inbox-msg--me .inbox-lead-chip {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-color: rgba(255,255,255,0.3);
}

.inbox-msg--system.inbox-msg--me .inbox-lead-chip {
  background: rgba(241, 104, 30, 0.1);
  color: #f1681e;
  border-color: rgba(241, 104, 30, 0.2);
}

.inbox-lead-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(241, 104, 30, 0.15);
}

.inbox-msg-time {
  font-size: 0.65rem;
  color: #94A3B8;
  text-align: right;
  margin-top: 6px;
  font-weight: 500;
}

.inbox-msg--me .inbox-msg-time {
  color: rgba(255, 255, 255, 0.8);
}

.inbox-compose {
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inbox-compose-options {
  display: flex;
  gap: 12px;
}

.inbox-compose-options select {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.75rem;
  color: #475569;
  outline: none;
  transition: border-color 0.2s;
}
.inbox-compose-options select:focus {
  border-color: #f1681e;
}

.inbox-compose-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.inbox-input {
  flex: 1;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: all 0.2s;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.01);
  max-height: 120px;
}

.inbox-input:focus {
  border-color: #f1681e;
  box-shadow: 0 0 0 3px rgba(241, 104, 30, 0.1);
}

@keyframes slideUpIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* User Chip (for tables) */
.user-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem;
}
.user-chip__avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #fff;
}

/* ---------- LOGIN (kept dramatic/dark) ---------- */
.login-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #080b14 0%, #131929 50%, #0e1420 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.login-overlay::before, .login-overlay::after {
  content: ''; position: absolute; border-radius: 50%;
  filter: blur(100px); opacity: 0.4;
}
.login-overlay::before {
  width: 600px; height: 600px; top: -200px; right: -100px;
  background: radial-gradient(circle, rgba(241,104,30,0.4) 0%, transparent 70%);
  animation: loginOrb1 20s ease infinite;
}
.login-overlay::after {
  width: 500px; height: 500px; bottom: -150px; left: -100px;
  background: radial-gradient(circle, rgba(255,138,76,0.3) 0%, transparent 70%);
  animation: loginOrb2 25s ease infinite;
}
.login-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%; max-width: 420px;
  backdrop-filter: blur(32px); -webkit-backdrop-filter: blur(32px);
  position: relative; z-index: 1;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
.login-title { text-align: center; font-size: 2.4rem; font-weight: 800; color: #fff; margin: 0 0 4px; }
.login-gradient-line {
  height: 3px; width: 48px; margin: 12px auto 16px;
  background: var(--accent-gradient);
  border-radius: 2px;
}
.login-subtitle { text-align: center; font-size: 0.85rem; color: rgba(255,255,255,0.5); margin: 0 0 28px; }
.login-card .form-group { margin-bottom: 16px; }
.login-card label { color: rgba(255,255,255,0.7); font-size: 13px; font-weight: 500; display: block; margin-bottom: 6px; }
.login-card .form-input {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: #fff;
}
.login-card .form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(241,104,30,0.2); }
.login-card .form-input::placeholder { color: rgba(255,255,255,0.3); }
.login-error { color: #ef4444; font-size: 13px; text-align: center; margin-top: 8px; }
.login-footer { text-align: center; font-size: 0.72rem; color: rgba(255,255,255,0.3); margin-top: 24px; }
.login-logo { text-align: center; margin-bottom: 8px; }

/* ---------- Animations ---------- */
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes rowFadeIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }
@keyframes toastProgress { from { width: 100%; } to { width: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes skeleton-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes loginOrb1 { 0%,100% { transform: translate(0,0); } 33% { transform: translate(80px,40px); } 66% { transform: translate(-40px,80px); } }
@keyframes loginOrb2 { 0%,100% { transform: translate(0,0); } 33% { transform: translate(-60px,-30px); } 66% { transform: translate(40px,-60px); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  #app { grid-template-columns: var(--sidebar-collapsed-width) 1fr; }
  .sidebar { width: var(--sidebar-collapsed-width); }
  .sidebar .nav-text,
  .sidebar .sidebar__subtitle,
  .sidebar .sidebar__brand,
  .sidebar .sidebar__user-info,
  .sidebar .sidebar__user-name,
  .sidebar .sidebar__user-role,
  .sidebar .sidebar__section-label,
  .sidebar .ai-usage__label,
  .sidebar .sidebar__logout,
  .sidebar .badge-count { display: none !important; }
  .sidebar .sidebar__header { justify-content: center; padding: 16px 0; }
  .sidebar .sidebar__logo { margin: 0 auto; }
  .sidebar .sidebar__toggle { display: none; }
  .sidebar .nav-link { justify-content: center; padding: 10px; }
  .sidebar .nav-icon { margin: 0; }
  .sidebar .sidebar__user { justify-content: center; padding: 12px 0; }
  .sidebar .sidebar__ai-widget { padding: 8px; }
  .sidebar .nav-badge { position: absolute; top: 4px; right: 4px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .search-form { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-height) 1fr;
    grid-template-areas: "topbar" "content";
  }
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
    box-shadow: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  .sidebar .nav-text,
  .sidebar .sidebar__subtitle,
  .sidebar .sidebar__brand,
  .sidebar .sidebar__user-info,
  .sidebar .sidebar__user-name,
  .sidebar .sidebar__user-role,
  .sidebar .sidebar__section-label,
  .sidebar .ai-usage__label,
  .sidebar .sidebar__logout,
  .sidebar .badge-count { display: revert !important; }
  .sidebar .sidebar__header { justify-content: revert; padding: 20px 20px 16px; }
  .sidebar .nav-link { justify-content: revert; padding: 9px 12px; }
  .sidebar .sidebar__user { justify-content: revert; padding: 16px 20px; }
  .sidebar .sidebar__toggle { display: none; }
  .topbar__menu-btn { display: flex; }
  .main-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .modal { width: 95%; }
  .kanban-board { padding-bottom: 80px; }
  .kanban-column { min-width: 240px; max-width: 260px; }
  .kanban-toolbar { flex-direction: column; align-items: stretch; }
  .kanban-toolbar__search { max-width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .inbox-container { grid-template-columns: 1fr; height: auto; }
  .inbox-list { max-height: 200px; }
}

@media (max-width: 480px) {
  .login-card { padding: 32px 24px; margin: 16px; }
  .main-content { padding: 12px; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .toast-container { display: none !important; }
  #app { display: block; }
  .main-content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}
