/* Conduit design system — dark sci-fi, cyan accent.
   Structure adapted from Linear; accent shifted to cyan for the EVE-native feel.
   System fonts only (no CDN) — self-hosted and privacy-conscious. */

:root {
  --bg: #08090a;
  --panel: #0f1011;
  --surface: #141517;
  --surface-2: #191a1b;
  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --text: #f7f8f8;
  --text-secondary: #d0d6e0;
  --text-muted: #8a8f98;
  --text-faint: #62666d;
  --accent: #22d3ee;
  --accent-bright: #67e8f9;
  --accent-bg: #0e7490;
  --accent-dim: rgba(34, 211, 238, 0.12);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  color-scheme: dark;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Typography ---- */
h1, h2, h3, h4 { color: var(--text); font-weight: 500; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: 1.4rem; letter-spacing: -0.03em; }
h2 {
  font-size: 1.05rem;
  margin-top: 2em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid var(--border-subtle);
}
h3 { font-size: 0.95rem; }
.panel[data-panel] > h2:first-child { margin-top: 0; }

p { margin: 0 0 0.9em; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-bright); }

/* Snapshot page: links default white, accent on hover. */
.snapshot-page a { color: var(--text); text-decoration: none; transition: color 0.15s ease; }
.snapshot-page a:hover { color: var(--accent); }

code, .mono { font-family: var(--font-mono); font-size: 0.85em; color: var(--text-secondary); }
.skills-header { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.skills-header p { margin: 0; }
.skills-header .injected { white-space: nowrap; }
.activity-layout { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 24px; align-items: start; }
.activity-main { min-width: 0; }
.activity-rail { display: flex; flex-direction: column; gap: 10px; }
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; }
.stat-label { display: block; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); white-space: nowrap; }
.stat-value { display: block; font-size: 22px; font-weight: 600; line-height: 1.2; margin-top: 4px; color: var(--text); white-space: nowrap; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 18px; }
a.subtle { color: var(--text-secondary); text-decoration: none; }
a.subtle:hover { color: var(--accent); }
.chart-card { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.chart-range { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; z-index: 1; }
.chart-range .btn { background: rgba(20, 21, 23, 0.85); }
#activity-chart { display: block; width: 100%; height: 154px; }
.activity-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.activity-col { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; }
.col-title { margin: 0 0 10px; text-align: center; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); }
.col-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border-subtle); }
.col-row:last-child { border-bottom: 0; }
.col-img { width: 32px; height: 32px; border-radius: 6px; flex-shrink: 0; vertical-align: middle; }
.col-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 13px; }
.col-name:hover { color: var(--accent-bright); }
.col-count { flex-shrink: 0; font-size: 12px; color: var(--text-muted); }
.pie-card { display: flex; gap: 20px; position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-top: 16px; padding: 12px 14px; }
.pie-left { flex: 1; min-width: 0; position: relative; }
.pie-history { flex: 1.15; min-width: 0; }
#activity-pie { display: block; width: 100%; height: 200px; }
.hist-scroll { max-height: 176px; overflow-y: auto; padding-right: 4px; }
.overview-alerts { display: flex; flex-direction: column; gap: 6px; max-height: 205px; overflow-y: auto; padding-right: 2px; }
.overview-alert { display: flex; align-items: center; gap: 10px; width: 100%; background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.28); border-radius: var(--radius-sm); padding: 8px 10px; margin: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.overview-alert.active { background: rgba(239, 68, 68, 0.16); border-color: rgba(239, 68, 68, 0.5); }
.overview-alert-mark { width: 18px; height: 18px; border-radius: 50%; background: #ef4444; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.overview-alert-entity { font-weight: 600; color: var(--text); white-space: nowrap; }
.overview-alert-reason { color: #f87171; font-size: 13px; }
.overview-alert-hostile { color: #fca5a5; font-weight: 600; }
.overview-alert-standing { color: #ef4444; font-size: 12px; font-weight: 600; padding: 1px 6px; border: 1px solid rgba(239, 68, 68, 0.4); border-radius: 8px; }
.overview-alert-sources { margin-left: auto; font-size: 12px; white-space: nowrap; }
.overview-alert-chevron { color: #f87171; flex-shrink: 0; transition: transform 0.15s; }
.overview-alert.active .overview-alert-chevron { transform: rotate(180deg); }
.overview-alert-detail { margin-top: 12px; padding: 10px 12px; background: rgba(239, 68, 68, 0.06); border: 1px solid rgba(239, 68, 68, 0.25); border-radius: var(--radius-sm); }
.overview-alert-detail-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid rgba(239, 68, 68, 0.2); }
.alert-detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 12px; max-height: 400px; overflow-y: auto; align-content: start; }
.alert-item { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 6px; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; border-radius: var(--radius-sm); text-decoration: none; }
.alert-item:hover { background: rgba(34, 211, 238, 0.06); }
.alert-item .col-img { width: 24px; height: 24px; }
.alert-item-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.alert-item-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.alert-item-meta { color: var(--text-secondary); white-space: nowrap; flex-shrink: 0; }
.alert-item-detail { grid-column: 1 / -1; background: rgba(0, 0, 0, 0.25); border-radius: var(--radius-sm); padding: 8px 10px; }
.alert-item-detail-row { display: flex; gap: 10px; padding: 2px 0; font-size: 13px; }
.alert-item-detail-row .faint { min-width: 90px; flex-shrink: 0; }
.alert-mail-body { color: var(--text-secondary); font-size: 13px; line-height: 1.5; max-height: 180px; overflow-y: auto; }
.alert-kill-link { color: var(--accent); margin-left: auto; flex-shrink: 0; }
.overview-doctrines { display: flex; flex-direction: column; gap: 2px; }
.overview-doctrine { display: flex; align-items: center; gap: 10px; width: 100%; padding: 5px 6px; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; border-radius: var(--radius-sm); }
.overview-doctrine:hover { background: rgba(34, 211, 238, 0.06); }
.overview-doctrine.active { background: var(--accent-dim); }
.overview-doctrine-name { font-weight: 600; color: #f87171; }
.overview-doctrine-ship { color: var(--text-secondary); }
.overview-doctrine-missing { margin-left: auto; color: #ef4444; font-size: 12px; white-space: nowrap; }
.overview-doctrine-detail { margin-top: 12px; padding: 10px 12px; background: rgba(0, 0, 0, 0.15); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); }
.hist-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--border-subtle); }
.hist-row:last-child { border-bottom: 0; }
.hist-dates { flex-shrink: 0; font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; }
.pie-tooltip { position: absolute; z-index: 2; padding: 5px 9px; background: rgba(20, 21, 23, 0.95); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; color: var(--text); pointer-events: none; white-space: nowrap; }

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.accent { color: var(--accent); }

/* ---- Layout ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 600; font-size: 15px; color: var(--text); letter-spacing: -0.02em; }
.brand .brand-dot { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 18px; }
.nav a { color: var(--text-muted); font-size: 13px; font-weight: 500; }
.nav a:hover { color: var(--text); }
.nav .nav-user { color: var(--text-faint); font-size: 13px; }
.nav-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: 0; padding: 6px; cursor: pointer; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text-secondary); border-radius: 1px; }

.content { max-width: 1000px; margin: 0 auto; padding: 28px 20px 64px; }

/* ---- Panels / cards ---- */
.panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 14px 0;
}
.panel + .panel { margin-top: 0; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.btn-primary { background: var(--accent-bg); border-color: var(--accent-bg); color: #fff; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger { color: var(--danger); border-color: rgba(239, 68, 68, 0.3); }
.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.field-row { display: flex; gap: 8px; align-items: center; }
.field-row input { flex: 1; }
.bot-heading { margin: 24px 0 12px; font-size: 16px; font-weight: 600; }
.btn-sm { padding: 3px 9px; font-size: 12px; }
.btn-link { background: none; border: none; color: var(--accent); padding: 0; font-size: 13px; cursor: pointer; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filter-bar select { min-width: 150px; }

.pap-fleet { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; }
.pap-fleet .pap-header { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; }
.pap-fleet .pap-header:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pap-fleet .pap-fc { font-weight: 600; color: var(--text); }
.pap-fleet .pap-loc { color: var(--text-secondary); }
.pap-fleet .pap-time { color: var(--text-secondary); font-size: 12px; }
.pap-fleet .pap-count { margin-left: auto; color: var(--text-secondary); }
.pap-fleet .pap-roster { display: none; padding: 0 12px 12px; border-top: 1px solid var(--border-subtle); }
.pap-fleet.open .pap-roster { display: block; max-height: 460px; overflow-y: auto; }
.pap-fleet .pap-meta { margin: 0 0 8px; font-size: 12px; }
.activity-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.activity-toggle { display: flex; gap: 6px; }
.activity-inactive { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.activity-row { cursor: pointer; }
.activity-detail td { padding: 8px 12px 12px; background: var(--panel); }
.activity-paps { display: flex; flex-direction: column; gap: 4px; }
.activity-pap { display: flex; gap: 14px; font-size: 13px; }
.activity-pap .muted { min-width: 140px; }
.ping-select-grid { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.ping-select { display: flex; flex-direction: column; gap: 4px; min-width: 220px; }
.ping-select label { font-size: 13px; color: var(--text-secondary); }
.ping-select select { min-width: 220px; }
.leaderboard-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.leaderboard-head h2 { margin: 0; padding: 0; border: none; }
.leaderboard { list-style: none; padding: 0; margin: 0 0 6px; min-height: 140px; }
.leaderboard li { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; font-size: 13px; }
.leaderboard .lb-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.leaderboard .lb-img { width: 22px; height: 22px; border-radius: 4px; object-fit: cover; flex: 0 0 auto; }
.leaderboard .empty { color: var(--text-secondary); justify-content: flex-start; }
.structure-browser-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.structure-browser-head h2 { margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  color: var(--text-faint);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
td { padding: 7px 10px; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); vertical-align: top; }
.fuel-expired { color: var(--danger); }
table.striped tr:nth-child(even) td { background: rgba(255, 255, 255, 0.02); }
.cell-main { display: flex; align-items: center; gap: 6px; }
.cell-text { display: flex; flex-direction: column; min-width: 0; }
.cell-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.sort-link { color: var(--text-secondary); text-decoration: none; }
.sort-link:hover { color: var(--text); }
.sort-link.active { color: var(--accent-bright); }
.power-tag { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 600; letter-spacing: 0.02em; }
.power-full { color: #5cbe5f; background: rgba(92, 190, 95, 0.12); }
.power-low { color: #feb140; background: rgba(254, 177, 64, 0.12); }
.power-abandoned { color: var(--danger); background: rgba(239, 68, 68, 0.12); }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
td.num, th.num { text-align: right; font-family: var(--font-mono); font-size: 12px; }

/* ---- Badges / pills ---- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}
.badge-accent { color: var(--accent); border-color: rgba(34, 211, 238, 0.3); background: var(--accent-dim); }
.badge-danger { color: var(--danger); border-color: rgba(239, 68, 68, 0.3); }
.badge-warning { color: var(--warning); border-color: rgba(245, 158, 11, 0.3); }
.badge-success { color: var(--success); border-color: rgba(16, 185, 129, 0.3); }
a.badge { cursor: pointer; text-decoration: none; }
a.badge.badge-warning:hover { color: var(--warning); border-color: var(--warning); }

/* ---- Compliance dots ---- */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.dot-ok { background: var(--success); box-shadow: 0 0 6px rgba(16, 185, 129, 0.6); }
.dot-bad { background: var(--danger); box-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }

/* ---- Lists ---- */
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--border-subtle); }
ul.plain li:last-child { border-bottom: none; }

/* ---- Forms ---- */
form { margin: 0; }
label { color: var(--text-secondary); font-size: 13px; }
.errorlist { color: var(--danger); list-style: none; padding: 0; margin: 6px 0 0; font-size: 12px; }
input[type="text"], input[type="password"], input[type="number"], input[type="datetime-local"], textarea, select {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
}
textarea { resize: none; }
select option { background: var(--surface); color: var(--text); }
input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus, input[type="datetime-local"]:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-bottom: 14px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field input, .form-field textarea { width: 100%; }
.form-field-full { grid-column: 1 / -1; }

/* ---- Group editor: two-column layout, permissions/roles rail on the right ---- */
.group-editor-layout { display: flex; gap: 24px; align-items: flex-start; }
.group-editor-main { flex: 1 1 auto; min-width: 0; }
.group-editor-side {
  flex: 0 0 auto;
  width: max-content;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-left: 20px;
  border-left: 1px solid var(--border);
}
.role-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 248px; /* 6 rows */
  padding-right: 4px;
}
.role-list .toggle-btn { width: 100%; text-align: left; flex-shrink: 0; }
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  cursor: help;
  margin-left: 6px;
  position: relative;
  vertical-align: middle;
}
.help-icon:hover { color: var(--text-secondary); border-color: var(--accent); }
.help-icon::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-secondary);
  white-space: normal;
  width: max-content;
  max-width: 240px;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, visibility 0.12s ease;
}
.help-icon:hover::after { opacity: 1; visibility: visible; }
.form-field .check { display: flex; align-items: center; gap: 8px; padding-top: 6px; }
.checkbox-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.checkbox-group label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-secondary); }
.scope-select { width: 100%; min-height: 160px; }
.entity-input { position: relative; }
.entity-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.entity-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; background: var(--accent-dim); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; }
.entity-chip-x { background: none; border: 0; color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 0 2px; }
.entity-chip-x:hover { color: var(--text); }
.entity-search { width: 100%; }
.entity-search-results { position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 40; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 200px; overflow-y: auto; }
.entity-search-item { display: block; width: 100%; text-align: left; padding: 7px 10px; background: none; border: 0; color: var(--text); cursor: pointer; font-size: 13px; }
.entity-search-item:hover { background: var(--accent-dim); }

/* Scope checkbox grid (Django CheckboxSelectMultiple renders a <ul>) */
form ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 16px; }
form ul li { list-style: none; }
form ul label { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 5px 8px; border-radius: var(--radius-sm); }
form ul label:hover { background: rgba(255, 255, 255, 0.03); }

/* ---- Signals ---- */
.signal { padding: 8px 12px; margin: 6px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.02); }
.signal strong { font-family: var(--font-mono); font-size: 12px; color: var(--accent); font-weight: 500; }

/* ---- Alerts / callouts ---- */
.callout { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: rgba(255, 255, 255, 0.02); margin: 12px 0; }
.callout-accent { border-color: rgba(34, 211, 238, 0.3); background: var(--accent-dim); }
.callout-warning { border-color: rgba(245, 158, 11, 0.3); }
.callout-danger { border-color: rgba(239, 68, 68, 0.3); }
.callout-success { border-color: rgba(16, 185, 129, 0.3); }

/* ---- Meta / header block ---- */
.page-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.page-head h1 { margin-bottom: 4px; }
.page-head-name { display: flex; align-items: center; gap: 10px; }
.page-head-actions { display: flex; gap: 8px; align-items: center; }
.char-switcher { position: relative; }
.char-switcher-toggle { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; }
.char-switcher-toggle h1 { margin-bottom: 0; }
.char-switcher-chevron { color: var(--text-muted); font-size: 15px; line-height: 1; transition: transform 0.15s; }
.char-switcher-toggle[aria-expanded="true"] .char-switcher-chevron { transform: rotate(180deg); }
.char-switcher-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 200px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45); z-index: 30; display: flex; flex-direction: column; padding: 4px; }
.char-switcher-item { padding: 8px 10px; color: var(--text); text-decoration: none; font-size: 14px; border-radius: var(--radius-sm); }
.char-switcher-item:hover { background: var(--accent-dim); color: var(--text); }
.subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 16px; margin: 0; }
.kv .k { color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.kv .v { color: var(--text); font-size: 14px; }

/* ---- Login ---- */
.login { max-width: 420px; margin: 12vh auto 0; text-align: center; }
.login h1 { font-size: 1.9rem; margin-bottom: 0.25em; }
.login h1 a { color: inherit; text-decoration: none; transition: color 0.15s ease; }
.login h1 a:hover { color: var(--accent); }
.login h1 .brand-dot { color: var(--accent); }
.login .btn-lg { padding: 10px 22px; font-size: 14px; }
.login-entity-logo { width: 96px; height: 96px; object-fit: contain; border-radius: 12px; margin-bottom: 0.6em; }
.login-entity-name { font-size: 2.2rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 0.15em; }
.login-entity-name a { color: inherit; text-decoration: none; transition: color 0.15s ease; }
.login-entity-name a:hover { color: var(--accent); }

/* ---- Empty states ---- */
.empty { color: var(--text-faint); font-size: 13px; padding: 10px 0; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; margin: 18px 0 6px; flex-wrap: wrap; border-bottom: 1px solid var(--border-subtle); }
.tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-muted); padding: 8px 14px; font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: inherit; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs .audit-switch-btn { margin-left: auto; align-self: center; }
.admin-search-row { display: flex; gap: 8px; align-items: center; }
.admin-search-row input { flex: 1; }
.admin-search-results { margin-top: 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.admin-search-card { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.admin-search-card img { width: 40px; height: 40px; border-radius: 50%; }
.admin-search-card-name { font-size: 14px; text-align: left; color: #fff; }
.admin-search-card.highlighted, .admin-search-card:hover { border-color: var(--accent); background: var(--accent-dim); }
.admin-search-card.is-admin { opacity: 0.55; }
.admin-search-card.is-owner { border-color: var(--accent); }
.name-resolver { max-width: 760px; }
.name-resolver-results { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.name-resolver-result { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.name-resolver-result img { width: 40px; height: 40px; border-radius: 50%; }
.name-resolver-result a { color: var(--accent); font-size: 14px; text-decoration: none; }
.name-resolver-result a:hover { text-decoration: underline; }
.name-resolver-result .resolver-id { font-size: 13px; color: var(--text-muted); font-family: var(--font-mono); }
.name-resolver-result .resolver-copy { margin-left: auto; }
.hidden { display: none !important; }

/* ---- Characters directory ---- */
.characters-panel-head { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.characters-panel-head input { flex: 1; }
.character-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; max-height: 460px; overflow-y: auto; padding-right: 4px; }
.character-block { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; cursor: pointer; }
.character-block:hover { border-color: var(--accent); }
.character-block.needs-audit { background: rgba(234, 179, 8, 0.12); border-color: rgba(234, 179, 8, 0.55); }
.character-block.selected { border-color: var(--accent); background: var(--accent-dim); }
.character-main { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.character-main img { width: 48px; height: 48px; border-radius: 50%; }
.character-main-name { font-size: 15px; font-weight: 500; color: var(--text); }
.character-alts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.character-alt { font-size: 12px; color: var(--text-secondary); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 2px 8px; }
.character-alt.needs-audit { color: #fde68a; border-color: rgba(234, 179, 8, 0.55); background: rgba(234, 179, 8, 0.16); }
.ceo-badge { position: absolute; top: 8px; right: 8px; font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: #93c5fd; background: rgba(59, 130, 246, 0.16); border: 1px solid rgba(59, 130, 246, 0.4); border-radius: 4px; padding: 1px 6px; }

/* ---- Audit overlay (characters) ---- */
.overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.overlay-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.65); }
.overlay-dialog { position: relative; width: min(1180px, 100%); height: min(92vh, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; overflow: hidden; }
.overlay-dialog-sm { width: min(560px, 100%); height: min(82vh, 100%); }
.overlay-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.overlay-title { font-size: 14px; font-weight: 500; color: var(--text); }
.overlay-dialog iframe { flex: 1; width: 100%; border: 0; background: var(--bg); }
.overlay-body { flex: 1; overflow-y: auto; padding: 20px; background: var(--bg); }

/* Embed mode: audit page rendered inside the overlay iframe drops the topbar. */
body.embed { background: var(--panel); }
body.embed .content { max-width: none; padding: 16px 20px 32px; }

/* ---- Pager ---- */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.pager-info { color: var(--text-faint); font-size: 12px; }
.filter-bar, .level-filter { display: flex; gap: 6px; margin: 4px 0 12px; flex-wrap: wrap; }
.skill-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.skill-cat {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer;
  color: var(--text-secondary); font-size: 13px; font-family: inherit; text-align: left;
}
.skill-cat:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.skill-cat.grayed { opacity: 0.4; }
.skill-cat.active { background: var(--accent-dim); border-color: rgba(34, 211, 238, 0.4); color: var(--text); }
.skill-cat-count { color: var(--accent); font-family: var(--font-mono); font-size: 12px; }
.skill-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 16px; margin-top: 12px; }
.skill-item { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--border-subtle); font-size: 13px; color: var(--text-secondary); }
.skill-lvl { font-family: var(--font-mono); font-size: 12px; }
.mail-row { cursor: pointer; }
.mail-row.active { background: var(--accent-dim); }
.mail-body { background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin: 8px 0; }
.mail-body-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.mail-body-text { color: var(--text-secondary); white-space: pre-wrap; font-size: 13px; line-height: 1.6; word-wrap: break-word; }
.mail-scroll { max-height: 360px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.mail-scroll thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }

/* ---- Section header with action button ---- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2em; padding-bottom: 0.5em; border-bottom: 1px solid var(--border-subtle); }
.section-head h2 { margin: 0; padding: 0; border: none; }

/* ---- Scrollable table (5 rows + sticky header) ---- */
.scroll-table { max-height: 210px; overflow-y: auto; }
.scroll-table thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.scroll-table-lg { max-height: 420px; overflow-y: auto; }
.scroll-table-lg thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.scroll-table-xl { max-height: 630px; overflow-y: auto; }
.scroll-table-xl thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.scroll-table-15 { max-height: 460px; overflow-y: auto; }
.scroll-table-15 thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }

/* ---- Dashboard two-column layout ---- */
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; }
.dash-col { min-width: 0; display: flex; flex-direction: column; }
.dash-col .panel { flex: 1 1 auto; min-height: 0; }
.dash-scroll { display: flex; flex-direction: column; max-height: 460px; }
.dash-scroll-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.dash-scroll-footer { flex: 0 0 auto; margin: 12px 0 0; }
.dash-groups { display: flex; flex-direction: column; }
.dash-groups .group-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.dash-subhead { margin-top: 0; }
.group-badges { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.group-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; border: 1px solid rgba(34, 211, 238, 0.3); color: var(--accent); background: var(--accent-dim); white-space: nowrap; }

/* ---- Group review cards ---- */
.group-scroll { max-height: 460px; overflow-y: auto; padding-right: 4px; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; align-content: start; }
.group-card { display: flex; flex-direction: column; gap: 8px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; text-decoration: none; color: var(--text); }
.group-card:hover { border-color: var(--accent); }
.group-card-name { font-weight: 600; font-size: 15px; }
.group-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-secondary); }
.group-card-pending { border-color: rgba(245, 158, 11, 0.5); background: rgba(245, 158, 11, 0.07); }
.group-card-pending:hover { border-color: var(--warning); }
.group-card-desc { font-size: 13px; color: var(--text-secondary); }
.group-card-apply { margin-top: auto; }
.group-detail-subhead { margin: 18px 0 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); }
.group-detail-subhead:first-child { margin-top: 0; }

/* ---- Group management overlay ---- */
.overlay-messages { margin-bottom: 12px; }
.group-edit { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.group-edit-row { display: flex; gap: 8px; }
.group-name-input { flex: 1; min-width: 0; }
.group-detail-section { margin-bottom: 18px; }
.group-detail-section h3 { margin: 0 0 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); }
.app-row, .member-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
.app-name, .member-name { font-weight: 500; min-width: 0; }
.app-actions, .member-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.app-actions form { display: flex; gap: 6px; align-items: center; }
.app-reason { width: 150px; }
.member-search { position: relative; margin-bottom: 12px; }
.member-search-row { display: flex; gap: 8px; }
.member-search-row input { flex: 1; min-width: 0; }
.member-list { max-height: 320px; overflow-y: auto; }
.member-search-empty { padding: 8px 12px; color: var(--text-secondary); font-size: 13px; }
.member-search-results { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 200px; overflow-y: auto; z-index: 20; margin-top: 2px; }
.member-search-results.show { display: block; }
.member-search-item { display: block; width: 100%; text-align: left; padding: 8px 12px; background: none; border: 0; color: var(--text); cursor: pointer; font: inherit; }
.member-search-item:hover { background: var(--accent-dim); }

/* ---- Inline add/edit panel ---- */
.editor-panel { margin-top: 16px; padding: 16px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--panel); }
.editor-panel h3 { margin-top: 0; }

/* ---- Toggle-button grids (multi-select) ---- */
.toggle-scroll { overflow-y: auto; padding-right: 4px; }
.toggle-scroll-sm { max-height: 124px; }  /* states: 3 rows */
.toggle-scroll-md { max-height: 168px; }  /* scopes: 4 rows */
.toggle-grid { display: grid; gap: 8px; }
.toggle-grid-6 { grid-template-columns: repeat(6, 1fr); }
.toggle-grid-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.toggle-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.staff-perms-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2em; padding-bottom: 0.5em; border-bottom: 1px solid var(--border-subtle); }
.staff-perms-header h2 { margin: 0; padding: 0; border: none; }
.staff-perms-header select { min-width: 220px; }
.toggle-grid-3 { grid-template-columns: repeat(3, 1fr); }
/* Submit buttons that directly follow a toggle grid need breathing room above. */
.toggle-grid + .hidden + .btn { margin-top: 14px; }

/* Autocomplete dropdowns (owner / system / formup location). */
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}
.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.autocomplete-item:hover { background: var(--accent-dim); color: var(--text); }
.autocomplete-kind {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 3px;
  padding: 1px 4px;
  flex-shrink: 0;
}
.toggle-btn {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.toggle-btn:hover { border-color: var(--accent); color: var(--text-secondary); }
.toggle-btn.selected { background: var(--accent-dim); border-color: var(--accent); color: var(--accent-bright); }
.standing-presets { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- Screenshot drop-zone (structure timer OCR) ---- */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.dragover, .dropzone:focus-visible { border-color: var(--accent); background: var(--accent-dim); outline: none; }
.dropzone-title { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.dropzone-hint { color: var(--text-muted); font-size: 12px; }
.ocr-status { margin-top: 10px; color: var(--text-secondary); font-size: 12px; }
.ocr-raw { margin-top: 12px; }
.ocr-raw-title { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.ocr-raw pre {
  margin: 0;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 180px;
  overflow-y: auto;
}

/* ---- Name row with flag buttons ---- */
.name-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.name-row > input[type="text"] { flex: 1 1 240px; min-width: 0; }
.group-flags { display: flex; gap: 8px; flex-shrink: 0; }
.ticker-checkbox { display: inline-flex; align-items: center; gap: 6px; margin-left: 16px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.ticker-checkbox input[type="checkbox"] { margin: 0; }

/* ---- Manager picker ---- */
.manager-picker { display: flex; flex-direction: column; gap: 8px; }
.manager-picker > input[type="text"] { width: 100%; }
.manager-selected { display: flex; flex-wrap: wrap; gap: 6px; }
.manager-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
}
.manager-chip-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.manager-chip-remove:hover { color: var(--danger); }

/* ---- Modal ---- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; width: 100%; max-width: 400px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); }
.modal h3 { margin-top: 0; }
.modal p { color: var(--text-secondary); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.doctrine-row { cursor: pointer; }
.doctrine-row.active { background: var(--accent-dim); }
.doctrine-skill-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 16px; margin-top: 8px; }
.doctrine-skill { display: flex; justify-content: space-between; gap: 8px; padding: 3px 8px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary); }
.doctrine-skill.green { color: #10b981; }
.doctrine-skill.yellow { color: #eab308; }
.doctrine-skill.red { color: #ef4444; }
.doctrine-skill-heading { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text); background: var(--accent-dim); padding: 4px 10px; border-radius: var(--radius-sm); margin: 14px 0 0; }
.doctrine-skill-section:first-child .doctrine-skill-heading { margin-top: 4px; }
.doctrine-fits-row td { padding: 0; border-bottom: none; }
.fits-list { display: flex; flex-direction: column; gap: 4px; padding: 6px 14px 10px; background: rgba(0, 0, 0, 0.15); }
.fit-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--border-subtle); }
.fit-row:last-child { border-bottom: none; }
.fit-name { flex: 1; min-width: 0; font-weight: 500; }
.fit-ship { color: var(--text-secondary); }
.fit-row-btn { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--border-subtle); text-align: left; font: inherit; color: inherit; cursor: pointer; border-radius: var(--radius-sm); }
.fit-row-btn:hover { background: rgba(34, 211, 238, 0.06); }
.fit-row-btn.active { background: var(--accent-dim); }
.doctrine-fit { border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 8px; }
.doctrine-fit-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; row-gap: 6px; font-weight: 600; margin-bottom: 4px; }
.doctrine-fit-name { flex: 1; }
.fit-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.fit-training { color: var(--text-muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
.asset-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.asset-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-height: 384px; overflow-y: auto; }
.asset-location {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 12px; cursor: pointer;
  color: var(--text-secondary); font-size: 13px; font-family: inherit; text-align: left;
  height: 41px;
}
.asset-location:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.asset-location.active { background: var(--accent-dim); border-color: rgba(34, 211, 238, 0.4); color: var(--text); }
.asset-loc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-loc-count { color: var(--accent); font-family: var(--font-mono); font-size: 12px; flex-shrink: 0; }
.asset-items { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 16px; max-height: 400px; overflow-y: auto; margin-top: 12px; }
.asset-items-head { grid-column: 1 / -1; position: sticky; top: 0; z-index: 2; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text); background: var(--surface-2); padding: 4px 10px; border-radius: var(--radius-sm); margin-bottom: 4px; box-shadow: 0 1px 0 rgba(34, 211, 238, 0.25); }
.asset-container { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 16px; margin: 6px 0 2px; }
.asset-container-head { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: var(--text); padding: 3px 2px; border-bottom: 1px solid var(--border-subtle); }
.asset-item-nested { padding-left: 8px; }
.asset-item { display: flex; align-items: center; gap: 10px; padding: 3px 0; font-size: 13px; color: var(--text-secondary); }
.asset-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-qty { min-width: 48px; text-align: right; }
.asset-value { min-width: 88px; text-align: right; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .dash-cols { grid-template-columns: 1fr; }
  .activity-layout { grid-template-columns: 1fr; }
  .activity-cols { grid-template-columns: 1fr 1fr; }
  .pie-card { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .group-editor-layout { flex-direction: column; }
  .group-editor-side { width: auto; padding-left: 0; border-left: 0; padding-top: 16px; border-top: 1px solid var(--border); }
  .admin-search-results { grid-template-columns: repeat(2, 1fr); }
  .doctrine-skill-grid { grid-template-columns: repeat(2, 1fr); }
  .asset-list, .asset-items, .asset-container { grid-template-columns: 1fr; }
  .toggle-grid-6 { grid-template-columns: repeat(3, 1fr); }
  .toggle-grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .content { padding: 20px 14px 48px; }
  .nav-toggle { display: flex; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: 4px 20px 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
  }
  .nav.open { display: flex; }
  .nav a { padding: 11px 0; border-bottom: 1px solid var(--border-subtle); }
  .nav a:last-child { border-bottom: 0; }
  .activity-cols { grid-template-columns: 1fr; }
  .skill-cats { grid-template-columns: 1fr; }
  .skill-list { grid-template-columns: 1fr; }
  .doctrine-skill-grid { grid-template-columns: 1fr; }
  .admin-search-results { grid-template-columns: 1fr; }
  .alert-detail-grid { grid-template-columns: 1fr; }
  .toggle-grid-6 { grid-template-columns: repeat(2, 1fr); }
}
