:root {
  --bg: #111111;
  --bg-2: #1A1A1A;
  --surface: #2A2A2A;
  --orange: #E8621A;
  --orange-hover: #d45515;
  --teal: #178C8C;
  --teal-deep: #126b6b;
  --fg: #F5F5F0;
  --fg-muted: #888888;
  --fg-dim: #555555;
  --border: #2A2A2A;
  --border-strong: #3a3a3a;
  --lapsed: #b94545;
  --shadow-cta: 0 4px 20px rgba(232, 98, 26, 0.35);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); min-height: 100vh; }
body {
  color: var(--fg);
  font-family: 'Barlow Semi Condensed', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--orange); color: var(--fg); }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font-family: inherit; color: inherit; background: none; border: 0; outline: none; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }

.proto-strip {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(17,17,17,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 0;
  padding: 0 24px;
  height: 44px;
}
.proto-strip .brand {
  font-size: 10px; letter-spacing: 3px; font-weight: 700;
  color: var(--fg-dim); text-transform: uppercase;
  padding-right: 24px;
  border-right: 1px solid var(--border-strong);
  margin-right: 8px;
}
.proto-strip .brand b { color: var(--fg-muted); font-weight: 700; }
.proto-link {
  font-size: 11px; letter-spacing: 2px; font-weight: 600;
  color: var(--fg-muted); text-transform: uppercase;
  padding: 0 16px; height: 44px;
  display: inline-flex; align-items: center;
  transition: color 0.2s ease;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.proto-link:hover { color: var(--fg); }
.proto-link.active { color: var(--orange); border-bottom-color: var(--orange); }
.proto-strip .right {
  margin-left: auto;
  font-size: 10px; letter-spacing: 2px;
  color: var(--fg-dim); text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.proto-strip .right .dot-orange { width: 6px; height: 6px; background: var(--orange); display: inline-block; }

main#screens { min-height: calc(100vh - 44px); }
.screen { display: none; }
.screen.active { display: block; }

.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; }
.eyebrow--orange { color: var(--orange); }
.eyebrow--teal { color: var(--teal); }
.eyebrow--muted { color: var(--fg-muted); }

.portal { max-width: 760px; margin: 0 auto; padding: 80px 32px 120px; }
h1.display {
  font-size: clamp(40px, 5.5vw, 64px);
  font-weight: 800; line-height: 1.05;
  letter-spacing: -0.5px; margin-top: 16px;
}
h1.display .light { color: var(--fg-muted); font-weight: 400; }
.lede { font-size: 19px; color: var(--fg-muted); margin-top: 20px; max-width: 56ch; line-height: 1.55; }
.divider { height: 1px; background: var(--border-strong); margin: 56px 0; }

.portal .tier-list { display: flex; flex-direction: column; }
.tier-row {
  display: grid; grid-template-columns: 1fr auto auto;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  gap: 24px;
  position: relative;
  transition: opacity 0.2s ease;
}
.tier-row:last-child { border-bottom: none; }
.tier-row.muted { opacity: 0.4; }
.tier-row.selected { opacity: 1; }
.tier-row.selected .tier-label,
.tier-row.selected .tier-price { color: var(--orange); }
.tier-row .marker {
  position: absolute; left: -20px; top: 50%;
  width: 8px; height: 8px; background: var(--orange);
  transform: translateY(-50%);
  opacity: 0;
}
.tier-row.selected .marker { opacity: 1; }
.tier-label { font-size: 22px; font-weight: 700; }
.tier-trucks { font-size: 14px; color: var(--fg-muted); letter-spacing: 1px; text-transform: uppercase; font-weight: 500; }
.tier-price { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tier-price .unit { font-size: 13px; color: var(--fg-muted); font-weight: 500; letter-spacing: 1px; text-transform: uppercase; margin-left: 4px; }
.tier-row.unavailable .tier-price { font-size: 14px; color: var(--fg-muted); font-weight: 500; letter-spacing: 1px; text-transform: uppercase; }

.includes-line {
  margin-top: 28px;
  font-size: 15px; color: var(--fg-muted);
  display: flex; align-items: flex-start; gap: 10px;
}
.includes-line .sq { width: 8px; height: 8px; background: var(--orange); margin-top: 7px; flex: none; }

.btn {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: inherit; font-size: 14px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 18px 28px;
  background: var(--orange); color: #111;
  border: 0; transition: all 0.25s ease; cursor: pointer;
}
.btn:hover { background: var(--orange-hover); transform: translateY(-2px); box-shadow: var(--shadow-cta); }
.btn .arr { font-weight: 800; }
.btn.btn-lg { padding: 22px 36px; font-size: 15px; }
.btn.btn-ghost { background: transparent; color: var(--fg); border: 1px solid var(--border-strong); }
.btn.btn-ghost:hover { background: var(--surface); transform: translateY(-2px); box-shadow: none; }
.btn.btn-dark { background: var(--bg-2); color: var(--fg); border: 1px solid var(--border-strong); }
.btn.btn-dark:hover { background: var(--surface); transform: translateY(-2px); box-shadow: none; }
.btn.btn-danger { background: transparent; color: var(--lapsed); border: 1px solid var(--lapsed); }
.btn.btn-danger:hover { background: rgba(185,69,69,0.1); transform: translateY(-2px); box-shadow: none; }

.cta-row { margin-top: 40px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.fine { font-size: 13px; color: var(--fg-dim); letter-spacing: 0.3px; }
.affiliate-note {
  margin-top: 28px; padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 14px; color: var(--fg-muted);
  letter-spacing: 0.3px;
}

.payment-meta { display: flex; flex-direction: column; gap: 14px; margin-top: 32px; }
.payment-meta .row { display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: baseline; }
.payment-meta .label { font-size: 11px; letter-spacing: 2px; color: var(--fg-dim); text-transform: uppercase; font-weight: 600; }
.payment-meta .value { font-size: 16px; color: var(--fg); }

.success-watermark {
  position: absolute; right: -40px; top: 60px;
  font-size: clamp(160px, 22vw, 320px);
  font-weight: 900; line-height: 0.85;
  color: var(--surface); letter-spacing: -8px;
  user-select: none; pointer-events: none;
  opacity: 0.6;
}
.portal-success { position: relative; overflow: hidden; }
.next-list { list-style: none; padding: 0; margin: 24px 0 0; }
.next-list li {
  padding: 16px 0;
  font-size: 17px; color: var(--fg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 14px;
}
.next-list li:last-child { border-bottom: none; }
.next-list li .num {
  font-size: 13px; font-weight: 700; letter-spacing: 1px;
  color: var(--orange);
  flex: none; width: 24px; padding-top: 2px;
}

.stripe-fade {
  position: fixed; inset: 0;
  background: rgba(17,17,17,0.85);
  backdrop-filter: blur(4px);
  z-index: 600; display: none;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 24px;
}
.stripe-fade.show { display: flex; }
.stripe-fade .pulse {
  font-size: 11px; letter-spacing: 4px;
  color: var(--fg-muted); text-transform: uppercase; font-weight: 700;
}
.stripe-bar { width: 240px; height: 2px; background: var(--border-strong); overflow: hidden; position: relative; }
.stripe-bar::after {
  content: ''; position: absolute; inset: 0;
  background: var(--teal);
  transform: translateX(-100%);
  animation: stripeSlide 1.2s ease-in-out infinite;
}
@keyframes stripeSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.login { max-width: 480px; margin: 0 auto; padding: 120px 32px 80px; }
.login-logo { height: 36px; margin-bottom: 56px; }
.login h1 { font-size: 44px; font-weight: 800; line-height: 1.05; letter-spacing: -0.3px; margin-top: 12px; }
.login p.muted { color: var(--fg-muted); font-size: 17px; margin-top: 20px; max-width: 40ch; }
.field { margin-top: 40px; }
.field label { display: block; font-size: 11px; letter-spacing: 2px; color: var(--fg-muted); text-transform: uppercase; font-weight: 600; margin-bottom: 12px; }
.field input[type=email], .field input[type=text] {
  display: block; width: 100%;
  font-size: 18px; padding: 14px 0;
  border-bottom: 1px solid var(--border-strong);
  background: transparent; color: var(--fg);
  transition: border-color 0.2s ease;
}
.field input::placeholder { color: var(--fg-dim); }
.field input:focus { border-bottom-color: var(--orange); }
.login .actions { margin-top: 32px; display: flex; flex-direction: column; gap: 24px; align-items: flex-start; }
.skip-link {
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--fg-dim); font-weight: 600;
  padding-top: 16px;
  border-top: 1px dashed var(--border-strong);
  cursor: pointer; transition: color 0.2s ease;
}
.skip-link:hover { color: var(--teal); }
.skip-link::before { content: '◊ DEV · '; color: var(--fg-dim); }

.admin-shell { min-height: calc(100vh - 44px); display: flex; flex-direction: column; }
.admin-header {
  display: flex; align-items: center;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  gap: 24px;
}
.admin-header .logo { height: 28px; }
.admin-header .admin-label {
  font-size: 11px; letter-spacing: 3px; font-weight: 700;
  text-transform: uppercase; color: var(--fg-muted);
  padding-left: 18px; border-left: 1px solid var(--border-strong);
}
.admin-header .who {
  margin-left: auto;
  display: flex; align-items: center; gap: 24px;
  font-size: 13px; color: var(--fg-muted);
}
.admin-header .who .email { color: var(--fg); font-weight: 500; }
.admin-header .who .signout {
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  font-weight: 600; cursor: pointer;
  color: var(--fg-muted);
  transition: color 0.2s ease;
}
.admin-header .who .signout:hover { color: var(--orange); }

.tabs { display: flex; padding: 0 32px; border-bottom: 1px solid var(--border); gap: 0; }
.tab {
  font-size: 13px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--fg-muted);
  padding: 18px 22px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s ease;
  background: transparent; cursor: pointer;
  display: inline-flex; align-items: baseline; gap: 10px;
}
.tab .count {
  font-size: 11px; color: var(--fg-dim); font-weight: 600;
  padding: 2px 8px; background: var(--surface);
  letter-spacing: 1px;
}
.tab .alert {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  padding: 2px 7px; margin-left: 2px;
  background: var(--orange); color: var(--fg);
  display: none;
}
.tab .alert.show { display: inline-block; }
.tab.active { color: var(--fg); border-bottom-color: var(--orange); }
.tab.active .count { background: rgba(232,98,26,0.15); color: var(--orange); }
.tab:hover:not(.active) { color: var(--fg); }
.tab-panel { display: none; padding: 40px 32px 80px; }
.tab-panel.active { display: block; }

.tab-intro {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 32px; margin-bottom: 36px; flex-wrap: wrap;
}
.tab-intro h2 { font-size: 36px; font-weight: 800; letter-spacing: -0.3px; }
.tab-intro .sub { color: var(--fg-muted); margin-top: 6px; font-size: 16px; }
.tab-intro .actions { display: flex; gap: 12px; }

.stat-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-bottom: 40px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat {
  padding: 22px 24px;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.stat:last-child { border-right: none; }
.stat-label { font-size: 11px; letter-spacing: 2px; font-weight: 600; text-transform: uppercase; color: var(--fg-muted); }
.stat-value {
  font-size: 38px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px; line-height: 1;
}
.stat.stat-orange .stat-value { color: var(--orange); }
.stat.stat-lapsed .stat-value { color: var(--lapsed); }

.filter-row {
  display: flex; gap: 24px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.search { flex: 1; min-width: 240px; display: flex; align-items: center; gap: 12px; }
.search input {
  flex: 1; font-size: 16px;
  padding: 8px 0;
  border-bottom: 1px solid transparent;
  background: transparent; color: var(--fg);
  transition: border-color 0.2s ease;
}
.search input::placeholder { color: var(--fg-dim); }
.search input:focus { border-bottom-color: var(--orange); }
.search-prefix { font-size: 11px; letter-spacing: 2px; color: var(--fg-dim); text-transform: uppercase; font-weight: 700; }
.filter { display: flex; align-items: center; gap: 10px; }
.filter label { font-size: 11px; letter-spacing: 2px; color: var(--fg-dim); text-transform: uppercase; font-weight: 600; }
.filter select {
  background: transparent; color: var(--fg);
  border: 0; border-bottom: 1px solid var(--border-strong);
  padding: 6px 24px 6px 0;
  font-size: 14px; letter-spacing: 0.5px;
  cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%), linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%);
  background-position: calc(100% - 12px) 50%, calc(100% - 7px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.filter select:focus, .filter select:hover { border-bottom-color: var(--orange); }
.filter select option { background: var(--bg-2); color: var(--fg); }

.data-table { margin-top: 0; width: 100%; }
.data-table thead th {
  font-size: 11px; letter-spacing: 2px;
  font-weight: 600; text-transform: uppercase;
  color: var(--fg-muted);
  text-align: left;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 15px; vertical-align: middle;
}
.data-table tbody tr {
  cursor: pointer;
  transition: background 0.18s ease;
}
.data-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.data-table .col-company { font-weight: 600; font-size: 16px; }
.data-table .col-contact { color: var(--fg-muted); }
.data-table .col-meta { color: var(--fg-muted); font-size: 14px; letter-spacing: 0.3px; }
.data-table .col-actions { text-align: right; }
.data-table tbody tr td:first-child { padding-left: 4px; }
.data-table tbody tr td:last-child { padding-right: 4px; }
.data-table thead th:first-child { padding-left: 4px; }
.data-table thead th:last-child { padding-right: 4px; }
.data-table .row-chev {
  color: var(--fg-dim); font-weight: 700;
  font-size: 14px; letter-spacing: 1px;
  transition: color 0.18s ease, transform 0.18s ease;
}
.data-table tbody tr:hover .row-chev { color: var(--orange); transform: translateX(2px); }
.data-table thead th.sortable { cursor: pointer; user-select: none; position: relative; }
.data-table thead th.sortable:hover { color: var(--fg); }
.data-table thead th .th-inner { display: inline-flex; align-items: center; gap: 4px; }
.data-table thead th .th-arrow {
  font-size: 11px; color: var(--fg-dim); width: 10px; display: inline-block;
}
.data-table thead th.sorted .th-arrow { color: var(--orange); }
.data-table thead th .th-filter {
  margin-left: 4px; width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-dim); font-size: 12px; line-height: 1;
  border: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  position: relative;
}
.data-table thead th .th-filter:hover { color: var(--orange); border-color: var(--border-strong); }
.data-table thead th .th-filter.active { color: var(--orange); }
.data-table thead th .th-filter.active::after {
  content: ''; position: absolute; top: -2px; right: -2px;
  width: 6px; height: 6px; background: var(--orange);
}
.col-menu {
  position: absolute; z-index: 800;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  min-width: 200px; max-width: 280px;
  padding: 6px 0;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.col-menu .menu-head {
  padding: 8px 14px 6px;
  font-size: 10px; letter-spacing: 2px; color: var(--fg-dim);
  text-transform: uppercase; font-weight: 600;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.col-menu .menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  font-size: 14px; color: var(--fg-muted);
  cursor: pointer; text-align: left; width: 100%;
  transition: background 0.12s ease, color 0.12s ease;
}
.col-menu .menu-item:hover { background: var(--surface); color: var(--fg); }
.col-menu .menu-item.selected { color: var(--orange); }
.col-menu .menu-item .check { width: 10px; color: var(--orange); font-weight: 700; }
.col-menu .menu-group {
  padding: 10px 14px 4px;
  margin-top: 4px;
  font-size: 10px; letter-spacing: 2px; color: var(--fg-dim);
  text-transform: uppercase; font-weight: 700;
  border-top: 1px solid var(--border);
}
.col-menu .menu-group:first-child { border-top: 0; margin-top: 0; }
.col-menu .menu-item.menu-sub { padding-left: 28px; font-size: 13px; }
.col-menu .menu-item.menu-all { font-weight: 600; color: var(--fg); }
.data-table .col-check { width: 36px; padding-right: 0; }
.data-table .col-check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--orange);
  cursor: pointer; vertical-align: middle;
}
.data-table tbody tr.row-selected { background: rgba(232,98,26,0.06); }
.data-table tbody tr.row-selected:hover { background: rgba(232,98,26,0.1); }
.bulk-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; margin-bottom: 16px;
  background: rgba(232,98,26,0.08);
  border: 1px solid rgba(232,98,26,0.35);
}
.bulk-bar .bulk-count {
  font-size: 13px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--fg-muted); margin-right: 8px;
}
.bulk-bar .bulk-count b { color: var(--orange); font-weight: 700; }
.bulk-bar .btn { padding: 8px 16px; font-size: 12px; }

.status {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
}
.status .dot { width: 8px; height: 8px; background: currentColor; flex: none; }
.status-current { color: var(--teal); }
.status-expiring { color: var(--orange); }
.status-lapsed { color: var(--lapsed); }
.type-tag {
  display: inline-block;
  font-size: 11px; letter-spacing: 1.5px; font-weight: 700;
  text-transform: uppercase; color: var(--fg-muted);
}
.hold-tag {
  display: inline-block; margin-left: 8px;
  font-size: 10px; letter-spacing: 1.5px; font-weight: 700;
  text-transform: uppercase; color: var(--orange);
  border: 1px solid var(--orange); padding: 1px 6px;
  vertical-align: middle;
}
.data-table tbody tr.row-held td { color: var(--fg-dim); }
.data-table tbody tr.row-held .col-company { color: var(--fg-muted); }

/* ---- events: tier-fill strip ---- */
.tier-strip { display: inline-flex; gap: 4px; vertical-align: middle; }
.tier-cell {
  min-width: 56px;
  padding: 6px 8px 5px;
  border-top: 3px solid currentColor;
  background: rgba(255,255,255,0.02);
  display: inline-flex; flex-direction: column;
  font-variant-numeric: tabular-nums;
}
.tier-cell .t-name {
  font-size: 10px; letter-spacing: 1.5px; font-weight: 700;
  text-transform: uppercase;
  color: currentColor;
  opacity: 0.9;
}
.tier-cell .t-frac {
  font-size: 13px; font-weight: 700;
  color: var(--fg);
  letter-spacing: 0.3px;
  margin-top: 2px;
}
.tier-cell.full { background: rgba(255,255,255,0.06); }
.tier-cell.empty .t-frac { color: var(--fg-muted); }
.tier-cell.empty { opacity: 0.55; }

/* ---- event side panel tiers ---- */
.evt-tier-block {
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.evt-tier-block:last-child { border-bottom: 0; }
.evt-tier-head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 14px;
}
.evt-tier-head .t-bar { width: 4px; height: 22px; flex: none; align-self: center; }
.evt-tier-head .t-name { font-size: 15px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.evt-tier-head .t-price { font-size: 13px; color: var(--fg-muted); font-weight: 500; letter-spacing: 0.3px; }
.evt-tier-head .t-frac {
  margin-left: auto;
  font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--fg-muted);
}
.evt-tier-head .t-frac.sold { color: var(--orange); }
.evt-tier-slots { display: flex; flex-direction: column; gap: 8px; }
.evt-slot {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 15px;
}
.evt-slot:first-child { border-top: 0; padding-top: 0; }
.evt-slot .ix {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--fg-dim);
  width: 28px; flex: none;
}
.evt-slot.open .name { color: var(--fg-muted); font-style: italic; }
.evt-slot .name { flex: 1; color: var(--fg); }
.evt-slot .tag {
  font-size: 10px; letter-spacing: 1.5px; font-weight: 700;
  text-transform: uppercase;
}
.evt-slot.open .tag { color: var(--orange); }
.evt-slot.filled .tag { color: var(--teal); }

.empty-state {
  padding: 80px 32px; text-align: center;
  border-bottom: 1px solid var(--border);
}
.empty-state .glyph {
  font-size: 72px; font-weight: 900;
  color: var(--border-strong); line-height: 1;
  letter-spacing: -3px;
}
.empty-state h3 { margin-top: 20px; font-size: 22px; font-weight: 700; text-transform: none; letter-spacing: 0; }
.empty-state p { margin-top: 12px; color: var(--fg-muted); max-width: 40ch; margin-left: auto; margin-right: auto; font-size: 15px; }

.side-scrim {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 700; opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.side-scrim.open { opacity: 1; pointer-events: auto; }
.side-panel {
  position: fixed;
  top: 50%; left: 50%;
  width: min(640px, calc(100vw - 32px));
  max-height: min(86vh, 860px);
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  transform: translate(-50%, -50%) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.32, 0.72, 0.27, 1);
  z-index: 750;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}
.side-panel.open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}
.side-head .pager {
  display: inline-flex; align-items: center; gap: 2px;
  margin-left: auto; margin-right: 8px;
  font-size: 11px; letter-spacing: 2px; color: var(--fg-muted);
}
.side-head .pager .pcount { padding: 0 10px; font-weight: 600; }
.side-head .pager .pbtn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-muted);
  font-size: 18px; line-height: 1;
  border: 1px solid var(--border-strong);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.side-head .pager .pbtn:hover:not([disabled]) { color: var(--orange); border-color: var(--orange); }
.side-head .pager .pbtn[disabled] { opacity: 0.35; cursor: not-allowed; }
.side-head .close { margin-left: 0; }
.side-head {
  display: flex; align-items: center;
  padding: 22px 32px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.side-head .eyebrow { color: var(--fg-muted); }
.side-head .close {
  margin-left: auto;
  font-size: 26px; line-height: 1;
  color: var(--fg-muted);
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.2s ease;
}
.side-head .close:hover { color: var(--orange); }
.side-body { padding: 32px; overflow-y: auto; flex: 1; }
.side-body h3.company { font-size: 30px; font-weight: 800; letter-spacing: -0.2px; line-height: 1.1; text-transform: none; }
.side-body .submeta { margin-top: 8px; font-size: 13px; color: var(--fg-muted); letter-spacing: 0.5px; }
.side-section { margin-top: 36px; }
.side-section .lbl {
  font-size: 11px; letter-spacing: 2.5px;
  font-weight: 600; text-transform: uppercase;
  color: var(--fg-muted); margin-bottom: 10px;
}
.side-section .val { font-size: 16px; color: var(--fg); line-height: 1.55; }
.side-section .val .multi { display: block; }
.side-quote {
  margin-top: 14px; font-size: 16px;
  font-style: italic; color: var(--fg);
  padding: 0 0 0 18px;
  border-left: 2px solid var(--teal);
  line-height: 1.6;
}
.side-foot {
  display: flex; gap: 12px;
  padding: 20px 32px;
  border-top: 1px solid var(--border-strong);
  background: var(--bg);
}
.side-foot .btn { flex: 1; justify-content: center; }

#toast-stack {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 1100;
  display: flex; flex-direction: column; gap: 12px;
  pointer-events: none;
}
.toast {
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  padding: 16px 20px;
  font-size: 14px; color: var(--fg);
  min-width: 320px; max-width: 420px;
  display: flex; align-items: flex-start; gap: 14px;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.32, 0.72, 0.27, 1);
  pointer-events: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.toast.in { transform: translateX(0); opacity: 1; }
.toast .toast-dot { width: 8px; height: 8px; background: var(--teal); flex: none; margin-top: 6px; }
.toast.error .toast-dot { background: var(--lapsed); }
.toast .toast-body strong { display: block; font-weight: 700; letter-spacing: 0.3px; margin-bottom: 2px; }
.toast .toast-body span { color: var(--fg-muted); font-size: 13px; line-height: 1.5; }

@media (max-width: 760px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .stat { border-right: none; border-bottom: 1px solid var(--border); }
  .admin-header { flex-wrap: wrap; padding: 16px 20px; gap: 12px; }
  .admin-header .who { width: 100%; margin-left: 0; gap: 12px; }
  .tabs { padding: 0 12px; overflow-x: auto; }
  .tab-panel { padding: 24px 20px 60px; }
  .filter-row { gap: 14px; padding: 12px 0; }
}

/* ===== Manual add / edit forms + history (admin CRUD) ===== */
.entity-form { margin-top: 28px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 18px; }
.form-field { display: flex; flex-direction: column; min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field label {
  font-size: 11px; letter-spacing: 2px; color: var(--fg-muted);
  text-transform: uppercase; font-weight: 600; margin-bottom: 8px;
}
.form-field .req { color: var(--orange); }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; font-size: 16px; padding: 10px 0;
  border-bottom: 1px solid var(--border-strong);
  background: transparent; color: var(--fg);
  transition: border-color 0.2s ease;
}
.form-field input[type=date] { color-scheme: dark; }
.form-field textarea { resize: vertical; line-height: 1.5; }
.form-field input::placeholder, .form-field textarea::placeholder { color: var(--fg-dim); }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-bottom-color: var(--orange); }
.form-field select option { background: var(--bg-2); color: var(--fg); }
.form-field.ro { opacity: 0.55; }
.form-field.ro input { cursor: not-allowed; }
.form-hint { margin-top: 7px; font-size: 12px; color: var(--fg-dim); letter-spacing: 0.3px; line-height: 1.4; }

.detail-actions { margin-top: 18px; }
.btn.btn-sm { padding: 9px 16px; font-size: 12px; letter-spacing: 1px; }
.side-foot { flex-wrap: wrap; }

.hist-item { padding: 14px 0; border-top: 1px solid var(--border); }
.hist-item:first-of-type { border-top: 0; }
.hist-head { font-size: 14px; color: var(--fg); }
.hist-when { font-size: 12px; color: var(--fg-dim); margin: 2px 0 8px; letter-spacing: 0.3px; }
.hist-line { font-size: 13px; color: var(--fg-muted); line-height: 1.7; }
.hist-k { color: var(--fg); font-weight: 600; }
.hist-old { color: var(--fg-dim); text-decoration: line-through; }
.hist-new { color: var(--teal); }
.hist-arr { color: var(--fg-dim); }
.hist-muted { color: var(--fg-muted); }
.hist-empty, .hist-loading { font-size: 14px; color: var(--fg-dim); }

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
}
