:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #a5b4fc;
  --sidebar-width: 260px;
  --sidebar-bg: #0f0f1a;
  --sidebar-text: #a1a1b5;
  --sidebar-active: #6366f1;
  --topbar-height: 60px;
  --bg-main: #f8f8fc;
  --card-bg: #ffffff;
  --border-color: #e5e7eb;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  font-size: 14px;
}

/* ─── SIDEBAR ──────────────────────────────────────────────── */
:root { --sidebar-collapsed-width: 64px; }

.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 1000;
  transition: width 0.22s ease, transform 0.25s ease;
  overflow: hidden;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: white;
}

.brand-icon {
  font-size: 24px;
  color: var(--primary);
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-ai { color: var(--primary); }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 4px 8px;
  margin-bottom: 4px;
}

.nav-link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all 0.15s;
}

.nav-link-item:hover {
  background: rgba(255,255,255,0.06);
  color: white;
}

.nav-link-item.active {
  background: rgba(99,102,241,0.18);
  color: #a5b4fc;
  font-weight: 600;
}

.nav-link-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
}

.user-details { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 11px; color: var(--sidebar-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-logout {
  color: var(--sidebar-text);
  font-size: 18px;
  text-decoration: none;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s;
}
.btn-logout:hover { color: #f87171; }

/* ─── SIDEBAR COLLAPSED (desktop) ─────────────────────────── */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}
.sidebar.collapsed .brand-name,
.sidebar.collapsed .brand-ai {
  opacity: 0;
  width: 0;
  overflow: hidden;
  display: none;
}
.sidebar.collapsed .sidebar-brand {
  padding: 20px 0 16px;
  justify-content: center;
  align-items: center;
}
.sidebar.collapsed .brand-link {
  justify-content: center;
}
.sidebar.collapsed .nav-section-label {
  opacity: 0;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.sidebar.collapsed .sidebar-nav {
  padding: 16px 6px;
}
.sidebar.collapsed .nav-link-item {
  justify-content: center;
  padding: 10px 0;
  gap: 0;
}
.sidebar.collapsed .nav-link-item span {
  display: none;
}
.sidebar.collapsed .nav-link-item i {
  font-size: 18px;
  width: auto;
}
.sidebar.collapsed .sidebar-footer {
  justify-content: center;
  padding: 12px 0;
  flex-direction: column;
  gap: 8px;
}
.sidebar.collapsed .user-details { display: none; }
.sidebar.collapsed .user-info { justify-content: center; }
.sidebar.collapsed .agency-workspace-dropdown { display: none; }

/* ─── SIDEBAR TOP COLLAPSE TOGGLE ─────────────────────────── */
.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: none;
  border: none;
  padding: 0;
  color: var(--sidebar-text);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.sidebar-collapse-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.sidebar-collapse-btn i {
  font-size: 16px;
  line-height: 1;
  transition: transform 0.22s ease;
}
/* Collapsed: hide the wordmark, center the toggle, flip chevron to "expand" */
.sidebar.collapsed .sidebar-brand-row {
  justify-content: center;
}
.sidebar.collapsed .brand-link {
  display: none;
}
.sidebar.collapsed .sidebar-collapse-btn i {
  transform: rotate(180deg);
}

/* ─── MAIN CONTENT ─────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  width: calc(100% - var(--sidebar-width));
  display: flex;
  flex-direction: column;
  transition: margin-left 0.22s ease, width 0.22s ease;
}
.main-content.sidebar-collapsed {
  margin-left: var(--sidebar-collapsed-width);
  width: calc(100% - var(--sidebar-collapsed-width));
}

.topbar {
  height: var(--topbar-height);
  background: white;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.btn-sidebar-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-sidebar-toggle:hover {
  background: rgba(99,102,241,0.08);
  color: var(--primary);
  border-color: var(--primary);
}

.content-area { flex: 1; }

/* ─── CARDS ────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  background: var(--card-bg);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 15px;
  padding: 16px 20px;
}

/* ─── STAT CARDS ───────────────────────────────────────────── */
.stat-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.stat-icon.purple { background: rgba(99,102,241,0.1); color: var(--primary); }
.stat-icon.green { background: rgba(16,185,129,0.1); color: var(--success); }
.stat-icon.blue { background: rgba(59,130,246,0.1); color: #3b82f6; }
.stat-icon.orange { background: rgba(245,158,11,0.1); color: var(--warning); }

.stat-number { font-size: 26px; font-weight: 700; line-height: 1; color: var(--text-primary); }
.stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; margin-top: 2px; }

/* ─── BUTTONS ──────────────────────────────────────────────── */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

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

/* ─── TABLES ───────────────────────────────────────────────── */
.table { font-size: 13.5px; }
.table thead th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 12px;
}
.table tbody td { padding: 12px; vertical-align: middle; }
.table-hover tbody tr:hover { background: rgba(99,102,241,0.03); }

/* ─── BADGES ───────────────────────────────────────────────── */
.badge-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.bg-purple-subtle { background-color: rgba(111,66,193,0.15) !important; }
.text-purple { color: #6f42c1 !important; }
.badge-draft { background: #f3f4f6; color: #6b7280; }
.badge-analyzed { background: rgba(59,130,246,0.1); color: #3b82f6; }
.badge-sent { background: rgba(16,185,129,0.1); color: #059669; }
.badge-failed { background: rgba(239,68,68,0.1); color: #dc2626; }
.badge-pending { background: rgba(245,158,11,0.1); color: #d97706; }
.badge-pending_payment { background: rgba(220,38,38,0.1); color: #dc2626; }
.badge-pending_rss { background: rgba(99,102,241,0.1); color: #6366f1; }
.badge-sending { background: rgba(59,130,246,0.1); color: #2563eb; }
.badge-analyzing { background: rgba(99,102,241,0.1); color: #6366f1; }
.badge-responded { background: rgba(16,185,129,0.18); color: #047857; }
.badge-scheduled { background: rgba(245,158,11,0.15); color: #b45309; }
.badge-unsubscribed { background: rgba(107,114,128,0.1); color: #4b5563; }
.badge-cancelled { background: rgba(107,114,128,0.1); color: #6b7280; }

/* ─── FORMS ────────────────────────────────────────────────── */
.form-control, .form-select {
  border-color: var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  padding: 8px 12px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-label { font-weight: 500; font-size: 13.5px; margin-bottom: 6px; }

/* ─── AUTH PAGES ───────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
}
.auth-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}
.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}
.auth-brand h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
}
.auth-brand p { color: var(--text-secondary); font-size: 14px; }

/* ─── LANDING ──────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 60%, #16213e 100%);
  color: white;
  padding: 100px 0 80px;
  text-align: center;
}
.hero h1 { font-size: 52px; font-weight: 800; line-height: 1.1; }
.hero h1 span { color: var(--primary-light); }
.hero p { font-size: 18px; color: rgba(255,255,255,0.7); max-width: 600px; margin: 20px auto; }
.features-section { padding: 80px 0; background: white; }
.feature-card {
  text-align: center;
  padding: 32px 24px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  height: 100%;
  transition: box-shadow 0.2s;
}
.feature-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.feature-icon {
  width: 56px; height: 56px;
  background: rgba(99,102,241,0.1);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  color: var(--primary);
  margin: 0 auto 20px;
}

/* ─── TOPIC TAGS ───────────────────────────────────────────── */
.topic-tag {
  display: inline-block;
  background: rgba(99,102,241,0.1);
  color: var(--primary-dark);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  margin: 2px;
}

/* ─── PAGE HEADER ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h2 { font-size: 22px; font-weight: 700; margin: 0; }
.page-subtitle { color: var(--text-secondary); font-size: 13.5px; margin-top: 4px; }

/* ─── PROGRESS / STEP ──────────────────────────────────────── */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--border-color);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 12px;
}
.step.active .step-num { background: var(--primary); color: white; }
.step.done .step-num { background: var(--success); color: white; }
.step-line { flex: 1; height: 1px; background: var(--border-color); }

/* ─── CONTACT CARD ─────────────────────────────────────────── */
.contact-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}
.contact-card:hover { border-color: var(--primary-light); }
.contact-card.selected { border-color: var(--primary); background: rgba(99,102,241,0.02); }

/* ─── TEMPLATE PREVIEW ─────────────────────────────────────── */
.template-preview {
  background: #f8f9fa;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  font-family: monospace;
  font-size: 13px;
  white-space: pre-wrap;
  max-height: 300px;
  overflow-y: auto;
}

/* ─── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
  /*
   * iOS Safari won't scroll a child inside overflow:hidden.
   * Solution: scroll the sidebar container itself (position:fixed
   * creates its own scroll context that iOS honours), and pin brand
   * + footer with position:sticky.
   */
  .sidebar {
    transform: translateX(-100%);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    /* remove the flex constraint so content can overflow naturally */
    display: block;
  }
  .sidebar.show {
    transform: translateX(0);
  }
  /* Brand sticks to the top of the scrollable sidebar */
  .sidebar .sidebar-brand {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--sidebar-bg);
  }
  /* Footer sticks to the bottom */
  .sidebar .sidebar-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: var(--sidebar-bg);
  }
  /* Nav flows naturally — the sidebar itself is the scroll container */
  .sidebar .sidebar-nav {
    overflow: visible;
    flex: none;
    height: auto;
  }
  .main-content { margin-left: 0; width: 100%; }
  .hero h1 { font-size: 32px; }
}

/* Prevent page scroll when mobile sidebar is open */
body.sidebar-open { overflow: hidden; }

/* ─── MISC ─────────────────────────────────────────────────── */
.text-primary-custom { color: var(--primary) !important; }
.bg-primary-soft { background: rgba(99,102,241,0.1) !important; }

.email-address-box {
  background: #f0f0ff;
  border: 1px dashed var(--primary-light);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: monospace;
  font-size: 14px;
  color: var(--primary-dark);
  font-weight: 600;
}

.spintax-help {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-state > i { font-size: 48px; opacity: 0.3; }
.empty-state h5 { margin-top: 16px; font-size: 16px; color: var(--text-primary); }

/* ─── DARK MODE ─────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg-main: #0d0d1a;
  --card-bg: #16172a;
  --border-color: #2a2b45;
  --text-primary: #e2e8f0;
  --text-secondary: #8892a4;
}
[data-theme="dark"] body { background: var(--bg-main); color: var(--text-primary); }
[data-theme="dark"] .topbar { background: #12132b; border-bottom-color: var(--border-color); }
[data-theme="dark"] .content-area { background: var(--bg-main); }
[data-theme="dark"] .card { background: var(--card-bg); border-color: var(--border-color); }
[data-theme="dark"] .card-header { background: transparent; border-bottom-color: var(--border-color); color: var(--text-primary); }
[data-theme="dark"] .stat-card { background: var(--card-bg); border-color: var(--border-color); }
[data-theme="dark"] .stat-number { color: var(--text-primary); }
[data-theme="dark"] .table { color: var(--text-primary); }
[data-theme="dark"] .table thead th { color: var(--text-secondary); border-bottom-color: var(--border-color); }
[data-theme="dark"] .table > :not(caption) > * > * { background-color: transparent; border-bottom-color: var(--border-color); color: inherit; }
[data-theme="dark"] .table-hover > tbody > tr:hover > * { background-color: rgba(99,102,241,0.07); }
[data-theme="dark"] .table-light { background: rgba(255,255,255,0.04); }
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select { background: #1e1f38; border-color: var(--border-color); color: var(--text-primary); }
[data-theme="dark"] .form-control::placeholder { color: #566070; }
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus { background: #22233e; border-color: var(--primary); color: var(--text-primary); }
[data-theme="dark"] .badge-draft { background: #252640; color: #8892a4; }
[data-theme="dark"] .badge-analyzed { background: rgba(59,130,246,0.15); color: #60a5fa; }
[data-theme="dark"] .badge-sent { background: rgba(16,185,129,0.15); color: #34d399; }
[data-theme="dark"] .badge-failed { background: rgba(239,68,68,0.15); color: #f87171; }
[data-theme="dark"] .badge-pending { background: rgba(245,158,11,0.15); color: #fbbf24; }
[data-theme="dark"] .badge-pending_payment { background: rgba(220,38,38,0.15); color: #f87171; }
[data-theme="dark"] .badge-pending_rss { background: rgba(99,102,241,0.15); color: #a5b4fc; }
[data-theme="dark"] .badge-sending { background: rgba(59,130,246,0.15); color: #93c5fd; }
[data-theme="dark"] .badge-analyzing { background: rgba(99,102,241,0.15); color: #a5b4fc; }
[data-theme="dark"] .badge-responded { background: rgba(16,185,129,0.15); color: #34d399; }
[data-theme="dark"] .text-muted { color: var(--text-secondary) !important; }
[data-theme="dark"] .btn-outline-primary { color: #a5b4fc; border-color: var(--primary); }
[data-theme="dark"] .btn-outline-primary:hover { background: var(--primary); color: #fff; }
[data-theme="dark"] .btn-outline-secondary { color: #8892a4; border-color: #3a3c5c; }
[data-theme="dark"] .btn-outline-secondary:hover { background: #3a3c5c; color: #e2e8f0; }
[data-theme="dark"] .btn-outline-danger { color: #f87171; border-color: #f87171; }
[data-theme="dark"] .btn-outline-warning { color: #fbbf24; border-color: #fbbf24; }
[data-theme="dark"] .btn-outline-success { color: #34d399; border-color: #34d399; }
[data-theme="dark"] .btn-outline-info { color: #60a5fa; border-color: #60a5fa; }
[data-theme="dark"] .modal-content { background: var(--card-bg); border-color: var(--border-color); color: var(--text-primary); }
[data-theme="dark"] .modal-header { border-bottom-color: var(--border-color); }
[data-theme="dark"] .modal-footer { border-top-color: var(--border-color); }
[data-theme="dark"] .dropdown-menu { background: #1e1f38; border-color: var(--border-color); }
[data-theme="dark"] .dropdown-item { color: var(--text-primary); }
[data-theme="dark"] .dropdown-item:hover { background: rgba(99,102,241,0.12); color: #fff; }
[data-theme="dark"] .alert-info { background: #1a2035; border-color: #2a3560; color: #94a3b8; }
[data-theme="dark"] .alert-success { background: #0d2818; border-color: #14532d; color: #4ade80; }
[data-theme="dark"] .alert-warning { background: #1f1a0d; border-color: #78350f; color: #fcd34d; }
[data-theme="dark"] .alert-danger { background: #200d0d; border-color: #7f1d1d; color: #f87171; }
[data-theme="dark"] .input-group-text { background: #1e1f38; border-color: var(--border-color); color: var(--text-secondary); }
[data-theme="dark"] .template-preview { background: #1a1b30; border-color: var(--border-color); color: var(--text-primary); }
[data-theme="dark"] .email-address-box { background: #1a1b30; border-color: var(--primary); color: #a5b4fc; }
[data-theme="dark"] .topic-tag { background: rgba(99,102,241,0.18); color: #a5b4fc; }
[data-theme="dark"] .spintax-help { background: #1f1a0d; border-color: #78350f; }
[data-theme="dark"] .contact-card { background: var(--card-bg); border-color: var(--border-color); }
[data-theme="dark"] hr { border-color: var(--border-color); }
[data-theme="dark"] .nav-tabs .nav-link { color: var(--text-secondary); border-color: transparent; }
[data-theme="dark"] .nav-tabs .nav-link.active { background: var(--card-bg); border-color: var(--border-color); color: var(--text-primary); }
[data-theme="dark"] .nav-tabs { border-bottom-color: var(--border-color); }
[data-theme="dark"] select option { background: #1e1f38; color: var(--text-primary); }

/* ─── THEME TOGGLE BUTTON ───────────────────────────────────── */
.btn-theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 5px 10px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.btn-theme-toggle:hover { background: rgba(99,102,241,0.08); color: var(--text-primary); border-color: var(--primary); }

/* ─── DASHBOARD DRAG & COLLAPSE ─────────────────────────────── */
.dash-section { position: relative; }
.dash-section.sortable-ghost { opacity: 0.35; }
.dash-section.sortable-chosen { cursor: grabbing; }
.dash-section.sortable-drag { box-shadow: 0 8px 32px rgba(0,0,0,0.18); }

.dash-drag-handle {
  cursor: grab;
  color: var(--text-secondary);
  opacity: 0.45;
  padding: 0 2px;
  font-size: 16px;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.dash-drag-handle:hover { opacity: 1; }
.sortable-chosen .dash-drag-handle { cursor: grabbing; }

.card-collapse-btn {
  background: none;
  border: none;
  padding: 2px 5px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  border-radius: 5px;
  transition: background 0.15s, transform 0.22s;
  flex-shrink: 0;
}
.card-collapse-btn:hover { background: rgba(99,102,241,0.1); color: var(--primary); }
.card-collapse-btn.is-collapsed i { transform: rotate(-90deg); display: inline-block; }
.card-collapse-btn i { transition: transform 0.22s; display: inline-block; }
