/* Reedin Admin — Shared Styles */
/* Brand: Hurme Geometric Sans 3 · Black #000 · Red #FF0000 · White #FFF */

@font-face {
  font-family: 'HurmeGeometric';
  src: url('../fonts/HurmeGeometricSans3-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'HurmeGeometric';
  src: url('../fonts/HurmeGeometricSans3-Black.woff2') format('woff2'),
       url('../fonts/HurmeGeometricSans3-Black.woff')  format('woff'),
       url('../fonts/HurmeGeometricSans3-Black.ttf')   format('truetype'),
       url('../fonts/HurmeGeometricSans3-Black.otf')   format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

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

:root {
  /* ── Brand palette ──────────────────────────── */
  --brand-black:    #000000;
  --brand-red:      #FF0000;
  --brand-white:    #FFFFFF;

  /* ── Sidebar ────────────────────────────────── */
  --sidebar-bg:     #000000;
  --sidebar-border: #222222;
  --sidebar-text:   #888888;
  --sidebar-active: #ffffff;
  --sidebar-hover:  #1a1a1a;
  --sidebar-width:  240px;

  /* ── Accent (Reedin Red) ─────────────────────── */
  --accent:         #FF0000;
  --accent-dark:    #CC0000;
  --accent-light:   #fff0f0;

  /* ── Content ─────────────────────────────────── */
  --bg:             #f5f5f5;
  --card-bg:        #ffffff;
  --border:         #e0e0e0;
  --text:           #000000;
  --text-muted:     #666666;

  /* ── Semantic ────────────────────────────────── */
  --danger:         #dc2626;
  --danger-light:   #fef2f2;
  --success:        #16a34a;
  --success-light:  #f0fdf4;
  --warning:        #d97706;
  --warning-light:  #fffbeb;

  /* ── Shape ───────────────────────────────────── */
  --radius:         4px;
  --radius-lg:      8px;
  --shadow:         0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg:      0 10px 28px rgba(0,0,0,.14);
}

html, body {
  height: 100%;
  font-family: 'HurmeGeometric', 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
}

/* ── Layout ─────────────────────────────────────────── */

.admin-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo .logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sidebar-logo .logo-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo .logo-icon img {
  width: 100%;
  height: auto;
  display: block;
  filter: brightness(0) invert(1); /* white version on black bg */
}

.sidebar-logo .logo-text {
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sidebar-logo .logo-sub {
  color: var(--sidebar-text);
  font-size: 11px;
  font-weight: 400;
}

.sidebar-section {
  padding: 16px 12px 8px;
}

.sidebar-section-label {
  color: var(--sidebar-text);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: 4px;
}

.sidebar-nav { list-style: none; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
}

.sidebar-nav a:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar-nav a.active {
  background: rgba(255,0,0,.12);
  color: var(--brand-red);
}

.sidebar-nav .nav-icon {
  width: 18px;
  text-align: center;
  opacity: .8;
  font-size: 15px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 12px;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
}

.sidebar-user .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-red);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  flex-shrink: 0;
}

.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { color: #fff; font-size: 13px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role { color: var(--sidebar-text); font-size: 11px; }

.btn-logout {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius);
  transition: color .15s;
  font-size: 15px;
}
.btn-logout:hover { color: var(--brand-red); }

/* ── Main content ───────────────────────────────────── */

.main-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.page-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-title { font-size: 18px; font-weight: 900; letter-spacing: -0.01em; }
.page-subtitle { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

.page-body { padding: 28px 32px; flex: 1; }

/* ── Buttons ────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
  text-decoration: none;
  text-transform: uppercase;
}

.btn-primary { background: var(--brand-red); color: #fff; border-color: var(--brand-red); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.btn-secondary { background: var(--card-bg); color: var(--text); border-color: #000; }
.btn-secondary:hover { background: var(--bg); }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; }

.btn-ghost { background: none; border-color: transparent; color: var(--text-muted); text-transform: none; font-weight: 400; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

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

/* ── Card ───────────────────────────────────────────── */

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

/* ── Table ──────────────────────────────────────────── */

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

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 900;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}
thead th:first-child { border-radius: var(--radius-lg) 0 0 0; }
thead th:last-child  { border-radius: 0 var(--radius-lg) 0 0; }

tbody tr { transition: background .1s; }
tbody tr:hover { background: #fafafa; }
tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }

/* ── Badge ──────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-kite       { background: #ede9fe; color: #7c3aed; }
.badge-wing       { background: #d1fae5; color: #065f46; }
.badge-board      { background: #fef3c7; color: #92400e; }
.badge-foilboard  { background: #fff7ed; color: #9a3412; }
.badge-bar        { background: #fee2e2; color: #991b1b; }
.badge-foil       { background: #f0fdf4; color: #166534; }
.badge-accessory  { background: #e0f2fe; color: #075985; }

/* contact types */
.badge-consumer   { background: #dbeafe; color: #1e40af; }
.badge-ambassador { background: #ede9fe; color: #6d28d9; }
.badge-team_rider { background: #ffedd5; color: #9a3412; }
.badge-dealer     { background: #d1fae5; color: #065f46; }
.badge-importer   { background: #cffafe; color: #155e75; }
.badge-staff      { background: #e5e7eb; color: #374151; }
.badge-friend     { background: #fce7f3; color: #9d174d; }
.badge-retail     { background: #f3f4f6; color: #4b5563; }
.badge-lead       { background: #fef3c7; color: #92400e; }
.badge-unknown    { background: #f3f4f6; color: #9ca3af; }

/* status pills */
.status-active    { color: var(--success); font-weight: 900; }
.status-inactive  { color: #9ca3af; }

/* registration statuses */
.badge-pending_review     { background: #fef3c7; color: #92400e; }
.badge-auto_processed     { background: #d1fae5; color: #065f46; }
.badge-manually_processed { background: #dbeafe; color: #1e40af; }
.badge-rejected           { background: #fee2e2; color: #991b1b; }

/* ── Searchable select ─────────────────────────────── */
.searchable-select { position: relative; }
.searchable-select .ss-input { width: 100%; padding-right: 32px; }
.searchable-select .ss-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; cursor: pointer; color: var(--text-muted);
  font-size: 14px; padding: 4px 6px;
}
.searchable-select .ss-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0;
  min-width: 100%; width: max-content; max-width: 480px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); max-height: 420px; overflow-y: auto;
  z-index: 50;
}
.searchable-select .ss-option {
  padding: 7px 12px; cursor: pointer; display: flex; align-items: baseline; gap: 8px;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}
.searchable-select .ss-option:last-child { border-bottom: 0; }
.searchable-select .ss-option:hover,
.searchable-select .ss-option.highlighted { background: var(--accent-light); }
.searchable-select .ss-label { font-weight: 400; color: var(--text); }
.searchable-select .ss-sublabel { color: var(--text-muted); font-size: 12px; }
.searchable-select .ss-empty { padding: 10px 12px; color: var(--text-muted); font-size: 13px; }
.searchable-select .ss-group-header {
  padding: 6px 12px 4px;
  font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); background: #fafafa;
  border-bottom: 1px solid var(--border); position: sticky; top: 0;
}

/* ── Dropzone (file upload) ────────────────────────── */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 18px; text-align: center; color: var(--text-muted);
  cursor: pointer; transition: all .15s;
  background: #fafafa;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent); background: var(--accent-light); color: var(--accent-dark);
}
.dropzone input[type="file"] { display: none; }
.dropzone-icon { font-size: 22px; margin-bottom: 4px; }

/* ── Review modal sections ─────────────────────────── */
.review-grid {
  display: grid; gap: 16px;
}
.review-section {
  background: #fafafa; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px;
}
.review-section h4 {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin-bottom: 8px; font-weight: 900;
}
.review-receipt-preview {
  width: 100%; height: 360px; border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff;
}
.review-receipt-preview iframe,
.review-receipt-preview embed,
.review-receipt-preview img {
  width: 100%; height: 100%; border: 0; display: block; object-fit: contain;
}
.owned-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 6px;
}
.owned-row .owned-check { color: var(--success); font-weight: 900; }
.owned-row .owned-info  { flex: 1; }
.owned-row .owned-meta  { color: var(--text-muted); font-size: 12px; }
.owned-form {
  background: #fff; border: 1px dashed var(--accent); border-radius: var(--radius);
  padding: 12px; margin-top: 8px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: end;
}
.owned-form .form-group { margin: 0; }
.owned-form .actions { grid-column: 1 / -1; display: flex; gap: 6px; justify-content: flex-end; }

/* pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: #fafafa;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-size: 13px;
  color: var(--text-muted);
  gap: 12px;
  flex-wrap: wrap;
}
.pagination-controls { display: flex; gap: 4px; align-items: center; }
.pagination .page-info { white-space: nowrap; }

/* filter search input */
.filter-search {
  flex: 1;
  min-width: 180px;
  max-width: 280px;
  padding: 6px 10px;
  font-size: 13px;
}

/* ── Wide detail modal ─────────────────────────────── */
.modal.modal-wide {
  max-width: 1100px;
  width: 95vw;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
}
@media (max-width: 800px) {
  .detail-grid { grid-template-columns: 1fr; }
}

.detail-section {
  margin-bottom: 24px;
}
.detail-section h3 {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.detail-grid-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
  font-size: 13px;
}
.detail-field { display: flex; flex-direction: column; gap: 2px; }
.detail-field .label { font-size: 11px; color: var(--text-muted); }
.detail-field .value { font-size: 13.5px; }

/* contacts mini-list */
.mini-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.mini-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.mini-list-row:last-child { border-bottom: none; }
.mini-list-row .name { flex: 1; font-weight: 400; }
.mini-list-row .meta { color: var(--text-muted); font-size: 12px; }

/* orders accordion */
.accordion { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.accordion-row {
  border-bottom: 1px solid var(--border);
}
.accordion-row:last-child { border-bottom: none; }
.accordion-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  background: #fff;
  transition: background .12s;
}
.accordion-header:hover { background: #fafafa; }
.accordion-header .order-num { font-weight: 900; min-width: 90px; }
.accordion-header .order-date { color: var(--text-muted); font-size: 12px; min-width: 90px; }
.accordion-header .order-total { margin-left: auto; font-weight: 400; }
.accordion-header .chev { font-size: 11px; color: var(--text-muted); width: 14px; }
.accordion-body {
  display: none;
  padding: 12px 14px;
  background: #fafafa;
  font-size: 12.5px;
}
.accordion-row.open .accordion-body { display: block; }
.accordion-row.open .accordion-header .chev { transform: rotate(90deg); }
.accordion-body table { font-size: 12.5px; }
.accordion-body th, .accordion-body td { padding: 6px 10px; }
.accordion-body thead th { background: transparent; }

/* Timeline */
.timeline {
  position: relative;
  padding-left: 16px;
  border-left: 2px solid var(--border);
}
.timeline-event {
  position: relative;
  padding-bottom: 14px;
  font-size: 12.5px;
}
.timeline-event::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
}
.timeline-event.event-order::before        { background: var(--success); }
.timeline-event.event-sync::before         { background: #6b7280; }
.timeline-event.event-create::before       { background: var(--warning); }
.timeline-event.event-registration::before { background: #7c3aed; }
.timeline-event.event-optin::before        { background: #0891b2; }
.timeline-event.event-ml-sync::before      { background: #6b7280; }
.timeline-event .ev-date { color: var(--text-muted); font-size: 11px; }
.timeline-event .ev-title { font-weight: 400; }

/* Scrollable timeline column */
.timeline-scroll {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

/* ── Detail tabs ──────────────────────────────────── */
.detail-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin: 20px 0 0;
}
.detail-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 14px;
  margin-bottom: -1px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .12s, border-color .12s;
  white-space: nowrap;
  font-family: inherit;
}
.detail-tab-btn:hover { color: var(--text); }
.detail-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.detail-tab-panel { padding-top: 14px; }

/* clickable text in tables */
.link-action {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-dark);
  cursor: pointer;
  font: inherit;
  text-align: left;
  text-decoration: none;
}
.link-action:hover { text-decoration: underline; }

/* inline-editable table cell input */
.inline-edit {
  width: 100%;
  min-width: 80px;
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: transparent;
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.inline-edit:hover { border-color: var(--border); background: #fff; }
.inline-edit:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,0,0,.10); background: #fff; }

/* ── Actions ────────────────────────────────────────── */

.row-actions { display: flex; gap: 6px; }

/* ── Relations page (grouped accordion) ─────────────── */

.rel-sort-bar {
  display: flex;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 2px solid var(--border);
  background: var(--bg);
  font-size: 10px;
  font-weight: 900;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  user-select: none;
}
.rel-sort-col { display: flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
.rel-sort-col:hover { color: var(--text); }
.rel-sort-col.sort-asc, .rel-sort-col.sort-desc { color: var(--text); }
.rel-col-toggle  { width: 28px; flex-shrink: 0; cursor: default; }
.rel-col-name    { flex: 1; min-width: 160px; }
.rel-col-type    { width: 110px; flex-shrink: 0; }
.rel-col-country { width: 80px; flex-shrink: 0; }
.rel-col-count   { width: 100px; flex-shrink: 0; justify-content: flex-end; }

.rel-group { border-bottom: 1px solid var(--border); }
.rel-group:last-child { border-bottom: none; }

.rel-group-header {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  font-size: 13.5px;
  transition: background .1s;
}
.rel-group-header:hover { background: var(--bg); }

.rel-chev { font-size: 10px; color: var(--text-muted); transition: transform .15s; display: inline-block; }
.rel-group.open .rel-chev { transform: rotate(90deg); }

.rel-group-body { display: none; border-top: 1px solid var(--border); background: var(--bg); }
.rel-group.open .rel-group-body { display: block; }
.rel-group-body table { margin: 0; width: auto; }
.rel-group-body th:first-child,
.rel-group-body td:first-child { min-width: 200px; }
.rel-group-body th {
  padding: 7px 14px 7px 42px;
  font-size: 10px; font-weight: 900;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.rel-group-body td { padding: 8px 14px 8px 42px; font-size: 13px; border-bottom: 1px solid var(--border); }
.rel-group-body tr:last-child td { border-bottom: none; }

/* ── Modal ──────────────────────────────────────────── */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(16px);
  transition: transform .2s;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 900; letter-spacing: -0.01em; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 20px; line-height: 1;
  padding: 2px; border-radius: var(--radius); transition: color .15s;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ── Form ───────────────────────────────────────────── */

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.form-label .req { color: var(--accent); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,0,0,.10);
}

/* ── Toast / alerts ─────────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
}

.toast {
  background: var(--brand-black);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  animation: slideIn .2s ease;
  max-width: 360px;
}
.toast.success { background: #14532d; }
.toast.error   { background: var(--danger); }

@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Sortable headers ───────────────────────────────── */

thead th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
thead th.sortable:hover { background: #f0f0f0; }

.sort-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity .15s;
}
thead th.sortable:hover .sort-arrow { opacity: .4; }
thead th.sort-asc  .sort-arrow,
thead th.sort-desc .sort-arrow { opacity: 1; color: var(--accent); }

/* ── Filter bar ─────────────────────────────────────── */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex-wrap: wrap;
}

.filter-select {
  width: auto;
  min-width: 140px;
  padding: 6px 10px;
  font-size: 13px;
}

.filter-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.active-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-light);
  color: var(--accent-dark);
  border: 1px solid rgba(255,0,0,.25);
  border-radius: 2px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ── Loading state ──────────────────────────────────── */

.loading-row td { text-align: center; padding: 40px; color: var(--text-muted); }
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ── Login page ─────────────────────────────────────── */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  padding: 24px;
}

.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  width: 100%;
  max-width: 380px;
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo .logo-circle {
  display: inline-block;
  margin-bottom: 16px;
}

.login-logo .logo-circle img {
  height: 36px;
  width: auto;
  display: block;
}

.login-logo h1 {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.login-logo p  { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.login-error {
  background: var(--danger-light);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.login-error.show { display: block; }

.btn-login {
  width: 100%;
  justify-content: center;
  padding: 10px;
  font-size: 14px;
  margin-top: 4px;
}
