/* ═══════════════════════════════════════════════════════════════════════════
   FLIGHTCASE — Design System v1.1
   Refined by Claude. Typography, spacing, and visual hierarchy overhaul.
═══════════════════════════════════════════════════════════════════════════ */

/* ── TOKENS ──────────────────────────────────────────────────────────────── */
:root {
  --bg:       #08080b;
  --surface:  #0f0f14;
  --surface2: #161620;
  --surface3: #1d1d2a;
  --border:   #242432;
  --border2:  #303042;
  --accent:   #e8ff47;
  --accent2:  #a8ff47;
  --text:     #ededf5;
  --text2:    #8a8aa6;
  --text3:    #52526a;
  --red:      #ff4757;
  --green:    #3de88a;
  --blue:     #47b4ff;
  --orange:   #ffb347;
  --purple:   #c882ff;
  --radius:   5px;
  --radius2:  9px;
  --radius3:  13px;
}

/* ── RESET ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ══════════════════════════════════════════════════════════════════════════
   SHELL
══════════════════════════════════════════════════════════════════════════ */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 216px; min-width: 216px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: 100vh; position: sticky; top: 0; overflow: hidden;
}

.logo { padding: 20px 18px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.logo-mark { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 16px; letter-spacing: .1em; color: var(--accent); line-height: 1; }
.logo-sub { font-family: 'DM Mono', monospace; font-size: 9px; color: var(--text3); letter-spacing: .12em; text-transform: uppercase; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { flex: 1; padding: 10px 10px 4px; overflow-y: auto; overflow-x: hidden; }
.nav-section { margin-bottom: 4px; }
.nav-section + .nav-section { padding-top: 8px; border-top: 1px solid var(--border); margin-top: 4px; }
.nav-label { font-family: 'DM Mono', monospace; font-size: 8.5px; color: var(--text3); letter-spacing: .16em; text-transform: uppercase; padding: 8px 8px 4px; display: block; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: var(--radius);
  font-size: 13px; color: var(--text2); font-weight: 400;
  transition: all .12s; border: 1px solid transparent;
  letter-spacing: .01em; cursor: pointer; white-space: nowrap;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--surface3); color: var(--text); border-color: var(--border2); font-weight: 500; }
.nav-icon { font-size: 13px; width: 16px; text-align: center; flex-shrink: 0; color: var(--text3); transition: color .12s; }
.nav-item:hover .nav-icon { color: var(--text2); }
.nav-item.active .nav-icon { color: var(--accent); }

.plan-card-wrap { padding: 10px 10px 4px; }
.plan-card { background: var(--surface2); border: 1px solid var(--border); border-left: 2px solid var(--accent); border-radius: var(--radius2); padding: 10px 12px; }
.plan-card__eyebrow { font-family: 'DM Mono', monospace; font-size: 8px; color: var(--accent); text-transform: uppercase; letter-spacing: .14em; margin-bottom: 4px; }
.plan-card__text { font-size: 11px; color: var(--text3); line-height: 1.5; margin-bottom: 8px; }
.plan-card__cta { display: block; text-align: center; border: 1px solid var(--border2); color: var(--text2); font-size: 11px; font-weight: 600; padding: 5px; border-radius: var(--radius); text-decoration: none; transition: all .15s; }
.plan-card__cta:hover { background: var(--surface3); border-color: var(--accent); color: var(--accent); }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); flex-shrink: 0; }
.user-pill { display: flex; align-items: center; gap: 9px; }
.user-avatar { width: 28px; height: 28px; border-radius: 6px; background: var(--surface3); border: 1px solid var(--border2); display: flex; align-items: center; justify-content: center; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 11px; color: var(--accent); flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.user-role { font-family: 'DM Mono', monospace; font-size: 8.5px; color: var(--text3); text-transform: uppercase; letter-spacing: .1em; }
.logout-btn { color: var(--text3); font-size: 13px; transition: color .15s; flex-shrink: 0; padding: 3px; border-radius: 4px; }
.logout-btn:hover { color: var(--red); }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar { height: 52px; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; gap: 12px; background: var(--surface); flex-shrink: 0; }
.topbar-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 15px; flex: 1; color: var(--text); letter-spacing: .01em; }
.topbar-actions { display: flex; gap: 6px; align-items: center; }

.content { flex: 1; overflow-y: auto; padding: 24px; }

/* ══════════════════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════════════════ */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius); font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid transparent; transition: all .14s; white-space: nowrap; line-height: 1; letter-spacing: .01em; }
.btn-primary { background: var(--accent); color: #000; font-weight: 600; border-color: var(--accent); }
.btn-primary:hover { background: #f0ff5a; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(232,255,71,.22); }
.btn-secondary { background: var(--surface3); color: var(--text); border-color: var(--border2); }
.btn-secondary:hover { background: var(--surface2); }
.btn-ghost { background: transparent; color: var(--text2); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); border-color: var(--border2); }
.btn-danger { background: transparent; color: var(--red); border-color: rgba(255,71,87,.25); }
.btn-danger:hover { background: rgba(255,71,87,.08); border-color: rgba(255,71,87,.4); }
.btn-sm  { padding: 5px 10px; font-size: 12px; }
.btn-xs  { padding: 3px 7px; font-size: 11px; }
.btn-icon { padding: 6px 7px; }

/* ══════════════════════════════════════════════════════════════════════════
   STAT CARDS
══════════════════════════════════════════════════════════════════════════ */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius2); padding: 18px 20px; }
.stat-card.highlight { background: var(--accent); border-color: var(--accent); }
.stat-card.highlight .stat-label, .stat-card.highlight .stat-value, .stat-card.highlight .stat-sub { color: #000; }
.stat-label { font-family: 'DM Mono', monospace; font-size: 9px; color: var(--text3); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; display: block; }
.stat-value { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 26px; line-height: 1; color: var(--text); }
.stat-sub { font-size: 11px; color: var(--text3); margin-top: 6px; }

/* ══════════════════════════════════════════════════════════════════════════
   TABLES
══════════════════════════════════════════════════════════════════════════ */
.table-container { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius2); overflow: hidden; }
.table-header { display: flex; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--border); gap: 10px; flex-wrap: wrap; }
.table-title { font-family: 'Syne', sans-serif; font-weight: 600; font-size: 13px; flex: 1; color: var(--text); }
table { width: 100%; border-collapse: collapse; }
thead th { font-family: 'DM Mono', monospace; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; color: var(--text3); padding: 9px 16px; text-align: left; border-bottom: 1px solid var(--border); font-weight: 500; background: var(--surface2); }
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }
tbody td { padding: 11px 16px; font-size: 13px; color: var(--text); vertical-align: middle; }
.col-actions { text-align: right; white-space: nowrap; }
.col-actions .btn + .btn { margin-left: 3px; }

/* ══════════════════════════════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════════════════════════════ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-family: 'DM Mono', monospace; font-size: 9px; color: var(--text3); text-transform: uppercase; letter-spacing: .1em; }
.field input, .field select, .field textarea { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 11px; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 13px; outline: none; transition: border-color .14s, background .14s; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); background: var(--surface3); }
.field select option { background: var(--surface2); }
.field textarea { resize: vertical; min-height: 72px; line-height: 1.6; }
.field-hint { font-size: 11px; color: var(--text3); }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius2); padding: 22px 24px; margin-bottom: 16px; }
.form-card-title { font-family: 'Syne', sans-serif; font-weight: 600; font-size: 13px; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; color: var(--text); }

/* ══════════════════════════════════════════════════════════════════════════
   BADGES & TAGS
══════════════════════════════════════════════════════════════════════════ */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-family: 'DM Mono', monospace; font-size: 9.5px; font-weight: 500; letter-spacing: .04em; line-height: 1.6; }
.badge-draft    { background: rgba(82,82,106,.2);   color: var(--text3); border: 1px solid var(--border); }
.badge-quote    { background: rgba(71,180,255,.12);  color: var(--blue);  border: 1px solid rgba(71,180,255,.25); }
.badge-approved { background: rgba(61,232,138,.12);  color: var(--green); border: 1px solid rgba(61,232,138,.25); }
.badge-invoiced { background: rgba(232,255,71,.12);  color: var(--accent);border: 1px solid rgba(232,255,71,.25); }
.badge-paid     { background: rgba(61,232,138,.18);  color: var(--green); border: 1px solid rgba(61,232,138,.35); }
.badge-overdue  { background: rgba(255,71,87,.12);   color: var(--red);   border: 1px solid rgba(255,71,87,.25); }
.badge-planning  { background: rgba(82,82,106,.2);   color: var(--text3); border: 1px solid var(--border); }
.badge-confirmed { background: rgba(71,180,255,.12);  color: var(--blue);  border: 1px solid rgba(71,180,255,.25); }
.badge-active    { background: rgba(61,232,138,.12);  color: var(--green); border: 1px solid rgba(61,232,138,.25); }
.badge-wrapped   { background: rgba(82,82,106,.15);   color: var(--text3); border: 1px solid var(--border); }

.cat-tag { display: inline-flex; padding: 1px 7px; border-radius: 4px; font-size: 9.5px; font-family: 'DM Mono', monospace; font-weight: 500; letter-spacing: .03em; line-height: 1.8; }
.cat-lighting { background: rgba(255,179,71,.12); color: var(--orange); }
.cat-audio    { background: rgba(71,180,255,.12); color: var(--blue);   }
.cat-video    { background: rgba(168,255,71,.12); color: var(--accent2);}
.cat-rigging  { background: rgba(255,71,87,.12);  color: var(--red);    }
.cat-labor    { background: rgba(61,232,138,.12); color: var(--green);  }
.cat-staging  { background: rgba(200,130,255,.12);color: var(--purple); }
.cat-misc     { background: rgba(82,82,106,.18);  color: var(--text3);  }
.cat-power    { background: rgba(61,232,138,.12); color: var(--green);  }
.cat-backline { background: rgba(255,179,71,.12); color: var(--orange); }

.role-admin  { background: rgba(232,255,71,.12);  color: var(--accent); border: 1px solid rgba(232,255,71,.25); }
.role-staff  { background: rgba(71,180,255,.12);  color: var(--blue);   border: 1px solid rgba(71,180,255,.25); }
.role-viewer { background: rgba(82,82,106,.2);    color: var(--text3);  border: 1px solid var(--border); }

/* ══════════════════════════════════════════════════════════════════════════
   LINE ITEMS
══════════════════════════════════════════════════════════════════════════ */
.line-items { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius2); overflow: hidden; margin-bottom: 10px; }
.line-item { display: grid; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); align-items: center; }
.line-item:last-child { border-bottom: none; }
.line-item-header { font-family: 'DM Mono', monospace; font-size: 8.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--text3); background: var(--surface3); border-bottom: 1px solid var(--border); padding: 7px 12px; }
.line-item input, .line-item select { background: var(--surface3); border: 1px solid transparent; border-radius: 4px; padding: 5px 8px; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 12px; outline: none; width: 100%; transition: border-color .14s; }
.line-item input:focus, .line-item select:focus { border-color: var(--accent); }
.line-remove { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 13px; padding: 4px; border-radius: 4px; transition: color .14s; display: flex; align-items: center; justify-content: center; }
.line-remove:hover { color: var(--red); }
.gear-cols  { grid-template-columns: 2fr 80px 80px 110px 36px; }
.labor-cols { grid-template-columns: 2fr 80px 80px 110px 36px; }

.totals-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius2); padding: 14px 16px; }
.totals-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 13px; color: var(--text2); }
.totals-row.total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; color: var(--text); font-weight: 600; }
.totals-row.total .amount { color: var(--accent); }

/* ══════════════════════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════════════════════ */
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.catalog-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius2); padding: 16px; position: relative; transition: border-color .15s, transform .15s, box-shadow .15s; }
.catalog-card:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.3); }
.catalog-card-name { font-family: 'Syne', sans-serif; font-weight: 600; font-size: 13px; margin: 8px 0 4px; }
.catalog-card-rate { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--accent); margin-top: 10px; }
.catalog-card-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }
.card-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.catalog-card:hover .card-actions { opacity: 1; }

.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.client-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius2); padding: 18px; transition: border-color .15s, transform .15s; }
.client-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.client-avatar { width: 36px; height: 36px; border-radius: 8px; background: var(--surface3); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 14px; color: var(--accent); margin-bottom: 12px; }
.client-name { font-family: 'Syne', sans-serif; font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.client-meta { font-size: 11px; color: var(--text3); margin-bottom: 12px; }
.client-stats { display: flex; gap: 20px; }
.client-stat { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--text3); }
.client-stat span { display: block; font-size: 13px; color: var(--text); font-weight: 500; }

.crew-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.crew-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(256px, 1fr)); gap: 12px; }
.crew-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius2); padding: 16px; transition: border-color .15s, transform .15s; position: relative; }
.crew-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.crew-avatar { width: 38px; height: 38px; border-radius: 8px; background: var(--surface3); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.crew-name { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 14px; }
.crew-roles-list { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 10px; }
.role-chip { font-size: 9.5px; font-family: 'DM Mono', monospace; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface2); color: var(--text2); }
.role-chip.primary { border-color: rgba(232,255,71,.3); color: var(--accent); background: rgba(232,255,71,.07); }
.crew-contact { font-size: 12px; color: var(--text2); line-height: 1.8; }
.rate-row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.rate-chip { font-family: 'DM Mono', monospace; font-size: 9.5px; padding: 2px 8px; border-radius: 4px; background: var(--surface3); border: 1px solid var(--border); color: var(--text2); }
.card-actions-abs { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.crew-card:hover .card-actions-abs { opacity: 1; }
.role-row { display: grid; grid-template-columns: 2fr 1fr 80px 80px 28px; gap: 6px; align-items: center; margin-bottom: 6px; }

.invoice-print { background: #fff; color: #111; border-radius: var(--radius2); padding: 44px; font-family: 'DM Sans', sans-serif; }

/* ══════════════════════════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════════════════════════ */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.75); backdrop-filter: blur(6px); z-index: 100; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius3); width: 540px; max-width: 96vw; max-height: 92vh; overflow-y: auto; animation: slideUp .2s cubic-bezier(.16,1,.3,1); box-shadow: 0 24px 64px rgba(0,0,0,.5); }
.modal-lg { width: 860px; }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-head { display: flex; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.modal-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 14px; flex: 1; }
.modal-close { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 16px; padding: 4px 6px; border-radius: 4px; transition: color .14s; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 22px; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 22px; border-top: 1px solid var(--border); }

/* ══════════════════════════════════════════════════════════════════════════
   DASHBOARD
══════════════════════════════════════════════════════════════════════════ */
.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.dash-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius2); padding: 18px 20px; }
.dash-stat.accent { background: var(--accent); border-color: var(--accent); }
.dash-stat.accent .stat-label, .dash-stat.accent .stat-value, .dash-stat.accent .stat-sub { color: #000; }
.dash-stat.warning .stat-value { color: var(--orange); }
.dash-stat.success .stat-value { color: var(--green); }
.dash-stat.alert   .stat-value { color: var(--red); }
.section-grid   { display: grid; grid-template-columns: 1fr 1fr;  gap: 14px; margin-bottom: 14px; }
.section-grid-3 { display: grid; grid-template-columns: 2fr 1fr;  gap: 14px; margin-bottom: 14px; }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius2); overflow: hidden; }
.dash-card-head { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.dash-card-title { font-family: 'Syne', sans-serif; font-weight: 600; font-size: 12px; flex: 1; }
.dash-card-body { padding: 0; }
.show-row-link, .inv-row-link { display: block; }
.show-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--border); transition: background .1s; cursor: pointer; }
.show-row:last-child { border-bottom: none; }
.show-row:hover { background: var(--surface2); }
.show-date-box { width: 42px; height: 42px; background: var(--surface3); border: 1px solid var(--border); border-radius: 7px; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.show-date-month { font-family: 'DM Mono', monospace; font-size: 7.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--text3); }
.show-date-day { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 17px; line-height: 1; color: var(--accent); }
.show-info { flex: 1; min-width: 0; }
.show-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.show-meta { font-size: 11px; color: var(--text3); margin-top: 1px; }
.crew-pill { font-family: 'DM Mono', monospace; font-size: 9.5px; padding: 2px 8px; border-radius: 20px; background: var(--surface3); border: 1px solid var(--border); color: var(--text3); white-space: nowrap; }
.crew-pill.ok   { background: rgba(61,232,138,.1);  border-color: rgba(61,232,138,.25);  color: var(--green); }
.crew-pill.warn { background: rgba(255,179,71,.1);  border-color: rgba(255,179,71,.25);  color: var(--orange); }
.inv-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; transition: background .1s; }
.inv-row:last-child { border-bottom: none; }
.inv-row:hover { background: var(--surface2); }
.inv-row__main { flex: 1; }
.inv-row__title { font-weight: 600; }
.inv-row__meta { font-size: 11px; color: var(--text3); }
.inv-row__amount { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--text2); }
.inv-row__amount.is-overdue { color: var(--red); }
.activity-scroll { max-height: 280px; overflow-y: auto; }
.activity-item { display: flex; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--border); font-size: 12px; align-items: flex-start; }
.activity-item:last-child { border-bottom: none; }
.activity-avatar { width: 24px; height: 24px; border-radius: 5px; background: var(--surface3); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.activity-text { flex: 1; color: var(--text2); line-height: 1.5; }
.activity-detail { color: var(--text3); }
.activity-time { font-family: 'DM Mono', monospace; font-size: 9.5px; color: var(--text3); white-space: nowrap; }
.chart-wrap { padding: 14px 16px; }
canvas#revenue-chart { width: 100%; height: 160px; }
.empty-dash { text-align: center; padding: 28px; color: var(--text3); font-size: 12px; }

/* ══════════════════════════════════════════════════════════════════════════
   INVENTORY
══════════════════════════════════════════════════════════════════════════ */
.inv-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 20px; }
.dept-section { margin-bottom: 16px; }
.dept-header { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius2) var(--radius2) 0 0; cursor: pointer; transition: background .12s; }
.dept-header:hover { background: var(--surface2); }
.dept-icon { font-size: 16px; }
.dept-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 14px; flex: 1; }
.dept-count { font-family: 'DM Mono', monospace; font-size: 9px; color: var(--text3); }
.dept-body { border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius2) var(--radius2); overflow: hidden; }
.cat-section { border-bottom: 1px solid var(--border); }
.cat-section:last-child { border-bottom: none; }
.cat-header { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 34px; background: var(--surface2); border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.cat-header:hover { background: var(--surface3); }
.cat-title { font-family: 'DM Mono', monospace; font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--text2); flex: 1; }
.cat-count { font-family: 'DM Mono', monospace; font-size: 9px; color: var(--text3); }
.item-row { display: grid; grid-template-columns: 2fr 80px 100px 100px 100px 90px; gap: 8px; align-items: center; padding: 8px 14px 8px 48px; border-bottom: 1px solid var(--border); font-size: 12px; transition: background .1s; }
.item-row:last-child { border-bottom: none; }
.item-row:hover { background: var(--surface2); }
.item-row-head { font-family: 'DM Mono', monospace; font-size: 8.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); background: var(--surface3); padding: 5px 14px 5px 48px; display: grid; grid-template-columns: 2fr 80px 100px 100px 100px 90px; gap: 8px; border-bottom: 1px solid var(--border); }
.case-row { display: grid; grid-template-columns: 2fr 80px 100px 100px 100px 90px; gap: 8px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--border); font-size: 12px; }
.dept-color-bar { width: 3px; height: 28px; border-radius: 2px; flex-shrink: 0; }
.inventory-filterbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.inventory-filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.inventory-search-form { margin-left: auto; display: flex; gap: 6px; }
.inventory-case-empty { padding: 11px 14px 11px 48px; font-size: 12px; color: var(--text3); }
.case-shell { border-bottom: 1px solid var(--border); }
.case-header { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; transition: background .1s; }
.case-header:hover { background: var(--surface2); }
.case-code { font-family: 'DM Mono', monospace; font-size: 9.5px; color: var(--accent); min-width: 70px; }
.case-name { font-weight: 600; font-size: 13px; flex: 1; }
.case-meta { font-size: 11px; color: var(--text3); }
.case-toolbar { display: flex; gap: 4px; }
.inventory-helper-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.inventory-helper-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 11px; color: var(--text3); background: var(--surface); }
.inventory-helper-chip--accent { color: var(--accent); border-color: rgba(232,255,71,.22); }
.inventory-management-card { margin-bottom: 14px; }
.inventory-uncased-list { padding: 4px 0; }
.inventory-uncased-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 16px; border-top: 1px solid var(--border); }
.inventory-uncased-row:first-child { border-top: none; }
.inventory-uncased-name { font-weight: 600; font-size: 13px; }
.inventory-uncased-meta { font-size: 11px; color: var(--text3); margin-top: 2px; }
.inventory-uncased-actions { display: flex; align-items: center; gap: 8px; }
.inventory-uncased-qty { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--text3); }
.case-primary { flex: 1; min-width: 0; }
.case-meta-stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.case-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 9.5px; color: var(--orange); background: rgba(255,179,71,.1); border: 1px solid rgba(255,179,71,.2); }
.case-metrics { display: flex; align-items: center; gap: 10px; }
.case-metric { font-family: 'DM Mono', monospace; font-size: 9.5px; color: var(--text3); white-space: nowrap; }
.case-arrow { color: var(--text3); font-size: 10px; }
.inventory-case-actions { padding: 7px 14px 7px 48px; }
.inventory-item-name { font-weight: 500; }
.inventory-item-sub { font-size: 10px; color: var(--text3); }
.inventory-dim { color: var(--text3); }
.field-note { font-size: 11px; color: var(--text3); margin-top: 5px; }

/* ══════════════════════════════════════════════════════════════════════════
   SHOWS
══════════════════════════════════════════════════════════════════════════ */
.shows-table tbody tr[data-href] { cursor: pointer; }
.shows-table tbody tr[data-href]:hover { background: var(--surface2); }
.shows-meta { font-size: 11px; color: var(--text3); }
.shows-status-badge { background: rgba(255,255,255,0.05); border: 1px solid currentColor; }
.shows-portal-meta { font-size: 10px; color: var(--text3); margin-top: 5px; }
.empty-state__cta { margin-top: 12px; }

/* ══════════════════════════════════════════════════════════════════════════
   UTILS
══════════════════════════════════════════════════════════════════════════ */
.mono { font-family: 'DM Mono', monospace; font-size: 11px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.empty-state { text-align: center; padding: 52px 20px; color: var(--text3); }
.empty-state .icon { font-size: 30px; margin-bottom: 12px; opacity: .5; }
.empty-state h3 { font-family: 'Syne', sans-serif; font-size: 15px; color: var(--text2); margin-bottom: 6px; }
.empty-state p { font-size: 12px; }
.search-input { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 11px; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 12px; width: 200px; outline: none; transition: border-color .14s; }
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text3); }
.segment { display: inline-flex; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; gap: 2px; }
.seg-btn { padding: 4px 11px; border-radius: 3px; font-size: 11px; font-weight: 500; cursor: pointer; border: none; background: none; color: var(--text3); transition: all .14s; font-family: 'DM Sans', sans-serif; white-space: nowrap; }
.seg-btn.active { background: var(--surface3); color: var(--text); border: 1px solid var(--border2); }
.alert { padding: 11px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; line-height: 1.5; }
.alert-error   { background: rgba(255,71,87,.08);  border: 1px solid rgba(255,71,87,.25);  color: var(--red); }
.alert-success { background: rgba(61,232,138,.08); border: 1px solid rgba(61,232,138,.25); color: var(--green); }
.text-muted { color: var(--text3); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
.flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .flex-1 { flex: 1; }
.text-right { text-align: right; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius3); padding: 40px 36px; width: 380px; max-width: 100%; box-shadow: 0 32px 80px rgba(0,0,0,.4); }
.login-logo { margin-bottom: 28px; }

#toast-container { position: fixed; bottom: 22px; right: 22px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius); padding: 11px 16px; font-size: 13px; display: flex; align-items: center; gap: 8px; box-shadow: 0 8px 32px rgba(0,0,0,.4); animation: slideRight .22s cubic-bezier(.16,1,.3,1); max-width: 340px; }
.toast-success { border-color: rgba(61,232,138,.3); }
.toast-error   { border-color: rgba(255,71,87,.3); }
@keyframes slideRight { from { transform: translateX(12px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .inv-stats  { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { width: 56px; min-width: 56px; }
  .logo-mark, .logo-sub, .nav-label, .nav-item > :not(.nav-icon), .user-info, .logout-btn, .plan-card-wrap { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .stats-grid, .crew-stats { grid-template-columns: 1fr 1fr; }
  .section-grid, .section-grid-3 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 600px) {
  .stats-grid, .dash-grid, .crew-stats { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════════
   BUILDER
══════════════════════════════════════════════════════════════════════════ */
.builder-shell { display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:20px; align-items:start; }
.builder-sidebar { position:sticky; top:20px; }
.builder-stack { display:grid; gap:20px; }
.builder-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius2); overflow:hidden; }
.builder-card__head { display:flex; align-items:center; gap:8px; justify-content:space-between; padding:14px 18px; border-bottom:1px solid var(--border); }
.builder-card__title { font-family:'Syne',sans-serif; font-size:14px; font-weight:600; }
.builder-card__body { padding:18px; }
.builder-actions,.builder-inline-actions { display:flex; gap:8px; flex-wrap:wrap; }
.builder-sections { display:grid; gap:12px; }
.section-block { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius2); overflow:hidden; }
.section-block.is-collapsed .section-block__body,.section-block.is-collapsed .section-block__footer { display:none; }
.section-block__head { display:flex; align-items:center; gap:12px; justify-content:space-between; padding:14px 18px; border-bottom:1px solid var(--border); background:linear-gradient(180deg,rgba(255,255,255,.02),transparent); }
.section-block__head-main { display:flex; align-items:center; gap:12px; min-width:0; }
.section-toggle { width:28px; height:28px; border:1px solid var(--border2); background:var(--surface2); color:var(--text2); border-radius:999px; cursor:pointer; transition:transform .15s,color .15s,border-color .15s; display:flex; align-items:center; justify-content:center; }
.section-block.is-collapsed .section-toggle { transform:rotate(-90deg); }
.section-block__title { font-family:'Syne',sans-serif; font-size:13px; font-weight:600; }
.section-block__meta { font-family:'DM Mono',monospace; font-size:10px; color:var(--text3); letter-spacing:.08em; text-transform:uppercase; }
.section-block__body { padding:8px 10px 10px; }
.section-block__footer { padding:0; }
.quote-lines { display:grid; gap:3px; }
.quote-line { border:1px solid var(--border); border-radius:6px; background:var(--surface2); display:block; }
.quote-line__head { display:none; }
.quote-line__eyebrow { display:none; }
.quote-line__tools { display:flex; gap:2px; align-items:center; }
.quote-line__grid { display:grid; grid-template-columns:14px minmax(0,1fr) 52px 52px 82px 70px 22px 22px; gap:4px; align-items:center; padding:4px 6px; }
.quote-line__grid.quote-line__grid--custom { grid-template-columns:14px minmax(0,1fr) 52px 52px 82px 70px 22px 22px; }
.quote-line__field { display:contents; }
.quote-line__field label { display:none; }
.quote-line input,.quote-line select { width:100%; background:var(--bg); color:var(--text); border:1px solid var(--border2); border-radius:5px; height:28px; padding:0 7px; font:inherit; font-size:12px; }
.builder-card input,.builder-card select,.builder-card textarea { width:100%; background:var(--bg); color:var(--text); border:1px solid var(--border2); border-radius:8px; min-height:36px; padding:7px 10px; font:inherit; }
.quote-line textarea,.builder-card textarea { min-height:110px; resize:vertical; }
.quote-line__amount { min-width:72px; text-align:right; font-family:'DM Mono',monospace; font-size:12px; color:var(--accent); font-weight:600; padding-right:4px; }
.pill { display:inline-flex; align-items:center; gap:4px; padding:4px 8px; border-radius:999px; font-family:'DM Mono',monospace; font-size:10px; line-height:1; border:1px solid var(--border2); color:var(--text2); background:var(--surface3); }
.pill--ok  { color:var(--green);  border-color:rgba(71,255,160,.25); background:rgba(71,255,160,.08); }
.pill--warn{ color:var(--orange); border-color:rgba(255,179,71,.25);  background:rgba(255,179,71,.08); }
.pill--bad { color:var(--red);    border-color:rgba(255,71,87,.25);   background:rgba(255,71,87,.08); }
.pill--accent{ color:var(--accent); border-color:rgba(232,255,71,.2); background:rgba(232,255,71,.08); }
.section-subtotal { padding:8px 14px; display:flex; justify-content:space-between; gap:12px; color:var(--text3); font-size:11px; background:var(--surface3); border-top:1px solid var(--border); }
.section-subtotal strong { color:var(--accent); font-family:'DM Mono',monospace; font-size:12px; }
.builder-meta { display:grid; gap:12px; }
.builder-meta-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.builder-empty { border:1px dashed var(--border2); border-radius:10px; padding:18px; color:var(--text3); text-align:center; font-size:12px; }
.builder-submit { display:grid; gap:8px; }
.builder-picker-list { max-height:420px; overflow-y:auto; }
.builder-picker-item { display:flex; align-items:center; gap:12px; padding:10px 8px; border-bottom:1px solid var(--border); cursor:pointer; transition:background .12s; }
.builder-picker-item:hover { background:var(--surface2); }
.builder-picker-item__meta { flex:1; min-width:0; }
.builder-picker-item__name { font-size:13px; font-weight:500; }
.builder-picker-item__sub { font-size:11px; color:var(--text3); }
.builder-picker-item__price { text-align:right; font-family:'DM Mono',monospace; font-size:12px; color:var(--accent); white-space:nowrap; }
.builder-picker-divider { font-family:'DM Mono',monospace; font-size:10px; color:var(--text3); text-transform:uppercase; letter-spacing:.1em; padding:12px 4px 8px; }
@media (max-width:1200px) { .builder-shell { grid-template-columns:1fr; } .builder-sidebar { position:static; } }
@media (max-width:820px) { .builder-meta-grid,.quote-line__grid,.quote-line__grid.quote-line__grid--custom { grid-template-columns:1fr 1fr; } .quote-line__amount { text-align:left; } }
@media (max-width:560px) { .quote-line__grid,.quote-line__grid.quote-line__grid--custom,.builder-meta-grid { grid-template-columns:1fr; } }

/* ══════════════════════════════════════════════════════════════════════════
   CALENDAR
══════════════════════════════════════════════════════════════════════════ */
.calendar-view { display:none; }
.calendar-view.is-active { display:block; }
.calendar-legend-bar { display:flex; gap:24px; flex-wrap:wrap; margin-bottom:20px; align-items:center; }
.calendar-legend-group { display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.calendar-legend-label,.gantt-col-label { font-family:'DM Mono',monospace; font-size:9px; color:var(--text3); text-transform:uppercase; letter-spacing:.1em; }
.gantt-wrap { overflow-x:auto; padding-bottom:20px; }
.gantt { min-width:900px; }
.gantt-header-row { display:flex; }
.gantt-show-col-head { width:260px; min-width:260px; padding:8px 16px; border-bottom:1px solid var(--border); border-right:1px solid var(--border); }
.gantt-row { display:flex; align-items:center; border-bottom:1px solid var(--border); min-height:48px; position:relative; }
.gantt-row:hover { background:var(--surface2); }
.gantt-label { width:260px; min-width:260px; padding:8px 16px; flex-shrink:0; }
.gantt-show-name { font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gantt-show-meta { font-size:10px; color:var(--text3); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gantt-timeline { flex:1; position:relative; height:48px; }
.gantt-bar { position:absolute; top:8px; height:32px; border-radius:6px; display:flex; align-items:center; padding:0 10px; font-size:11px; font-weight:600; white-space:nowrap; overflow:hidden; transition:filter .15s; border-width:1px; border-style:solid; min-width:4px; cursor:pointer; }
.gantt-bar:hover { filter:brightness(1.2); }
.gantt-bar-label { overflow:hidden; text-overflow:ellipsis; }
.gantt-dates { display:grid; grid-template-columns:repeat(56,minmax(34px,1fr)); flex:1; }
.gantt-date-cell { font-family:'DM Mono',monospace; font-size:9px; color:var(--text3); text-align:center; padding:8px 0; border-bottom:1px solid var(--border); border-right:1px solid var(--border); }
.gantt-date-cell.today { background:rgba(232,255,71,.06); color:var(--accent); }
.gantt-date-cell.weekend { background:rgba(255,255,255,.01); }
.gantt-today-line { position:absolute; top:0; bottom:0; width:2px; background:var(--accent); opacity:.6; pointer-events:none; z-index:2; }
.gantt-empty { text-align:center; padding:40px; color:var(--text3); font-size:13px; }
.calendar-empty-link { color:var(--accent); }
.calendar-nav { display:flex; align-items:center; gap:16px; margin-bottom:20px; }
.calendar-nav--footer { margin-top:16px; justify-content:center; }
.calendar-nav__today { margin-left:auto; }
.cal-month { font-family:'Syne',sans-serif; font-weight:700; font-size:20px; }
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:1px; background:var(--border); border:1px solid var(--border); border-radius:var(--radius2); overflow:hidden; }
.cal-day-head { background:var(--surface2); padding:8px; text-align:center; font-family:'DM Mono',monospace; font-size:9px; text-transform:uppercase; letter-spacing:.1em; color:var(--text3); }
.cal-day { background:var(--surface); min-height:100px; padding:6px; position:relative; }
.cal-day.other-month { background:var(--surface2); opacity:.5; }
.cal-day.today { background:rgba(232,255,71,.03); }
.cal-day-num { font-family:'DM Mono',monospace; font-size:11px; color:var(--text3); margin-bottom:4px; }
.cal-day.today .cal-day-num { color:var(--accent); font-weight:700; }
.cal-event { display:block; padding:3px 6px; border-radius:4px; font-size:10px; font-weight:600; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; border-left:3px solid; transition:opacity .15s; cursor:pointer; }
.cal-event:hover { opacity:.8; }
.cal-event.continues-left { border-radius:0 4px 4px 0; margin-left:-6px; padding-left:4px; }
.cal-event.continues-right { border-radius:4px 0 0 4px; margin-right:-6px; padding-right:4px; }
.legend-item { display:flex; align-items:center; gap:6px; font-size:11px; color:var(--text2); }
.legend-dot { width:10px; height:10px; border-radius:3px; flex-shrink:0; }
@media (max-width:900px) { .calendar-nav { flex-wrap:wrap; } .calendar-nav__today { margin-left:0; } }

/* ══════════════════════════════════════════════════════════════════════════
   CLIENTS
══════════════════════════════════════════════════════════════════════════ */
.clients-toolbar { display:flex; align-items:end; justify-content:space-between; gap:14px; margin-bottom:18px; flex-wrap:wrap; }
.clients-toolbar__title { font-family:'Syne',sans-serif; font-size:18px; font-weight:700; }
.clients-toolbar__meta { color:var(--text3); font-size:12px; margin-top:4px; }
.clients-toolbar__search { width:min(360px,100%); }
.clients-search { width:100%; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:10px 12px; color:var(--text); outline:none; }
.clients-search:focus { border-color:var(--accent); }
.client-stat { display:flex; justify-content:space-between; align-items:center; padding:9px 10px; border-radius:var(--radius); background:var(--surface2); border:1px solid var(--border); font-size:12px; color:var(--text2); }
.client-stat span { color:var(--text); font-weight:600; }
.client-actions { display:flex; gap:6px; margin-top:14px; }
.client-delete-form { display:inline-flex; }
.empty-state--wide { grid-column:1 / -1; }
.clients-empty-filtered { margin-top:18px; text-align:center; color:var(--text3); font-size:12px; }

/* ══════════════════════════════════════════════════════════════════════════
   CREW ACCOUNTS (admin)
══════════════════════════════════════════════════════════════════════════ */
.crew-access-stats { margin-bottom:18px; }
.crew-access-head { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.panel-subtitle { font-size:11px; color:var(--text3); margin-top:4px; }
.panel-body--flush { padding:0; }
.panel-body--scroll { overflow:auto; }
.action-cluster { display:flex; gap:8px; }
.action-cluster--wrap { flex-wrap:wrap; }
.inline-form { display:inline; }
.status-pill { display:inline-flex; align-items:center; padding:4px 10px; border-radius:999px; font-size:11px; font-weight:600; }
.status-pill.is-active   { background:rgba(71,255,160,.12); color:var(--green); border:1px solid rgba(71,255,160,.25); }
.status-pill.is-disabled { background:rgba(255,120,120,.12); color:var(--red);   border:1px solid rgba(255,120,120,.25); }
.status-pill.is-idle     { background:var(--surface3);       color:var(--text3); border:1px solid var(--border); }
@media (max-width:900px) { .crew-access-head { flex-direction:column; align-items:stretch; } }

/* ══════════════════════════════════════════════════════════════════════════
   CREW AUTH (login/set-password pages — standalone, no app shell)
══════════════════════════════════════════════════════════════════════════ */
body.crew-auth-page { background:linear-gradient(180deg,#080809 0%,#0d0e13 100%); min-height:100vh; }
.crew-auth-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px; }
.crew-auth-card { width:100%; max-width:440px; background:rgba(17,18,23,.94); border:1px solid rgba(38,41,54,.8); border-radius:24px; padding:28px; box-shadow:0 30px 80px rgba(0,0,0,.45); }
.crew-auth-eyebrow { font-family:'DM Mono',monospace; font-size:11px; letter-spacing:.18em; text-transform:uppercase; color:var(--accent); margin-bottom:12px; }
.crew-auth-title { margin:0 0 8px; font-size:34px; line-height:1; }
.crew-auth-subtitle { color:#98a0b3; font-size:15px; line-height:1.6; margin-bottom:22px; }
.crew-auth-alert { padding:12px 14px; border-radius:14px; margin-bottom:16px; font-size:14px; }
.crew-auth-alert--error   { background:rgba(255,107,107,.08); border:1px solid rgba(255,107,107,.25); color:#ffb3b3; }
.crew-auth-alert--success { background:rgba(71,255,160,.08);  border:1px solid rgba(71,255,160,.22);  color:#9be3b2; }
.crew-auth-form { display:grid; gap:14px; }
.crew-auth-field label { display:block; font-size:12px; color:#98a0b3; margin-bottom:8px; letter-spacing:.04em; text-transform:uppercase; }
.crew-auth-field input { width:100%; padding:14px 15px; border-radius:14px; border:1px solid rgba(38,41,54,.8); background:#171921; color:#f5f7fb; font-size:16px; outline:none; }
.crew-auth-field input:focus { border-color:var(--accent); }
.crew-auth-button { width:100%; padding:14px 16px; border:none; border-radius:16px; background:var(--accent); color:#000; font-weight:700; font-size:15px; cursor:pointer; }
.crew-auth-links { display:flex; justify-content:space-between; gap:14px; margin-top:16px; font-size:14px; color:#98a0b3; }
.crew-auth-links--single { justify-content:flex-start; }
.crew-auth-note { margin-top:22px; padding-top:18px; border-top:1px solid rgba(38,41,54,.8); font-size:13px; color:#98a0b3; line-height:1.6; }
.crew-auth-note--compact { margin-top:0; margin-bottom:18px; padding-top:0; border-top:0; }

/* ══════════════════════════════════════════════════════════════════════════
   CREW CONSOLE (crew dashboard — standalone)
══════════════════════════════════════════════════════════════════════════ */
.crew-shell { max-width:1200px; margin:0 auto; padding:calc(env(safe-area-inset-top) + 18px) 18px calc(env(safe-area-inset-bottom) + 28px); }
.crew-header { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; margin-bottom:20px; }
.crew-eyebrow { font-family:'DM Mono',monospace; font-size:11px; letter-spacing:.16em; text-transform:uppercase; color:var(--accent); margin-bottom:8px; }
.crew-title { font-family:'Syne',sans-serif; font-size:38px; line-height:1.02; margin:0; }
.crew-subtitle { margin-top:8px; color:#97a0b3; max-width:620px; }
.crew-header-actions { display:flex; gap:10px; flex-wrap:wrap; }
.hero-panel,.section-card { background:rgba(18,21,32,.86); border:1px solid rgba(255,255,255,.08); border-radius:24px; backdrop-filter:blur(18px); }
.hero-panel { padding:22px; margin-bottom:18px; display:grid; grid-template-columns:1.4fr 1fr; gap:20px; align-items:end; }
.hero-kicker { font-family:'DM Mono',monospace; font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:var(--accent); margin-bottom:10px; }
.hero-copy p { margin:0; color:#97a0b3; font-size:15px; line-height:1.6; }
.stat-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
.stat-card { background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.08); border-radius:18px; padding:14px; }
.stat-card span { display:block; font-family:'DM Mono',monospace; font-size:10px; letter-spacing:.12em; text-transform:uppercase; color:#97a0b3; margin-bottom:10px; }
.stat-card strong { font-family:'Syne',sans-serif; font-size:32px; line-height:1; }
.stat-card--pending strong { color:#ffd166; }
.stat-card--alert   strong { color:#ff6b6b; }
.section-card { padding:18px; margin-bottom:18px; }
.section-card--warning { border-color:rgba(255,107,107,.28); background:rgba(51,19,24,.55); }
.section-head { display:flex; justify-content:space-between; gap:14px; align-items:flex-end; margin-bottom:16px; }
.section-head h2 { font-family:'Syne',sans-serif; font-size:22px; margin:0; }
.section-meta { font-size:12px; color:#97a0b3; }
.crew-grid { display:grid; grid-template-columns:1.3fr .9fr; gap:18px; }
.call-stack,.mini-stack,.table-list,.conflict-stack { display:grid; gap:12px; }
.call-card,.mini-row,.table-row,.conflict-row { background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.08); border-radius:20px; }
.call-card { padding:16px; }
.call-card h3 { font-size:24px; line-height:1.08; margin:10px 0 6px; font-family:'Syne',sans-serif; }
.call-role { font-size:14px; font-weight:700; margin-bottom:6px; }
.call-meta,.call-venue,.conflict-meta,.mini-row__meta,.table-row__meta { color:#97a0b3; font-size:13px; line-height:1.5; }
.call-topline { display:flex; justify-content:space-between; gap:10px; align-items:center; }
.tenant-pill { display:inline-flex; align-items:center; padding:6px 10px; border-radius:999px; font-family:'DM Mono',monospace; font-size:10px; letter-spacing:.08em; text-transform:uppercase; background:rgba(255,255,255,.06); color:#f5f7fb; }
.call-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:14px; }
.mini-row,.table-row { display:flex; justify-content:space-between; gap:14px; align-items:center; padding:14px; transition:transform .12s,border-color .12s; }
.mini-row:hover,.table-row:hover,.call-card:hover { border-color:rgba(232,255,71,.28); transform:translateY(-1px); }
.mini-row__date { font-family:'DM Mono',monospace; font-size:11px; color:var(--accent); min-width:80px; }
.mini-row__title,.table-row__title,.conflict-title { font-weight:700; font-size:15px; }
.table-row__main { flex:1; min-width:0; }
.conflict-row { display:grid; grid-template-columns:1fr 40px 1fr; gap:12px; padding:14px; }
.conflict-company { font-family:'DM Mono',monospace; font-size:10px; letter-spacing:.08em; text-transform:uppercase; color:var(--accent); margin-bottom:6px; }
.conflict-divider { display:flex; align-items:center; justify-content:center; color:var(--red); font-size:20px; }
@media (max-width:960px) { .hero-panel,.crew-grid { grid-template-columns:1fr; } .crew-header { flex-direction:column; } .stat-grid { grid-template-columns:repeat(4,1fr); } }
@media (max-width:720px) { .crew-title { font-size:30px; } .stat-grid { grid-template-columns:repeat(2,1fr); } .mini-row,.table-row,.conflict-row { grid-template-columns:1fr; display:grid; } .conflict-divider { display:none; } }

/* ══════════════════════════════════════════════════════════════════════════
   CREW PORTAL (magic link — standalone)
══════════════════════════════════════════════════════════════════════════ */
.portal-shell { max-width:980px; margin:0 auto; padding:calc(env(safe-area-inset-top) + 18px) 18px calc(env(safe-area-inset-bottom) + 28px); }
.portal-shell--expired { min-height:100vh; display:grid; place-items:center; }
.expired-card { background:#141821; border:1px solid rgba(255,255,255,.08); border-radius:28px; padding:36px; text-align:center; max-width:420px; }
.expired-icon { font-size:42px; margin-bottom:8px; }
.portal-hero { background:linear-gradient(135deg,rgba(232,255,71,.14),rgba(20,24,33,.96) 46%); border:1px solid rgba(255,255,255,.08); border-radius:28px; padding:22px; margin-bottom:18px; }
.portal-brand { font-family:'DM Mono',monospace; font-size:11px; letter-spacing:.18em; text-transform:uppercase; color:var(--accent); }
.portal-hero__meta { font-size:12px; color:#9ca6ba; margin-top:6px; }
.portal-hero__content { display:flex; justify-content:space-between; gap:16px; align-items:flex-end; margin-top:18px; }
.portal-kicker { font-family:'DM Mono',monospace; font-size:10px; letter-spacing:.14em; text-transform:uppercase; color:#9ca6ba; margin-bottom:10px; }
.portal-hero h1 { font-family:'Syne',sans-serif; font-size:36px; line-height:1.04; margin:0 0 6px; }
.portal-hero p { margin:0; color:#9ca6ba; }
.portal-alert { padding:14px 16px; border-radius:18px; margin-bottom:16px; border:1px solid rgba(255,255,255,.08); }
.portal-alert.is-success { background:rgba(71,255,160,.12); color:#47ffa0; border-color:rgba(71,255,160,.28); }
.portal-alert.is-danger  { background:rgba(255,107,107,.12); color:#ff6b6b; border-color:rgba(255,107,107,.28); }
.portal-grid { display:grid; grid-template-columns:1.1fr .9fr; gap:18px; margin-bottom:18px; }
.portal-card { background:rgba(20,24,33,.92); border:1px solid rgba(255,255,255,.08); border-radius:24px; padding:18px; margin-bottom:18px; }
.portal-card--warning { border-color:rgba(255,209,102,.28); background:rgba(44,34,15,.55); }
.portal-card__head { display:flex; justify-content:space-between; gap:12px; align-items:flex-end; margin-bottom:16px; }
.portal-card__head h2 { font-family:'Syne',sans-serif; font-size:24px; margin:0; }
.portal-card__head span { font-size:12px; color:#9ca6ba; }
.call-block { display:grid; gap:14px; }
.call-time { font-family:'Syne',sans-serif; font-size:54px; line-height:.95; color:var(--accent); }
.call-notes { display:grid; gap:10px; color:#9ca6ba; line-height:1.6; }
.response-stack,.message-form { display:grid; gap:10px; }
.btn-state { cursor:default; background:#1b2130; border:1px solid rgba(255,255,255,.08); }
.btn-state.is-confirmed { background:rgba(71,255,160,.12); color:#47ffa0; border-color:rgba(71,255,160,.28); }
.btn-state.is-declined  { background:rgba(255,107,107,.12); color:#ff6b6b; border-color:rgba(255,107,107,.28); }
.btn-inline { display:inline-flex; width:auto; }
.detail-stack,.schedule-stack { display:grid; gap:12px; color:#9ca6ba; line-height:1.6; }
.conflict-list,.contact-grid { display:grid; gap:12px; }
.conflict-item,.message-bubble,.contact-card { background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.08); border-radius:18px; padding:14px; }
.conflict-item__title,.contact-name { font-weight:700; color:#f5f7fb; }
.conflict-item__meta,.contact-link,.contact-role { font-size:13px; color:#9ca6ba; }
.schedule-day { padding:14px; border-radius:18px; background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.08); }
.schedule-day__date { font-weight:700; margin-bottom:12px; }
.schedule-lines { display:grid; gap:10px; }
.schedule-lines--grid { grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); }
.schedule-line { display:flex; justify-content:space-between; gap:12px; padding-bottom:10px; border-bottom:1px solid rgba(255,255,255,.05); }
.schedule-line:last-child { border-bottom:none; padding-bottom:0; }
.schedule-line span { color:#9ca6ba; font-size:13px; }
.schedule-note { margin-top:10px; color:#9ca6ba; font-size:13px; }
.contact-grid { grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); }
.contact-role { font-family:'DM Mono',monospace; letter-spacing:.08em; text-transform:uppercase; }
.message-bubble { color:#9ca6ba; line-height:1.6; margin-bottom:12px; }
.message-bubble strong { display:block; color:#f5f7fb; margin-bottom:4px; }
.message-bubble.is-reply { background:rgba(71,180,255,.1); }
.message-box { width:100%; min-height:110px; padding:14px; border-radius:18px; border:1px solid rgba(255,255,255,.08); background:#1b2130; color:#f5f7fb; font:inherit; resize:vertical; }
@media (max-width:840px) { .portal-grid { grid-template-columns:1fr; } .portal-hero__content { flex-direction:column; align-items:flex-start; } .call-time { font-size:44px; } }

/* ══════════════════════════════════════════════════════════════════════════
   DOC LINKS
══════════════════════════════════════════════════════════════════════════ */
.doc-pill { display:inline-flex; align-items:center; padding:4px 8px; border-radius:999px; border:1px solid var(--border); font-size:10px; font-family:'DM Mono',monospace; text-transform:uppercase; letter-spacing:.08em; }
.doc-pill--none    { color:var(--text3); }
.doc-pill--live    { background:rgba(232,255,71,.08);  border-color:rgba(232,255,71,.25);  color:var(--accent); }
.doc-pill--viewed  { background:rgba(71,197,255,.12);  border-color:rgba(71,197,255,.24);  color:#7dd3fc; }
.doc-pill--approved{ background:rgba(71,255,160,.1);   border-color:rgba(71,255,160,.25);  color:var(--green); }
.doc-pill--expired,.doc-pill--revoked { background:rgba(255,71,87,.08); border-color:rgba(255,71,87,.25); color:var(--red); }
.doc-meta { margin-top:4px; font-size:11px; color:var(--text3); }
.link-row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.link-input { flex:1; min-width:260px; background:var(--surface2); border:1px solid var(--border); border-radius:8px; padding:10px 12px; color:var(--text); outline:none; }
.link-actions { margin-top:12px; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }

/* ══════════════════════════════════════════════════════════════════════════
   INVOICE VIEW
══════════════════════════════════════════════════════════════════════════ */
.invoice-print-shell { max-width:980px; margin:0 auto; }
.invoice-sheet { max-width:780px; margin:0 auto; background:#fff; color:#111; border-radius:12px; padding:36px; box-shadow:0 20px 60px rgba(0,0,0,.18); }
.invoice-sheet__header { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin-bottom:40px; }
.invoice-brand { font-family:'Syne',sans-serif; font-weight:800; font-size:24px; letter-spacing:.06em; }
.invoice-brand-sub,.invoice-kicker { font-size:10px; color:#888; letter-spacing:.12em; text-transform:uppercase; }
.invoice-brand-sub { margin-top:2px; }
.invoice-head-meta { text-align:right; }
.invoice-number { font-family:'Syne',sans-serif; font-weight:700; font-size:26px; }
.invoice-status { display:inline-block; padding:4px 12px; border-radius:999px; font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; margin-top:6px; }
.invoice-status.is-paid    { background:#dcfce7; color:#166534; }
.invoice-status.is-overdue { background:#fee2e2; color:#991b1b; }
.invoice-status.is-open    { background:#fef9c3; color:#713f12; }
.invoice-meta-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:24px; padding:20px; background:#f8f8f8; border-radius:8px; margin-bottom:32px; }
.invoice-strong { font-weight:600; font-size:14px; }
.invoice-muted  { font-size:12px; color:#555; margin-top:2px; }
.invoice-meta-row { display:flex; justify-content:space-between; gap:12px; font-size:12px; color:#555; margin-top:4px; }
.invoice-section { margin-bottom:28px; }
.invoice-table { width:100%; border-collapse:collapse; }
.invoice-table thead tr { border-bottom:2px solid #000; }
.invoice-table th { text-align:left; padding:7px 0; font-size:10px; text-transform:uppercase; letter-spacing:.08em; color:#888; }
.invoice-table td { padding:9px 0; font-size:13px; border-bottom:1px solid #eee; }
.invoice-table th.text-center,.invoice-table td.text-center { text-align:center; }
.invoice-table th.text-right,.invoice-table td.text-right { text-align:right; }
.invoice-table__amount { font-weight:600; }
.invoice-note-box { padding:12px 16px; background:#f8f8f8; border-radius:6px; font-size:12px; color:#555; margin-bottom:24px; }
.invoice-note-label { font-weight:600; color:#333; }
.invoice-totals-wrap { display:flex; justify-content:flex-end; }
.invoice-totals { min-width:280px; }
.invoice-total-row { display:flex; justify-content:space-between; gap:16px; padding:5px 0; font-size:13px; color:#555; }
.invoice-total-row--rule { border-top:1px solid #e5e5e5; margin-top:4px; }
.invoice-total-row--grand { padding:14px 0 6px; font-family:'Syne',sans-serif; font-weight:700; font-size:22px; border-top:2px solid #000; margin-top:8px; color:#111; }
.invoice-link { color:var(--accent); }
.invoice-due-overdue { color:var(--red); }
@media print { body { background:#fff; } .sidebar,.topbar,.topbar-actions,.alert { display:none !important; } .content,.invoice-print-shell,.invoice-sheet { margin:0; max-width:none; box-shadow:none; padding:0; } }
@media (max-width:900px) { .invoice-sheet { padding:24px; } .invoice-meta-grid { grid-template-columns:1fr; } .invoice-sheet__header { flex-direction:column; } .invoice-head-meta { text-align:left; } }

/* ══════════════════════════════════════════════════════════════════════════
   LOGIN
══════════════════════════════════════════════════════════════════════════ */
body.login-page { display:flex; align-items:center; justify-content:center; min-height:100vh; padding:24px; }
.login-company { margin-top:4px; }
.login-submit { width:100%; justify-content:center; }
.login-note { text-align:center; font-size:12px; color:var(--text3); margin-top:16px; }
.login-note__link { color:var(--accent); }

/* ══════════════════════════════════════════════════════════════════════════
   QUOTES & INVOICES LIST
══════════════════════════════════════════════════════════════════════════ */
.is-disabled { opacity:.6; cursor:not-allowed; }
.quotes-table-wrap .table-header { gap:14px; }
.table-subtitle { font-size:11px; color:var(--text3); margin-top:4px; }
.empty-state-cta { margin-top:12px; }
.empty-state-note { margin-top:12px; color:var(--text2); }

/* ══════════════════════════════════════════════════════════════════════════
   SETTINGS
══════════════════════════════════════════════════════════════════════════ */
.settings-page { padding-bottom:40px; }
.settings-grid { display:grid; grid-template-columns:minmax(0,520px) 320px; gap:20px; align-items:start; }
.readonly-input { opacity:.55; }
.settings-inline-link { color:var(--accent); }
.settings-note-card { background:linear-gradient(180deg,rgba(71,180,255,.08),rgba(71,180,255,.03)); }
.settings-note-stack { display:grid; gap:14px; }
.settings-note-block { padding-bottom:12px; border-bottom:1px solid var(--border); }
.settings-note-block:last-child { padding-bottom:0; border-bottom:0; }
.settings-note-label { font-family:'DM Mono',monospace; font-size:10px; text-transform:uppercase; letter-spacing:.1em; color:var(--blue); margin-bottom:6px; }
.settings-note-block p { color:var(--text2); font-size:12px; line-height:1.55; }
@media (max-width:980px) { .settings-grid { grid-template-columns:1fr; } }

/* ── MISSING PATCHES ────────────────────────────────────────────────────── */
/* quote-line__status */
.quote-line__status { display:none; }

/* crew console / portal pending state */
.status-pill.is-pending { background:rgba(255,209,102,.12); color:#ffd166; border:1px solid rgba(255,209,102,.3); }

/* crew portal primary card */
.portal-card--primary { background:rgba(20,24,33,.98); }

/* settings main card constraint */
.settings-main-card { max-width:100%; }

/* ── BUILDER DRAG & DROP ─────────────────────────────────────────────────── */
.quote-line__drag {
  cursor: grab;
  color: var(--text3);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
}
.quote-line__drag:active { cursor: grabbing; }
.quote-line.is-dragging {
  opacity: .4;
  outline: 1px dashed var(--accent);
  border-radius: 6px;
}
.quote-line.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.quote-line__tool-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  font-size: 13px;
  padding: 2px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .12s;
  width: 22px;
  height: 22px;
}
.quote-line__tool-btn:hover { color: var(--text); background: var(--surface3); }
.quote-line__tool-btn--remove:hover { color: var(--red); }
.quote-line__tools { display:flex; gap:2px; align-items:center; }

.quote-line select[name='line_section[]'] { display:none; }

/* ── QUOTE LINE HEADER ROW ──────────────────────────────────────────────── */
.quote-line-header {
  display: grid;
  grid-template-columns: 14px minmax(0,1fr) 52px 52px 82px 70px 22px 22px;
  gap: 4px;
  padding: 3px 6px 5px;
  font-family: 'DM Mono', monospace;
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
}
