/* ============================================================
   MBI — Budget Intelligence System
   Theme File · Version 1.0
   Makai US Group LLC
   ============================================================

   TABLE OF CONTENTS
   -----------------
   1.  CSS Variables
   2.  Reset & Base
   3.  Layout
   4.  Typography & Labels
   5.  Form Elements
   6.  Buttons
   7.  Metrics Panel
   8.  Progress Bar & Phase Steps
   9.  Footer Controls
   10. Report Wrapper & Header
   11. Report Content & Tables
   12. Report Footer & Status Blocks
   13. Print Styles
   14. Auth Overlay
   15. User Bar
   16. Modals (Projects · Settings)
   ============================================================ */


/* ── 1. CSS VARIABLES ──────────────────────────────────────── */
:root {

  /* Brand colors */
  --gold:       #b39359;
  --gold-2:     #c9a84c;
  --gold-light: #d4b483;
  --gold-glow:  rgba(179, 147, 89, 0.25);

  /* Backgrounds */
  --bg:         #080b10;
  --card:       #0d1117;
  --navy:       #0f172a;
  --surface-1:  #0a0e16;
  --surface-2:  #0a0d14;
  --surface-3:  #131820;
  --surface-4:  #161b24;
  --input-bg:   #131820;
  --input-focus:#1a2030;

  /* Borders */
  --border:     #1e2330;
  --border-2:   #252a35;
  --border-gold: rgba(179, 147, 89, 0.3);

  /* Text */
  --text:       #e0e6ed;
  --text-dim:   #cbd5e1;
  --muted:      #6b7280;
  --muted-2:    #475569;
  --muted-3:    #334155;

  /* Semantic */
  --red:        #ef4444;
  --green:      #22c55e;
  --cyan:       #06b6d4;
  --teal:       #0d9488;
  --teal-dark:  #0f766e;
  --amber:      #f59e0b;

  /* Spacing */
  --sp-xs:  4px;
  --sp-sm:  8px;
  --sp-md:  16px;
  --sp-lg:  24px;
  --sp-xl:  32px;
  --sp-2xl: 48px;

  /* Radius */
  --r-sm:   6px;
  --r-md:   8px;
  --r-lg:   10px;
  --r-xl:   14px;
  --r-2xl:  16px;

  /* Shadows */
  --shadow-card:  0 8px 48px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(179, 147, 89, 0.06) inset;
  --shadow-btn:   0 4px 14px rgba(59, 95, 192, 0.25);
  --shadow-gold:  0 4px 18px rgba(179, 147, 89, 0.3);
  --shadow-gold-hover: 0 7px 24px rgba(179, 147, 89, 0.4);

  /* Transitions */
  --t-fast:   0.15s ease;
  --t-normal: 0.2s ease;
  --t-slow:   0.25s ease;

  /* Typography */
  --font:     'Inter', sans-serif;
  --font-size-base: 13px;
}


/* ── 2. RESET & BASE ───────────────────────────────────────── */
*  { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background:  var(--bg);
  color:       var(--text);
  display:     flex;
  flex-direction: column;
  align-items: center;
  padding:     0 20px 80px;
}


/* ── 3. LAYOUT ─────────────────────────────────────────────── */
.dashboard {
  width:         980px;
  background:    var(--card);
  padding:       var(--sp-2xl);
  border-radius: var(--r-2xl);
  border:        1px solid var(--border);
  margin:        40px 0 0;
  box-shadow:    var(--shadow-card);
  overflow:      hidden;
}

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


/* ── 4. TYPOGRAPHY & LABELS ────────────────────────────────── */
label {
  font-size:      9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color:          var(--muted);
  font-weight:    700;
  margin-bottom:  8px;
  display:        block;
}

/* ── Header ── */
.header-section {
  display:      flex;
  align-items:  center;
  gap:          20px;
  margin:       calc(-1 * var(--sp-2xl)) calc(-1 * var(--sp-2xl)) 36px;
  padding:      32px var(--sp-2xl) 28px;
  background:   linear-gradient(180deg, #111827 0%, var(--card) 100%);
  border-bottom: 1px solid var(--border);
  box-shadow:   0 4px 16px rgba(0, 0, 0, 0.35);
}
.header-section img { height: 52px; filter: drop-shadow(0 2px 8px rgba(179, 147, 89, 0.2)); }
.header-section h1  { font-size: 24px; font-weight: 700; color: #fff; margin-bottom: 3px; letter-spacing: -0.01em; }
.header-section p   { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }

/* ── Section Labels ── */
.section-label {
  font-size:      10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight:    800;
  color:          var(--gold);
  margin:         30px 0 16px;
  display:        flex;
  align-items:    center;
  gap:            10px;
}
.section-label::before {
  content: ''; width: 3px; height: 14px;
  background: var(--gold); border-radius: 2px; flex-shrink: 0;
}
.section-label::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.metrics-panel .section-label { margin-top: 0; }


/* ── 5. FORM ELEMENTS ──────────────────────────────────────── */
input, select, textarea {
  background:    var(--input-bg);
  border:        1px solid var(--border-2);
  border-radius: var(--r-md);
  padding:       13px 15px;
  color:         var(--text);
  width:         100%;
  font-family:   var(--font);
  font-size:     var(--font-size-base);
  margin-bottom: 20px;
  transition:    border-color var(--t-normal), background var(--t-normal);
}
input:focus, select:focus, textarea:focus {
  outline:      none;
  border-color: var(--gold);
  background:   var(--input-focus);
}
select option         { background: var(--input-bg); }
input[type="file"]    { padding: 10px 14px; font-size: 11px; color: var(--muted); cursor: pointer; }
input[type="file"]:focus { border-color: var(--gold); }


/* ── 6. BUTTONS ────────────────────────────────────────────── */

/* Primary (blue gradient) */
.btn-primary {
  background:    linear-gradient(135deg, #3b5fc0 0%, #4b6cb7 100%);
  color:         white;
  padding:       18px;
  width:         100%;
  border:        none;
  border-radius: var(--r-lg);
  font-weight:   700;
  cursor:        pointer;
  text-transform: uppercase;
  font-size:     12px;
  letter-spacing: 0.1em;
  transition:    opacity var(--t-normal), transform var(--t-fast);
  box-shadow:    var(--shadow-btn);
}
.btn-primary:hover    { opacity: 0.88; transform: translateY(-1px); }
.btn-primary:disabled { background: #1a1f26; color: var(--muted); cursor: not-allowed; box-shadow: none; transform: none; }

/* Full analysis (gold gradient) */
.btn-full {
  background:    linear-gradient(135deg, #b3935a 0%, var(--gold-2) 100%);
  color:         var(--bg);
  padding:       20px;
  width:         100%;
  border:        none;
  border-radius: var(--r-lg);
  font-weight:   800;
  cursor:        pointer;
  text-transform: uppercase;
  font-size:     13px;
  letter-spacing: 0.1em;
  margin-top:    10px;
  transition:    opacity var(--t-normal), transform var(--t-fast), box-shadow var(--t-fast);
  box-shadow:    var(--shadow-gold);
}
.btn-full:hover    { opacity: 0.9; transform: translateY(-2px); box-shadow: var(--shadow-gold-hover); }
.btn-full:disabled { background: #1a1f26; color: var(--muted); cursor: not-allowed; box-shadow: none; transform: none; }

/* Phase buttons */
.phase-buttons        { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.phase-buttons-bottom { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }

/* Per-phase mini progress bars */
.phase-btn-group      { display: flex; flex-direction: column; }
.phase-btn-group .btn-phase { flex: 1; border-radius: 6px 6px 0 0; }
.phase-mini-track     { height: 4px; background: rgba(255,255,255,0.07); border-radius: 0 0 6px 6px; overflow: hidden; }
.phase-mini-fill      { height: 100%; width: 0%; background: var(--pc, #3b82f6); border-radius: 0 2px 2px 0; transition: width 0.5s cubic-bezier(0.4,0,0.2,1), opacity 0.8s ease; }

.btn-phase {
  background:    var(--surface-1);
  border:        1px solid var(--border-2);
  color:         var(--muted);
  padding:       16px 8px;
  border-radius: var(--r-lg);
  font-size:     10px;
  font-weight:   700;
  cursor:        pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition:    all var(--t-normal);
  text-align:    center;
}
.btn-phase:hover {
  border-color: rgba(179, 147, 89, 0.5);
  color:        var(--gold);
  background:   rgba(179, 147, 89, 0.06);
  transform:    translateY(-1px);
  box-shadow:   0 4px 12px rgba(0, 0, 0, 0.3);
}
.btn-phase.active-phase {
  border-color: var(--gold);
  color:        var(--gold);
  background:   rgba(179, 147, 89, 0.08);
  animation:    pulse 1.5s infinite;
  box-shadow:   0 0 0 1px rgba(179, 147, 89, 0.2);
}
.btn-phase.done {
  border-color: rgba(34, 197, 94, 0.35);
  color:        var(--green);
  background:   rgba(34, 197, 94, 0.07);
}
.btn-phase.done:hover { border-color: var(--green); background: rgba(34, 197, 94, 0.12); transform: translateY(-1px); }

@keyframes pulse {
  0%,  100% { box-shadow: 0 0 0 0   rgba(179, 147, 89, 0.35); }
  50%        { box-shadow: 0 0 0 7px rgba(179, 147, 89, 0); }
}

/* Export buttons */
.btn-export {
  background:    transparent;
  border:        1px solid var(--border-2);
  color:         var(--muted);
  padding:       9px 18px;
  border-radius: var(--r-sm);
  font-size:     9px;
  cursor:        pointer;
  text-transform: uppercase;
  font-weight:   700;
  letter-spacing: 0.08em;
  display:       none;
  transition:    all var(--t-normal);
}
.btn-export:hover { border-color: var(--gold); color: var(--gold); background: rgba(179, 147, 89, 0.06); }


/* ── 7. METRICS PANEL ──────────────────────────────────────── */
.metrics-toggle {
  background:  var(--surface-1);
  border:      1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding:     15px 20px;
  cursor:      pointer;
  display:     flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  user-select: none;
  transition:  border-color var(--t-normal), background var(--t-normal);
}
.metrics-toggle:hover           { border-color: var(--border-gold); background: #0d1320; }
.metrics-toggle span            { font-size: 12px; font-weight: 700; color: var(--gold); letter-spacing: 0.06em; text-transform: uppercase; }
.metrics-toggle .arrow          { color: var(--muted); transition: transform var(--t-slow); font-size: 13px; }
.metrics-toggle.open            { border-color: var(--border-gold); border-radius: var(--r-lg) var(--r-lg) 0 0; background: #0d1320; }
.metrics-toggle.open .arrow     { transform: rotate(180deg); }

.metrics-panel {
  display:       none;
  background:    var(--surface-2);
  border:        1px solid var(--border-2);
  border-top:    none;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  padding:       28px;
  margin-bottom: 20px;
}
.metrics-panel.open { display: block; }


/* ── 8. PROGRESS BAR & PHASE STEPS ────────────────────────── */
.progress-bar {
  background:  var(--surface-2);
  border:      1px solid var(--border-gold);
  border-radius: var(--r-xl);
  padding:     22px 24px;
  margin:      18px 0;
  display:     none;
  box-shadow:  0 0 0 1px rgba(179, 147, 89, 0.08) inset;
}
.progress-header  { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.progress-title   { font-size: 10px; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: 0.15em; }
.progress-pct     { font-size: 22px; font-weight: 900; color: var(--gold); }
.progress-current { font-size: 13px; color: #fff; font-weight: 600; margin-bottom: 14px; min-height: 20px; }
.progress-track   { background: #1a1f26; border-radius: 6px; height: 8px; overflow: hidden; margin-bottom: 22px; }
.progress-fill    { background: linear-gradient(90deg, var(--gold), var(--gold-light)); height: 100%; border-radius: 6px; transition: width 0.6s ease; width: 0%; }

.phase-steps      { display: flex; flex-direction: column; gap: 8px; }
.phase-step-row   { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r-md); transition: background var(--t-normal); }
.phase-step-row.step-pending { opacity: 0.4; }
.phase-step-row.step-running { background: rgba(179, 147, 89, 0.08); border: 1px solid rgba(179, 147, 89, 0.25); opacity: 1; }
.phase-step-row.step-done    { background: rgba(34, 197, 94, 0.06);  border: 1px solid rgba(34, 197, 94, 0.18);  opacity: 1; }

.step-icon         { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex-shrink: 0; }
.step-icon.pending { background: #1a1f26; color: var(--muted); border: 1px solid var(--border-2); }
.step-icon.running { background: var(--gold); color: var(--bg); animation: spin 1s linear infinite; }
.step-icon.done    { background: var(--green); color: #000; }

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.step-info { flex: 1; }
.step-name { font-size: 12px; font-weight: 700; color: #fff; }
.step-desc { font-size: 10px; color: var(--muted); margin-top: 1px; }
.step-time { font-size: 10px; color: var(--muted); text-align: right; white-space: nowrap; }


/* ── 9. FOOTER CONTROLS ────────────────────────────────────── */
.footer-controls {
  width:      980px;
  display:    flex;
  justify-content: space-between;
  align-items: center;
  margin:     14px 0 0;
  padding:    12px 20px;
  background: linear-gradient(180deg, var(--card) 0%, var(--bg) 100%);
  border:     1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.3);
}
.footer-label {
  font-size:      9px;
  color:          var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight:    700;
}


/* ── 10. REPORT WRAPPER & HEADER ───────────────────────────── */
#report-output-container {
  display:    none;
  width:      980px;
  margin-top: 8px;
}
#final-report-wrapper {
  background: #fff !important;
  color:      #1a1a1a !important;
  width:      100%;
  max-width:  820px;
  margin:     0 auto;
  box-sizing: border-box;
  padding:    0 12px;
}

.luxury-header {
  border-bottom:  3px solid var(--navy);
  padding-bottom: 16px;
  margin-bottom:  22px;
  display:        flex;
  justify-content: space-between;
  align-items:    flex-end;
}
.luxury-header-left   { display: flex; align-items: center; gap: 14px; }
.luxury-header h2     { font-size: 24px !important; color: var(--navy); margin: 0; font-weight: 700; white-space: nowrap; }
.luxury-header h1     { font-size: 10px !important; color: var(--gold); margin: 0 0 4px; letter-spacing: 2px; font-weight: 700; text-align: right; white-space: nowrap; }

.status-blocks        { display: flex; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.status-box           { border-left: 2px solid var(--gold); padding-left: 8px; }
.status-box b         { font-size: 6px; text-transform: uppercase; color: #888; display: block; margin-bottom: 2px; }
.status-box div       { font-size: 8px; font-weight: 800; color: var(--navy); }

.costsf-banner        { background: #f0f4ff; border-left: 4px solid var(--navy); border-radius: 4px; padding: 10px 16px; margin-bottom: 18px; display: flex; gap: 30px; flex-wrap: wrap; }
.costsf-item b        { font-size: 6px; text-transform: uppercase; color: #888; display: block; margin-bottom: 2px; }
.costsf-item div      { font-size: 11px; font-weight: 800; color: var(--navy); }


/* ── 11. REPORT CONTENT & TABLES ───────────────────────────── */
#pdf-analysis-content                   { font-size: 9.5px; line-height: 1.5; color: #1a1a1a; }
#pdf-analysis-content table             { width: 100%; border-collapse: collapse; margin-bottom: 16px; table-layout: fixed; }
#pdf-analysis-content tr                { page-break-inside: avoid !important; }
#pdf-analysis-content th                { background: var(--navy) !important; color: white !important; padding: 7px 6px; font-size: 8px; text-transform: uppercase; text-align: left; }
#pdf-analysis-content td                { padding: 5px 6px; border: 1px solid #e2e8f0; font-size: 8.5px; word-wrap: break-word; }
#pdf-analysis-content th:nth-child(2)   { width: 42%; }
#pdf-analysis-content th:nth-child(6)   { width: 16%; }
#pdf-analysis-content h1,
#pdf-analysis-content h2,
#pdf-analysis-content h3               { font-size: 12px; border-bottom: 2px solid var(--navy); margin: 14px 0 7px; padding-bottom: 4px; text-transform: uppercase; color: var(--navy); }
#pdf-analysis-content blockquote       { background: #fff8e6; border-left: 4px solid var(--amber); padding: 10px 14px; margin: 10px 0; font-size: 9px; color: #92400e; border-radius: 4px; }

.truncation-warning { background: #fff8e6; border: 1px solid var(--amber); border-radius: var(--r-sm); padding: 12px 16px; margin: 12px 0; font-size: 12px; color: #92400e; display: none; }


/* ── 12. REPORT FOOTER ─────────────────────────────────────── */
.report-footer    { display: flex; justify-content: space-between; gap: 40px; border-top: 2px solid #e2e8f0; padding-top: 18px; margin-top: 28px; font-size: 8.5px; color: #555; page-break-inside: avoid; }
.signature-block  { width: 35%; text-align: right; }
.sig-line         { border-bottom: 1.5px solid #1a1a1a; width: 100%; margin: 22px 0 5px; }


/* ── 13. PRINT STYLES — see print.css (loaded with media="print") ── */


/* ── 14. AUTH OVERLAY ──────────────────────────────────────── */
#auth-overlay {
  position:    fixed;
  inset:       0;
  background:  rgba(8, 11, 16, 0.97);
  display:     flex;
  align-items: center;
  justify-content: center;
  z-index:     9999;
  backdrop-filter: blur(4px);
}

.auth-card {
  background:    var(--card);
  border:        1px solid var(--border);
  border-radius: var(--r-2xl);
  padding:       40px 48px;
  width:         420px;
  box-shadow:    0 24px 64px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(179, 147, 89, 0.08) inset;
}
.auth-logo             { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-logo img         { height: 40px; }
.auth-logo-text h2     { font-size: 16px; font-weight: 700; color: #fff; }
.auth-logo-text p      { font-size: 10px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

.auth-tabs   { display: flex; margin-bottom: 28px; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.auth-tab    { flex: 1; padding: 9px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; cursor: pointer; background: transparent; border: none; color: var(--muted); transition: all var(--t-normal); }
.auth-tab.active { background: var(--gold); color: #000; }

.auth-field          { margin-bottom: 16px; }
.auth-field label    { display: block; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 6px; }
.auth-field input    { width: 100%; background: var(--surface-4); border: 1px solid var(--border-2); border-radius: var(--r-md); padding: 11px 14px; color: var(--text); font-size: 13px; font-family: var(--font); outline: none; transition: border-color var(--t-normal); margin-bottom: 0; }
.auth-field input:focus { border-color: var(--gold); }

.auth-btn          { width: 100%; padding: 13px; background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #000; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; border: none; border-radius: var(--r-md); cursor: pointer; margin-top: 8px; transition: opacity var(--t-normal); }
.auth-btn:hover    { opacity: 0.9; }
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-error { background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.25); border-radius: var(--r-sm); padding: 10px 14px; font-size: 11px; color: var(--red);   margin-top: 12px; display: none; }
.auth-info  { background: rgba(34, 197, 94, 0.07);  border: 1px solid rgba(34, 197, 94, 0.2);  border-radius: var(--r-sm); padding: 10px 14px; font-size: 11px; color: var(--green); margin-top: 12px; display: none; }


/* ── 15. USER BAR ──────────────────────────────────────────── */
#user-bar {
  display:       none;
  align-items:   center;
  background:    #080e1a;
  border:        1px solid #0f2240;
  border-radius: var(--r-lg);
  margin-bottom: 20px;
  overflow:      hidden;
  font-size:     12px;
}

.ub-seg {
  display:     flex;
  align-items: center;
  gap:         8px;
  padding:     10px 16px;
  border-right: 1px solid #0f2240;
  cursor:      pointer;
  transition:  background var(--t-fast);
  white-space: nowrap;
}
.ub-seg:last-child        { border-right: none; }
.ub-seg:hover             { background: #0f2240; }
.ub-seg.ub-user           { cursor: default; border-right: none; }
.ub-seg.ub-user:hover     { background: transparent; }

.ub-avatar {
  width:         38px;
  height:        38px;
  border-radius: var(--r-md);
  flex-shrink:   0;
  background:    linear-gradient(135deg, var(--teal), #0284c7);
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     13px;
  font-weight:   700;
  color:         #fff;
  letter-spacing: 0.04em;
}
.ub-name  { font-size: 14px; font-weight: 600; color: var(--text-dim); line-height: 1.3; }
.ub-email { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.ub-spacer { flex: 1; }

.ub-seg-icon  { font-size: 15px; color: var(--muted-2); transition: color var(--t-fast); }
.ub-seg-label { font-size: 11px; color: #64748b; font-weight: 500; transition: color var(--t-fast); }
.ub-seg:hover .ub-seg-icon,
.ub-seg:hover .ub-seg-label { color: #94a3b8; }

.ub-seg.ub-save              { }
.ub-seg.ub-save .ub-seg-icon  { color: var(--teal); }
.ub-seg.ub-save .ub-seg-label { color: #5eead4; }
.ub-seg.ub-save:hover         { background: rgba(13, 148, 136, 0.1); }
.ub-seg.ub-save:hover .ub-seg-icon,
.ub-seg.ub-save:hover .ub-seg-label { color: #2dd4bf; }

.ub-seg.ub-logout              { }
.ub-seg.ub-logout .ub-seg-icon  { color: var(--muted-3); }
.ub-seg.ub-logout .ub-seg-label { color: var(--muted-3); }
.ub-seg.ub-logout:hover         { background: rgba(239, 68, 68, 0.07); }
.ub-seg.ub-logout:hover .ub-seg-icon,
.ub-seg.ub-logout:hover .ub-seg-label { color: var(--red); }

.ub-meter {
  display:        flex;
  flex-direction: column;
  gap:            4px;
  padding:        10px 16px;
  border-right:   1px solid #0f2240;
}
.ub-meter-row   { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.ub-meter-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-3); }
.ub-meter-count { font-size: 11px; font-weight: 600; color: var(--cyan); }
.ub-meter-track { height: 3px; background: #0f2240; border-radius: 2px; margin-top: 2px; }

#usage-bar    { height: 100%; width: 0%; background: var(--cyan); border-radius: 2px; transition: width 0.4s, background 0.4s; }
#usage-meter  { display: none; }


/* ── 16. MODALS ────────────────────────────────────────────── */

/* ── Projects modal ── */
#projects-overlay {
  display:         none;
  position:        fixed;
  inset:           0;
  background:      rgba(0, 0, 0, 0.7);
  z-index:         9000;
  justify-content: center;
  align-items:     center;
}

/* ── Settings modal ── */
#settings-overlay {
  display:         none;
  position:        fixed;
  inset:           0;
  background:      rgba(0, 0, 0, 0.72);
  z-index:         9100;
  justify-content: center;
  align-items:     center;
}

.settings-card {
  background:     #0d1724;
  border:         1px solid #1e3a5f;
  border-radius:  var(--r-xl);
  width:          500px;
  max-width:      95vw;
  max-height:     88vh;
  overflow-y:     auto;
  display:        flex;
  flex-direction: column;
}
.settings-header {
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  padding:         20px 24px 16px;
  border-bottom:   1px solid #1e2a3a;
  position:        sticky;
  top:             0;
  background:      #0d1724;
  z-index:         1;
}
.settings-header h3   { font-size: 15px; font-weight: 600; color: #e2e8f0; margin: 0; }
.settings-close       { background: none; border: none; color: var(--muted-2); font-size: 22px; cursor: pointer; line-height: 1; padding: 0 2px; }
.settings-close:hover { color: #94a3b8; }

.settings-tabs { display: flex; border-bottom: 1px solid #1e2a3a; padding: 0 24px; }
.settings-tab  {
  font-size:      12px;
  font-weight:    600;
  color:          var(--muted-2);
  padding:        10px 14px;
  cursor:         pointer;
  border-bottom:  2px solid transparent;
  margin-bottom:  -1px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition:     color var(--t-fast);
}
.settings-tab.active          { color: var(--cyan); border-bottom-color: var(--cyan); }
.settings-tab:hover:not(.active) { color: #94a3b8; }

.settings-body    { padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.settings-field   { display: flex; flex-direction: column; gap: 6px; }
.settings-field label {
  font-size:      11px;
  font-weight:    600;
  color:          #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom:  0;
}
.settings-field input {
  background:    #0a1220;
  border:        1px solid #1e2a3a;
  border-radius: var(--r-md);
  color:         #e2e8f0;
  font-size:     13px;
  padding:       9px 12px;
  outline:       none;
  transition:    border-color var(--t-fast);
  font-family:   var(--font);
  margin-bottom: 0;
}
.settings-field input:focus            { border-color: var(--cyan); }
.settings-field input[readonly]        { color: var(--muted-2); cursor: default; }
.settings-field input[readonly]:focus  { border-color: #1e2a3a; }

.settings-divider { height: 1px; background: #1e2a3a; }

.settings-btn          { padding: 9px 20px; border-radius: var(--r-md); border: none; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; cursor: pointer; transition: all var(--t-fast); font-family: var(--font); text-transform: uppercase; }
.settings-btn.primary  { background: var(--teal); color: #fff; }
.settings-btn.primary:hover    { background: var(--teal-dark); }
.settings-btn.primary:disabled { opacity: 0.5; cursor: not-allowed; }
.settings-btn.danger   { background: transparent; color: var(--red); border: 1px solid rgba(239, 68, 68, 0.3); }
.settings-btn.danger:hover { background: rgba(239, 68, 68, 0.08); }

.settings-msg     { font-size: 12px; padding: 8px 12px; border-radius: var(--r-sm); min-height: 16px; }
.settings-msg.ok  { background: rgba(13, 148, 136, 0.12); color: #2dd4bf; border: 1px solid rgba(13, 148, 136, 0.2); }
.settings-msg.err { background: rgba(239, 68, 68, 0.08);  color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); }

.plan-badge           { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.plan-badge.basic     { background: rgba(71, 85, 105, 0.2); color: #94a3b8; border: 1px solid var(--muted-3); }
.plan-badge.pro       { background: rgba(6, 182, 212, 0.1); color: var(--cyan); border: 1px solid rgba(6, 182, 212, 0.3); }
.plan-badge.enterprise{ background: rgba(179, 147, 89, 0.1); color: var(--gold); border: 1px solid var(--border-gold); }

.plan-row           { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.plan-storage-track { flex: 1; height: 6px; background: #0a1220; border-radius: 3px; overflow: hidden; }
.plan-storage-fill  { height: 100%; border-radius: 3px; transition: width 0.4s, background 0.4s; }
