/* ============================================
   PULSE-AI DASHBOARD — Shared Styles
   ============================================ */

:root {
  /* Brand */
  --primary: #6C5CE7;
  --primary-light: #A29BFE;
  --primary-dark: #5A4BD1;
  --accent: #00CEC9;
  --accent-light: #81ECEC;

  /* Status */
  --red: #FF6B6B;
  --red-bg: #FFF0F0;
  --orange: #FDCB6E;
  --orange-bg: #FFF8E7;
  --green: #00B894;
  --green-bg: #E8FFF7;
  --blue: #74B9FF;
  --blue-bg: #EBF5FF;

  /* Neutrals */
  --bg: #F5F6FA;
  --card: #FFFFFF;
  --sidebar-bg: #1E1E2E;
  --sidebar-hover: #2D2D44;
  --sidebar-active: #6C5CE7;
  --text: #2D3436;
  --text-light: #636E72;
  --text-muted: #B2BEC3;
  --border: #E1E5EE;

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: #fff;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand .logo {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
}

.sidebar-brand h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.sidebar-brand span {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.nav-section {
  margin-bottom: 8px;
}
.nav-section-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.35);
  padding: 12px 12px 6px;
  font-weight: 600;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
}
.nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
  text-decoration: none;
}
.nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
}
.nav-link .icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* Top bar */
.topbar {
  height: var(--header-height);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--text-light);
}

.topbar-meta .badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.72rem;
}

.badge-pre { background: var(--orange-bg); color: #E17055; }
.badge-ok { background: var(--green-bg); color: var(--green); }
.badge-alert { background: var(--red-bg); color: var(--red); }

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  padding: 4px;
}

/* Content area */
.content {
  padding: 28px 32px 48px;
  max-width: 1200px;
}

/* ============================================
   COMPONENTS
   ============================================ */

/* -- KPI Cards -- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.kpi-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}
.kpi-card:hover { box-shadow: var(--shadow); }

.kpi-card .kpi-label {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 500;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.kpi-card .kpi-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.kpi-card .kpi-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.kpi-card.highlight { border-left: 4px solid var(--primary); }
.kpi-card.success { border-left: 4px solid var(--green); }
.kpi-card.warning { border-left: 4px solid var(--orange); }
.kpi-card.danger { border-left: 4px solid var(--red); }

/* -- Section Cards -- */
.section-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  overflow: hidden;
}

.section-card .card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-card .card-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.section-card .card-body {
  padding: 20px 24px;
}

/* -- Tables -- */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

thead th {
  background: var(--bg);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tbody tr:hover { background: rgba(108, 92, 231, 0.03); }
tbody tr:last-child td { border-bottom: none; }

/* -- Progress bars -- */
.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 10px;
}
.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.fill-primary { background: var(--primary); }
.fill-green { background: var(--green); }
.fill-orange { background: var(--orange); }
.fill-red { background: var(--red); }

.progress-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  min-width: 40px;
  text-align: right;
}

/* -- Alert banners -- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.88rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}
.alert-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.alert-red { background: var(--red-bg); color: #C0392B; border-left: 4px solid var(--red); }
.alert-orange { background: var(--orange-bg); color: #E17055; border-left: 4px solid var(--orange); }
.alert-green { background: var(--green-bg); color: #00B894; border-left: 4px solid var(--green); }
.alert-blue { background: var(--blue-bg); color: #0984E3; border-left: 4px solid var(--blue); }

/* -- Checklist -- */
.checklist { list-style: none; }
.checklist li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}
.checklist li:last-child { border-bottom: none; }
.check-icon { font-size: 1.1rem; flex-shrink: 0; }
.check-done { color: var(--green); }
.check-pending { color: var(--text-muted); }

/* -- Tags -- */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
}
.tag-bryan { background: #EBF5FF; color: #0984E3; }
.tag-theo { background: #FFF0F0; color: #E17055; }
.tag-both { background: #E8FFF7; color: #00B894; }

/* -- Timeline -- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 10px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  margin-bottom: 20px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -22px; top: 6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--card);
}
.timeline-item.done::before { background: var(--green); }
.timeline-item.pending::before { background: var(--text-muted); }

.timeline-item h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.timeline-item p {
  font-size: 0.82rem;
  color: var(--text-light);
}

/* -- Funnel diagram -- */
.funnel { text-align: center; margin: 24px 0; }
.funnel-step {
  margin: 0 auto;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  position: relative;
  margin-bottom: 6px;
}
.funnel-step .funnel-meta {
  font-weight: 400;
  font-size: 0.78rem;
  opacity: 0.85;
  display: block;
  margin-top: 2px;
}
.funnel-step::after {
  content: '';
  display: block;
  width: 0; height: 0;
  margin: 0 auto;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
}
.f1 { max-width: 100%; background: #EBF5FF; color: #0984E3; }
.f2 { max-width: 85%; background: #F0EDFF; color: var(--primary); }
.f3 { max-width: 65%; background: #E8FFF7; color: #00B894; }
.f4 { max-width: 50%; background: #FFF8E7; color: #E17055; }
.f5 { max-width: 40%; background: var(--primary); color: #fff; }

.funnel-arrow {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 4px 0;
}

/* -- Two column layout -- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

/* -- Competitor cards -- */
.competitor-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: box-shadow 0.2s;
}
.competitor-card:hover { box-shadow: var(--shadow); }
.competitor-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.competitor-card .comp-meta {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 12px;
}
.competitor-card .comp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.comp-tag-strength { background: var(--green-bg); color: var(--green); padding: 2px 8px; border-radius: 10px; font-size: 0.7rem; font-weight: 600; }
.comp-tag-weakness { background: var(--red-bg); color: var(--red); padding: 2px 8px; border-radius: 10px; font-size: 0.7rem; font-weight: 600; }

/* -- Section title -- */
.page-intro {
  margin-bottom: 28px;
}
.page-intro h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 6px;
}
.page-intro p {
  color: var(--text-light);
  font-size: 0.92rem;
  max-width: 600px;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

/* -- Matrice -- */
.matrix-check { color: var(--green); font-weight: 700; }
.matrix-partial { color: var(--orange); font-weight: 700; }
.matrix-no { color: var(--red); font-weight: 700; }

/* -- Code / preformatted -- */
.code-block {
  background: var(--sidebar-bg);
  color: #DFE6E9;
  padding: 18px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
}

/* -- Tabs -- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 10px 18px;
  border: none;
  background: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .main {
    margin-left: 0;
  }
  .hamburger { display: block; }
  .content { padding: 20px 16px 40px; }
  .topbar { padding: 0 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-card .kpi-value { font-size: 1.3rem; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

/* ---- Overlay for mobile sidebar ---- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* ============================================
   DARK MODE
   ============================================ */
body.dark {
  --bg: #121218;
  --card: #1E1E2E;
  --sidebar-bg: #0D0D14;
  --sidebar-hover: #2D2D44;
  --text: #DFE6E9;
  --text-light: #B2BEC3;
  --text-muted: #636E72;
  --border: #2D2D44;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
  --red-bg: #2D1B1B;
  --orange-bg: #2D2518;
  --green-bg: #1B2D24;
  --blue-bg: #1B2230;
}
body.dark .topbar { background: var(--card); border-bottom-color: var(--border); }
body.dark table thead th { background: #16161F; }
body.dark .code-block { background: #0D0D14; }
body.dark .tracker-input, body.dark .textarea-full { background: #16161F; color: var(--text); border-color: var(--border); }
body.dark .tracker-input:focus, body.dark .textarea-full:focus { background: #1E1E2E; }
body.dark select, body.dark input[type="date"] { background: #16161F; color: var(--text); border-color: var(--border); }

/* -- Dark mode toggle -- */
.dark-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.3s;
}
.dark-toggle:hover { background: var(--primary-dark); }

/* ============================================
   SEARCH OVERLAY
   ============================================ */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  padding: 10vh 20px 20px;
  justify-content: center;
  align-items: flex-start;
}
.search-overlay.show { display: flex; }

.search-box {
  background: var(--card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.search-input {
  width: 100%;
  padding: 16px 20px;
  border: none;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  background: var(--card);
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}
.search-result-item {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 0.88rem;
  transition: background 0.15s;
}
.search-result-item:hover { background: var(--bg); text-decoration: none; }
.search-result-item .sr-page { font-size: 0.72rem; color: var(--primary); font-weight: 600; text-transform: uppercase; }
.search-result-item .sr-title { font-weight: 600; }
.search-result-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 0.88rem; }

/* -- Search trigger -- */
.search-trigger {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.2s;
}
.search-trigger:hover { border-color: var(--primary); }
.search-kbd { background: var(--card); padding: 1px 6px; border-radius: 4px; font-size: 0.7rem; border: 1px solid var(--border); }

/* ============================================
   EXPORT PDF BUTTON
   ============================================ */
.btn-export-pdf {
  position: fixed;
  bottom: 20px;
  right: 74px;
  padding: 10px 16px;
  border-radius: 22px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 200;
  display: flex; align-items: center; gap: 6px;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-export-pdf:hover { border-color: var(--primary); color: var(--primary); }

/* ---- Admin Login Modal ---- */
.admin-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.admin-modal-overlay.show { opacity: 1; pointer-events: all; }
.admin-modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  width: 320px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  text-align: center;
}
.admin-modal-box .logo {
  width: 48px; height: 48px; font-size: 1.4rem;
  margin: 0 auto 16px;
}
.admin-modal-box h3 { font-size: 1.05rem; margin-bottom: 4px; }
.admin-modal-box p { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 20px; }
.admin-modal-box input {
  width: 100%; box-sizing: border-box;
  margin-bottom: 10px;
}
.admin-modal-box .btn-primary { width: 100%; }
.admin-modal-error { color: var(--red); font-size: 0.8rem; margin-top: 8px; display: none; }

/* Sidebar admin badge */
.nav-link .admin-lock {
  margin-left: auto;
  font-size: 0.7rem;
  opacity: 0.4;
  transition: opacity 0.2s;
}
.nav-link:hover .admin-lock { opacity: 0.8; }
.admin-logged-in-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; color: var(--green);
  padding: 3px 8px; border-radius: 20px;
  background: rgba(16,185,129,0.1);
  margin: 4px 12px 8px;
}

/* ---- Print ---- */
@media print {
  .sidebar, .topbar, .hamburger, .dark-toggle, .btn-export-pdf, .search-overlay { display: none !important; }
  .main { margin-left: 0 !important; }
  .content { padding: 0 !important; }
  .section-card { break-inside: avoid; }
  body.dark { --bg: #fff; --card: #fff; --text: #000; --text-light: #333; --border: #ddd; }
}

/* ============================================
   SHARING SYSTEM
   ============================================ */

/* ---- Share banner ---- */
.share-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.share-banner-icon { font-size: 0.9rem; }
.share-banner-sep { opacity: 0.5; }
.share-banner-note { opacity: 0.85; font-weight: 400; }

/* Décaler le layout quand le bandeau est visible */
body:has(.share-banner:not([style*="display:none"])) .sidebar,
body:has(.share-banner:not([style*="display:none"])) .main {
  padding-top: 32px;
}

/* ---- Error page ---- */
.share-error {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.share-error-box {
  text-align: center;
  padding: 48px 32px;
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  max-width: 400px;
  width: 90%;
}
.share-error-box h2 { margin-bottom: 12px; }
.share-error-box p { color: var(--text-muted); font-size: 0.9rem; }

/* ---- Propose button ---- */
.propose-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  padding: 10px 18px;
  border-radius: 22px;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  font-family: inherit;
}
.propose-btn:hover {
  background: var(--primary-dark, #4f46e5);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.45);
}

/* ---- Propose modal ---- */
.propose-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.propose-modal {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.propose-modal h3 { margin-bottom: 4px; }
.propose-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}
.propose-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 100px;
}
.propose-select:focus, .propose-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.propose-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ---- Admin login screen ---- */
.admin-login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.admin-login-box {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 40px 36px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow);
  text-align: center;
}
.admin-login-box h2 { font-size: 1.3rem; }

/* ---- Token cards in share-admin ---- */
.token-card .card-header { align-items: flex-start; }
.token-url-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.token-url-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
}
.copy-btn {
  white-space: nowrap;
}
.btn-delete {
  background: none;
  border: 1px solid var(--border);
  color: var(--red, #ef4444);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.btn-delete:hover { background: rgba(239,68,68,0.08); border-color: var(--red, #ef4444); }

/* ---- Pages checkboxes grid ---- */
.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.page-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: background 0.15s;
}
.page-checkbox-label:hover { background: var(--bg); }
.page-checkbox-label input[type="checkbox"] { accent-color: var(--primary); }

/* ---- Toggle switch ---- */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ---- Form label ---- */
.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 6px;
}

/* ---- Proposals list ---- */
.proposal-card { transition: opacity 0.2s; }
.proposal-done { opacity: 0.6; }
.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---- Buttons ---- */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.btn-primary:hover { background: var(--primary-dark, #4f46e5); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
