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

:root {
  /* Brand Colors inspired by Official Glow & Beauty Center Contract */
  --brand-primary: #0f2932;
  --brand-primary-dark: #08181e;
  --brand-primary-light: #183d4a;
  --brand-secondary: #5c7d8d;
  --brand-secondary-light: #7c9eae;
  --brand-accent: #c8a97e;
  --brand-accent-light: #e2c9a6;
  --brand-teal: #14b8a6;
  --brand-teal-soft: rgba(20, 184, 166, 0.14);

  /* Dark Luxury Theme (Default) */
  --bg-main: #071318;
  --bg-surface: #0d2129;
  --bg-card: rgba(16, 40, 49, 0.85);
  --bg-card-hover: rgba(22, 53, 65, 0.95);
  --bg-glass: rgba(15, 41, 50, 0.82);
  --border-color: rgba(124, 158, 174, 0.18);
  --border-highlight: rgba(200, 169, 126, 0.45);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --info: #38bdf8;
  --info-bg: rgba(56, 189, 248, 0.12);

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(200, 169, 126, 0.2);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-main: #f4f7f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-glass: rgba(255, 255, 255, 0.92);
  --border-color: rgba(15, 41, 50, 0.12);
  --border-highlight: rgba(15, 41, 50, 0.3);

  --text-primary: #0f2932;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --shadow-sm: 0 2px 8px rgba(15, 41, 50, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 41, 50, 0.09);
  --shadow-lg: 0 16px 40px rgba(15, 41, 50, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: 'Cairo', 'Tajawal', sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: 'Cairo', 'Tajawal', sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 15% 15%, rgba(92, 125, 141, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(200, 169, 126, 0.08) 0%, transparent 45%);
  min-height: 100vh;
}

/* =========================================================
   PASSWORD LOCK SCREEN
   ========================================================= */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #061014 0%, #0f2932 50%, #163844 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.auth-overlay.unlocked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-bg-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image: radial-gradient(#c8a97e 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: rgba(13, 33, 41, 0.88);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(200, 169, 126, 0.35);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2.25rem;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 40px rgba(200, 169, 126, 0.12);
  animation: floatIn 0.6s ease-out;
}

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

.auth-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.auth-lotus-svg {
  width: 74px;
  height: 74px;
  padding: 13px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(200, 169, 126, 0.2), rgba(92, 125, 141, 0.2));
  border: 1px solid rgba(200, 169, 126, 0.45);
  box-shadow: var(--shadow-glow);
}

.auth-brand-name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: #ffffff;
  line-height: 1.2;
}

.auth-brand-sub {
  font-size: 0.78rem;
  letter-spacing: 4px;
  color: var(--brand-accent);
  text-transform: uppercase;
  font-weight: 600;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  background: rgba(200, 169, 126, 0.12);
  border: 1px solid rgba(200, 169, 126, 0.3);
  color: var(--brand-accent-light);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.auth-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.35rem;
}

.auth-desc {
  font-size: 0.86rem;
  color: #94a3b8;
  margin-bottom: 1.25rem;
}

.auth-input-group {
  position: relative;
  margin-bottom: 0.85rem;
}

.auth-input {
  width: 100%;
  padding: 0.9rem 3rem;
  font-size: 1.25rem;
  font-family: 'Cairo', monospace;
  font-weight: 700;
  letter-spacing: 6px;
  text-align: center;
  background: rgba(7, 19, 24, 0.9);
  border: 1.5px solid rgba(124, 158, 174, 0.3);
  border-radius: var(--radius-md);
  color: #fff;
  outline: none;
  transition: var(--transition);
}

.auth-input:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 4px rgba(200, 169, 126, 0.15);
}

.auth-input.error {
  border-color: var(--danger);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.auth-toggle-vis {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
}

.auth-error-msg {
  color: #f87171;
  font-size: 0.84rem;
  font-weight: 600;
  min-height: 1.3rem;
  margin-bottom: 0.45rem;
}

.auth-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-bottom: 1.15rem;
  direction: ltr;
}

.keypad-btn {
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(124, 158, 174, 0.2);
  background: rgba(24, 61, 74, 0.45);
  color: #e2e8f0;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  transition: var(--transition);
}

.keypad-btn:hover {
  background: rgba(200, 169, 126, 0.22);
  border-color: var(--brand-accent);
  color: #fff;
}

.auth-submit-btn {
  width: 100%;
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, #c8a97e 0%, #a88453 100%);
  color: #08181e;
  font-size: 1rem;
  font-weight: 800;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 8px 20px rgba(200, 169, 126, 0.3);
  transition: var(--transition);
}

.auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(200, 169, 126, 0.45);
}

.auth-footer-meta {
  margin-top: 1.35rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(124, 158, 174, 0.16);
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #94a3b8;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* =========================================================
   TOP HEADER & NAVIGATION
   ========================================================= */
.top-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-Identity {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo-box {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light));
  border: 1px solid var(--border-highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-title-wrap h1 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.brand-title-wrap p {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.verified-pill {
  font-size: 0.7rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.db-status-pill {
  font-size: 0.72rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--info);
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.48rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.action-btn:hover {
  border-color: var(--brand-accent);
  transform: translateY(-1px);
}

.action-btn.primary {
  background: linear-gradient(135deg, #c8a97e, #a88453);
  color: #08181e;
  border-color: transparent;
  font-weight: 800;
}

.action-btn.save-db {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border-color: transparent;
  font-weight: 800;
}

/* Section Navigation Bar */
.nav-tabs-bar {
  background: rgba(8, 24, 30, 0.6);
  border-top: 1px solid var(--border-color);
  overflow-x: auto;
}

[data-theme="light"] .nav-tabs-bar {
  background: rgba(15, 41, 50, 0.04);
}

.nav-tabs-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-tab {
  padding: 0.7rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(200, 169, 126, 0.06);
}

.nav-tab.active {
  color: var(--brand-accent);
  border-bottom-color: var(--brand-accent);
  background: rgba(200, 169, 126, 0.1);
}

.nav-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(124, 158, 174, 0.16);
  font-size: 0.74rem;
}

.nav-tab.active .nav-num {
  background: var(--brand-accent);
  color: #08181e;
}

/* =========================================================
   MAIN CONTAINER & HERO BANNER
   ========================================================= */
.main-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.65rem 1.5rem 4rem;
}

.hero-banner {
  position: relative;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #0f2932 0%, #163a47 60%, #1f4e5f 100%);
  border: 1px solid rgba(200, 169, 126, 0.35);
  padding: 2rem;
  margin-bottom: 1.85rem;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  color: #fff;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 2rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0.85rem;
  border-radius: 999px;
  background: rgba(200, 169, 126, 0.18);
  border: 1px solid rgba(200, 169, 126, 0.4);
  color: var(--brand-accent-light);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}

.hero-title {
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 0.7rem;
}

.hero-title span {
  color: var(--brand-accent);
}

.hero-subtitle {
  color: #cbd5e1;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  max-width: 720px;
}

.hero-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(8, 24, 30, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
  color: #e2e8f0;
}

.meta-pill strong {
  color: var(--brand-accent-light);
}

.hero-stamp-card {
  background: rgba(8, 24, 30, 0.65);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(200, 169, 126, 0.35);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.stamp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stamp-header h3 {
  font-size: 0.92rem;
  color: var(--brand-accent-light);
  font-weight: 800;
}

.stamp-list {
  list-style: none;
  display: grid;
  gap: 0.45rem;
  font-size: 0.83rem;
}

.stamp-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.stamp-list li span:first-child {
  color: #94a3b8;
}

.stamp-list li span:last-child {
  font-weight: 700;
  color: #fff;
}

/* =========================================================
   TOP KPI STRIP
   ========================================================= */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-md);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

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

.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  background: rgba(200, 169, 126, 0.14);
  color: var(--brand-accent);
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-pos {
  color: var(--success);
  font-weight: 700;
}

.badge-warn {
  color: var(--warning);
  font-weight: 700;
}

/* =========================================================
   SECTIONS & CARDS
   ========================================================= */
.study-section {
  margin-bottom: 2.65rem;
  scroll-margin-top: 130px;
  animation: fadeIn 0.35s ease;
}

.study-section.hidden-section {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.section-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.section-num-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-accent), #9b7848);
  color: #08181e;
  font-size: 1.15rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-title-group h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}

.section-title-group p {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(200, 169, 126, 0.3);
}

.card-title {
  font-size: 1.04rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card-title-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

/* =========================================================
   INTERACTIVE FINANCIAL SIMULATOR
   ========================================================= */
.simulator-wrapper {
  display: grid;
  grid-template-columns: 1.05fr 1.35fr;
  gap: 1.35rem;
  align-items: start;
}

.scenario-presets {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
}

.preset-btn {
  flex: 1;
  min-width: 115px;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: rgba(15, 41, 50, 0.5);
  color: var(--text-secondary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

[data-theme="light"] .preset-btn {
  background: #f1f5f9;
}

.preset-btn:hover {
  border-color: var(--brand-accent);
  color: var(--text-primary);
}

.preset-btn.active {
  background: linear-gradient(135deg, rgba(200, 169, 126, 0.25), rgba(200, 169, 126, 0.1));
  border-color: var(--brand-accent);
  color: var(--brand-accent);
}

.slider-group {
  margin-bottom: 1.05rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px dashed var(--border-color);
}

.slider-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.slider-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
}

.slider-val-badge {
  padding: 0.18rem 0.65rem;
  border-radius: 8px;
  background: rgba(200, 169, 126, 0.16);
  border: 1px solid rgba(200, 169, 126, 0.35);
  color: var(--brand-accent);
  font-weight: 800;
  font-size: 0.86rem;
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(124, 158, 174, 0.25);
  outline: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-accent);
  border: 3px solid #08181e;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.sim-results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}

.sim-metric-box {
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-sm);
  background: rgba(8, 24, 30, 0.55);
  border: 1px solid var(--border-color);
}

[data-theme="light"] .sim-metric-box {
  background: #f8fafc;
}

.sim-metric-box.highlight {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(15, 41, 50, 0.6));
  border-color: rgba(16, 185, 129, 0.4);
}

.sim-metric-box.gold {
  background: linear-gradient(135deg, rgba(200, 169, 126, 0.18), rgba(15, 41, 50, 0.6));
  border-color: rgba(200, 169, 126, 0.45);
}

.sim-metric-label {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
}

.sim-metric-value {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text-primary);
}

.sim-metric-sub {
  font-size: 0.73rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

/* Break-even progress bar */
.breakeven-bar-wrap {
  padding: 0.95rem 1.15rem;
  border-radius: var(--radius-sm);
  background: rgba(8, 24, 30, 0.5);
  border: 1px solid var(--border-color);
  margin-bottom: 1.15rem;
}

[data-theme="light"] .breakeven-bar-wrap {
  background: #f8fafc;
}

.progress-track {
  width: 100%;
  height: 11px;
  border-radius: 999px;
  background: rgba(124, 158, 174, 0.2);
  overflow: hidden;
  margin: 0.55rem 0;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  transition: width 0.4s ease;
}

/* =========================================================
   FORMS, INPUTS & CRM PIPELINE CONTROLS
   ========================================================= */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: rgba(8, 24, 30, 0.65);
  color: var(--text-primary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.84rem;
  outline: none;
  transition: var(--transition);
}

[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] .form-textarea {
  background: #f8fafc;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--brand-accent);
}

.form-textarea {
  min-height: 90px;
  resize: vertical;
}

/* =========================================================
   TABLES & COMPARISON MATRICES
   ========================================================= */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th,
.data-table td {
  padding: 0.8rem 0.9rem;
  text-align: right;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: rgba(15, 41, 50, 0.7);
  color: var(--brand-accent-light);
  font-weight: 800;
  white-space: nowrap;
}

[data-theme="light"] .data-table th {
  background: #0f2932;
  color: #fff;
}

.data-table tbody tr:hover {
  background: rgba(200, 169, 126, 0.05);
}

/* =========================================================
   CONTRACT CLAUSE AUDITOR & COPY BOXES
   ========================================================= */
.clause-audit-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  padding: 1.2rem;
  margin-bottom: 1rem;
}

.clause-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.8rem;
}

.clause-box {
  padding: 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  position: relative;
}

.clause-box.before {
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.clause-box.after {
  background: var(--success-bg);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.clause-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  margin-bottom: 0.4rem;
}

.clause-box.before .clause-tag {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.clause-box.after .clause-tag {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.copy-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(200, 169, 126, 0.4);
  background: rgba(200, 169, 126, 0.15);
  color: var(--brand-accent-light);
  font-family: 'Cairo', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.copy-btn:hover {
  background: var(--brand-accent);
  color: #08181e;
}

.step-list {
  display: grid;
  gap: 0.8rem;
}

.step-item {
  display: flex;
  gap: 0.9rem;
  padding: 0.95rem;
  border-radius: var(--radius-sm);
  background: rgba(8, 24, 30, 0.4);
  border: 1px solid var(--border-color);
  align-items: flex-start;
  transition: var(--transition);
}

[data-theme="light"] .step-item {
  background: #f8fafc;
}

.step-item.completed {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.step-badge {
  min-width: 36px;
  height: 34px;
  padding: 0 8px;
  border-radius: 10px;
  background: rgba(200, 169, 126, 0.18);
  border: 1px solid rgba(200, 169, 126, 0.4);
  color: var(--brand-accent);
  font-weight: 800;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-item.completed .step-badge {
  background: var(--success);
  color: #08181e;
  border-color: var(--success);
}

.chart-container {
  position: relative;
  height: 280px;
  width: 100%;
}

.alert-banner {
  display: flex;
  gap: 0.9rem;
  padding: 1.1rem 1.3rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(15, 41, 50, 0.7));
  border: 1px solid rgba(245, 158, 11, 0.4);
  margin-bottom: 1.3rem;
  align-items: flex-start;
}

/* Toast Notification */
.toast-notify {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9500;
  padding: 0.8rem 1.25rem;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.95);
  color: #fff;
  font-weight: 700;
  font-size: 0.86rem;
  box-shadow: var(--shadow-md);
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition);
}

.toast-notify.show {
  transform: translateY(0);
  opacity: 1;
}

.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.84rem;
  background: rgba(8, 24, 30, 0.5);
}

@media (max-width: 1080px) {
  .hero-grid,
  .simulator-wrapper,
  .grid-2,
  .clause-compare-grid {
    grid-template-columns: 1fr;
  }
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 640px) {
  .sim-results-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 1.45rem;
  }
  .auth-card {
    padding: 1.75rem 1.15rem;
  }
}

@media print {
  .auth-overlay,
  .top-header,
  .preset-btn,
  .copy-btn,
  .toast-notify {
    display: none !important;
  }
  .study-section.hidden-section {
    display: block !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
}
