/* ═══════════════════════════════════════════════════════════
   OCT GROUP — Precision Luxury Design System
   Real Estate Automation SaaS

   Aesthetic: Linear meets Mediterranean warmth
   Deep navy surfaces, liquid cyan light, geometric precision
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@300;400;600;700;800&family=Rubik:wght@400;500;600;700&display=swap');

/* ── Design Tokens ──────────────────────────────────────── */
:root {
  /* Brand */
  --cyan: #88dee9;
  --cyan-soft: rgba(136, 222, 233, 0.12);
  --cyan-glow: rgba(136, 222, 233, 0.25);
  --navy: #0a1628;
  --navy-mid: #132d4a;
  --navy-light: #1b4165;
  --navy-surface: #0e1f38;
  --green: #b3ea60;
  --green-soft: rgba(179, 234, 96, 0.15);

  /* Surfaces */
  --bg: #f4f7fa;
  --bg-warm: #f8fafb;
  --surface: #ffffff;
  --surface-hover: #f0f6f8;
  --surface-selected: #eaf7f9;
  --surface-elevated: #ffffff;

  /* Text */
  --text-primary: #1a2332;
  --text-secondary: #5a6b7d;
  --text-tertiary: #8b99a8;
  --text-inverse: #ffffff;
  --text-on-cyan: #082030;

  /* Borders */
  --border: #e4eaf0;
  --border-subtle: #eef2f6;
  --border-focus: var(--cyan);

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-pill: 100px;

  /* Shadows — layered for depth */
  --sh-xs: 0 1px 2px rgba(10, 22, 40, 0.04);
  --sh-sm: 0 1px 3px rgba(10, 22, 40, 0.06), 0 1px 2px rgba(10, 22, 40, 0.04);
  --sh-md: 0 4px 12px rgba(10, 22, 40, 0.07), 0 1px 3px rgba(10, 22, 40, 0.05);
  --sh-lg: 0 8px 32px rgba(10, 22, 40, 0.1), 0 2px 8px rgba(10, 22, 40, 0.06);
  --sh-xl: 0 20px 60px rgba(10, 22, 40, 0.15), 0 4px 16px rgba(10, 22, 40, 0.08);
  --sh-cyan: 0 4px 20px rgba(136, 222, 233, 0.3);
  --sh-float: 0 12px 40px rgba(10, 22, 40, 0.18);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 0.15s;
  --dur: 0.25s;
  --dur-slow: 0.4s;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  font-family: 'Assistant', 'Rubik', -apple-system, sans-serif;
  direction: rtl;
  text-align: right;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
input, button, textarea, select { font-family: inherit; }

.container { max-width: 1000px; margin: 0 auto; padding: 24px 20px; }

/* ═══════════════════════════════════════════════════════════
   AUTH VIEW — Atmospheric login
   ═══════════════════════════════════════════════════════════ */
.auth-view {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  direction: ltr; /* force LTR for centering */
  text-align: center;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(136, 222, 233, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(179, 234, 96, 0.04) 0%, transparent 40%),
    linear-gradient(160deg, #060d18 0%, var(--navy) 30%, var(--navy-mid) 70%, var(--navy-light) 100%);
  overflow: hidden;
}

/* Subtle animated grain */
.auth-view::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  animation: grainDrift 8s linear infinite;
}

@keyframes grainDrift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

.auth-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 48px 44px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--sh-xl), 0 0 0 1px rgba(255,255,255,0.06);
  position: relative;
  animation: cardReveal 0.5s var(--ease-out);
  direction: rtl; /* restore RTL inside card */
  text-align: right;
  margin: 0 auto;
}

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo { text-align: center; margin-bottom: 28px; direction: ltr; }
.auth-logo img { height: 64px; margin: 0 auto; display: block; }

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  justify-content: center;
  background: var(--bg);
  border-radius: var(--r-pill);
  padding: 4px;
  direction: rtl;
}

.auth-tab {
  flex: 1;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  font-family: inherit;
}

.auth-tab:hover { color: var(--text-primary); }

.auth-tab.active {
  background: var(--navy);
  color: var(--text-inverse);
  box-shadow: var(--sh-sm);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.95rem;
  outline: none;
  transition: all var(--dur) var(--ease);
  background: var(--surface);
  color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}

.form-group input::placeholder { color: var(--text-tertiary); }

.auth-links { text-align: center; font-size: 0.85rem; margin-top: 6px; }
.auth-links a {
  color: var(--cyan);
  font-weight: 600;
  transition: color var(--dur-fast);
}
.auth-links a:hover { color: var(--navy-light); }

.auth-error {
  color: #dc2626;
  font-size: 0.85rem;
  padding: 12px 16px;
  background: #fef2f2;
  border-radius: var(--r-sm);
  margin-top: 8px;
  border: 1px solid #fecaca;
  line-height: 1.5;
}

.auth-status-message { text-align: center; padding: 36px 20px; }
.auth-status-message h3 { font-size: 1.2rem; color: var(--navy); margin: 18px 0 8px; font-weight: 700; }
.auth-status-message p { color: var(--text-secondary); line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════
   BUTTONS — Precision pill shapes
   ═══════════════════════════════════════════════════════════ */
.btn {
  font-family: inherit;
  font-weight: 700;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  border: none;
  font-size: 0.9rem;
  padding: 11px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.2;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--navy);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background: var(--navy-mid);
  transform: translateY(-1px);
  box-shadow: var(--sh-lg);
}

.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }

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

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

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

.btn-sm { padding: 7px 16px; font-size: 0.82rem; }
.btn-block { width: 100%; }

.btn-accent {
  background: var(--cyan);
  color: var(--text-on-cyan);
  font-weight: 700;
}

.btn-accent:hover {
  background: var(--green);
  box-shadow: 0 4px 16px rgba(179, 234, 96, 0.3);
}

/* ═══════════════════════════════════════════════════════════
   HEADER HERO — Dramatic yet refined
   ═══════════════════════════════════════════════════════════ */
.header-hero {
  background:
    radial-gradient(ellipse at 30% 0%, rgba(136, 222, 233, 0.1) 0%, transparent 50%),
    linear-gradient(150deg, #060d18 0%, var(--navy) 40%, var(--navy-mid) 100%);
  color: var(--text-inverse);
  padding: 36px 24px 72px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan) 0%, var(--green) 50%, var(--cyan) 100%);
  background-size: 200% 100%;
  animation: shimmerBar 4s linear infinite;
}

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

.header-hero::after {
  content: '';
  position: absolute;
  bottom: -1px; left: -5%; right: -5%;
  height: 40px;
  background: var(--bg);
  border-radius: 50% 50% 0 0;
}

.header-hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-inverse);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.header-subtitle {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--cyan);
  opacity: 0.9;
  margin-bottom: 4px;
}

.header-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 960px;
  margin: 0 auto 20px;
}

.header-logo img {
  height: 38px;
  background: rgba(255,255,255,0.95);
  padding: 5px 10px;
  border-radius: var(--r-xs);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.confidential-badge {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

.header-controls { margin-top: 20px; }

.user-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  justify-content: center;
}

.user-greeting {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.88rem;
}

/* ── Package Selector — Frosted glass ───────────────────── */
.package-selector {
  display: inline-flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  padding: 6px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.package-option {
  padding: 10px 24px;
  border-radius: var(--r-pill);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all var(--dur) var(--ease);
  border: none;
  background: transparent;
  font-family: inherit;
  white-space: nowrap;
}

.package-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

.package-option.selected {
  background: var(--cyan);
  color: var(--text-on-cyan);
  font-weight: 700;
  box-shadow: var(--sh-cyan);
}

/* ═══════════════════════════════════════════════════════════
   CATALOG — Chapter & Feature Architecture
   ═══════════════════════════════════════════════════════════ */
.chapter-section {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  transition: all var(--dur) var(--ease);
}

.chapter-section:hover {
  box-shadow: var(--sh-md);
  border-color: var(--border);
}

.chapter-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-warm);
}

.chapter-title {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.chapter-number {
  background: var(--navy);
  color: var(--cyan);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
}

.chapter-actions { display: flex; gap: 6px; }

.chapter-actions button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  padding: 5px 14px;
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  font-family: inherit;
  font-weight: 600;
}

.chapter-actions button:hover {
  background: var(--cyan);
  color: var(--text-on-cyan);
  border-color: var(--cyan);
  box-shadow: var(--sh-cyan);
}

.feature-grid { list-style: none; }

.feature-card {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}

.feature-card:last-child { border-bottom: none; }

.feature-card:hover {
  background: var(--surface-hover);
}

.feature-card.selected {
  background: var(--surface-selected);
  border-right: 3px solid var(--cyan);
}

.feature-card.diamond-feature {
  background: linear-gradient(to left, var(--cyan-soft), transparent 60%);
}

.feature-card.diamond-feature.selected {
  background: linear-gradient(to left, rgba(136, 222, 233, 0.12), var(--surface-selected));
}

.feature-content { flex: 1; padding-left: 14px; }

.feature-header {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.feature-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-primary);
  margin: 0;
}

.diamond-badge {
  background: linear-gradient(135deg, var(--cyan), var(--green));
  color: var(--text-on-cyan);
  padding: 2px 12px;
  border-radius: var(--r-pill);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.time-badge {
  background: var(--bg);
  color: var(--text-secondary);
  padding: 3px 12px;
  border-radius: var(--r-pill);
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
}

.feature-desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 8px;
}

.client-req {
  background: var(--bg);
  border: 1px dashed var(--border);
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.5;
}

/* ── Checkbox — Refined ────────────────────────────────── */
.checkbox-wrapper {
  position: relative;
  width: 22px; height: 22px;
  flex-shrink: 0; margin-top: 2px;
}

.custom-checkbox {
  position: absolute;
  opacity: 0;
  width: 22px; height: 22px;
  cursor: pointer;
  z-index: 1;
}

.checkmark {
  position: absolute;
  top: 0; right: 0;
  width: 22px; height: 22px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-xs);
  transition: all var(--dur) var(--ease);
}

.feature-card:hover .checkmark { border-color: var(--cyan); }

.custom-checkbox:checked ~ .checkmark {
  background: var(--navy);
  border-color: var(--navy);
  box-shadow: 0 2px 6px rgba(10, 22, 40, 0.2);
}

.checkmark::after {
  content: '';
  position: absolute;
  display: none;
  left: 6px; top: 2px;
  width: 6px; height: 10px;
  border: solid var(--text-inverse);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.custom-checkbox:checked ~ .checkmark::after { display: block; }

.diamond-feature .checkmark { border-color: var(--cyan); }
.diamond-feature .custom-checkbox:checked ~ .checkmark {
  background: var(--cyan);
  border-color: var(--cyan);
}
.diamond-feature .checkmark::after { border-color: var(--navy); }

/* ═══════════════════════════════════════════════════════════
   STICKY FOOTER — Command bar
   ═══════════════════════════════════════════════════════════ */
.sticky-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--navy);
  border-top: 2px solid var(--cyan);
  z-index: 1000;
  box-shadow: 0 -8px 40px rgba(10, 22, 40, 0.35);
}

.footer-inner { max-width: 1000px; margin: 0 auto; padding: 10px 20px; }

.progress-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 2px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  transition: width 0.5s var(--ease);
  border-radius: 2px;
}

.footer-stats {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.stat-live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
  animation: livePulse 2s ease-in-out infinite;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-inverse);
  transition: transform var(--dur) var(--ease-bounce);
}

.stat-value.bump { animation: bumpAnim 0.35s var(--ease-bounce); }

.stat-label {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.footer-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding-bottom: 2px;
}

/* ═══════════════════════════════════════════════════════════
   ADMIN PANEL — Professional dashboard
   ═══════════════════════════════════════════════════════════ */
.admin-header {
  background: var(--navy);
  padding: 12px 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 2px solid rgba(136, 222, 233, 0.3);
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1200px;
  justify-content: space-between;
}

.admin-logo img {
  height: 28px;
  background: rgba(255,255,255,0.95);
  padding: 4px 8px;
  border-radius: var(--r-xs);
}

.admin-title {
  color: var(--cyan);
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.admin-tabs {
  background: var(--surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 28px;
  display: flex;
  gap: 0;
  overflow-x: auto;
  position: sticky;
  top: 52px;
  z-index: 9;
  -webkit-overflow-scrolling: touch;
}

.admin-tabs::-webkit-scrollbar { height: 0; }

.admin-tab {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-tertiary);
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all var(--dur) var(--ease);
  position: relative;
}

.admin-tab::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 20%; right: 20%;
  height: 2px;
  background: var(--cyan);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform var(--dur) var(--ease);
}

.admin-tab.active {
  color: var(--navy);
  font-weight: 700;
}

.admin-tab.active::after { transform: scaleX(1); }
.admin-tab:hover { color: var(--text-primary); }

.admin-content { max-width: 1100px; margin: 0 auto; padding: 24px 28px; }
.admin-tab-panel { display: none; }
.admin-tab-panel.active { display: block; }

/* Admin Table Styling */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.admin-table th {
  padding: 10px 12px;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  text-align: right;
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.admin-table tr:hover td { background: var(--surface-hover); }

/* ═══════════════════════════════════════════════════════════
   MODALS — Cinematic overlays
   ═══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 13, 24, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  padding: 16px;
  animation: fadeIn var(--dur) var(--ease);
}

.modal-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--sh-float), 0 0 0 1px rgba(255,255,255,0.05);
  width: 100%;
  animation: modalSlideUp var(--dur-slow) var(--ease-out);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(32px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.modal-lg { max-width: 720px; }

.modal-header {
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  padding: 22px 28px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1;
}

.modal-header h2 {
  color: var(--cyan);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-inverse);
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--dur-fast);
}

.modal-close:hover { background: rgba(255, 255, 255, 0.18); }
.modal-body { padding: 24px 28px; }
.modal-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 10px;
}

/* ═══════════════════════════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════════════════════════ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  cursor: zoom-out;
  animation: fadeIn var(--dur) var(--ease);
}

.lightbox-content { position: relative; }

.lightbox-close {
  position: absolute;
  top: -44px; right: 0;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-inverse);
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background var(--dur-fast);
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.25); }

#lightboxImage {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: var(--r-md);
  box-shadow: var(--sh-float);
  object-fit: contain;
}

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════ */
@keyframes bumpAnim {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(34, 197, 94, 0.5); }
  50% { opacity: 0.6; box-shadow: 0 0 16px rgba(34, 197, 94, 0.3); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-5px); }
  30% { transform: translateX(5px); }
  45% { transform: translateX(-3px); }
  60% { transform: translateX(3px); }
}

.shake { animation: shake 0.45s var(--ease); }
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ═══════════════════════════════════════════════════════════
   TOGGLE SWITCH — iOS-style
   ═══════════════════════════════════════════════════════════ */
.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input { display: none; }

.toggle-slider {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  transition: background var(--dur) var(--ease);
  flex-shrink: 0;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform var(--dur) var(--ease);
}

.toggle-switch input:checked + .toggle-slider {
  background: #22c55e;
}

.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(-18px);
}

/* Red variant for blocked */
.toggle-switch.toggle-danger input:checked + .toggle-slider {
  background: #ef4444;
}

.toggle-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════
   ADMIN CARDS — Better feature/system cards
   ═══════════════════════════════════════════════════════════ */
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 16px;
  transition: all var(--dur) var(--ease);
}

.admin-card:hover {
  border-color: var(--border);
  box-shadow: var(--sh-sm);
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.admin-card-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.admin-card-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-top: 4px;
}

.admin-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.admin-card-actions button {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all var(--dur-fast);
}

.admin-card-actions button:hover {
  background: var(--cyan-soft);
  border-color: var(--cyan);
  color: var(--text-primary);
}

.admin-card-actions button.danger:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

/* Feature edit form in-place */
.feature-edit-form {
  background: var(--bg-warm);
  border: 2px solid var(--cyan);
  border-radius: var(--r-md);
  padding: 20px;
  animation: fadeIn var(--dur) var(--ease);
}

/* System/Chapter inline cards */
.admin-inline-section {
  margin-top: 10px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--r-sm);
  border: 1px solid var(--border-subtle);
}

.admin-inline-section h4 {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 700;
}

/* Badge pills */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge.approved { background: #dcfce7; color: #166534; }
.status-badge.pending { background: #fef9c3; color: #854d0e; }
.status-badge.blocked { background: #fecaca; color: #991b1b; }
.status-badge.active { background: #dbeafe; color: #1e40af; }
.status-badge.inactive { background: var(--bg); color: var(--text-tertiary); }

/* ═══════════════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════════════ */
@media print {
  .sticky-footer, .admin-header, .admin-tabs, .modal-overlay,
  .lightbox-overlay, .header-controls, .package-selector,
  .chapter-actions, .footer-actions, .user-bar, .auth-view {
    display: none !important;
  }
  body { background: #fff; font-size: 11pt; }
  .header-hero { background: var(--navy) !important; padding: 20px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .header-hero::after { display: none; }
  .chapter-section { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
  .feature-card { break-inside: avoid; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .header-hero { padding: 28px 16px 56px; }
  .header-hero h1 { font-size: 1.6rem; }
  .header-subtitle { font-size: 0.95rem; }
  .header-top-bar { margin-bottom: 14px; }
  .header-logo img { height: 30px; }

  .package-selector { flex-wrap: wrap; gap: 4px; padding: 5px; }
  .package-option { padding: 8px 16px; font-size: 0.82rem; }

  .container { padding: 16px 12px; }

  .chapter-header { padding: 14px 16px; flex-direction: column; gap: 8px; align-items: flex-start; }
  .chapter-title { font-size: 1rem; }
  .chapter-number { width: 26px; height: 26px; font-size: 0.75rem; }

  .feature-card { padding: 14px 16px; }
  .feature-content { padding-left: 10px; }
  .feature-title { font-size: 0.9rem; }
  .feature-desc { font-size: 0.82rem; }
  .client-req { font-size: 0.78rem; padding: 8px 10px; }

  .footer-stats { gap: 16px; padding: 4px 0; }
  .stat-value { font-size: 1.05rem; }
  .footer-inner { padding: 8px 14px; }

  .auth-card { padding: 32px 20px; max-width: 100%; }
  .auth-logo img { height: 48px; }
  .auth-view { padding: 12px; }

  .modal-card { border-radius: var(--r-lg); max-height: 96vh; }
  .modal-header { padding: 16px 20px; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .modal-body { padding: 16px 20px; }
  .modal-footer { padding: 12px 20px; flex-wrap: wrap; }

  .admin-header { padding: 10px 16px; }
  .admin-tabs { padding: 0 12px; top: 48px; }
  .admin-tab { padding: 10px 14px; font-size: 0.78rem; }
  .admin-content { padding: 16px 12px; }
}

@media (max-width: 480px) {
  .header-hero h1 { font-size: 1.35rem; }
  .header-subtitle { font-size: 0.88rem; }
  .auth-tabs { gap: 2px; }
  .feature-header { flex-direction: column; align-items: flex-start; gap: 4px; }
  .footer-stats { gap: 12px; }
  .stat-value { font-size: 0.95rem; }
  .stat-label { font-size: 0.58rem; }
}
