/* ============================================================
   Neelima Matrimony CRM — Design System
   Shared across all pages
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  --rose-600: #E11D48;
  --rose-500: #F43F5E;
  --rose-400: #FB7185;
  --gold-500: #F59E0B;
  --gold-400: #FBBF24;

  --grad-brand: linear-gradient(135deg, #E11D48 0%, #F59E0B 100%);
  --grad-brand-soft: linear-gradient(135deg, rgba(225,29,72,.12) 0%, rgba(245,158,11,.12) 100%);
  --grad-sidebar: linear-gradient(180deg, #2A0F2E 0%, #1A0C22 100%);

  --hot: #EF4444;
  --warm: #F59E0B;
  --cold: #38BDF8;
  --success: #10B981;

  --bg: #F6F5F8;
  --surface: #FFFFFF;
  --surface-2: #FAFAFB;
  --surface-3: #F1F0F4;
  --border: #E8E6ED;
  --border-strong: #D8D5E0;

  --text: #1C1A22;
  --text-2: #5D5870;
  --text-3: #918CA3;

  --sh-sm: 0 1px 2px rgba(26,12,34,.06), 0 1px 3px rgba(26,12,34,.04);
  --sh-md: 0 2px 4px rgba(26,12,34,.04), 0 8px 20px rgba(26,12,34,.07);
  --sh-lg: 0 8px 16px rgba(26,12,34,.06), 0 24px 48px rgba(26,12,34,.12);
  --sh-brand: 0 8px 24px rgba(225,29,72,.28);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 999px;

  --sidebar-w: 264px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 68px;

  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-num: "JetBrains Mono", ui-monospace, monospace;
}

[data-theme="dark"] {
  --bg: #121016;
  --surface: #1A1720;
  --surface-2: #211D2A;
  --surface-3: #2A2535;
  --border: #2E2939;
  --border-strong: #3D3750;
  --text: #F2F0F6;
  --text-2: #A8A2BA;
  --text-3: #746E88;
  --sh-sm: 0 1px 2px rgba(0,0,0,.3);
  --sh-md: 0 4px 12px rgba(0,0,0,.35);
  --sh-lg: 0 16px 48px rgba(0,0,0,.5);
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background .3s var(--ease), color .3s var(--ease);
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
::selection { background: rgba(225,29,72,.22); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-full); border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ---------- 3. Shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  transition: grid-template-columns .3s var(--ease);
}
.app.is-collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

/* ---------- 4. Sidebar ---------- */
.sidebar {
  background: var(--grad-sidebar);
  color: #E9E4F0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  z-index: 40;
}
.sidebar::before {
  content: ""; position: absolute;
  top: -120px; left: -60px; width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(245,158,11,.18), transparent 68%);
  pointer-events: none;
}
.sidebar::after {
  content: ""; position: absolute;
  bottom: -100px; right: -80px; width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(225,29,72,.22), transparent 70%);
  pointer-events: none;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px; height: var(--topbar-h);
  position: relative; z-index: 1;
}
.brand-mark {
  width: 36px; height: 36px; flex: none;
  border-radius: 11px; background: var(--grad-brand);
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px; color: #fff;
  box-shadow: var(--sh-brand); letter-spacing: -.5px;
}
.brand-text { overflow: hidden; white-space: nowrap; transition: opacity .2s var(--ease); }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -.2px; color: #fff; }
.brand-sub {
  font-size: 10.5px; color: rgba(233,228,240,.5);
  letter-spacing: .8px; text-transform: uppercase; font-weight: 600;
}
.is-collapsed .brand-text { opacity: 0; }

.nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 12px 20px; position: relative; z-index: 1; }
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border: none; }
.nav-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.1px;
  text-transform: uppercase; color: rgba(233,228,240,.35);
  padding: 18px 12px 8px; white-space: nowrap;
  transition: opacity .2s var(--ease);
}
.is-collapsed .nav-label { opacity: 0; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-md);
  color: rgba(233,228,240,.72);
  font-weight: 500; font-size: 13.5px;
  white-space: nowrap; position: relative; width: 100%;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.nav-item svg { width: 19px; height: 19px; flex: none; stroke-width: 1.9; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active {
  background: var(--grad-brand); color: #fff;
  font-weight: 600; box-shadow: var(--sh-brand);
}
.nav-item.active::before {
  content: ""; position: absolute;
  left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0;
  background: var(--gold-400);
}
.nav-text { overflow: hidden; transition: opacity .2s var(--ease); text-align: left; }
.is-collapsed .nav-text { opacity: 0; }
.is-collapsed .nav-item { justify-content: center; padding: 11px; }
.nav-badge {
  margin-left: auto; background: rgba(255,255,255,.14); color: #fff;
  font-size: 10.5px; font-weight: 700; padding: 2px 7px;
  border-radius: var(--r-full); font-family: var(--font-num);
}
.nav-item.active .nav-badge { background: rgba(0,0,0,.22); }
.nav-badge.hot { background: var(--hot); }
.is-collapsed .nav-badge { display: none; }

.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.07); position: relative; z-index: 1; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--r-md);
  transition: background .18s var(--ease); white-space: nowrap; width: 100%;
}
.user-chip:hover { background: rgba(255,255,255,.07); }
.user-meta { overflow: hidden; text-align: left; transition: opacity .2s var(--ease); }
.user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-role { font-size: 11px; color: rgba(233,228,240,.5); }
.is-collapsed .user-meta { opacity: 0; }
.user-logout {
  margin-left: auto; display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: var(--r-sm); flex: none;
  color: rgba(233,228,240,.55); transition: color .18s var(--ease), background .18s var(--ease);
}
.user-logout:hover { color: #fff; background: rgba(255,255,255,.1); }
.user-logout svg { width: 15px; height: 15px; }
.is-collapsed .user-logout { display: none; }

/* ---------- 5. Topbar ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px; position: sticky; top: 0; z-index: 30;
}
.icon-btn {
  width: 38px; height: 38px; flex: none;
  border-radius: var(--r-md); display: grid; place-items: center;
  color: var(--text-2); position: relative;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.icon-btn svg { width: 19px; height: 19px; stroke-width: 1.9; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.dot {
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--rose-500); border: 2px solid var(--surface);
}
.page-title { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.page-crumb { font-size: 12px; color: var(--text-3); font-weight: 500; }
.search { margin-left: auto; position: relative; width: 300px; max-width: 34vw; }
.search > span {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-3); pointer-events: none;
  display: grid; place-items: center;
}
.search > span svg { width: 16px; height: 16px; }
.search input {
  width: 100%; height: 40px; padding: 0 46px 0 38px;
  border-radius: var(--r-full); border: 1px solid var(--border);
  background: var(--surface-2); font-size: 13px; outline: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.search input::placeholder { color: var(--text-3); }
.search input:focus {
  border-color: var(--rose-400);
  box-shadow: 0 0 0 3.5px rgba(225,29,72,.12);
  background: var(--surface);
}
.search kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-num); font-size: 10px; color: var(--text-3);
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 5px; padding: 2px 5px; pointer-events: none;
}
/* Search results dropdown */
.search-pop {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--sh-lg);
  padding: 6px; z-index: 50; min-width: 320px;
  animation: fadeUp .2s var(--ease-out) both;
}
.search-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r-sm);
  transition: background .15s var(--ease);
}
.search-row:hover { background: var(--surface-2); }
.search-row .grow { flex: 1; min-width: 0; }
.search-empty { padding: 18px; text-align: center; font-size: 12.5px; color: var(--text-3); }

.content { padding: 24px; flex: 1; animation: fadeUp .45s var(--ease-out) both; }
.content-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.content-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.7px; }
.content-head p { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.head-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- 6. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-md);
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
  transition: transform .12s var(--ease), box-shadow .18s var(--ease),
              background .18s var(--ease), border-color .18s var(--ease);
}
.btn svg { width: 17px; height: 17px; stroke-width: 2; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: var(--sh-brand); }
.btn-primary:hover { box-shadow: 0 10px 30px rgba(225,29,72,.4); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text-2); box-shadow: var(--sh-sm); }
.btn-ghost:hover { border-color: var(--border-strong); color: var(--text); }
.btn-soft { background: var(--grad-brand-soft); color: var(--rose-600); border-color: rgba(225,29,72,.2); }
.btn-soft:hover { background: rgba(225,29,72,.16); }
[data-theme="dark"] .btn-soft { color: var(--rose-400); }
.btn-wa { background: #25D366; color: #fff; box-shadow: 0 8px 24px rgba(37,211,102,.3); }
.btn-wa:hover { box-shadow: 0 10px 30px rgba(37,211,102,.42); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn-sm svg { width: 15px; height: 15px; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-lg { height: 46px; font-size: 14.5px; }
.btn-block { width: 100%; }

/* ---------- 7. Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm);
  transition: box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 14.5px; font-weight: 700; letter-spacing: -.2px; }
.card-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.card-body { padding: 18px; }
.card-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }

/* ---------- 8. Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px; box-shadow: var(--sh-sm);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }
.stat::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  padding: 1px; background: var(--grad-brand);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .25s var(--ease); pointer-events: none;
}
.stat:hover::after { opacity: .55; }
.stat-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.stat-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.stat-ico svg { width: 18px; height: 18px; stroke-width: 2; }
.stat-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); letter-spacing: -.1px; }
.stat-val { font-size: 28px; font-weight: 800; letter-spacing: -1.2px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--text-3); }
.trend {
  display: inline-flex; align-items: center; gap: 3px;
  font-weight: 700; font-size: 11.5px; padding: 2px 7px;
  border-radius: var(--r-full); font-variant-numeric: tabular-nums;
}
.trend svg { width: 12px; height: 12px; stroke-width: 2.6; }
.trend.up { color: var(--success); background: rgba(16,185,129,.11); }
.trend.down { color: var(--hot); background: rgba(239,68,68,.11); }
.t-rose { background: rgba(225,29,72,.11); color: var(--rose-600); }
.t-gold { background: rgba(245,158,11,.13); color: #B45309; }
.t-green { background: rgba(16,185,129,.11); color: #047857; }
.t-blue { background: rgba(56,189,248,.13); color: #0369A1; }
.t-indigo { background: rgba(99,102,241,.11); color: #4338CA; }
[data-theme="dark"] .t-gold { color: var(--gold-400); }
[data-theme="dark"] .t-green { color: #34D399; }
[data-theme="dark"] .t-blue { color: #7DD3FC; }
[data-theme="dark"] .t-indigo { color: #A5B4FC; }
[data-theme="dark"] .t-rose { color: var(--rose-400); }

/* ---------- 9. Grid ---------- */
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }
.mb-20 { margin-bottom: 20px; }
@media (max-width: 1100px) { .g-2, .g-3, .g-2-1, .g-1-2 { grid-template-columns: 1fr; } }

/* ---------- 10. Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.hot { color: var(--hot); background: rgba(239,68,68,.1); }
.badge.warm { color: #B45309; background: rgba(245,158,11,.13); }
.badge.cold { color: #0369A1; background: rgba(56,189,248,.14); }
.badge.success { color: #047857; background: rgba(16,185,129,.11); }
.badge.info { color: #4338CA; background: rgba(99,102,241,.11); }
.badge.muted { color: var(--text-3); background: var(--surface-3); }
[data-theme="dark"] .badge.warm { color: var(--gold-400); }
[data-theme="dark"] .badge.cold { color: #7DD3FC; }
[data-theme="dark"] .badge.success { color: #34D399; }
[data-theme="dark"] .badge.info { color: #A5B4FC; }
.badge-plain::before { display: none; }

/* ---------- 11. Avatar ---------- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700; color: #fff;
  letter-spacing: -.2px; flex: none;
  background: var(--grad-brand); overflow: hidden;
}
.avatar.sm { width: 28px; height: 28px; font-size: 10.5px; }
.avatar.lg { width: 52px; height: 52px; font-size: 17px; }
.avatar.xl { width: 84px; height: 84px; font-size: 28px; }

/* ---------- 12. Table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 11px; font-weight: 700;
  letter-spacing: .7px; text-transform: uppercase; color: var(--text-3);
  padding: 11px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
tbody tr { transition: background .15s var(--ease); }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-name { font-weight: 600; letter-spacing: -.1px; }
.cell-meta { font-size: 11.5px; color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.mono { font-family: var(--font-num); font-size: 12px; letter-spacing: -.3px; }
.row-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .18s var(--ease); }
tbody tr:hover .row-actions { opacity: 1; }

/* ---------- 13. Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field label .req { color: var(--rose-500); }
.input, .select, textarea.input {
  width: 100%; height: 42px; padding: 0 13px;
  border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--surface-2); font-size: 13.5px; outline: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
textarea.input { height: auto; padding: 11px 13px; resize: vertical; min-height: 92px; line-height: 1.6; }
.input::placeholder { color: var(--text-3); }
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--rose-400);
  box-shadow: 0 0 0 3.5px rgba(225,29,72,.12);
  background: var(--surface);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23918CA3' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
  padding-right: 36px; cursor: pointer;
}
.input-icon { position: relative; }
.input-icon > span {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none; display: grid; place-items: center;
}
.input-icon > span svg { width: 17px; height: 17px; }
.input-icon .input { padding-left: 40px; }
.input-icon button.reveal {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: var(--r-sm);
  display: grid; place-items: center; color: var(--text-3);
}
.input-icon button.reveal:hover { background: var(--surface-3); color: var(--text); }
.input-icon button.reveal svg { width: 16px; height: 16px; }
.hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 720px) { .field-row, .field-row-3 { grid-template-columns: 1fr; } }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); }
.check input { width: 16px; height: 16px; accent-color: #E11D48; cursor: pointer; flex: none; }
/* Server-side messages — validation errors, flash status */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-radius: var(--r-md);
  font-size: 13px; font-weight: 600; line-height: 1.5;
  margin-bottom: 18px; border: 1px solid transparent;
}
.alert svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.alert-err  { background: rgba(239,68,68,.09);  border-color: rgba(239,68,68,.25);  color: #B91C1C; }
.alert-ok   { background: rgba(16,185,129,.09); border-color: rgba(16,185,129,.25); color: #047857; }
.alert-warn { background: rgba(245,158,11,.1);  border-color: rgba(245,158,11,.28); color: #B45309; }
.alert-info { background: rgba(56,189,248,.1);  border-color: rgba(56,189,248,.28); color: #0369A1; }
[data-theme="dark"] .alert-err  { color: #FCA5A5; }
[data-theme="dark"] .alert-ok   { color: #6EE7B7; }
[data-theme="dark"] .alert-warn { color: #FCD34D; }
[data-theme="dark"] .alert-info { color: #7DD3FC; }
.alert ul { margin: 0; padding-left: 16px; }

.seg { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: var(--r-md); gap: 2px; }
.seg button { padding: 7px 14px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--text-2); transition: all .18s var(--ease); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--sh-sm); }
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--r-md);
  padding: 26px; text-align: center; background: var(--surface-2);
  transition: border-color .2s var(--ease), background .2s var(--ease); cursor: pointer;
}
.dropzone:hover { border-color: var(--rose-400); background: var(--grad-brand-soft); }
.dropzone svg { width: 26px; height: 26px; color: var(--text-3); margin: 0 auto 8px; stroke-width: 1.6; }
.dropzone p { font-size: 13px; font-weight: 600; }
.dropzone span { font-size: 11.5px; color: var(--text-3); }

/* ---------- 14. Timeline ---------- */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px;
  width: 2px; background: linear-gradient(180deg, var(--border) 0%, var(--border) 85%, transparent 100%);
}
.tl-item { position: relative; padding-bottom: 22px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -30px; top: 1px;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border);
}
.tl-dot svg { width: 13px; height: 13px; stroke-width: 2.2; }
.tl-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tl-title { font-size: 13.5px; font-weight: 600; }
.tl-time { font-size: 11.5px; color: var(--text-3); margin-left: auto; white-space: nowrap; }
.tl-body {
  font-size: 13px; color: var(--text-2); margin-top: 5px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 10px 12px; line-height: 1.6;
}
.tl-by { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }

/* ---------- 15. Progress ---------- */
.bar { height: 7px; background: var(--surface-3); border-radius: var(--r-full); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--grad-brand); transition: width 1s var(--ease-out); }
.bar.thin { height: 5px; }
.bar span.green { background: linear-gradient(90deg, #10B981, #34D399); }
.radial { position: relative; width: 128px; height: 128px; flex: none; }
.radial svg { transform: rotate(-90deg); }
.radial circle { fill: none; stroke-width: 10; stroke-linecap: round; }
.radial .track { stroke: var(--surface-3); }
.radial .val { stroke: url(#gradBrand); transition: stroke-dashoffset 1.2s var(--ease-out); }
.radial-mid { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.radial-num { font-size: 24px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.radial-cap { font-size: 10.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }

/* ---------- 16. Charts ---------- */
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 200px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); font-weight: 500; }
.legend-swatch { width: 9px; height: 9px; border-radius: 3px; flex: none; }

/* ---------- 17. List rows ---------- */
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-title { font-size: 13.5px; font-weight: 600; letter-spacing: -.1px; }
.list-sub { font-size: 11.5px; color: var(--text-3); }
.rank {
  width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center; font-size: 11px; font-weight: 800;
  background: var(--surface-3); color: var(--text-2); flex: none; font-family: var(--font-num);
}
.rank.gold { background: var(--grad-brand); color: #fff; box-shadow: var(--sh-brand); }

/* ---------- 18. Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.kan-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px; min-height: 280px; }
.kan-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 0 2px; }
.kan-title { font-size: 12.5px; font-weight: 700; letter-spacing: .2px; }
.kan-count { font-size: 11px; font-weight: 700; color: var(--text-3); background: var(--surface-3); padding: 1px 7px; border-radius: var(--r-full); font-family: var(--font-num); }
.kan-bar { height: 3px; border-radius: 3px; margin-bottom: 12px; }
.kan-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px; margin-bottom: 9px;
  box-shadow: var(--sh-sm); cursor: grab;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.kan-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }

/* ---------- 19. Match / profile cards ---------- */
.match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.match-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-sm);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.match-card:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); }
.match-cover { height: 92px; background: var(--grad-brand); position: relative; }
.match-cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.25), transparent 60%); }
.match-score {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,.32); backdrop-filter: blur(6px); color: #fff;
  font-size: 11px; font-weight: 800; padding: 3px 9px;
  border-radius: var(--r-full); z-index: 1; font-variant-numeric: tabular-nums;
}
.match-body { padding: 0 14px 14px; text-align: center; }
.match-body .avatar { margin: -32px auto 10px; border: 3px solid var(--surface); position: relative; }
.match-name { font-size: 14.5px; font-weight: 700; letter-spacing: -.2px; }
.match-meta { font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.match-tags { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; margin-bottom: 12px; }
.tag { font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: var(--r-full); background: var(--surface-3); color: var(--text-2); }
.match-foot { display: flex; gap: 6px; }
.match-foot .btn { flex: 1; }

/* ---------- 20. WhatsApp ---------- */
.wa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.wa-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px; box-shadow: var(--sh-sm);
  display: flex; flex-direction: column;
  transition: transform .22s var(--ease-out), box-shadow .22s var(--ease-out), border-color .22s var(--ease);
}
.wa-card:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: rgba(37,211,102,.4); }
.wa-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.wa-ico {
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(37,211,102,.12); color: #16A34A;
  display: grid; place-items: center; flex: none;
}
.wa-ico svg { width: 17px; height: 17px; stroke-width: 2; }
.wa-name { font-size: 13.5px; font-weight: 700; }
.wa-uses { font-size: 11px; color: var(--text-3); }
.wa-bubble {
  background: #DCF8C6; color: #1C2B22;
  border-radius: 12px 12px 12px 3px; padding: 10px 12px;
  font-size: 12.5px; line-height: 1.55; margin-bottom: 12px;
  flex: 1; white-space: pre-line;
}
[data-theme="dark"] .wa-bubble { background: #1F3D2B; color: #D7EFD9; }
.wa-bubble .var {
  background: rgba(225,29,72,.14); color: var(--rose-600);
  border-radius: 4px; padding: 0 4px; font-weight: 700;
  font-family: var(--font-num); font-size: 11.5px;
}
[data-theme="dark"] .wa-bubble .var { color: var(--rose-400); }

/* ---------- 21. Toast ---------- */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 90; }
.toast {
  display: flex; align-items: center; gap: 11px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px 16px;
  box-shadow: var(--sh-lg); min-width: 280px;
  animation: toastIn .4s var(--ease-out);
}
.toast svg { width: 18px; height: 18px; flex: none; color: var(--success); }
.toast.wa svg { color: #25D366; }
.toast-msg { font-size: 13px; font-weight: 600; }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- 22. Modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(26,12,34,.5);
  backdrop-filter: blur(4px); display: grid; place-items: center;
  z-index: 80; padding: 20px; animation: fade .25s var(--ease);
}
.modal {
  background: var(--surface); border-radius: var(--r-xl);
  box-shadow: var(--sh-lg); width: 100%; max-width: 560px;
  max-height: 88vh; overflow: auto; animation: modalIn .35s var(--ease-out);
}
@keyframes fade { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 20px; border-top: 1px solid var(--border);
  background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl);
}

/* ---------- 23. Auth (login page) ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } }
.auth-art {
  background: var(--grad-sidebar); position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 44px; color: #fff;
}
.auth-art::before {
  content: ""; position: absolute;
  top: -140px; right: -100px; width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(245,158,11,.3), transparent 65%);
  animation: float 14s ease-in-out infinite;
}
.auth-art::after {
  content: ""; position: absolute;
  bottom: -160px; left: -120px; width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(225,29,72,.35), transparent 68%);
  animation: float 18s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(28px, -22px) scale(1.09); }
}
.auth-art > * { position: relative; z-index: 1; }
.auth-tag { font-size: 40px; font-weight: 800; letter-spacing: -1.6px; line-height: 1.15; max-width: 460px; }
.auth-tag em {
  font-style: normal; background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-sub { color: rgba(233,228,240,.62); margin-top: 14px; max-width: 400px; font-size: 14.5px; }
.auth-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.auth-stat-n { font-size: 26px; font-weight: 800; letter-spacing: -.9px; }
.auth-stat-l { font-size: 11.5px; color: rgba(233,228,240,.5); text-transform: uppercase; letter-spacing: .8px; font-weight: 600; }
.auth-form { display: grid; place-items: center; padding: 40px; background: var(--surface); }
.auth-box { width: 100%; max-width: 380px; animation: fadeUp .5s var(--ease-out) both; }
.auth-box h1 { font-size: 26px; font-weight: 800; letter-spacing: -.9px; }
.auth-box .lede { color: var(--text-2); margin: 6px 0 26px; font-size: 13.5px; }

/* ---------- 24. Misc ---------- */
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.hstack { display: flex; align-items: center; gap: 10px; }
/* Pagination */
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.pager-btn {
  padding: 7px 14px; border-radius: var(--r-md); font-size: 12.5px; font-weight: 600;
  color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border);
  transition: all .18s var(--ease);
}
.pager-btn:hover { background: var(--surface-3); color: var(--text); }
.pager-btn.is-disabled { opacity: .45; pointer-events: none; }
.pager-info { font-size: 12.5px; color: var(--text-3); font-weight: 600; }

.vstack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-3); }
.text-ok  { color: var(--success); }
.text-err { color: var(--hot); }
.text-warn { color: var(--warm); }
.text-sm { font-size: 12.5px; }

@media (max-width: 860px) {
  .app { grid-template-columns: 0 1fr; }
  .sidebar { position: fixed; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .3s var(--ease); }
  .app.is-open .sidebar { transform: none; }
  .search { width: 170px; }
  .content { padding: 16px; }
  .kanban { grid-template-columns: repeat(4, 260px); }
}

/* Matchmaking — selected member row */
.list-row.is-active { background: var(--grad-brand-soft); border-radius: var(--r-md); }
.match-card { transition: outline .15s var(--ease); }

/* Employee — missed follow-up row */
.row-urgent {
  border-left: 3px solid var(--rose-500);
  background: rgba(225,29,72,.04);
  padding-left: 11px;
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
tr.row-urgent { border-left: none; background: rgba(225,29,72,.05); }
tr.row-urgent td:first-child { box-shadow: inset 3px 0 0 var(--rose-500); }
