/* =====================================================================
   ArchiBoard – Design System
   Inspiré de Linear, Notion, Monday, ClickUp.
   Dark + Light, Glassmorphism, Mobile First.
===================================================================== */

/* ------- Tokens / Variables ------- */
:root {
  --brand-50:#eef4ff;
  --brand-100:#dbe7ff;
  --brand-200:#b6cdff;
  --brand-300:#86acff;
  --brand-400:#5985ff;
  --brand-500:#3a63f5;  /* primary */
  --brand-600:#2a4adb;
  --brand-700:#2239af;
  --brand-800:#1c2e84;
  --brand-900:#172658;

  --accent:#7c5cff;
  --success:#10b981;
  --warning:#f59e0b;
  --danger:#ef4444;
  --info:#0ea5e9;

  --radius-sm:6px;
  --radius:10px;
  --radius-lg:16px;
  --radius-xl:22px;

  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow:    0 4px 16px rgba(15,23,42,.08);
  --shadow-lg: 0 20px 50px rgba(15,23,42,.12);

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'JetBrains Mono', Menlo, Consolas, monospace;

  --header-h: 64px;
  --sidebar-w: 260px;
  --sidebar-w-collapsed: 72px;

  /* Light theme defaults */
  --bg:           #f6f7fb;
  --bg-elev:      #ffffff;
  --bg-soft:      #f0f2f8;
  --surface:      rgba(255,255,255,.7);
  --surface-strong: rgba(255,255,255,.92);
  --border:       rgba(15,23,42,.08);
  --border-strong:rgba(15,23,42,.14);
  --text:         #0f172a;
  --text-soft:    #475569;
  --text-muted:   #94a3b8;
  --input-bg:     #ffffff;
  --kbd-bg:       #eef0f6;

  --gradient-brand: linear-gradient(135deg, #3a63f5 0%, #7c5cff 50%, #ec4899 100%);
  --gradient-hero:  radial-gradient(1200px 600px at 10% -10%, rgba(124,92,255,.18), transparent 60%),
                    radial-gradient(1000px 500px at 90% -20%, rgba(58,99,245,.18), transparent 60%);
}

html[data-theme="dark"] {
  --bg:           #0b0f1a;
  --bg-elev:      #131826;
  --bg-soft:      #0f1422;
  --surface:      rgba(22,28,44,.7);
  --surface-strong: rgba(22,28,44,.92);
  --border:       rgba(255,255,255,.08);
  --border-strong:rgba(255,255,255,.14);
  --text:         #e6ebf5;
  --text-soft:    #a4adc2;
  --text-muted:   #6b7491;
  --input-bg:     #0f1422;
  --kbd-bg:       #1a2236;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow:    0 8px 28px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.55);

  --gradient-hero:  radial-gradient(1200px 600px at 10% -10%, rgba(124,92,255,.25), transparent 60%),
                    radial-gradient(1000px 500px at 90% -20%, rgba(58,99,245,.22), transparent 60%);
}

/* ------- Reset ------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { padding:0; margin:0; }
body {
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width:100%; display:block; }
a { color: var(--brand-500); text-decoration:none; }
a:hover { color: var(--brand-600); }
button { font-family: inherit; cursor:pointer; }
hr { border:none; border-top:1px solid var(--border); margin:1rem 0; }

/* Scrollbar */
::-webkit-scrollbar { width:10px; height:10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius:8px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
::-webkit-scrollbar-track { background: transparent; }

/* ------- Typography ------- */
h1,h2,h3,h4,h5,h6 { margin:0 0 .5rem; font-weight:700; letter-spacing:-.01em; color:var(--text); }
h1 { font-size: clamp(1.8rem, 2.6vw, 2.4rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
p { margin:0 0 .75rem; color: var(--text-soft); }
small { color: var(--text-muted); }
.text-muted { color: var(--text-muted); }
.text-soft  { color: var(--text-soft); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-info    { color: var(--info); }
.text-right { text-align:right; }
.text-center{ text-align:center; }
.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ------- Layout helpers ------- */
.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.row { display:flex; flex-wrap:wrap; gap: 16px; }
.col { flex:1; min-width: 0; }
.grid { display:grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 900px) {
  .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; }
}
.flex { display:flex; }
.flex-col { display:flex; flex-direction:column; }
.items-center { align-items:center; }
.justify-between { justify-content:space-between; }
.justify-end { justify-content:flex-end; }
.gap-2 { gap:8px; } .gap-3 { gap:12px; } .gap-4 { gap:16px; } .gap-6 { gap:24px; }
.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-6{margin-top:24px}.mt-8{margin-top:32px}
.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}.mb-6{margin-bottom:24px}.mb-8{margin-bottom:32px}
.p-3{padding:12px}.p-4{padding:16px}.p-6{padding:24px}
.w-full{width:100%}.h-full{height:100%}
.hide-mobile { display:initial; }
.show-mobile { display:none; }
@media (max-width: 768px) {
  .hide-mobile { display:none !important; }
  .show-mobile { display:initial; }
}

/* ------- Card ------- */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.card-glass {
  background: var(--surface);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.card-header { display:flex; align-items:center; justify-content:space-between; margin-bottom: 12px; }
.card-title { font-weight:700; font-size: 1.05rem; }
.card-sub { color: var(--text-muted); font-size: .85rem; }

/* ------- Buttons ------- */
.btn {
  display: inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font-weight: 600; font-size: .9rem;
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--gradient-brand);
  color: white;
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(58,99,245,.35);
}
.btn-primary:hover { color:white; filter: brightness(1.05); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }
.btn-soft { background: var(--bg-soft); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: rgba(239,68,68,.3); }
.btn-danger:hover { background: rgba(239,68,68,.1); }
.btn-success { background: var(--success); color:white; border-color:transparent; }
.btn-sm { padding:6px 11px; font-size: .82rem; }
.btn-lg { padding: 12px 22px; font-size: 1rem; }
.btn-block { width:100%; }
.btn-icon { padding: 8px; }
.btn-icon svg { width:18px; height:18px; }

/* ------- Forms ------- */
.form-group { margin-bottom: 14px; }
.form-label { display:block; margin-bottom:6px; font-weight:600; font-size:.85rem; color: var(--text-soft); }
.form-control, .form-select, textarea {
  width:100%;
  padding: 10px 12px;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .92rem;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(58,99,245,.18);
}
textarea { min-height: 90px; resize: vertical; }
.form-hint { color: var(--text-muted); font-size: .8rem; margin-top:4px; }
.form-error { color: var(--danger); font-size:.82rem; margin-top:4px; }
.input-icon { position:relative; }
.input-icon svg { position:absolute; left:10px; top:50%; transform:translateY(-50%); width:18px; height:18px; color:var(--text-muted); }
.input-icon .form-control { padding-left:36px; }

/* ------- Badges & chips ------- */
.badge {
  display:inline-flex; align-items:center; gap:4px;
  padding: 3px 9px; font-size:.72rem; font-weight:600;
  border-radius: 999px; background: var(--bg-soft); color: var(--text-soft);
  border:1px solid var(--border);
}
.badge-brand { background: rgba(58,99,245,.12); color: var(--brand-500); border-color:transparent;}
.badge-success { background: rgba(16,185,129,.12); color: var(--success); border-color:transparent;}
.badge-warning { background: rgba(245,158,11,.14); color: var(--warning); border-color:transparent;}
.badge-danger  { background: rgba(239,68,68,.12);  color: var(--danger);  border-color:transparent;}
.badge-info    { background: rgba(14,165,233,.12); color: var(--info);    border-color:transparent;}
.dot { width:8px; height:8px; border-radius:50%; display:inline-block; }

/* ------- Tables ------- */
.table-wrap { overflow-x:auto; border-radius: var(--radius-lg); border:1px solid var(--border); background: var(--bg-elev); }
.table { width:100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 14px; text-align:left; font-size:.9rem; border-bottom: 1px solid var(--border); }
.table th { font-weight:600; color: var(--text-soft); background: var(--bg-soft); position: sticky; top:0; }
.table tbody tr:hover { background: var(--bg-soft); }
.table tbody tr:last-child td { border-bottom:none; }

/* ------- Avatar ------- */
.avatar { width:36px; height:36px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-weight:700; font-size:.85rem; color:white; background: var(--brand-500); }
.avatar-sm { width:28px; height:28px; font-size:.72rem; }
.avatar-lg { width:48px; height:48px; font-size:.95rem; }
.avatar-stack { display:flex; }
.avatar-stack .avatar { margin-left:-8px; border:2px solid var(--bg-elev); }
.avatar-stack .avatar:first-child { margin-left:0; }

/* ------- Layout app ------- */
.app-layout { display:flex; min-height:100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  display:flex; flex-direction:column;
  position: sticky; top: 0; height: 100vh;
  z-index: 30;
  transition: transform .25s ease, width .25s ease;
}
.sidebar-brand {
  display:flex; align-items:center; gap:10px;
  padding: 18px 20px;
  font-weight: 800; font-size: 1.15rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand .logo {
  width:34px; height:34px; border-radius:10px; background: var(--gradient-brand);
  display:inline-flex; align-items:center; justify-content:center; color:white; font-weight:800;
}
.sidebar-nav { flex:1; padding: 12px 10px; overflow-y:auto; }
.sidebar-nav .nav-section { font-size:.7rem; font-weight:700; color: var(--text-muted); text-transform:uppercase; letter-spacing:.08em; padding: 14px 12px 6px; }
.sidebar-nav a {
  display:flex; align-items:center; gap:10px;
  padding: 9px 12px; margin: 2px 0;
  border-radius: var(--radius); color: var(--text-soft);
  font-weight:500; font-size:.92rem;
  transition: background .15s, color .15s;
}
.sidebar-nav a:hover { background: var(--bg-soft); color: var(--text); }
.sidebar-nav a.active {
  background: linear-gradient(120deg, rgba(58,99,245,.12), rgba(124,92,255,.08));
  color: var(--brand-500);
}
.sidebar-nav a.active svg { color: var(--brand-500); }
.sidebar-nav a svg { width:18px; height:18px; color: var(--text-muted); flex-shrink:0; }

.sidebar-footer { padding: 14px; border-top: 1px solid var(--border); }

.app-main { flex:1; min-width: 0; display:flex; flex-direction:column; }

.app-header {
  display:flex; align-items:center; justify-content:space-between;
  height: var(--header-h);
  padding: 0 24px;
  background: var(--surface-strong);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.header-search { position:relative; flex:1; max-width: 460px; }
.header-search input { padding-left: 38px; background: var(--bg-soft); border-color: transparent; }
.header-search svg { position:absolute; left:12px; top:50%; transform:translateY(-50%); color: var(--text-muted); width:18px; height:18px; }
.header-actions { display:flex; align-items:center; gap:8px; }
.header-icon-btn {
  width:38px; height:38px; border-radius: var(--radius); border:none; background: transparent; color: var(--text-soft);
  display:inline-flex; align-items:center; justify-content:center; cursor:pointer; position:relative;
}
.header-icon-btn:hover { background: var(--bg-soft); color: var(--text); }
.header-icon-btn .badge-dot {
  position:absolute; top:6px; right:6px;
  width:8px; height:8px; border-radius:50%; background: var(--danger);
  border: 2px solid var(--bg-elev);
}

.app-content { padding: 24px; flex:1; }
.page-header { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-bottom:18px; }
.page-title { font-size: 1.6rem; font-weight:800; }

/* Mobile */
.menu-toggle { display:none; }
@media (max-width: 980px) {
  .sidebar {
    position: fixed; left:0; top:0; transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .menu-toggle { display:inline-flex; }
  .app-content { padding: 16px; }
  .header-search { display:none; }
}

/* ------- Stat card ------- */
.stat-card {
  display:flex; align-items:center; gap:14px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  position: relative; overflow:hidden;
}
.stat-card::before {
  content:''; position:absolute; inset:0;
  background: var(--gradient-hero); opacity:.4; pointer-events:none;
}
.stat-card .stat-icon {
  width:48px; height:48px; border-radius:14px;
  background: rgba(58,99,245,.12); color: var(--brand-500);
  display:inline-flex; align-items:center; justify-content:center;
  z-index:1;
}
.stat-card .stat-icon svg { width:22px; height:22px; }
.stat-card .stat-body { z-index:1; }
.stat-card .stat-label { color: var(--text-muted); font-size:.78rem; font-weight:600; text-transform:uppercase; letter-spacing:.05em; }
.stat-card .stat-value { font-size:1.6rem; font-weight:800; line-height:1.1; margin-top:2px; }
.stat-card .stat-trend { font-size:.78rem; margin-top: 2px; }

/* ------- Kanban ------- */
.kanban {
  display:flex; gap:14px; overflow-x:auto; padding: 4px 4px 14px;
  scroll-snap-type: x proximity;
}
.kanban-col {
  flex: 0 0 290px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display:flex; flex-direction:column;
  max-height: calc(100vh - 200px);
  scroll-snap-align: start;
}
.kanban-col-header {
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-weight:700; font-size:.88rem;
}
.kanban-col-count { background: var(--bg-elev); color: var(--text-muted); font-size:.72rem; padding:2px 7px; border-radius:999px; }
.kanban-col-body { padding: 10px; overflow-y:auto; min-height: 50px; flex:1; }
.kanban-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-500);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
}
.kanban-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kanban-card.dragging { opacity: .4; }
.kanban-card-title { font-weight:600; font-size:.92rem; margin-bottom: 6px; }
.kanban-card-meta { display:flex; align-items:center; justify-content:space-between; font-size:.78rem; color:var(--text-muted); }
.kanban-col[data-drag-over="1"] { background: rgba(58,99,245,.05); border-color: var(--brand-500); }

/* ------- Auth pages ------- */
.auth-shell {
  min-height: 100vh;
  display:grid; grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.auth-form-col {
  padding: 60px 6vw;
  display:flex; flex-direction:column; justify-content:center;
}
.auth-hero-col {
  position:relative;
  background: var(--gradient-brand);
  color:white;
  padding: 60px;
  display:flex; flex-direction:column; justify-content:space-between;
  overflow:hidden;
}
.auth-hero-col::after {
  content:''; position:absolute; inset:0;
  background: radial-gradient(800px 400px at 80% 10%, rgba(255,255,255,.18), transparent 60%);
}
.auth-form { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-brand { display:flex; align-items:center; gap:12px; font-weight:800; font-size: 1.3rem; margin-bottom: 32px; }
.auth-brand .logo { width:40px; height:40px; border-radius:12px; background: var(--gradient-brand); color:white; display:inline-flex; align-items:center; justify-content:center; }
.auth-features { list-style:none; padding:0; margin:24px 0; display:grid; gap:14px; position:relative; z-index:1; }
.auth-features li { display:flex; gap:10px; align-items:start; }
.auth-features .check { background: rgba(255,255,255,.2); border-radius:8px; width:28px; height:28px; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero-col { display:none; }
  .auth-form-col { padding: 40px 24px; }
}

/* ------- Landing ------- */
.landing-nav {
  position: sticky; top:0; z-index: 50;
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 5vw;
  background: var(--surface-strong);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.landing-nav .menu { display:flex; gap:24px; align-items:center; }
.landing-nav a { color: var(--text-soft); font-weight:500; }
.landing-nav a:hover { color: var(--text); }
.hero {
  position:relative; padding: 90px 5vw 100px; text-align:center;
  background: var(--gradient-hero);
  overflow:hidden;
}
.hero h1 { font-size: clamp(2.3rem, 5vw, 4.2rem); line-height: 1.05; max-width: 900px; margin: 0 auto 20px; }
.hero p { font-size: 1.15rem; max-width: 700px; margin: 0 auto 28px; color: var(--text-soft); }
.hero-cta { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; }
.hero-preview {
  max-width: 1100px; margin: 60px auto 0; padding: 12px;
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}

.section { padding: 80px 5vw; }
.section h2 { text-align:center; font-size: clamp(1.8rem, 3vw, 2.6rem); margin-bottom:14px; }
.section .lead { text-align:center; color: var(--text-soft); max-width: 700px; margin: 0 auto 50px; }

.feature-grid { display:grid; gap: 20px; grid-template-columns: repeat(3, minmax(0,1fr)); max-width:1180px; margin:0 auto; }
@media (max-width: 900px) { .feature-grid { grid-template-columns:1fr; } }
.feature {
  padding: 24px; border-radius: var(--radius-lg);
  background: var(--bg-elev); border:1px solid var(--border);
  transition: transform .2s, box-shadow .2s;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature .ico {
  width:46px; height:46px; border-radius:12px;
  background: rgba(58,99,245,.12); color: var(--brand-500);
  display:inline-flex; align-items:center; justify-content:center; margin-bottom:14px;
}

.pricing-grid { display:grid; gap:20px; grid-template-columns: repeat(4, minmax(0,1fr)); max-width:1180px; margin:0 auto; }
@media (max-width: 1024px) { .pricing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .pricing-grid { grid-template-columns: 1fr; } }
.plan {
  padding: 26px; border-radius: var(--radius-lg);
  background: var(--bg-elev); border:1px solid var(--border);
  display:flex; flex-direction:column;
  position:relative; transition: transform .2s, box-shadow .2s;
}
.plan:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.plan.popular { border-color: var(--brand-500); box-shadow: 0 10px 40px rgba(58,99,245,.15); }
.plan .price { font-size: 2.2rem; font-weight: 800; margin: 10px 0; }
.plan ul { list-style:none; padding:0; margin: 16px 0; display:grid; gap:8px; }
.plan ul li { display:flex; gap:8px; align-items:center; color: var(--text-soft); font-size:.92rem; }
.plan .badge-pop { position:absolute; top:-12px; right:16px; }

footer { padding: 40px 5vw; text-align:center; color: var(--text-muted); border-top: 1px solid var(--border); }

/* ------- Toast ------- */
.toast-host { position:fixed; bottom: 20px; right: 20px; z-index: 9999; display:flex; flex-direction:column; gap: 8px; }
.toast {
  background: var(--bg-elev); border:1px solid var(--border);
  padding: 12px 16px; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 240px; display:flex; align-items:center; gap:10px;
  animation: slideIn .3s ease;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--info); }
@keyframes slideIn { from { transform: translateX(20px); opacity:0; } to { transform:translateX(0); opacity:1;} }

/* ------- Modal ------- */
.modal-backdrop {
  position:fixed; inset:0; background: rgba(0,0,0,.5); z-index: 1000;
  display:none; align-items:center; justify-content:center; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-backdrop.open { display:flex; }
.modal {
  background: var(--bg-elev); border-radius: var(--radius-lg); border:1px solid var(--border);
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y:auto;
  box-shadow: var(--shadow-lg);
  animation: popIn .2s ease;
}
.modal.modal-lg { max-width: 800px; }
.modal-header { display:flex; align-items:center; justify-content:space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display:flex; gap:8px; justify-content:flex-end; }
@keyframes popIn { from { transform: scale(.96); opacity:0; } to { transform:scale(1); opacity:1; } }

/* ------- Dropdown ------- */
.dropdown { position: relative; display:inline-block; }
.dropdown-menu {
  position: absolute; right:0; top: calc(100% + 6px);
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 220px; padding: 6px; z-index: 100; display:none;
}
.dropdown.open .dropdown-menu { display:block; }
.dropdown-menu a, .dropdown-menu button {
  display:flex; align-items:center; gap:8px; width:100%; padding: 9px 10px;
  border:none; background:transparent; color:var(--text); text-align:left; font-size:.9rem;
  border-radius: 8px; cursor:pointer;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--bg-soft); }
.dropdown-divider { height:1px; background: var(--border); margin:6px 0; }

/* ------- Progress ------- */
.progress { background: var(--bg-soft); border-radius:999px; height: 8px; overflow:hidden; }
.progress > div { height:100%; background: var(--gradient-brand); transition: width .3s ease; }

/* ------- Tabs ------- */
.tabs { display:flex; gap:4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap:wrap; }
.tab { padding: 10px 14px; cursor:pointer; color: var(--text-soft); font-weight:600; font-size:.9rem; border-bottom: 2px solid transparent; }
.tab.active { color: var(--brand-500); border-bottom-color: var(--brand-500); }
.tab:hover { color: var(--text); }

/* ------- Chat ------- */
.chat-shell { display:grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - var(--header-h) - 48px); background: var(--bg-elev); border:1px solid var(--border); border-radius: var(--radius-lg); overflow:hidden; }
.chat-list { border-right:1px solid var(--border); overflow-y:auto; }
.chat-list .item { display:flex; gap:10px; align-items:center; padding:12px; cursor:pointer; border-bottom:1px solid var(--border); }
.chat-list .item:hover, .chat-list .item.active { background: var(--bg-soft); }
.chat-main { display:flex; flex-direction:column; }
.chat-header { padding:14px 18px; border-bottom:1px solid var(--border); font-weight:700; }
.chat-body { flex:1; padding:18px; overflow-y:auto; display:flex; flex-direction:column; gap:10px; background: var(--bg-soft); }
.chat-msg { max-width: 70%; padding: 9px 13px; border-radius: 14px; line-height: 1.45; font-size:.92rem; }
.chat-msg.in  { background: var(--bg-elev); align-self:flex-start; border:1px solid var(--border); border-bottom-left-radius:4px; }
.chat-msg.out { background: var(--gradient-brand); color:white; align-self:flex-end; border-bottom-right-radius:4px; }
.chat-msg .meta { font-size:.7rem; opacity:.7; margin-top:4px; }
.chat-form { padding: 12px; border-top:1px solid var(--border); display:flex; gap:8px; }
@media (max-width: 768px) { .chat-shell { grid-template-columns: 1fr; } .chat-list { display:none; } body.chat-list-open .chat-list { display:block; } body.chat-list-open .chat-main { display:none; } }

/* ------- Skeleton ------- */
.skel { background: linear-gradient(90deg, var(--bg-soft) 25%, var(--border) 50%, var(--bg-soft) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ------- Utilities ------- */
.bg-soft { background: var(--bg-soft); }
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.divider { height:1px; background: var(--border); margin: 12px 0; }
.fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity:0; transform: translateY(4px); } to { opacity:1; transform: translateY(0);} }
