:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-2: #1a1a1a;
  --border: #222222;
  --border-2: #2a2a2a;
  --gold: #C8973A;
  --gold-soft: #8a6826;
  --crimson: #8B0000;
  --text: #F5F5F5;
  --text-2: #888888;
  --text-3: #5a5a5a;
  --success-bg: #1a3d1a;
  --success: #4caf50;
  --warning-bg: #3d2e00;
  --warning: #f0a500;
  --danger-bg: #3d0000;
  --danger: #e53935;
  --facility-blue: #1a3a5c;
  --facility-blue-soft: #234d7a;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  padding: 0;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a { color: var(--gold); text-decoration: none; }

/* ---- App shell ---- */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.navbar {
  height: 60px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.wordmark {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.wordmark-dot {
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 2px;
  transform: rotate(45deg);
}

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-2);
  font-weight: 500;
  font-size: 13px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover { color: var(--text); background: var(--surface); }
.nav-link.active { color: var(--text); background: var(--surface); }
.nav-link.active::after {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  background: var(--gold);
  border-radius: 50%;
  margin-left: 2px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.role-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.role-badge.gold { color: var(--gold); border-color: var(--gold-soft); background: rgba(200, 151, 58, 0.08); }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.avatar-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 220px;
  padding: 6px;
  z-index: 100;
}

.avatar-menu-item {
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
}
.avatar-menu-item:hover { background: var(--surface-2); }
.avatar-menu-item.muted { color: var(--text-2); }
.avatar-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.avatar-menu-header {
  padding: 8px 10px 4px;
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.main {
  flex: 1;
  padding: 28px 32px 80px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
}

/* ---- Cards ---- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-pad {
  padding: 20px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.metric {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-label {
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.metric-trend {
  font-size: 11px;
  color: var(--text-3);
}

.metric.success .metric-value { color: var(--success); }
.metric.warning .metric-value { color: var(--warning); }
.metric.danger .metric-value { color: var(--danger); }

.metric .pill-icon {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.metric.success .pill-icon { background: var(--success-bg); color: var(--success); }
.metric.warning .pill-icon { background: var(--warning-bg); color: var(--warning); }
.metric.danger .pill-icon { background: var(--danger-bg); color: var(--danger); }

/* ---- Tables ---- */

.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data thead th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  user-select: none;
  white-space: nowrap;
}

table.data thead th.sortable { cursor: pointer; }
table.data thead th.sortable:hover { color: var(--text); }
table.data thead th .sort-ind {
  margin-left: 4px;
  opacity: 0.6;
}

table.data tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

table.data tbody tr { transition: background 0.1s; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: none; }

.cell-muted { color: var(--text-2); }
.cell-mono { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }

/* ---- Badges & pills ---- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge.success { background: var(--success-bg); color: var(--success); }
.badge.warning { background: var(--warning-bg); color: var(--warning); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.neutral { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge.gold { background: rgba(200, 151, 58, 0.12); color: var(--gold); }
.badge.crimson { background: rgba(139, 0, 0, 0.18); color: #e88; }
.badge.dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.tag-sport {
  display: inline-block;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  font-weight: 500;
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.12s;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold);
  color: #1a1305;
  font-weight: 600;
}
.btn-primary:hover { background: #d6a346; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--border-2); }

.btn-ghost {
  color: var(--text-2);
}
.btn-ghost:hover { color: var(--text); background: var(--surface); }

.btn-danger {
  background: var(--crimson);
  color: var(--text);
}
.btn-danger:hover { background: #a40404; }

.btn-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(76, 175, 80, 0.2);
}
.btn-success:hover { background: #214d21; }

.btn-deny {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(229, 57, 53, 0.2);
}
.btn-deny:hover { background: #4d0000; }

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-xs {
  padding: 3px 7px;
  font-size: 11px;
  border-radius: 4px;
}

/* ---- Form ---- */

.input, .select, .textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text);
  transition: border-color 0.12s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--gold-soft);
}
.input::placeholder { color: var(--text-3); }

.field-label {
  display: block;
  font-size: 11px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-grid {
  display: grid;
  gap: 14px;
}
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ---- Progress bar ---- */

.progress {
  width: 90px;
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}
.progress-fill {
  height: 100%;
  background: var(--gold);
  transition: width 0.4s ease;
}

/* ---- Tabs ---- */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.12s;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--gold); }

/* ---- Login ---- */

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  background:
    radial-gradient(circle at 20% 30%, rgba(200, 151, 58, 0.06), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(139, 0, 0, 0.05), transparent 40%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 32px;
}

.login-mark {
  font-weight: 700;
  font-size: 18px;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.login-mark-dot {
  width: 12px;
  height: 12px;
  background: var(--gold);
  border-radius: 3px;
  transform: rotate(45deg);
}

.login-sub {
  color: var(--text-2);
  font-size: 12px;
  margin-bottom: 28px;
}

.login-field { margin-bottom: 14px; }

.login-help {
  text-align: center;
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-3);
}

/* ---- Role switcher (demo) ---- */

.role-switcher {
  position: fixed;
  bottom: 16px;
  left: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 100;
  width: 260px;
}

.role-switcher-head {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 8px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.role-switcher-head .demo-pill {
  background: rgba(200, 151, 58, 0.12);
  color: var(--gold);
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.role-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  width: 100%;
  text-align: left;
  font-size: 12px;
  color: var(--text-2);
}
.role-option:hover { background: var(--surface-2); color: var(--text); }
.role-option.active { background: var(--surface-2); color: var(--text); }

.role-option-marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-2);
  flex-shrink: 0;
}
.role-option.active .role-option-marker { background: var(--gold); border-color: var(--gold); }

.role-option-name { flex: 1; }
.role-option-who { font-size: 10px; color: var(--text-3); }

/* ---- Calendar (month) ---- */

.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.cal-head {
  background: var(--surface-2);
  padding: 8px 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.cal-cell {
  min-height: 92px;
  padding: 6px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
}
.cal-cell:nth-child(7n+1) { /* sundays */ }
.cal-cell.dim { background: rgba(0,0,0,0.2); }
.cal-cell.dim .cal-date { color: var(--text-3); }
.cal-cell.today { background: rgba(200, 151, 58, 0.04); }
.cal-cell.today .cal-date { color: var(--gold); font-weight: 700; }

.cal-date {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 500;
}

.cal-event {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.cal-event.away { background: rgba(200, 151, 58, 0.16); color: var(--gold); border-left: 2px solid var(--gold); }
.cal-event.home { background: rgba(139, 0, 0, 0.25); color: #f0a0a0; border-left: 2px solid var(--crimson); }
.cal-event.pending {
  background: transparent;
  border: 1px dashed var(--text-3);
  color: var(--text-2);
}

/* ---- Facilities grid ---- */

.facility-grid {
  display: grid;
  grid-template-columns: 130px repeat(16, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  font-size: 11px;
}

.fg-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px 4px;
  min-height: 40px;
  position: relative;
}

.fg-head {
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.04em;
}

.fg-row-label {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 500;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 12px;
}

.fg-block {
  position: absolute;
  inset: 4px 2px;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.fg-block.practice { background: var(--facility-blue); color: #cfe4ff; border-left: 2px solid var(--facility-blue-soft); }
.fg-block.game { background: rgba(139,0,0,0.5); color: #f0a0a0; border-left: 2px solid var(--crimson); }
.fg-block.pending {
  background-image: repeating-linear-gradient(45deg, rgba(200,151,58,0.18), rgba(200,151,58,0.18) 4px, transparent 4px, transparent 8px);
  border: 1px dashed var(--gold-soft);
  color: var(--gold);
}

.fg-block-team {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fg-block-meta { font-size: 9px; opacity: 0.85; font-weight: 500; }

/* ---- Approval cards ---- */

.approval-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.approval-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
}

.approval-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.approval-team {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.approval-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  font-size: 12px;
  color: var(--text-2);
}

.approval-meta dt { font-weight: 500; color: var(--text-3); }
.approval-meta dd { margin: 0; color: var(--text); }

.approval-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.approval-footer {
  font-size: 11px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 2px;
}

/* ---- Inline form ---- */

.inline-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.inline-form-head {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ---- Empty + skeleton ---- */

.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-2);
}
.empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--text-3);
}
.empty-title { color: var(--text); font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.empty-msg { font-size: 12px; margin-bottom: 14px; }

.skeleton-row {
  display: flex;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.skeleton-bar {
  height: 12px;
  background: linear-gradient(90deg, var(--surface-2), #1f1f1f, var(--surface-2));
  background-size: 400% 100%;
  animation: shimmer 1.2s linear infinite;
  border-radius: 3px;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* ---- Ledger ---- */

.ledger {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 0;
}

.ledger-inner {
  padding: 18px 24px;
}

.ledger-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
}

.ledger-stats {
  display: flex;
  gap: 24px;
  font-size: 12px;
  color: var(--text-2);
}
.ledger-stat strong { color: var(--text); font-weight: 600; }

/* ---- Drop zone ---- */

.drop-zone {
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  background: var(--surface);
  margin-bottom: 16px;
  transition: border-color 0.15s, background 0.15s;
}
.drop-zone:hover {
  border-color: var(--gold-soft);
  background: rgba(200, 151, 58, 0.03);
}
.drop-zone-title { font-weight: 600; margin-bottom: 4px; }
.drop-zone-sub { font-size: 12px; color: var(--text-2); margin-bottom: 14px; }

/* ---- Utility ---- */

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-gap-8 { display: flex; gap: 8px; align-items: center; }
.flex-gap-12 { display: flex; gap: 12px; align-items: center; }
.flex-col { display: flex; flex-direction: column; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  font-weight: 600;
  margin: 24px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title .count {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 10px;
  color: var(--text-2);
  letter-spacing: 0;
}

.spacer { flex: 1; }

.dim { color: var(--text-2); }
.crimson { color: #f0a0a0; }
.gold { color: var(--gold); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 12px;
  margin-bottom: 12px;
}
.back-link:hover { color: var(--text); }

.checkmark { color: var(--success); }
.crossmark { color: var(--danger); }

.tip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--gold);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-2);
  border-radius: 4px;
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--success);
  margin-left: 8px;
  animation: fadein 0.2s;
}
@keyframes fadein {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes lockIn {
  0% { background: rgba(200, 151, 58, 0.3); }
  100% { background: transparent; }
}
.lock-in { animation: lockIn 0.9s ease-out; }

/* responsive */
@media (max-width: 1024px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- SAF workflow stepper ---- */

.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.step {
  padding: 14px 16px;
  position: relative;
  border-right: 1px solid var(--border);
}
.step:last-child { border-right: none; }

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.step.done .step-num { background: var(--success-bg); color: var(--success); }
.step.current .step-num { background: var(--gold); color: #1a1305; }
.step.returned .step-num { background: var(--danger-bg); color: var(--danger); }

.step-label { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.step-meta { font-size: 11px; color: var(--text-3); }
.step.done .step-meta strong { color: var(--success); font-weight: 500; }
.step.current { background: rgba(200, 151, 58, 0.03); }
.step.current .step-label { color: var(--gold); }

/* ---- E-board ---- */

.eboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.eboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.eboard-head {
  display: flex;
  gap: 10px;
  align-items: center;
}
.eboard-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surface-2), #1f1f1f);
  border: 1px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  flex-shrink: 0;
}
.eboard-pos {
  font-size: 11px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.eboard-name { font-weight: 600; font-size: 14px; }
.eboard-meta {
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.eboard-card.primary {
  border-color: var(--gold-soft);
  background: linear-gradient(180deg, rgba(200,151,58,0.04), var(--surface));
}
.eboard-card.primary .eboard-avatar {
  background: rgba(200,151,58,0.15);
  color: var(--gold);
  border-color: var(--gold-soft);
}

/* ---- Tasks ---- */

.task-list {
  display: flex;
  flex-direction: column;
}
.task-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  padding: 14px 18px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.task-item:first-child { border-top: 1px solid var(--border); border-radius: 8px 8px 0 0; }
.task-item:last-child { border-radius: 0 0 8px 8px; }
.task-item:only-child { border-radius: 8px; }
.task-item:hover { background: var(--surface-2); }

.task-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.task-icon.gold { background: rgba(200, 151, 58, 0.12); color: var(--gold); }
.task-icon.crimson { background: rgba(139, 0, 0, 0.2); color: #f0a0a0; }
.task-icon.blue { background: rgba(26, 58, 92, 0.4); color: #8fbce0; }
.task-icon.success { background: var(--success-bg); color: var(--success); }
.task-icon.warning { background: var(--warning-bg); color: var(--warning); }

.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.task-sub { font-size: 12px; color: var(--text-2); }
.task-age {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}

/* ---- Modal ---- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 32px;
  overflow: auto;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-width: 820px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  overflow: hidden;
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}
.modal-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-body { padding: 0; overflow: auto; }
.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ---- Printable SAF ---- */

.saf-paper {
  background: white;
  color: #111;
  padding: 56px 64px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  line-height: 1.5;
}

.saf-paper h1 {
  font-size: 18px;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.saf-paper .saf-eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #888;
  font-weight: 600;
}
.saf-paper .saf-hr { height: 2px; background: #c8973a; margin: 14px 0 22px; }
.saf-paper .saf-section-h {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  font-weight: 700;
  border-bottom: 1px solid #ccc;
  padding-bottom: 4px;
  margin: 22px 0 10px;
}
.saf-paper .saf-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 4px 14px;
  padding: 4px 0;
  border-bottom: 1px dotted #ddd;
}
.saf-paper .saf-row dt { font-weight: 600; color: #444; }
.saf-paper .saf-row dd { margin: 0; color: #111; }
.saf-paper .saf-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; }
.saf-paper .saf-just {
  border: 1px solid #ccc;
  padding: 12px;
  min-height: 64px;
  margin-top: 6px;
  white-space: pre-wrap;
}
.saf-paper .saf-sigs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 26px;
}
.saf-paper .saf-sig-line {
  border-bottom: 1px solid #111;
  height: 36px;
  margin-bottom: 6px;
  font-family: 'Brush Script MT', cursive;
  font-size: 22px;
  color: #1a3a5c;
  padding-left: 6px;
  display: flex;
  align-items: flex-end;
}
.saf-paper .saf-sig-meta { font-size: 10px; color: #666; }
.saf-paper .saf-sig-name { font-size: 11px; font-weight: 700; color: #111; margin-top: 2px; }
.saf-paper .saf-footer {
  margin-top: 36px;
  padding-top: 12px;
  border-top: 1px solid #ddd;
  font-size: 9px;
  color: #888;
  display: flex;
  justify-content: space-between;
}
.saf-paper .saf-amount {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.saf-paper .saf-amount-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
}
.saf-paper .saf-cat {
  display: inline-block;
  border: 1px solid #c8973a;
  color: #8a6826;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}

@media print {
  body * { visibility: hidden; }
  .saf-print-root, .saf-print-root * { visibility: visible; }
  .saf-print-root {
    position: absolute !important;
    inset: 0 !important;
    background: white !important;
    padding: 0 !important;
    overflow: visible !important;
    max-height: none !important;
  }
  .modal-backdrop { background: white !important; padding: 0 !important; }
  .modal { box-shadow: none !important; border: none !important; max-width: none !important; max-height: none !important; }
  .modal-head, .modal-foot, .modal-noprint { display: none !important; }
  .saf-paper { padding: 24px 32px; }
  @page { size: letter; margin: 0.5in; }
}
