/* ═══════════════════════════════════════════════════════════════
   HireYT — Enterprise Design System v3
   Brand: Orange #E8621A · Grid: 4px base · Font: Inter 14px
   Dark mode: class="dark" on <html> OR prefers-color-scheme
   ═══════════════════════════════════════════════════════════════ */

/* ── Design Tokens (Light) ──────────────────────────────────── */
:root {
  /* Brand */
  --brand:        #E8621A;
  --brand-dark:   #c45013;
  --brand-hover:  #d4561A;
  --brand-light:  #fff4ee;
  --brand-mid:    rgba(232,98,26,0.12);
  --brand-glow:   rgba(232,98,26,0.18);

  /* Surfaces */
  --bg:           #f4f5f7;
  --surface:      #ffffff;
  --surface2:     #f9fafb;
  --surface3:     #f3f4f6;
  --surface4:     #e9eaec;

  /* Borders */
  --border:       #e2e4e9;
  --border-light: #edeef2;
  --border-hover: #c8cad2;
  --border-focus: var(--brand);

  /* Text */
  --text:         #0f1117;
  --text2:        #374151;
  --text-muted:   #6b7280;
  --text-light:   #9ca3af;
  --text-xlight:  #d1d5db;

  /* Semantic */
  --green:        #059669;  --green-dark:  #047857; --green-bg:  #ecfdf5; --green-border: #a7f3d0;
  --red:          #dc2626;  --red-dark:    #b91c1c; --red-bg:    #fef2f2; --red-border:   #fecaca;
  --amber:        #d97706;  --amber-dark:  #b45309; --amber-bg:  #fffbeb; --amber-border: #fde68a;
  --blue:         #2563eb;  --blue-dark:   #1d4ed8; --blue-bg:   #eff6ff; --blue-border:  #bfdbfe;
  --purple:       #7c3aed;  --purple-dark: #6d28d9; --purple-bg: #f5f3ff; --purple-border:#ddd6fe;
  --cyan:         #0891b2;  --cyan-dark:   #0e7490; --cyan-bg:   #ecfeff; --cyan-border:  #a5f3fc;
  --teal:         #0d9488;  --teal-bg:     #f0fdfa;

  /* Sidebar */
  --sidebar-bg:     #111827;
  --sidebar-bg2:    #1a2332;
  --sidebar-text:   #9ca3af;
  --sidebar-hover:  rgba(255,255,255,0.06);
  --sidebar-active: rgba(232,98,26,0.18);
  --sidebar-active-text: #fdba74;
  --sidebar-active-border: var(--brand);
  --sidebar-section: #475569;
  --sidebar-border: rgba(255,255,255,0.05);

  /* Layout */
  --sidebar-w:    256px;
  --header-h:     56px;

  /* Radius */
  --r-xs:  4px;
  --r-sm:  6px;
  --r:     10px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
  --shadow:     0 1px 4px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:  0 8px 28px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.05);
  --shadow-xl:  0 20px 60px rgba(0,0,0,0.14), 0 8px 16px rgba(0,0,0,0.06);

  /* Typography */
  --font:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

  /* Motion */
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:    cubic-bezier(0, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:    100ms;
  --dur:         180ms;
  --dur-slow:    280ms;

  /* Compat aliases — preserves existing code that uses old names */
  --accent:       var(--brand);
  --accent-hover: var(--brand-dark);
  --accent-light: var(--brand-light);
  --accent-glow:  var(--brand-glow);
  --radius:       var(--r-md);
  --radius-sm:    var(--r-sm);
  --radius-xs:    var(--r-xs);
}

/* ── Dark Mode ──────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) { :root { --ds-dark: 1; } }
html.dark, @media (prefers-color-scheme: dark) {
  :root {
    --bg:           #0d0f13;
    --surface:      #161b22;
    --surface2:     #1c2128;
    --surface3:     #21262d;
    --surface4:     #2d333b;
    --border:       #30363d;
    --border-light: #21262d;
    --border-hover: #484f58;
    --text:         #e6edf3;
    --text2:        #c9d1d9;
    --text-muted:   #8b949e;
    --text-light:   #6e7681;
    --text-xlight:  #3d444d;
    --brand-light:  rgba(232,98,26,0.15);
    --brand-mid:    rgba(232,98,26,0.2);
    --green-bg:     rgba(5,150,105,0.15);  --green-border: rgba(52,211,153,0.3);
    --red-bg:       rgba(220,38,38,0.15);  --red-border:   rgba(252,165,165,0.3);
    --amber-bg:     rgba(217,119,6,0.15);  --amber-border: rgba(253,230,138,0.3);
    --blue-bg:      rgba(37,99,235,0.15);  --blue-border:  rgba(147,197,253,0.3);
    --purple-bg:    rgba(124,58,237,0.15); --purple-border:rgba(196,181,253,0.3);
    --cyan-bg:      rgba(8,145,178,0.15);  --cyan-border:  rgba(103,232,249,0.3);
    --shadow:       0 1px 4px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md:    0 4px 12px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.2);
    --shadow-lg:    0 8px 28px rgba(0,0,0,0.5), 0 4px 8px rgba(0,0,0,0.2);
  }
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 14px; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--brand); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--brand-dark); }
::selection { background: var(--brand-light); color: var(--brand-dark); }
img, svg { display: block; max-width: 100%; }

/* ── Focus / Accessibility ──────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.skip-link {
  position: absolute; top: -48px; left: 0;
  background: var(--brand); color: #fff;
  padding: 8px 16px; border-radius: 0 0 var(--r) 0;
  font-weight: 700; font-size: 13px; z-index: 9999;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 0; }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeIn    { from { opacity:0; transform:translateY(6px) } to { opacity:1; transform:translateY(0) } }
@keyframes slideIn   { from { opacity:0; transform:translateX(100%) } to { opacity:1; transform:translateX(0) } }
@keyframes slideUp   { from { transform:translateY(100%); opacity:0 } to { transform:translateY(0); opacity:1 } }
@keyframes scaleIn   { from { opacity:0; transform:scale(.96) } to { opacity:1; transform:scale(1) } }
@keyframes shimmer   { 0% { background-position: -200% 0 } 100% { background-position: 200% 0 } }
@keyframes spin      { to { transform:rotate(360deg) } }
@keyframes pulse     { 0%,100%{opacity:1} 50%{opacity:.5} }
.animate-in { animation: fadeIn var(--dur-slow) var(--ease) both; }

/* ── App Shell ──────────────────────────────────────────────── */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  border-right: 1px solid var(--sidebar-border);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.sidebar-logo {
  padding: 16px 18px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}
.sidebar-logo svg { flex-shrink: 0; }

.sidebar-section {
  padding: 20px 18px 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--sidebar-section);
  font-weight: 600;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--sidebar-text);
  transition: all var(--dur) var(--ease);
  border-left: 3px solid transparent;
  margin: 1px 8px 1px 0;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  user-select: none;
}
.sidebar-item:hover {
  background: var(--sidebar-hover);
  color: #e2e8f0;
}
.sidebar-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
  border-left-color: var(--sidebar-active-border);
  font-weight: 600;
}
.sidebar-item .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}
.sidebar-item.active .icon,
.sidebar-item:hover .icon { opacity: 1; }

.sidebar-badge {
  margin-left: auto;
  background: var(--brand);
  color: #fff;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

/* ── Main Area ──────────────────────────────────────────────── */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  min-width: 0;
}

/* ── Header ─────────────────────────────────────────────────── */
.header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-search { flex: 1; max-width: 400px; }
.header-search input {
  width: 100%;
  padding: 7px 12px 7px 34px;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  font-size: 13.5px;
  background: var(--surface2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8.5' cy='8.5' r='5.5'/%3E%3Cpath d='M15 15l-3-3'/%3E%3C/svg%3E") 9px center / 16px no-repeat;
  color: var(--text);
  transition: all var(--dur) var(--ease);
  font-family: var(--font);
}
.header-search input:focus {
  outline: none;
  border-color: var(--brand);
  background-color: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.header-search input::placeholder { color: var(--text-light); }

.header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }

.header-icon-btn {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  border: none; background: none;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  position: relative;
}
.header-icon-btn:hover { background: var(--surface2); color: var(--text); }
.header-icon-btn .notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px;
  border-radius: 50%; background: var(--brand);
  border: 2px solid var(--surface);
}

.header-divider { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }

.header-user {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 5px 8px;
  border-radius: var(--r-sm);
  transition: all var(--dur) var(--ease);
}
.header-user:hover { background: var(--surface2); }
.header-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #ff8c42);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
#header-name { font-size: 13px; font-weight: 600; color: var(--text2); }
#header-role { font-size: 11px; color: var(--text-muted); }

/* ── Content ─────────────────────────────────────────────────── */
.content { flex: 1; overflow-y: auto; padding: 24px; }

/* ── Page Headers ───────────────────────────────────────────── */
.list-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 20px; gap: 12px;
}
.list-header h2 {
  font-size: 20px; font-weight: 800;
  letter-spacing: -0.4px; color: var(--text);
}
.list-meta { color: var(--text-muted); font-size: 12px; }

/* ── Stat Cards ─────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  transition: all var(--dur-slow) var(--ease);
  animation: fadeIn var(--dur-slow) var(--ease) both;
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--brand);
  opacity: 0; transition: opacity var(--dur) var(--ease);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card:hover::after { opacity: 1; }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -0.5px; color: var(--text); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-delta { font-size: 11px; margin-top: 6px; display: flex; align-items: center; gap: 3px; }
.stat-delta.up   { color: var(--green); }
.stat-delta.down { color: var(--red); }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  padding: 20px;
  transition: box-shadow var(--dur-slow) var(--ease);
  animation: fadeIn var(--dur-slow) var(--ease) both;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.card-title { font-size: 14px; font-weight: 700; color: var(--text); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  border: 1.5px solid transparent;
  border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600;
  font-family: var(--font); cursor: pointer;
  transition: all var(--dur) var(--ease);
  white-space: nowrap; text-decoration: none;
  user-select: none;
  line-height: 1.4;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--brand); color: #fff;
  border-color: var(--brand);
  box-shadow: 0 1px 3px rgba(232,98,26,0.25);
}
.btn-primary:hover {
  background: var(--brand-dark); border-color: var(--brand-dark);
  box-shadow: 0 4px 12px rgba(232,98,26,0.35);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--surface); color: var(--text2);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--surface2);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}
.btn-danger {
  background: var(--red); color: #fff;
  border-color: var(--red);
  box-shadow: 0 1px 3px rgba(220,38,38,0.25);
}
.btn-danger:hover {
  background: var(--red-dark);
  box-shadow: 0 4px 12px rgba(220,38,38,0.35);
  transform: translateY(-1px);
}
.btn-ghost {
  background: none; color: var(--text-muted);
  border-color: transparent; padding: 6px 10px;
  border-radius: var(--r-xs);
}
.btn-ghost:hover { color: var(--brand); background: var(--brand-light); }
.btn-sm  { padding: 5px 10px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn-lg  { padding: 10px 22px; font-size: 14.5px; }
.btn-group { display: flex; gap: 8px; align-items: center; }
.btn-icon { padding: 7px; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text2); margin-bottom: 6px;
}
.form-label.required::after {
  content: ' *'; color: var(--red); font-weight: 700;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 14px; font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  transition: all var(--dur) var(--ease);
  line-height: 1.5;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.form-input::placeholder { color: var(--text-light); }
.form-textarea { min-height: 80px; resize: vertical; }
.form-select { cursor: pointer; }
.form-input.field-error, .form-select.field-error, .form-textarea.field-error {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.1) !important;
}
.form-input.field-ok, .form-select.field-ok, .form-textarea.field-ok {
  border-color: var(--green) !important;
  box-shadow: 0 0 0 3px rgba(5,150,105,0.08) !important;
}
.field-hint { font-size: 12px; margin-top: 4px; min-height: 16px; transition: all var(--dur); }
.field-hint.error { color: var(--red); }
.field-hint.ok    { color: var(--green); }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-helper { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Data Table ─────────────────────────────────────────────── */
.list-filters {
  display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center;
}
.list-filters select, .list-filters input {
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px; background: var(--surface);
  color: var(--text); font-family: var(--font);
  transition: border-color var(--dur);
}
.list-filters select:focus, .list-filters input:focus {
  border-color: var(--brand); outline: none;
}

.data-table-wrap { overflow-x: auto; border-radius: var(--r-md); box-shadow: var(--shadow); }
.data-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--surface); border-radius: var(--r-md);
  overflow: hidden;
}
.data-table thead th {
  padding: 10px 14px;
  text-align: left; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); background: var(--surface2);
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap; cursor: pointer; user-select: none;
  transition: background var(--dur-fast);
}
.data-table thead th:hover { background: var(--surface3); color: var(--text2); }
.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13.5px; transition: background var(--dur-fast);
  max-width: 220px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  color: var(--text2);
}
.data-table tbody td strong, .data-table tbody td b { color: var(--text); }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover td { background: var(--brand-light); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 650;
  white-space: nowrap; letter-spacing: 0.1px;
  border: 1px solid transparent;
}
.badge-green  { background: var(--green-bg);  color: var(--green-dark);  border-color: var(--green-border); }
.badge-red    { background: var(--red-bg);    color: var(--red-dark);    border-color: var(--red-border); }
.badge-amber  { background: var(--amber-bg);  color: var(--amber-dark);  border-color: var(--amber-border); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue-dark);   border-color: var(--blue-border); }
.badge-purple { background: var(--purple-bg); color: var(--purple-dark); border-color: var(--purple-border); }
.badge-gray   { background: var(--surface3);  color: var(--text-muted);  border-color: var(--border); }
.badge-cyan   { background: var(--cyan-bg);   color: var(--cyan-dark);   border-color: var(--cyan-border); }
.badge-brand  { background: var(--brand-light); color: var(--brand-dark); border-color: rgba(232,98,26,0.3); }

/* Status dot prefix */
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge.no-dot::before { display: none; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center;
  justify-content: space-between; padding: 14px 0;
}
.pagination-info { font-size: 12.5px; color: var(--text-muted); }
.pagination-btns { display: flex; gap: 4px; }
.pagination-btns button {
  padding: 5px 11px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-xs);
  background: var(--surface);
  cursor: pointer; font-size: 12.5px;
  color: var(--text2); font-family: var(--font);
  transition: all var(--dur-fast);
}
.pagination-btns button:hover    { background: var(--surface2); border-color: var(--border-hover); }
.pagination-btns button.active   { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination-btns button:disabled { opacity: 0.35; cursor: default; }

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs {
  display: flex; border-bottom: 2px solid var(--border);
  margin-bottom: 20px; gap: 2px;
}
.tab {
  padding: 9px 16px;
  font-size: 13.5px; font-weight: 600;
  color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--dur); border-radius: var(--r-xs) var(--r-xs) 0 0;
}
.tab:hover { color: var(--text2); background: var(--surface2); }
.tab.active {
  color: var(--brand); border-bottom-color: var(--brand);
  background: var(--brand-light);
}

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 20px; overflow-y: auto;
  animation: fadeIn 150ms var(--ease);
}
.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  width: 100%; max-width: 700px;
  border: 1px solid var(--border);
  animation: scaleIn var(--dur-slow) var(--ease-bounce);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
.modal-close {
  width: 28px; height: 28px; border-radius: var(--r-xs);
  border: none; background: var(--surface2);
  color: var(--text-muted); font-size: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--dur-fast); flex-shrink: 0;
}
.modal-close:hover { background: var(--surface3); color: var(--text); }
.modal-body {
  padding: 24px;
  max-height: 70vh; overflow-y: auto;
}
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ── Toast ───────────────────────────────────────────────────── */
.toast-container {
  position: fixed; top: 64px; right: 20px;
  z-index: 2000; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn var(--dur-slow) var(--ease-bounce);
  max-width: 360px; min-width: 240px;
  border: 1px solid transparent;
}
.toast-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.toast-error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.toast-info    { background: var(--surface); color: var(--text2); border-color: var(--border); }
.toast-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }

/* ── Timeline ────────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute;
  left: 8px; top: 6px; bottom: 6px;
  width: 1.5px; background: var(--border);
  border-radius: 2px;
}
.timeline-item {
  position: relative; padding-bottom: 18px;
  animation: fadeIn var(--dur-slow) var(--ease) both;
}
.timeline-item::before {
  content: ''; position: absolute;
  left: -23px; top: 5px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--brand);
  border: 2.5px solid var(--surface);
  box-shadow: 0 0 0 2px var(--brand-light);
}
.timeline-item .time { font-size: 11px; color: var(--text-light); }
.timeline-item .desc { font-size: 13.5px; margin-top: 2px; color: var(--text2); }

/* ── Skeleton ────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--border-light) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-sm);
}

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 52px 24px; color: var(--text-muted);
}
.empty-state .icon { font-size: 44px; margin-bottom: 14px; opacity: 0.5; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.empty-state p  { font-size: 13.5px; max-width: 340px; margin: 0 auto 20px; line-height: 1.6; }

/* ── Auth Screen ─────────────────────────────────────────────── */
.auth-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  position: relative; overflow: hidden;
}
.auth-screen::before {
  content: '';
  position: absolute; top: -300px; right: -300px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(232,98,26,0.07) 0%, transparent 65%);
  pointer-events: none;
}
.auth-screen::after {
  content: '';
  position: absolute; bottom: -200px; left: -200px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(232,98,26,0.04) 0%, transparent 65%);
  pointer-events: none;
}
.auth-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  padding: 40px 36px;
  width: 100%; max-width: 420px;
  border: 1px solid var(--border);
  animation: scaleIn 350ms var(--ease-bounce);
  position: relative; z-index: 1;
}
.auth-card h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 4px; }
.auth-card h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.auth-card > p { color: var(--text-muted); margin-bottom: 24px; font-size: 13.5px; }

/* ── Pipeline Board ──────────────────────────────────────────── */
.pipeline-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.pipeline-board::-webkit-scrollbar { height: 6px; }
.pipeline-board::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }

/* ── Hamburger (Mobile) ──────────────────────────────────────── */
.sidebar-toggle {
  display: none; background: none; border: none;
  cursor: pointer; padding: 6px; border-radius: var(--r-sm);
  transition: background var(--dur-fast); flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--surface2); }
.sidebar-toggle svg { display: block; width: 22px; height: 22px; stroke: var(--text-muted); stroke-width: 1.8; fill: none; stroke-linecap: round; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); backdrop-filter: blur(2px); z-index: 199; }

/* ── Progress Bar ────────────────────────────────────────────── */
.progress-track { background: var(--border-light); border-radius: 6px; height: 6px; overflow: hidden; }
.progress-fill  { height: 100%; border-radius: 6px; transition: width 0.6s var(--ease); background: var(--brand); }
.progress-fill.green  { background: var(--green); }
.progress-fill.amber  { background: var(--amber); }
.progress-fill.red    { background: var(--red); }

/* ── Dropdown Menu ───────────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  padding: 6px; min-width: 180px; z-index: 100;
  animation: scaleIn 150ms var(--ease);
  transform-origin: top right;
}
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--r-xs);
  font-size: 13.5px; color: var(--text2); cursor: pointer;
  transition: all var(--dur-fast);
}
.dropdown-item:hover { background: var(--surface2); color: var(--text); }
.dropdown-item.danger:hover { background: var(--red-bg); color: var(--red); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Alert / Banner ──────────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: var(--r-sm);
  border: 1px solid; font-size: 13.5px; margin-bottom: 16px;
}
.alert-success { background: var(--green-bg); border-color: var(--green-border); color: var(--green-dark); }
.alert-error   { background: var(--red-bg);   border-color: var(--red-border);   color: var(--red-dark); }
.alert-warning { background: var(--amber-bg); border-color: var(--amber-border); color: var(--amber-dark); }
.alert-info    { background: var(--blue-bg);  border-color: var(--blue-border);  color: var(--blue-dark); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .form-row-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
    transform: translateX(-100%); transition: transform var(--dur-slow) var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-open .sidebar-backdrop { display: block; }
  .header { padding: 0 12px; gap: 8px; }
  .header-search { flex: 1; min-width: 0; }
  .header-search input { font-size: 13px; padding: 7px 10px 7px 32px; }
  #header-name, #header-role { display: none; }
  .content { padding: 16px 14px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 600px; }
  .stats-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .list-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .list-filters { flex-wrap: wrap; }
  .list-filters select, .list-filters input { flex: 1 1 140px; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { border-radius: var(--r-lg) var(--r-lg) 0 0; max-width: 100%; animation: slideUp var(--dur-slow) var(--ease); }
  .modal-body { max-height: 65vh; }
  .auth-card { max-width: 100%; border-radius: 0; box-shadow: none; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 32px 24px; }
  .auth-screen { align-items: flex-start; }
  .toast-container { top: auto; bottom: 72px; right: 12px; left: 12px; }
  .toast { max-width: 100%; }
  .pagination { flex-direction: column; gap: 8px; align-items: center; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .tab { white-space: nowrap; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .list-header h2 { font-size: 18px; }
}
