@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Instrument+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');
@font-face { font-family: 'AGs'; font-weight: 700; font-style: normal; src: url('/fonts/cloud9-type-dept-albeitgroteskcaps-bold.ttf') format('truetype'); }
@font-face { font-family: 'AGs'; font-weight: 500; font-style: normal; src: url('/fonts/cloud9-type-dept-albeitgroteskcaps-medium.ttf') format('truetype'); }

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

:root {
  --gold:        #b98f44;
  --gold-l:      #e8c97a;
  --gold-pale:   rgba(185,143,68,0.12);
  --bg:          #0a0d0f;
  --bg2:         #0c0f12;
  --bg3:         #111417;
  --bg4:         rgba(255,255,255,0.02);
  --border:      rgba(255,255,255,0.07);
  --border-gold: rgba(185,143,68,0.2);
  --text:        rgba(255,255,255,0.92);
  --text-mid:    rgba(255,255,255,0.70);
  --text-dim:    rgba(255,255,255,0.52);
  --text-faint:  rgba(255,255,255,0.28);
  --red:         #e85d5d;
  --green:       #4caf82;
  --green-mid:   #8dc87a;
  --amber:       #e8963a;
  --blue:        #3b82f6;
  --font-d:      'Instrument Sans', sans-serif;
  --z-dropdown:  100;
  --z-sticky:    200;
  --z-modal-bd:  500;
  --z-modal:     600;
  --z-toast:     700;
  --z-tooltip:   800;
  --font-m:      'DM Mono', monospace;
  --font-b:      'Instrument Sans', sans-serif;
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--font-b); font-size: 16px; }
button { cursor: pointer; font-family: var(--font-b); }
input, select, textarea { font-family: var(--font-b); }
::-webkit-scrollbar { width: 5px; background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(185,143,68,0.18); border-radius: 3px; }

/* ── LOGIN ── */
#login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.login-bg { position: absolute; inset: 0; background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(185,143,68,0.13) 0%, transparent 70%); pointer-events: none; }
.login-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(185,143,68,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(185,143,68,0.04) 1px, transparent 1px); background-size: 48px 48px; pointer-events: none; }
.login-card { background: rgba(14,17,20,0.97); border: 1px solid var(--border-gold); border-radius: 3px; padding: 48px; width: 100%; max-width: 420px; position: relative; box-shadow: 0 32px 80px rgba(0,0,0,0.6); animation: fadeUp 0.4s ease; }
@keyframes fadeUp { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:none; } }

/* ── APP SHELL ── */
#app { display: none; height: 100vh; overflow: hidden; }
.app-layout { display: flex; height: 100%; }

/* ── SIDEBAR ── */
.sidebar { width: 240px; height: 100%; background: var(--bg2); border-right: 1px solid var(--border-gold); display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto; }
.sidebar-logo { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 18px; }
.sidebar-logo-text { line-height: 1; }
.sidebar-logo-text .logo-line1 { font-family: 'AGs', var(--font-b); font-size: 22px; font-weight: 700; letter-spacing: 0.06em; color: var(--gold-l); line-height: 1; display: block; }
.sidebar-logo-text .logo-line2 { font-family: 'AGs', var(--font-b); font-size: 20px; font-weight: 500; letter-spacing: 0.06em; color: var(--gold); margin-top: 4px; display: block; text-align: center; }
.sidebar-divider { height: 1px; background: linear-gradient(90deg, transparent, var(--border-gold), transparent); margin: 0 20px; }
.nav-section { padding: 14px 0; }
.nav-section-label { font-family: var(--font-m); font-size: 11px; letter-spacing: 0.12em; color: rgba(255,255,255,0.22); padding: 0 20px 8px; }
.nav-section-label.nav-toggle { cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding-right: 18px; user-select: none; transition: color 0.15s; }
.nav-section-label.nav-toggle:hover { color: rgba(255,255,255,0.4); }
.nav-toggle-chevron { font-size: 8px; transition: transform 0.2s ease; }
.nav-collapse-wrap { overflow: hidden; max-height: 0; transition: max-height 0.25s ease; }
.nav-collapse-wrap.open { max-height: 400px; }
/* ── Accounting tabs ── */
.acc-tab-bar { display: flex; gap: 0; padding: 0 36px; border-bottom: 1px solid rgba(185,143,68,.15); }
.acc-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 10px 20px; font-family: var(--font-b); font-size: 13px; letter-spacing: .01em; color: var(--text-dim); cursor: pointer; transition: all .15s; }
.acc-tab:hover { color: var(--text-mid); }
.acc-tab.active { color: var(--gold-l); border-bottom-color: var(--gold-l); }
/* ── P&L Statement ── */
.pl-section-title { font-family: var(--font-m); font-size: 11px; letter-spacing: .14em; color: rgba(185,143,68,.7); padding: 16px 0 8px; }
.pl-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.04); font-size: 15px; }
.pl-row:last-child { border-bottom: none; }
.pl-total-row { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.12); font-family: var(--font-m); font-size: 14px; font-weight: 600; }
.pl-net-row { display: flex; justify-content: space-between; padding: 14px 20px; border-radius: 4px; font-family: var(--font-m); font-size: 16px; font-weight: 600; margin-top: 24px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 20px; background: none; border: none; color: var(--text-mid); font-size: 13px; cursor: pointer; text-align: left; position: relative; transition: color 0.15s, background 0.15s; }
.nav-item:hover { color: rgba(255,255,255,0.75); background: rgba(255,255,255,0.03); }
.nav-item.active { color: var(--gold-l); background: rgba(185,143,68,0.08); }
.nav-item.active::after { content: ''; position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 2px; height: 18px; background: var(--gold-l); border-radius: 2px 0 0 2px; }
.nav-item:disabled, .nav-item[disabled] { color: rgba(255,255,255,0.2); cursor: not-allowed; }
.nav-icon { font-size: 14px; width: 18px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-badge { margin-left: auto; font-family: var(--font-m); font-size: 8px; background: rgba(185,143,68,0.1); border: 1px solid rgba(185,143,68,0.2); border-radius: 10px; padding: 1px 7px; color: var(--gold); }
.sidebar-spacer { flex: 1; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 14px 20px; }
.user-av { width: 30px; height: 30px; background: rgba(185,143,68,0.14); border: 1px solid rgba(185,143,68,0.3); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--gold-l); font-weight: 600; flex-shrink: 0; }
.user-name-d { font-size: 14px; color: rgba(255,255,255,0.7); font-weight: 500; }
.user-role-d { font-size: 12px; color: var(--text-faint); font-family: var(--font-m); letter-spacing: 0.04em; margin-top: 1px; }
.logout-btn { margin-left: auto; background: none; border: none; color: var(--text-faint); font-size: 14px; padding: 4px; transition: color 0.15s; }
.logout-btn:hover { color: var(--text-mid); }

/* ── NOTIFICATIONS ── */
.notif-btn { position: relative; background: none; border: none; color: var(--text-faint); font-size: 16px; padding: 4px 5px; cursor: pointer; transition: color 0.15s; line-height: 1; border-radius: 3px; flex-shrink: 0; }
.notif-btn:hover { color: var(--text-mid); background: rgba(255,255,255,0.05); }
.notif-badge { position: absolute; top: -5px; right: -5px; min-width: 15px; height: 15px; background: var(--red); border-radius: 8px; font-family: var(--font-m); font-size: 11px; color: #fff; display: flex; align-items: center; justify-content: center; padding: 0 3px; line-height: 1; pointer-events: none; }
.notif-panel { position: fixed; left: 240px; top: 0; width: 340px; max-height: 520px; background: #0e1115; border: 1px solid var(--border-gold); border-radius: 0 0 6px 0; display: flex; flex-direction: column; z-index: var(--z-modal); box-shadow: 4px 4px 32px rgba(0,0,0,0.6); animation: notifSlide 0.18s ease; }
@keyframes notifSlide { from { opacity:0; transform: translateY(-12px); } to { opacity:1; transform: translateY(0); } }
.notif-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.notif-panel-title { font-family: var(--font-m); font-size: 11px; letter-spacing: 0.1em; color: var(--gold); }
.notif-close { background: none; border: none; color: var(--text-faint); font-size: 16px; cursor: pointer; padding: 0 2px; line-height: 1; }
.notif-close:hover { color: var(--text-mid); }
.notif-list { overflow-y: auto; flex: 1; padding: 6px 0; }
.notif-group-label { font-family: var(--font-m); font-size: 11px; letter-spacing: 0.1em; color: var(--text-faint); padding: 10px 16px 4px; text-transform: uppercase; }
.notif-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 16px; cursor: pointer; transition: background 0.12s; }
.notif-item:hover { background: rgba(255,255,255,0.04); }
.notif-item.urgent { background: rgba(232,93,93,0.06); }
.notif-item.high { background: rgba(232,150,58,0.06); }
.notif-item.normal { background: rgba(185,143,68,0.04); }
.notif-item.low { background: transparent; }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.notif-dot.urgent { background: var(--red); }
.notif-dot.high { background: #e8943d; }
.notif-dot.normal { background: var(--gold); }
.notif-dot.low { background: rgba(255,255,255,0.2); }
.notif-text { flex: 1; min-width: 0; }
.notif-title { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-body { font-family: var(--font-m); font-size: 11px; color: var(--text-dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { font-family: var(--font-m); font-size: 11px; color: var(--text-faint); flex-shrink: 0; margin-top: 3px; }
.notif-empty { padding: 32px 16px; text-align: center; font-family: var(--font-m); font-size: 11px; color: var(--text-faint); }

/* ── MAIN ── */
.main-area { flex: 1; height: 100%; overflow: hidden; display: flex; flex-direction: column; }
.view { height: 100%; overflow-y: auto; overflow-x: hidden; }
#view-detail, #view-app-detail, #view-lms-detail { overflow: hidden; display: flex; flex-direction: column; }
.page-header { padding: 24px 36px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; flex-shrink: 0; }
.page-title { font-family: var(--font-d); font-size: 22px; font-weight: 600; color: #fff; letter-spacing: -0.01em; }
.page-sub { font-size: 14px; color: var(--text-mid); margin-top: 3px; }

/* ── FIELDS ── */
.field-group { margin-bottom: 16px; }
.field-label { display: block; font-family: var(--font-m); font-size: 11px; letter-spacing: 0.12em; color: var(--text-dim); margin-bottom: 7px; text-transform: uppercase; }
.field-label .req { color: var(--gold-l); margin-left: 2px; }
.opt-badge { font-family: var(--font-m); font-size: 8px; letter-spacing: 0.06em; color: var(--text-faint); background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 2px; padding: 1px 5px; margin-left: 4px; vertical-align: middle; }
.field-input { width: 100%; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 2px; padding: 10px 14px; color: var(--text); font-size: 16px; outline: none; transition: border-color 0.2s; }
.field-input:focus { border-color: rgba(185,143,68,0.4); }
.field-input::placeholder { color: var(--text-faint); text-transform: none; }
select.field-input { background: var(--bg3); cursor: pointer; }
textarea.field-input { resize: vertical; min-height: 72px; }
.field-err { color: #ff6b7a; font-size: 13px; margin-top: 3px; }

/* ── BUTTONS ── */
.btn-primary { width: 100%; background: var(--gold); border: none; border-radius: 2px; padding: 13px; color: var(--bg); font-family: var(--font-m); font-size: 13px; font-weight: 500; letter-spacing: 0.04em; transition: filter 0.2s; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-gold { background: var(--gold); border: none; border-radius: 2px; padding: 10px 22px; color: var(--bg); font-family: var(--font-m); font-size: 13px; font-weight: 500; letter-spacing: 0.04em; transition: filter 0.2s; }
.btn-gold:hover { filter: brightness(1.1); }
.btn-gold:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline { background: none; border: 1px solid var(--border-gold); border-radius: 2px; padding: 9px 18px; color: var(--gold-l); font-family: var(--font-m); font-size: 13px; letter-spacing: 0.08em; transition: all 0.15s; }
.btn-outline:hover { background: rgba(185,143,68,0.08); }
.btn-ghost { background: none; border: 1px solid var(--border); border-radius: 2px; padding: 8px 16px; color: var(--text-mid); font-family: var(--font-m); font-size: 12px; letter-spacing: 0.08em; transition: all 0.15s; }
.btn-ghost:hover { border-color: rgba(255,255,255,0.15); color: var(--text); }
.btn-danger { background: rgba(232,93,93,0.1); border: 1px solid rgba(232,93,93,0.3); border-radius: 2px; padding: 8px 16px; color: var(--red); font-family: var(--font-m); font-size: 12px; letter-spacing: 0.08em; }
.dash-period-btn { background: var(--bg3); border: 1px solid var(--border); border-radius: 2px; padding: 5px 13px; color: var(--text-dim); font-family: var(--font-m); font-size: 11px; letter-spacing: 0.06em; cursor: pointer; transition: all 0.15s; }
.dash-period-btn:hover { border-color: rgba(255,255,255,0.14); color: var(--text-mid); background: rgba(255,255,255,0.04); }
.dash-period-btn.active { background: rgba(185,143,68,0.10); border-color: rgba(185,143,68,0.4); color: var(--gold-l); }

/* ── CARDS ── */
.card { background: var(--bg4); border: 1px solid var(--border); border-radius: 4px; padding: 20px 24px; margin-bottom: 16px; }
.card-title { font-family: var(--font-m); font-size: 11px; letter-spacing: 0.1em; color: rgba(185,143,68,0.65); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid rgba(185,143,68,0.1); }
.section-title { font-family: var(--font-m); font-size: 11px; letter-spacing: 0.1em; color: rgba(185,143,68,0.65); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid rgba(185,143,68,0.1); }

/* ── KV ROWS ── */
.kv-grid { background: var(--bg4); border: 1px solid var(--border); border-radius: 3px; padding: 0 16px; margin-bottom: 16px; }
.kv-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.kv-row:last-child { border-bottom: none; }
.kv-key { font-size: 14px; color: var(--text-dim); }
.kv-val { font-size: 15px; font-weight: 500; color: var(--text); font-family: var(--font-m); }
.kv-val.bad { color: var(--red); }
.kv-val.good { color: var(--green); }

/* ── STATS ── */
.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; padding: 24px 36px 0; }
.stat-card { background: var(--bg4); border: 1px solid var(--border); border-radius: 4px; padding: 16px 20px; }
.stat-label { font-family: var(--font-m); font-size: 11px; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 8px; }
.stat-value { font-family: var(--font-d); font-size: 28px; font-weight: 700; color: #fff; line-height: 1; }
.stat-sub { font-size: 13px; color: var(--text-mid); margin-top: 4px; }

/* ── PIPELINE ── */
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 10px; padding: 16px 36px 24px; }
.stage-col { min-width: 0; }
.stage-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding: 6px 10px; border-radius: 2px; border-top: 2px solid; }
.stage-title { font-family: var(--font-m); font-size: 10px; letter-spacing: 0.06em; font-weight: 500; }
.stage-count { font-family: var(--font-m); font-size: 12px; background: rgba(255,255,255,0.08); padding: 1px 7px; border-radius: 10px; }
.enq-card { background: var(--bg3); border: 1px solid var(--border); border-radius: 3px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; transition: border-color 0.15s; }
.enq-card:hover { border-color: rgba(185,143,68,0.3); }
.enq-name { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enq-meta { font-family: var(--font-m); font-size: 12px; color: var(--text-dim); }
.enq-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.tag { font-family: var(--font-m); font-size: 9px; letter-spacing: 0.05em; padding: 2px 7px; border-radius: 2px; border: 1px solid; }

/* ── TABLE ── */
.enq-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.enq-table th { font-family: var(--font-m); font-size: 11px; letter-spacing: 0.1em; color: var(--text-dim); padding: 10px 14px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.07); white-space: nowrap; }
.enq-table td { padding: 13px 14px; font-size: 15px; color: var(--text); border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.enq-table tr:hover td { background: rgba(185,143,68,0.04); cursor: pointer; }
.th-cell { font-family: var(--font-m); font-size: 11px; letter-spacing: 0.1em; color: var(--text-dim); padding: 8px 12px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.07); white-space: nowrap; font-weight: 500; }
.mono { font-family: var(--font-m); font-size: 13px; }
.stage-badge { font-family: var(--font-m); font-size: 11px; letter-spacing: 0.06em; padding: 3px 9px; border-radius: 2px; border: 1px solid; white-space: nowrap; }

/* ── DATA TABLE (generic) ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { font-family: var(--font-m); font-size: 11px; letter-spacing: 0.1em; color: var(--text-dim); padding: 11px 14px; text-align: left; border-bottom: 2px solid rgba(185,143,68,0.2); white-space: nowrap; text-transform: uppercase; }
.data-table td { padding: 13px 14px; font-size: 15px; color: var(--text); border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.score-pill { display: inline-flex; align-items: center; gap: 5px; }
.score-dot { width: 7px; height: 7px; border-radius: 50%; }

/* ── FORM ── */
.form-body { padding: 24px 36px; }
.form-section { background: var(--bg4); border: 1px solid var(--border); border-radius: 4px; padding: 24px 28px; margin-bottom: 18px; }
.form-section-title { font-family: var(--font-m); font-size: 11px; letter-spacing: 0.1em; color: rgba(185,143,68,0.65); margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid rgba(185,143,68,0.1); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-row-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 16px; }
input[type="date"].field-input { min-height: 42px; box-sizing: border-box; padding-top: 9px; padding-bottom: 9px; }

/* ── DETAIL ── */
.detail-layout { display: grid; grid-template-columns: 1fr 320px; grid-template-rows: 1fr; flex: 1; min-height: 0; overflow: hidden; }
.detail-main { overflow-y: auto; padding: 20px 28px; min-height: 0; }
.detail-sidebar { background: var(--bg2); border-left: 1px solid var(--border); overflow-y: auto; padding: 20px; min-height: 0; }
.tab-bar { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-btn { background: none; border: none; border-bottom: 2px solid transparent; padding: 11px 16px; color: var(--text-mid); font-family: var(--font-b); font-size: 13px; letter-spacing: 0.01em; cursor: pointer; transition: all 0.15s; }
.tab-btn.active { color: var(--gold-l); border-bottom-color: var(--gold-l); }

/* ── SCORE ── */
.score-gauge { text-align: center; padding: 14px 0; }
.score-big { font-family: var(--font-d); font-size: 48px; font-weight: 700; line-height: 1; }
.score-bar { height: 4px; background: rgba(255,255,255,0.07); border-radius: 2px; margin: 10px 0 6px; overflow: hidden; }
.score-fill { height: 100%; border-radius: 2px; transition: width 0.5s ease; }
.score-range { display: flex; justify-content: space-between; font-family: var(--font-m); font-size: 12px; color: var(--text-dim); }
.score-param { margin-bottom: 10px; }
.score-param-row { display: flex; justify-content: space-between; margin-bottom: 4px; }
.score-param-label { font-size: 13px; color: var(--text-mid); }
.score-param-val { font-family: var(--font-m); font-size: 13px; }
.score-mini-bar { height: 2px; background: rgba(255,255,255,0.07); border-radius: 1px; overflow: hidden; }
.score-mini-fill { height: 100%; border-radius: 1px; }

/* ── BSA RESULTS ── */
.bsa-banner { display: grid; grid-template-columns: repeat(6,1fr); gap: 10px; margin-bottom: 20px; }
.bsa-metric { background: var(--bg4); border: 1px solid var(--border); border-radius: 3px; padding: 14px 16px; }
.bsa-metric-label { font-family: var(--font-m); font-size: 11px; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 6px; }
.bsa-metric-value { font-size: 18px; font-weight: 600; color: var(--text); }
.flag-card { border-radius: 2px; padding: 12px 16px; margin: 8px 0; border: 1px solid; }
.analysis-card { background: var(--bg4); border: 1px solid var(--border); border-radius: 3px; padding: 14px 16px; margin-bottom: 10px; }
.analysis-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.analysis-type { font-family: var(--font-m); font-size: 11px; letter-spacing: 0.06em; color: var(--gold); }

/* ── UPLOAD ── */
.upload-zone { border: 1px dashed rgba(185,143,68,0.3); border-radius: 3px; padding: 20px; text-align: center; cursor: pointer; transition: all 0.15s; margin-bottom: 14px; }
.upload-zone:hover { background: rgba(185,143,68,0.04); border-color: rgba(185,143,68,0.5); }

/* ── NOTES / TIMELINE ── */
.note-item { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 2px; padding: 12px 14px; margin-bottom: 8px; }
.note-meta { font-family: var(--font-m); font-size: 11px; color: var(--text-dim); margin-bottom: 6px; }
.note-content { font-size: 15px; color: var(--text-mid); line-height: 1.6; }
.timeline-item { display: flex; gap: 12px; margin-bottom: 14px; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; border: 2px solid; }
.timeline-label { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.timeline-meta { font-family: var(--font-m); font-size: 12px; color: var(--text-dim); }

/* ── AI BOX ── */
.ai-box { background: rgba(185,143,68,0.05); border: 1px solid rgba(185,143,68,0.2); border-radius: 3px; padding: 20px 24px; line-height: 1.75; color: rgba(255,255,255,0.78); font-size: 15px; }
.ai-badge { font-family: var(--font-m); font-size: 11px; letter-spacing: 0.08em; color: var(--gold-l); background: rgba(185,143,68,0.12); border: 1px solid rgba(185,143,68,0.25); border-radius: 2px; padding: 2px 8px; display: inline-block; margin-bottom: 12px; }

/* ── INFO / WARN ── */
.info-box { background: rgba(185,143,68,0.05); border: 1px solid rgba(185,143,68,0.14); border-radius: 2px; padding: 12px 16px; font-size: 14px; color: rgba(255,255,255,0.4); display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; }
.info-icon { color: var(--gold-l); flex-shrink: 0; }
.warn-box { background: rgba(232,93,93,0.07); border: 1px solid rgba(232,93,93,0.2); border-radius: 2px; padding: 12px 16px; font-size: 14px; color: rgba(255,150,150,0.7); display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; }
.error-msg { background: rgba(232,93,93,0.08); border: 1px solid rgba(232,93,93,0.25); border-radius: 2px; padding: 10px 14px; color: #ff6b7a; font-size: 14px; margin-bottom: 14px; }

/* ── MODAL ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: var(--z-modal-bd); align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal-overlay.open { display: flex; }
.modal { background: var(--bg2); border: 1px solid var(--border-gold); border-radius: 4px; padding: 32px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; position: relative; animation: fadeUp 0.25s ease; }
.modal-title { font-family: var(--font-d); font-size: 18px; font-weight: 600; color: #fff; margin-bottom: 20px; }
.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; color: var(--text-mid); font-size: 18px; cursor: pointer; }

/* ── MISC ── */
.divider-gold { height: 1px; background: linear-gradient(90deg, transparent, var(--border-gold), transparent); margin: 0 0 24px; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-faint); }
.empty-icon { font-size: 32px; margin-bottom: 10px; opacity: 0.4; }
.empty-text { font-family: var(--font-m); font-size: 11px; letter-spacing: 0.1em; }
.loading { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(185,143,68,0.3); border-top-color: var(--gold-l); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-full { display: flex; align-items: center; justify-content: center; padding: 48px; gap: 12px; color: var(--text-dim); font-family: var(--font-m); font-size: 11px; letter-spacing: 0.1em; }
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--bg2); border: 1px solid var(--border-gold); border-radius: 3px; padding: 12px 20px; font-size: 15px; z-index: var(--z-toast); animation: slideUp 0.3s ease; display: none; }
.toast.show { display: block; }
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.search-input { background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 2px; padding: 9px 14px; color: var(--text); font-size: 15px; outline: none; width: 260px; }
.search-input::placeholder { color: var(--text-faint); }
.filter-select { background: var(--bg3); border: 1px solid var(--border); border-radius: 2px; padding: 9px 12px; color: var(--text-mid); font-size: 14px; outline: none; cursor: pointer; }
.list-header { padding: 22px 36px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }

/* ── QUICK BSA ── */
.bsa-upload-area { max-width: 760px; padding: 24px 36px; }
.bsa-results { padding: 0 36px 24px; max-width: 1100px; }
.bsa-two-col { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 20px; }

/* ── CONFIG ── */
.config-body { padding: 24px 36px; max-width: 760px; }
.stage-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.weights-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 10px; }

/* ── APP DETAIL SCROLL ── */
#appd-content { flex: 1; overflow-y: auto; min-height: 0; }

/* ── APPLICATIONS ── */
.app-stage-pill { background: none; border: 1px solid var(--border); border-radius: 2px; padding: 5px 12px; color: var(--text-dim); font-family: var(--font-b); font-size: 12px; letter-spacing: 0.01em; cursor: pointer; }
.app-stage-pill.active { border-color: rgba(185,143,68,.4); background: rgba(185,143,68,.1); color: var(--gold-l); }

/* ── CIC REPORT ── */
.cr-step-item { display: flex; align-items: center; gap: 10px; padding: 11px 16px; cursor: pointer; opacity: 0.45; border-radius: 2px; transition: all 0.15s; }
.cr-step-item.active { opacity: 1; background: rgba(185,143,68,.12); }
.cr-step-num { width: 22px; height: 22px; border-radius: 50%; background: rgba(185,143,68,.15); border: 1px solid rgba(185,143,68,.3); display: flex; align-items: center; justify-content: center; font-family: var(--font-m); font-size: 10px; color: var(--gold-l); flex-shrink: 0; }
.cr-step-label { font-family: var(--font-m); font-size: 11px; color: var(--text); letter-spacing: 0.06em; }
.cr-step-sub { font-family: var(--font-m); font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.cri { background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 2px; padding: 6px 9px; color: var(--text); font-family: var(--font-m); font-size: 12px; outline: none; }
.cri:focus { border-color: rgba(185,143,68,.4); }
.cr-tip { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; background: rgba(185,143,68,.15); border: 1px solid rgba(185,143,68,.3); color: rgba(185,143,68,.8); font-size: 9px; cursor: help; vertical-align: middle; margin-left: 4px; font-family: var(--font-m); font-style: normal; flex-shrink: 0; }
#cr-tip-box { display: none; position: fixed; background: var(--bg); border: 1px solid rgba(185,143,68,.3); color: var(--text-mid); padding: 12px 14px; border-radius: 4px; font-size: 11px; font-family: var(--font-m); line-height: 1.65; max-width: 320px; z-index: 9999; box-shadow: 0 8px 32px rgba(0,0,0,.6); pointer-events: none; }
#cr-tip-box .cr-tip-title { display: block; color: var(--gold); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 7px; padding-bottom: 6px; border-bottom: 1px solid rgba(185,143,68,.2); }
#cr-tip-box.visible { display: block; }

/* ── LMS ── */
.lms-metric { background: var(--bg3); border: 1px solid var(--border); border-radius: 3px; padding: 16px 20px; }
.lms-metric-label { font-family: var(--font-m); font-size: 11px; letter-spacing: .1em; color: var(--text-dim); margin-bottom: 6px; text-transform: uppercase; }
.lms-metric-value { font-family: var(--font-d); font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; }
.lms-metric-sub { font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.pdc-badge { font-family: var(--font-m); font-size: 11px; padding: 3px 8px; border-radius: 2px; display: inline-block; letter-spacing: .04em; }

/* ── FLATPICKR DARK THEME OVERRIDES ── */
.flatpickr-calendar { background: var(--bg2) !important; border: 1px solid rgba(185,143,68,.25) !important; border-radius: 4px !important; box-shadow: 0 16px 48px rgba(0,0,0,.6) !important; font-family: var(--font-b) !important; }
.flatpickr-months { background: transparent !important; padding: 8px 4px 4px !important; }
.flatpickr-month { background: transparent !important; color: var(--text) !important; }
.flatpickr-current-month { color: var(--gold-l) !important; font-family: var(--font-m) !important; font-size: 13px !important; }
.flatpickr-current-month select, .flatpickr-current-month input { color: var(--gold-l) !important; background: transparent !important; border: none !important; font-family: var(--font-m) !important; }
.numInputWrapper span.arrowUp::after { border-bottom-color: var(--gold) !important; }
.numInputWrapper span.arrowDown::after { border-top-color: var(--gold) !important; }
.flatpickr-prev-month, .flatpickr-next-month { color: var(--gold) !important; fill: var(--gold) !important; }
.flatpickr-prev-month:hover, .flatpickr-next-month:hover { color: var(--gold-l) !important; fill: var(--gold-l) !important; }
.flatpickr-weekdays { background: transparent !important; }
span.flatpickr-weekday { background: transparent !important; color: var(--text-faint) !important; font-family: var(--font-m) !important; font-size: 10px !important; letter-spacing: .08em !important; }
.flatpickr-days { border: none !important; }
.dayContainer { border: none !important; }
.flatpickr-day { color: var(--text-mid) !important; border-radius: 3px !important; border: 1px solid transparent !important; font-family: var(--font-b) !important; font-size: 13px !important; }
.flatpickr-day:hover { background: rgba(185,143,68,.12) !important; border-color: rgba(185,143,68,.2) !important; color: var(--gold-l) !important; }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--gold) !important; border-color: var(--gold) !important; color: #000 !important; font-weight: 700 !important; }
.flatpickr-day.today { border-color: rgba(185,143,68,.4) !important; color: var(--gold-l) !important; }
.flatpickr-day.today.selected { color: #000 !important; }
.flatpickr-day.flatpickr-disabled, .flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: var(--text-faint) !important; opacity: .4 !important; }
.flatpickr-input[readonly] { opacity: 1 !important; cursor: pointer !important; }

/* ── CUSTOM CONFIRM DIALOG ── */
#adhconfirm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: var(--z-modal-bd); display: none; align-items: center; justify-content: center; }
#adhconfirm-overlay.open { display: flex; }
#adhconfirm-box { background: var(--bg2); border: 1px solid rgba(185,143,68,.25); border-radius: 4px; width: 100%; max-width: 420px; padding: 28px 28px 22px; box-shadow: 0 24px 64px rgba(0,0,0,.7); animation: fadeUp 0.18s ease; }
#adhconfirm-title { font-family: var(--font-m); font-size: 10px; letter-spacing: .12em; color: rgba(185,143,68,.65); margin-bottom: 10px; }
#adhconfirm-msg { font-size: 14px; color: var(--text-mid); line-height: 1.65; margin-bottom: 22px; }
#adhconfirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
#adhconfirm-cancel { background: none; border: 1px solid var(--border); border-radius: 3px; color: var(--text-dim); font-size: 12px; font-family: var(--font-m); letter-spacing: .06em; padding: 9px 20px; cursor: pointer; transition: border-color .15s, color .15s; }
#adhconfirm-cancel:hover { border-color: var(--text-dim); color: var(--text); }
#adhconfirm-ok { background: var(--gold); border: none; border-radius: 3px; color: #000; font-size: 12px; font-family: var(--font-m); font-weight: 700; letter-spacing: .08em; padding: 9px 24px; cursor: pointer; transition: opacity .15s; }
#adhconfirm-ok:hover { opacity: .88; }
#adhconfirm-ok.danger { background: var(--red); color: #fff; }
