/* ============================================================
   DevVault – app.css  (Dark-first, Light via [data-theme="light"])
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────── */
:root {
  /* Brand */
  --brand-primary:   #6366f1;
  --brand-secondary: #8b5cf6;
  --brand-accent:    #06b6d4;
  --brand-success:   #10b981;
  --brand-warning:   #f59e0b;
  --brand-danger:    #ef4444;
  --brand-info:      #3b82f6;

  /* Dark theme (default) */
  --bg-base:         #0f1117;
  --bg-surface:      #1a1d27;
  --bg-surface-2:    #21253a;
  --bg-surface-3:    #2a2f45;
  --bg-hover:        #2e3350;
  --border-color:    #2e3350;
  --border-subtle:   #1e2238;

  --text-primary:    #e8eaf6;
  --text-secondary:  #9094b5;
  --text-muted:      #5c6080;
  --text-inverse:    #0f1117;

  /* Sidebar */
  --sidebar-w:       260px;
  --sidebar-bg:      #12151f;
  --sidebar-border:  #1e2238;
  --nav-active-bg:   rgba(99,102,241,.15);
  --nav-active-text: #818cf8;
  --nav-hover-bg:    rgba(255,255,255,.04);

  /* Topbar */
  --topbar-h:        60px;
  --topbar-bg:       #1a1d27;
  --topbar-border:   #2e3350;

  /* Card */
  --card-bg:         #1a1d27;
  --card-border:     #2e3350;
  --card-radius:     14px;
  --card-shadow:     0 2px 16px rgba(0,0,0,.35);

  /* Input */
  --input-bg:        #21253a;
  --input-border:    #2e3350;
  --input-focus:     #6366f1;

  /* Misc */
  --radius-sm:  6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: .18s ease;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

[data-theme="light"] {
  --bg-base:        #f0f2f8;
  --bg-surface:     #ffffff;
  --bg-surface-2:   #f6f7fb;
  --bg-surface-3:   #eef0f7;
  --bg-hover:       #e8eaf6;
  --border-color:   #dde0ef;
  --border-subtle:  #e8eaf6;

  --text-primary:   #1e2140;
  --text-secondary: #5c6494;
  --text-muted:     #9094b5;
  --text-inverse:   #ffffff;

  --sidebar-bg:     #ffffff;
  --sidebar-border: #e8eaf6;
  --nav-active-bg:  rgba(99,102,241,.1);
  --nav-active-text:#6366f1;
  --nav-hover-bg:   rgba(99,102,241,.05);

  --topbar-bg:      #ffffff;
  --topbar-border:  #e8eaf6;

  --card-bg:        #ffffff;
  --card-border:    #e8eaf6;
  --card-shadow:    0 2px 12px rgba(0,0,0,.06);

  --input-bg:       #f6f7fb;
  --input-border:   #dde0ef;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 14px;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
}

a { color: var(--brand-primary); text-decoration: none; }
a:hover { color: var(--brand-secondary); }

/* ── Layout ────────────────────────────────────────────── */
.app-body { display: flex; width: 100%; overflow-x: hidden; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Sidebar Search */
.sidebar-search {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-search .input-group-text {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-right: none;
  color: var(--text-muted);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.sidebar-search .form-control {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-left: none;
  color: var(--text-primary);
  font-size: 13px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.sidebar-search .form-control:focus {
  background: var(--input-bg);
  border-color: var(--brand-primary);
  box-shadow: none;
  color: var(--text-primary);
}

.search-dropdown {
  position: absolute;
  left: 14px; right: 14px;
  top: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  max-height: 380px;
  overflow-y: auto;
  z-index: 1100;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border-subtle);
}

.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--nav-hover-bg); }

.search-item-icon {
  width: 30px; height: 30px;
  background: var(--nav-active-bg);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  color: var(--brand-primary);
  flex-shrink: 0;
}

.search-item-title { font-size: 13px; font-weight: 500; }
.search-item-type  { font-size: 11px; color: var(--text-muted); }

/* Nav */
.sidebar-nav { padding: 10px 10px; flex: 1; }
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: 6px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover { background: var(--nav-hover-bg); color: var(--text-primary); text-decoration: none; }
.nav-item.active { background: var(--nav-active-bg); color: var(--nav-active-text); }
.nav-item.active .nav-icon { color: var(--brand-primary); }

.nav-icon { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--bg-surface-3);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
  min-width: 22px;
  text-align: center;
}

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

/* Main wrapper */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 900;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

.topbar-breadcrumb a { color: var(--text-secondary); }
.topbar-breadcrumb a:hover { color: var(--brand-primary); }
.bc-sep { color: var(--text-muted); }
.bc-current { color: var(--text-primary); font-weight: 500; }

/* Page content */
.page-content { padding: 24px; flex: 1; }

/* ── Cards ─────────────────────────────────────────────── */
.dv-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

.dv-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.dv-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.dv-card-body { padding: 20px; }

/* ── Stat Cards ────────────────────────────────────────── */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon.purple { background: rgba(99,102,241,.15); color: var(--brand-primary); }
.stat-icon.blue   { background: rgba(59,130,246,.15); color: var(--brand-info); }
.stat-icon.green  { background: rgba(16,185,129,.15); color: var(--brand-success); }
.stat-icon.amber  { background: rgba(245,158,11,.15); color: var(--brand-warning); }
.stat-icon.red    { background: rgba(239,68,68,.15);  color: var(--brand-danger); }
.stat-icon.cyan   { background: rgba(6,182,212,.15);  color: var(--brand-accent); }

.stat-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 2px;
}

/* ── Project Cards ─────────────────────────────────────── */
.project-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 18px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--project-color, var(--brand-primary));
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0,0,0,.3);
  border-color: var(--project-color, var(--brand-primary));
  text-decoration: none;
}

.project-card-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }

.project-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.project-name { font-size: 15px; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.project-client { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.project-progress {
  height: 4px;
  background: var(--bg-surface-3);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.project-progress-bar {
  height: 100%;
  background: var(--project-color, var(--brand-primary));
  border-radius: 4px;
  transition: width .4s ease;
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.project-actions { display: flex; gap: 4px; }

/* ── Kanban Board ──────────────────────────────────────── */
.kanban-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 16px; }
.kanban-column {
  min-width: 280px;
  background: var(--bg-surface-2);
  border-radius: var(--card-radius);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.kanban-column-header {
  padding: 14px 16px;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-column-header .col-count {
  background: var(--bg-surface-3);
  color: var(--text-muted);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 20px;
  margin-left: auto;
}

.kanban-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }

.kanban-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: grab;
  transition: box-shadow var(--transition), transform var(--transition);
}

.kanban-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.25); transform: translateY(-1px); }
.kanban-card.dragging { opacity: .5; transform: rotate(2deg); }

/* ── Badges ────────────────────────────────────────────── */
.badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .03em;
}

.badge-primary   { background: rgba(99,102,241,.2);  color: #818cf8; }
.badge-secondary { background: rgba(148,163,184,.15); color: #94a3b8; }
.badge-success   { background: rgba(16,185,129,.15);  color: #34d399; }
.badge-warning   { background: rgba(245,158,11,.15);  color: #fbbf24; }
.badge-danger    { background: rgba(239,68,68,.15);   color: #f87171; }
.badge-info      { background: rgba(59,130,246,.15);  color: #60a5fa; }
.badge-dark      { background: rgba(15,23,42,.4);     color: #64748b; }

[data-theme="light"] .badge-primary   { background: rgba(99,102,241,.1);  color: #4f46e5; }
[data-theme="light"] .badge-success   { background: rgba(16,185,129,.1);  color: #059669; }
[data-theme="light"] .badge-warning   { background: rgba(245,158,11,.1);  color: #d97706; }
[data-theme="light"] .badge-danger    { background: rgba(239,68,68,.1);   color: #dc2626; }
[data-theme="light"] .badge-info      { background: rgba(59,130,246,.1);  color: #2563eb; }
[data-theme="light"] .badge-secondary { background: rgba(100,116,139,.1); color: #475569; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 13.5px;
  padding: 8px 16px;
  border: 1px solid transparent;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(99,102,241,.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99,102,241,.5);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.btn-outline:hover { background: var(--bg-hover); border-color: var(--brand-primary); color: var(--brand-primary); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger  { background: rgba(239,68,68,.15); border-color: rgba(239,68,68,.3); color: #f87171; }
.btn-danger:hover { background: rgba(239,68,68,.25); }

.btn-success { background: rgba(16,185,129,.15); border-color: rgba(16,185,129,.3); color: #34d399; }
.btn-success:hover { background: rgba(16,185,129,.25); }

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }

.btn-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--brand-primary); }

/* ── Forms ─────────────────────────────────────────────── */
.form-control, .form-select {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  padding: 8px 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus, .form-select:focus {
  background: var(--input-bg);
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
  color: var(--text-primary);
  outline: none;
}

.form-control::placeholder { color: var(--text-muted); }

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Tables ────────────────────────────────────────────── */
.dv-table { width: 100%; border-collapse: separate; border-spacing: 0; }

.dv-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface-2);
}

.dv-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 13.5px;
  vertical-align: middle;
}

.dv-table tr:last-child td { border-bottom: none; }

.dv-table tbody tr:hover td { background: var(--bg-hover); }

/* ── Password Vault Cards ──────────────────────────────── */
.password-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 16px;
  transition: border-color var(--transition), transform var(--transition);
}

.password-card:hover { border-color: var(--brand-primary); transform: translateY(-1px); }

.password-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }

.password-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  background: var(--nav-active-bg);
  color: var(--brand-primary);
  flex-shrink: 0;
}

.password-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-bottom: 6px;
}

.password-field-label { font-size: 11px; color: var(--text-muted); width: 70px; flex-shrink: 0; }

.password-field-value {
  flex: 1;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Code Snippet ──────────────────────────────────────── */
.snippet-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition);
}

.snippet-card:hover { transform: translateY(-2px); border-color: var(--brand-primary); }

.snippet-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.lang-php        { background: rgba(119,123,179,.2); color: #7779b3; }
.lang-javascript { background: rgba(245,158,11,.15); color: #fbbf24; }
.lang-css        { background: rgba(59,130,246,.15); color: #60a5fa; }
.lang-html       { background: rgba(239,68,68,.15);  color: #f87171; }
.lang-mysql      { background: rgba(16,185,129,.15); color: #34d399; }
.lang-python     { background: rgba(99,102,241,.15); color: #818cf8; }
.lang-bash       { background: rgba(100,116,139,.15);color: #94a3b8; }
.lang-other      { background: rgba(107,114,128,.15);color: #9ca3af; }

.snippet-code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--bg-base);
  padding: 14px 16px;
  max-height: 200px;
  overflow: auto;
  line-height: 1.7;
}

/* ── Activity Timeline ─────────────────────────────────── */
.timeline { position: relative; padding-left: 28px; }

.timeline::before {
  content: '';
  position: absolute;
  left: 9px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.timeline-item { position: relative; margin-bottom: 20px; }

.timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--brand-primary);
  border: 2px solid var(--bg-surface);
}

.timeline-time { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }

.timeline-content { font-size: 13px; color: var(--text-secondary); }

.timeline-content strong { color: var(--text-primary); }

/* ── User Avatar ───────────────────────────────────────── */
.avatar-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 3px 10px 3px 4px;
  color: var(--text-secondary);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.user-avatar-btn:hover { border-color: var(--brand-primary); background: var(--bg-hover); }
.user-avatar-btn.dropdown-toggle::after { display: none; }

/* ── Toasts ─────────────────────────────────────────────── */
.dv-toast {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  animation: slideInRight .25s ease;
  font-size: 13.5px;
  color: var(--text-primary);
}

.dv-toast.success .toast-icon { color: var(--brand-success); }
.dv-toast.error   .toast-icon { color: var(--brand-danger);  }
.dv-toast.warning .toast-icon { color: var(--brand-warning); }
.dv-toast.info    .toast-icon { color: var(--brand-info);    }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0);    }
}

/* ── Modal overrides ────────────────────────────────────── */
.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 16px 20px;
}

.modal-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.btn-close { filter: invert(1) opacity(.5); }
[data-theme="light"] .btn-close { filter: none; }

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

/* ── Dropdown ───────────────────────────────────────────── */
.dropdown-menu {
  background: var(--bg-surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  padding: 6px;
}

.dropdown-item {
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px;
  padding: 8px 12px;
  transition: background var(--transition), color var(--transition);
}

.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-divider { border-color: var(--border-color); margin: 4px 0; }

/* ── Progress bars ─────────────────────────────────────── */
.progress {
  height: 6px;
  background: var(--bg-surface-3);
  border-radius: 6px;
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
  border-radius: 6px;
  transition: width .4s ease;
}

/* ── Notif dot ──────────────────────────────────────────── */
.notif-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brand-danger);
  border: 2px solid var(--topbar-bg);
}

/* ── Sidebar toggle (mobile) ────────────────────────────── */
.sidebar-toggle, .topbar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 1050;
  }

  .sidebar.open { transform: translateX(0); }

  .main-wrapper { margin-left: 0; }

  .page-content { padding: 16px; }
}

/* ── Utilities ──────────────────────────────────────────── */
.text-primary-custom { color: var(--text-primary)   !important; }
.text-muted-custom   { color: var(--text-muted)     !important; }
.text-brand          { color: var(--brand-primary)  !important; }
.bg-surface          { background: var(--bg-surface)  !important; }
.bg-surface-2        { background: var(--bg-surface-2)!important; }
.border-custom       { border-color: var(--border-color)!important; }

.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-12  { font-size: 12px; }
.fs-13  { font-size: 13px; }

.scrollable-x { overflow-x: auto; }
.cursor-pointer { cursor: pointer; }

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

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── CKEditor integration ───────────────────────────────── */
.ck-editor__editable {
  background: var(--input-bg) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--input-border) !important;
  border-radius: 0 0 var(--radius-md) var(--radius-md) !important;
  min-height: 200px;
}

.ck-toolbar {
  background: var(--bg-surface-2) !important;
  border: 1px solid var(--input-border) !important;
  border-bottom: none !important;
  border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

/* ── Dropzone ───────────────────────────────────────────── */
.dropzone {
  background: var(--bg-surface-2);
  border: 2px dashed var(--border-color);
  border-radius: var(--card-radius);
  color: var(--text-secondary);
  transition: border-color var(--transition), background var(--transition);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone:hover, .dropzone.dz-drag-hover {
  border-color: var(--brand-primary);
  background: rgba(99,102,241,.05);
}

/* ── Page header ────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── Filter bar ─────────────────────────────────────────── */
.filter-bar {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* ── Empty state ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: .4;
}

.empty-state-title   { font-size: 18px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state-subtitle{ font-size: 14px; }
