/* ============================================================
   AD AeroReg — Stylesheet v1.0
   Brand: #25064d | #1a6daf | #25abbe | #fdcd12 | #f45eac
============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
 /* ── Logo colors — uncomment to restore ──
  --bg:           #0e0220;
  --surface:      #1a0535;
  --surface2:     #240a4a;
  --card:         #1e0840;
  --border:       #3a1560;
  --border2:      #4d2280;
  --purple:       #25064d;
  --blue:         #1a6daf;
  --teal:         #25abbe;
  --gold:         #fdcd12;
  --gold-dark:    #c9a30e;
  --pink:         #f45eac;
  --green:        #27ae60;
  --red:          #c0392b;
  --orange:       #e67e22;
  --text:         #f0e8ff;
  --text-muted:   #9a7abf;
  --text-dim:     #6a5090;
  ── end logo colors ── */

  /* ── Classic dark theme (active) ── */
  --bg:           #1a1a2e;
  --surface:      #16213e;
  --surface2:     #0f3460;
  --card:         #16213e;
  --border:       #0f3460;
  --border2:      #1a4a8a;
  --purple:       #0f3460;
  --blue:         #1a6daf;
  --teal:         #00b4d8;
  --gold:         #e94560;
  --gold-dark:    #c73652;
  --gold-fill:    #edcb84;
  --pink:         #e94560;
  --green:        #27ae60;
  --red:          #c0392b;
  --orange:       #e67e22;
  --text:         #eaeaea;
  --text-muted:   #a0a0b0;
  --text-dim:     #606080;

  /* ── Layout & fonts — always active ── */
  --mono:         'IBM Plex Mono', 'Courier New', monospace;
  --sans:         'Inter', system-ui, -apple-system, sans-serif;
  --sidebar-w:    220px;
  --topbar-h:     52px;
  --radius:       8px;     /* cards, panels, modals */
  --radius-sm:    6px;     /* buttons, inputs, badges */
  --radius-pill:  999px;   /* genuine status pills only */
}

/* ============================================================
   LIGHT THEME — activates automatically when OS is light mode
   ADD this block immediately after the closing } above
   ============================================================ */

@media (prefers-color-scheme: light) {
  :root {
    --bg:           #f0f4f8;
    --surface:      #ffffff;
    --surface2:     #e8edf4;
    --card:         #ffffff;
    --border:       #d0dae6;
    --border2:      #b0bece;
    --purple:       #1e3a5f;
    --blue:         #1a6daf;
    --teal:         #0077a8;
    --gold:         #c0392b;
    --gold-dark:    #a93226;
    --pink:         #c0392b;
    --green:        #1e8449;
    --red:          #c0392b;
    --orange:       #d35400;
    --text:         #1a1a2e;
    --text-muted:   #4a5a70;
    --text-dim:     #8a9bb0;
}
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); min-height: 100vh; line-height: 1.55; -webkit-font-smoothing: antialiased; letter-spacing: -.005em; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-dark); }
button { cursor: pointer; font-family: var(--sans); }
input, select, textarea { font-family: var(--sans); }
/* Data tokens (P/N, S/N, numbers, dates, indexes) stay monospace for alignment + the instrument feel. */
.mono { font-family: var(--mono); font-feature-settings: "tnum"; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── App Shell ───────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); height: 100vh; min-height: 100vh; background: var(--purple);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; z-index: 200; transition: transform .25s;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px; padding: 16px 14px;
  border-bottom: 1px solid var(--border); background: var(--surface);
}
.sidebar-logo-img { width: 38px; height: 38px; flex-shrink: 0; }
.sidebar-title { font-family: var(--sans); font-size: 16px; font-weight: 400; letter-spacing: .05em; color: var(--gold); text-transform: uppercase; }
.sidebar-sub { font-size: 9px; color: var(--text-muted); letter-spacing: .05em; font-family: var(--sans); text-transform: uppercase; }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-group-label { font-family: var(--sans); font-size: 9px; letter-spacing: .07em; color: var(--text-dim); text-transform: uppercase; padding: 16px 14px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  color: var(--text-muted); font-family: var(--sans); font-size: 13px; letter-spacing: 0; font-weight: 500;
  transition: all .15s; border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: var(--text); }
.nav-item.active { background: rgba(253,205,18,.08); color: var(--gold); border-left-color: var(--gold); }
.sidebar-user {
  padding: 12px 14px; border-top: 1px solid var(--border); display: flex;
  align-items: center; gap: 8px; background: var(--surface);
}
.sidebar-user-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--sans); font-size: 12px; font-weight: 500; color: #000; flex-shrink: 0; }
.sidebar-user-name { font-size: 11px; color: var(--text); font-family: var(--sans); font-weight: 400; }
.sidebar-user-role { font-size: 9px; color: var(--text-muted); font-family: var(--sans); letter-spacing: .05em; text-transform: uppercase; }
.sidebar-logout { margin-left: auto; color: var(--text-muted); font-size: 16px; padding: 4px; transition: color .15s; }
.sidebar-logout:hover { color: var(--red); }

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  position: fixed; top: 0; left: var(--sidebar-w); right: 0; z-index: 100;
}
.topbar-toggle { display: none; background: none; border: none; color: var(--text-muted); font-size: 20px; }
.topbar-title { flex: 1; font-family: var(--sans); font-size: 15px; font-weight: 600; letter-spacing: -.005em; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-notif { position: relative; background: none; border: 1px solid var(--border2); color: var(--text-muted); padding: 5px 10px; border-radius: var(--radius); transition: all .15s; }
.topbar-notif:hover { border-color: var(--gold); color: var(--gold); }
.notif-badge { position: absolute; top: -6px; right: -6px; background: var(--pink); color: #fff; font-size: 9px; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-family: var(--sans); font-weight: 400; }
.topbar-profile { font-family: var(--sans); font-size: 12px; color: var(--text-muted); letter-spacing: .02em; }

/* ── Notification panel ──────────────────────────────────── */
.notif-panel {
  position: fixed; top: var(--topbar-h); right: 0; width: 340px; max-height: 60vh;
  background: var(--surface2); border: 1px solid var(--border2); border-top: none;
  z-index: 150; display: none; overflow-y: auto;
}
.notif-panel.open { display: block; }
.notif-panel-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.notif-panel-header span { font-family: var(--sans); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--gold); }
.notif-panel-header button { background: none; border: 1px solid var(--border2); color: var(--text-muted); font-size: 10px; padding: 3px 8px; font-family: var(--sans); letter-spacing: .02em; }
.notif-item { padding: 12px 14px; border-bottom: 1px solid var(--border); transition: background .15s; }
.notif-item:hover { background: rgba(253,205,18,.05); }
.notif-item.unread { border-left: 3px solid var(--gold); }
.notif-item-title { font-size: 12px; color: var(--text); margin-bottom: 4px; }
.notif-item-msg { font-size: 11px; color: var(--text-muted); line-height: 1.5; }
.notif-item-time { font-size: 10px; color: var(--text-dim); margin-top: 4px; }

/* ── Main content ────────────────────────────────────────── */
.main-content { margin-left: var(--sidebar-w); padding-top: var(--topbar-h); min-height: 100vh; }
.page-content { padding: 24px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-family: var(--sans); font-size: 21px; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.page-header p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Auth pages ──────────────────────────────────────────── */
.auth-content { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px; position: relative; overflow: hidden; }
.auth-card { background: var(--surface); border: 1px solid var(--border2); width: 100%; max-width: 420px; padding: 0; position: relative; z-index: 1; }
.auth-card-header { padding: 24px 28px; border-bottom: 1px solid var(--border); background: var(--purple); text-align: center; }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 10px; }
.auth-logo img { width: 48px; height: 48px; }
.auth-logo-title { font-family: var(--sans); font-size: 22px; font-weight: 500; letter-spacing: .04em; color: var(--gold); text-transform: uppercase; }
.auth-logo-sub { font-size: 9px; color: var(--text-muted); letter-spacing: .05em; font-family: var(--sans); text-transform: uppercase; }
.auth-card-body { padding: 28px; }
.auth-radar { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#bgCanvas { width: 100%; height: 100%; }

/* ── Cards ───────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.card-header { padding: 13px 18px; border-bottom: 1px solid var(--border); background: var(--card-head-bg); border-radius: var(--radius) var(--radius) 0 0; display: flex; align-items: center; justify-content: space-between; }
.card-header h2 { font-family: var(--sans); font-size: 13.5px; font-weight: 600; letter-spacing: 0; color: var(--text); }
.card-body { padding: 18px; }

/* ── Detail list — canonical label/value spec rows (platform-wide) ──────────
   Baseline-aligned so each label lines up with the FIRST line of its value;
   the divider sits on the whole ROW, so it never goes ragged when a value
   wraps to multiple lines or carries a pill/badge. Use everywhere we show
   label → value detail (replaces ad-hoc 2-column grids). */
.detail-list { display: flex; flex-direction: column; }
.detail-row {
  display: flex; gap: 16px; align-items: baseline;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.detail-row:first-child { padding-top: 0; }
.detail-row:last-child  { padding-bottom: 0; border-bottom: none; }
.detail-k { flex: 0 0 165px; font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.detail-v { flex: 1 1 auto; min-width: 0; font-size: 13.5px; color: var(--text); line-height: 1.5; }
.detail-v.mono { font-family: var(--mono); font-weight: 600; }
@media (max-width: 560px) { .detail-row { flex-direction: column; gap: 3px; align-items: stretch; } .detail-k { flex-basis: auto; } }

/* ── Forms ───────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: .04em; color: var(--text-muted); text-transform: uppercase; }
.form-label.required::after { content: ' *'; color: var(--pink); }
.form-control {
  background: var(--bg); border: 1px solid var(--border2); color: var(--text);
  font-family: var(--sans); font-size: 13.5px; padding: 9px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s; width: 100%; border-radius: var(--radius-sm);
  color-scheme: dark;
}
.form-control:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(226,185,111,.12); }
.form-control:disabled { opacity: .5; cursor: not-allowed; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 10px; color: var(--text-dim); margin-top: 3px; }
.form-error-msg { background: rgba(192,57,43,.12); border: 1px solid rgba(192,57,43,.3); color: #e74c3c; font-size: 12px; padding: 8px 12px; border-radius: var(--radius); display: none; margin-bottom: 14px; }
.form-error-msg.show { display: block; }
.form-section { margin-bottom: 28px; }
.form-section-title { font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--text); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.form-section-title::before { content: ''; width: 4px; height: 4px; background: var(--gold); display: inline-block; flex-shrink: 0; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn { font-family: var(--sans); font-size: 13px; letter-spacing: 0; font-weight: 550; text-transform: none; padding: 9px 16px; border: none; border-radius: var(--radius-sm); transition: all .15s; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: var(--gold-fill); color: #000; }
/* Subtle lift on hover (brightness + soft shadow) — keeps the click affordance
   without the dated colour-swap. Gold stays the lighter --gold at rest. */
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 2px 12px rgba(237,203,132,.22); }
.btn-primary:active { filter: brightness(.97); box-shadow: none; }
.btn-secondary { background: transparent; color: var(--teal); border: 1px solid rgba(37,171,190,.3); }
.btn-secondary:hover { background: rgba(37,171,190,.1); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border2); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }
.btn-danger { background: transparent; color: var(--red); border: 1px solid rgba(192,57,43,.3); }
.btn-danger:hover { background: rgba(192,57,43,.1); }
.btn-success { background: var(--green); color: #fff; }
/* Filled neutral button — for a secondary row action (e.g. Edit) that needs a
   distinct background from the ghost View button. High contrast in both themes. */
.btn-edit { background: var(--surface2); color: var(--text); border: 1px solid var(--border2); }
.btn-edit:hover { border-color: var(--text-muted); filter: brightness(1.08); }
.btn-sm { padding: 5px 12px; font-size: 10px; }
.btn-xs { padding: 3px 8px; font-size: 9px; }
.btn-icon { padding: 6px 10px; }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border2); background: var(--surface); white-space: nowrap; cursor: pointer; user-select: none; }
.data-table th:hover { color: var(--gold); }
.data-table th .sort-icon { margin-left: 4px; opacity: .4; }
.data-table th.sorted .sort-icon { opacity: 1; color: var(--gold); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover td { background: rgba(253,205,18,.03); }
.data-table tr.clickable { cursor: pointer; }

/* ── Badges ──────────────────────────────────────────────── */
.badge { display: inline-block; white-space: nowrap; padding: 3px 10px; font-family: var(--sans); font-size: 10.5px; letter-spacing: .03em; font-weight: 600; text-transform: uppercase; border-radius: var(--radius-sm); }
.badge-available { background: rgba(39,174,96,.18); color: #2ecc71; border: 1px solid rgba(39,174,96,.35); }
.badge-gone { background: rgba(192,57,43,.18); color: #e74c3c; border: 1px solid rgba(192,57,43,.35); }
.badge-deal-available { background: rgba(26,109,175,.18); color: #3498db; border: 1px solid rgba(26,109,175,.35); }
.badge-deal-negotiations { background: rgba(230,126,34,.18); color: #e67e22; border: 1px solid rgba(230,126,34,.35); }
.badge-deal-loi { background: rgba(253,205,18,.18); color: var(--gold); border: 1px solid rgba(253,205,18,.35); }
.badge-deal-dropped { background: rgba(192,57,43,.15); color: #e74c3c; border: 1px solid rgba(192,57,43,.3); }
.badge-deal-sold { background: rgba(39,174,96,.2); color: #2ecc71; border: 1px solid rgba(39,174,96,.4); }
.badge-sv { background: rgba(39,174,96,.15); color: #27ae60; border: 1px solid rgba(39,174,96,.3); }
.badge-unsv { background: rgba(192,57,43,.15); color: #e74c3c; border: 1px solid rgba(192,57,43,.3); }
.badge-admin { background: rgba(253,205,18,.15); color: var(--gold); border: 1px solid rgba(253,205,18,.3); }
.badge-editor { background: rgba(37,171,190,.15); color: var(--teal); border: 1px solid rgba(37,171,190,.3); }
.badge-viewer { background: rgba(26,109,175,.15); color: var(--blue); border: 1px solid rgba(26,109,175,.3); }
.badge-pending { background: rgba(230,126,34,.15); color: var(--orange); border: 1px solid rgba(230,126,34,.3); }

/* ── Status selects with color preview ───────────────────── */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }

/* ── Buyer chips ─────────────────────────────────────────── */
.buyer-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.buyer-chip { padding: 2px 10px; font-size: 10px; font-family: var(--sans); letter-spacing: .02em; border-radius: 2px; font-weight: 400; }

/* ── Dashboard ───────────────────────────────────────────── */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); padding: 18px; border-left: 3px solid var(--gold); }
.stat-card-val { font-family: var(--sans); font-size: 36px; font-weight: 700; color: var(--gold); }
.stat-card-label { font-family: var(--sans); font-size: 10px; letter-spacing: .05em; color: var(--text-muted); text-transform: uppercase; margin-top: 4px; }
.stat-card.blue { border-left-color: var(--blue); }
.stat-card.blue .stat-card-val { color: var(--blue); }
.stat-card.teal { border-left-color: var(--teal); }
.stat-card.teal .stat-card-val { color: var(--teal); }
.stat-card.green { border-left-color: var(--green); }
.stat-card.green .stat-card-val { color: var(--green); }
.stat-card.red { border-left-color: var(--red); }
.stat-card.red .stat-card-val { color: var(--red); }
.stat-card.pink { border-left-color: var(--pink); }
.stat-card.pink .stat-card-val { color: var(--pink); }
.dashboard-panel { background: var(--card); border: 1px solid var(--border); }
.dashboard-panel-header { padding: 12px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.dashboard-panel-header h3 { font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--text); }
.dashboard-panel-body { padding: 14px 18px; max-height: 400px; overflow-y: auto; }
.reminder-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.reminder-item:last-child { border-bottom: none; }
.reminder-time { font-size: 10px; color: var(--gold); margin-bottom: 3px; }
.reminder-text { font-size: 12px; color: var(--text); }
.reminder-link { font-size: 11px; color: var(--teal); margin-top: 3px; display: block; }

/* ── Modals ──────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--surface2); border: 1px solid var(--border2); width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; border-radius: var(--radius); }
.modal-lg { max-width: 900px; }
.modal-xl { max-width: 1100px; }
.modal-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--surface2); z-index: 1; }
.modal-header h3 { font-family: var(--sans); font-size: 15px; font-weight: 600; letter-spacing: -.005em; color: var(--text); }
.modal-close { background: none; border: 1px solid var(--border2); color: var(--text-muted); width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: all .15s; border-radius: var(--radius); }
.modal-close:hover { border-color: var(--red); color: var(--red); }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ── Tabs ────────────────────────────────────────────────── */
.tab-bar { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-btn { font-family: var(--sans); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; padding: 10px 16px; background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-muted); transition: all .15s; cursor: pointer; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Engine blocks ───────────────────────────────────────── */
.engine-blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.engine-block { background: var(--bg); border: 1px solid var(--border2); padding: 14px; }
.engine-block-title { font-family: var(--sans); font-size: 10px; letter-spacing: .05em; color: var(--teal); text-transform: uppercase; margin-bottom: 12px; border-bottom: 1px solid rgba(37,171,190,.2); padding-bottom: 6px; }

/* ── File upload area ────────────────────────────────────── */
.upload-area { border: 2px dashed var(--border2); padding: 24px; text-align: center; transition: border-color .15s; cursor: pointer; border-radius: var(--radius); }
.upload-area:hover, .upload-area.dragover { border-color: var(--gold); background: rgba(253,205,18,.04); }
.upload-area-icon { font-size: 28px; margin-bottom: 8px; }
.upload-area-text { font-family: var(--sans); font-size: 12.5px; letter-spacing: 0; color: var(--text-muted); }
.upload-area input { display: none; }
.file-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.file-item { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border); padding: 7px 10px; border-radius: var(--radius); }
.file-item-name { flex: 1; font-size: 11px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-size { font-size: 10px; color: var(--text-dim); }
.file-item-remove { background: none; border: none; color: var(--red); font-size: 14px; padding: 0 4px; }

/* ── Negotiations log ────────────────────────────────────── */
.neg-log { display: flex; flex-direction: column; gap: 12px; }
.neg-entry { background: var(--bg); border: 1px solid var(--border); padding: 12px 14px; border-radius: var(--radius); }
.neg-entry-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.neg-entry-date { font-family: var(--sans); font-size: 10px; color: var(--gold); letter-spacing: .02em; }
.neg-entry-author { font-size: 10px; color: var(--text-muted); }
.neg-entry-text { font-size: 12px; line-height: 1.6; color: var(--text); white-space: pre-wrap; }
.neg-reminder { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 10px; color: var(--teal); }

/* ── Filters bar ─────────────────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); }
.filter-group { display: flex; align-items: center; gap: 6px; }
.filter-label { font-family: var(--sans); font-size: 9px; letter-spacing: .05em; color: var(--text-muted); text-transform: uppercase; white-space: nowrap; }
.filter-control { background: var(--card); border: 1px solid var(--border2); color: var(--text); font-family: var(--mono); font-size: 11px; padding: 5px 9px; outline: none; border-radius: var(--radius); }
.filter-control:focus { border-color: var(--gold); }
.filter-sep { width: 1px; height: 20px; background: var(--border2); }
.result-count { background: rgba(253,205,18,.1); color: var(--gold); border: 1px solid rgba(253,205,18,.25); padding: 3px 10px; font-family: var(--mono); font-size: 11px; border-radius: var(--radius); }

/* ── Toast ───────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--surface2); border: 1px solid var(--border2); padding: 12px 18px; min-width: 260px; font-size: 12px; border-radius: var(--radius); pointer-events: all; transform: translateX(120%); opacity: 0; transition: all .3s; display: flex; align-items: center; gap: 10px; }
.toast.show { transform: translateX(0); opacity: 1; }
.toast.ok { border-left: 3px solid var(--green); }
.toast.err { border-left: 3px solid var(--red); }
.toast.warn { border-left: 3px solid var(--orange); }
.toast.info { border-left: 3px solid var(--teal); }

/* ── Loading spinner ─────────────────────────────────────── */
.spinner { width: 32px; height: 32px; border: 3px solid var(--border2); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Deal view ───────────────────────────────────────────── */
.deal-header { background: var(--surface2); border: 1px solid var(--border2); padding: 20px 24px; margin-bottom: 20px; display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.deal-title { font-family: var(--sans); font-size: 20px; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.deal-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.deal-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.deal-party { background: var(--card); border: 1px solid var(--border); padding: 14px; }
.deal-party-label { font-family: var(--sans); font-size: 9px; letter-spacing: .05em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 8px; }
.deal-party-name { font-family: var(--sans); font-size: 16px; font-weight: 400; color: var(--text); }

/* ── Public landing page ─────────────────────────────────── */
.landing-page { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.landing-hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 24px; text-align: center; position: relative; }
.landing-logo { width: 100px; height: 100px; margin-bottom: 24px; }
.landing-title { font-family: var(--sans); font-size: 36px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.landing-subtitle { font-family: var(--sans); font-size: 14px; letter-spacing: .07em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 48px; }
.landing-actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.landing-action { padding: 15px 32px; font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: 0; border-radius: var(--radius-sm); transition: all .2s; }
.landing-action-primary { background: var(--gold-fill); color: #000; }
.landing-action-primary:hover { filter: brightness(1.05); box-shadow: 0 4px 16px rgba(237,203,132,.25); color: #000; }
.landing-action-ghost { background: transparent; border: 2px solid var(--gold); color: var(--gold); }
.landing-action-ghost:hover { background: rgba(253,205,18,.1); }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 24px; }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: .3; }
.empty-state-text { font-family: var(--sans); font-size: 14px; letter-spacing: 0; color: var(--text-muted); }

/* ── Pagination ──────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 4px; margin-top: 16px; justify-content: center; flex-wrap: wrap; }
.page-btn { background: var(--card); border: 1px solid var(--border2); color: var(--text-muted); padding: 5px 10px; font-family: var(--sans); font-size: 11px; border-radius: var(--radius); transition: all .15s; }
.page-btn:hover { border-color: var(--gold); color: var(--gold); }
.page-btn.active { background: var(--gold-fill); color: #000; border-color: var(--gold-fill); font-weight: 700; }

/* ── LOI warning banner ──────────────────────────────────── */
.loi-banner { background: rgba(253,205,18,.1); border: 1px solid rgba(253,205,18,.3); border-left: 4px solid var(--gold); padding: 12px 16px; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px; }
.loi-banner-icon { font-size: 18px; flex-shrink: 0; }
.loi-banner-text { font-size: 12px; line-height: 1.6; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .deal-parties { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .topbar { left: 0; }
  .main-content { margin-left: 0; }
  .topbar-toggle { display: block; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .engine-blocks { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .page-content { padding: 14px; }
  .landing-title { font-size: 24px; }
  .landing-actions { flex-direction: column; }
  .landing-action { padding: 14px 28px; }
}

/* ── Date / time input icons (calendar, clock) — dark mode fix ── */
input[type="date"].form-control,
input[type="datetime-local"].form-control,
input[type="time"].form-control,
input[type="month"].form-control {
  color-scheme: dark;
}
input[type="date"].form-control::-webkit-calendar-picker-indicator,
input[type="datetime-local"].form-control::-webkit-calendar-picker-indicator,
input[type="time"].form-control::-webkit-calendar-picker-indicator {
  filter: invert(0.8) sepia(0.2) saturate(2) hue-rotate(10deg) brightness(1.2);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity .15s;
}
input[type="date"].form-control::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"].form-control::-webkit-calendar-picker-indicator:hover,
input[type="time"].form-control::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* ── Password field wrapper with toggle eye ── */
.pw-wrap { position: relative; }
.pw-wrap .form-control { padding-right: 38px; }
.pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 2px 4px;
  color: #ffffff;
  display: none; align-items: center; justify-content: center;
  transition: color .15s; line-height: 1;
}
.pw-toggle:hover { color: var(--gold); }
@media (prefers-color-scheme: light) {
  .pw-toggle { color: #333333; }
  .pw-toggle:hover { color: var(--gold); }
}

/* ── RMA extension sub-row (deal lists) ─────────────────────────────── */
/* An attached "↳ RMA" lineage row shown directly beneath its parent deal. */
.data-table tr.has-rma-ext > td { border-bottom: none; }      /* fuse parent to child */
.rma-ext-row > td { border-top: none; padding-top: 0; }
.rma-ext-spacer { width: 36px; background: transparent; }
.rma-ext-cell {
  padding: 4px 12px 11px 14px;
  background: linear-gradient(to right, rgba(253,205,18,.06), transparent 55%);
  border-left: 2px solid rgba(253,205,18,.55);
  white-space: nowrap;
}
.rma-ext-glyph { color: var(--text-dim); margin-right: 9px; font-size: 1rem; vertical-align: middle; }
.rma-ext-tag {
  font-family: var(--sans); font-size: 9px; font-weight: 800; letter-spacing: .09em;
  background: var(--gold-fill); color: #1a1a1a; padding: 2px 6px; border-radius: 4px; margin-right: 9px;
  vertical-align: middle;
}
.rma-ext-no {
  font-family: var(--mono); font-weight: 600; font-size: .82rem; color: var(--text);
  margin-right: 11px; vertical-align: middle;
}
.rma-ext-pill {
  font-family: var(--sans); font-size: .72rem; font-weight: 700;
  padding: 2px 10px; border-radius: 12px; margin-right: 12px; vertical-align: middle;
}
.rma-ext-amber  { background: rgba(214,158,46,.16); color: #b7791f; }
.rma-ext-blue   { background: rgba(52,152,219,.16); color: #2980b9; }
.rma-ext-purple { background: rgba(155,89,182,.16); color: #8e44ad; }
.rma-ext-green  { background: rgba(39,174,96,.16);  color: #27ae60; }
.rma-ext-red    { background: rgba(231,76,60,.16);  color: #e74c3c; }
.rma-ext-grey   { background: var(--surface); color: var(--text-muted); }
.rma-ext-link { font-size: .78rem; color: var(--teal); font-weight: 600; text-decoration: none; vertical-align: middle; }
.rma-ext-link:hover { text-decoration: underline; }
/* "It's your turn" badge — fires only for the party who owes the next action. */
.rma-ext-turn {
  display: inline-block; font-family: var(--sans); font-size: .68rem; font-weight: 700;
  letter-spacing: .02em; padding: 2px 9px; border-radius: var(--radius-pill);
  margin-right: 10px; vertical-align: middle; white-space: nowrap;
  background: rgba(231,76,60,.14); color: #e74c3c; border: 1px solid rgba(231,76,60,.35);
}
/* "Action needed" pulsing row dot — turn-signal on list rows (matches Module A asset deals). */
.row-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#e5484d;margin-right:6px;vertical-align:middle;animation:rowpulse 1.5s infinite}
@keyframes rowpulse{0%,100%{opacity:1}50%{opacity:.4}}
