/* ── Design tokens ── */
:root {
  --color-bg:           #1a1a2e;
  --color-card:         #16213e;
  --color-border:       #3d4f6f;
  --color-border-dark:  #2d4a70;
  --color-text:         #eee;
  --color-text-muted:   #aaa;
  --color-text-dim:     #6b7c93;
  --color-green:        #00b894;
  --color-green-hover:  #00a383;
  --color-red:          #d63031;
  --color-amber:        #fdcb6e;
  --color-error:        #ff6b6b;
}

/* ── Base ── */
body { background: var(--color-bg) !important; }

/* ── Flash messages ── */
.flash-messages {
  color: var(--color-error);
  background: #2d2d44;
  padding: 10px;
  border-radius: 8px;
  margin: 10px;
}
.flash-messages li { list-style: none; }

/* ── Page card (shared container used across all inner pages) ── */
.page-card {
  background: var(--color-card);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  margin-bottom: 24px;
}

.page-card h1 {
  color: var(--color-text);
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.page-card h2 {
  color: var(--color-text);
  font-size: 1.2rem;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border-dark);
}

/* ── Page wrapper ── */
.page-container {
  margin: 30px auto;
  padding: 0 16px;
}

/* ── Dark input ── */
.dark-input {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  padding: 10px 12px;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.dark-input:focus {
  outline: none;
  border-color: var(--color-green);
}

/* ── Form structure ── */
.field-group {
  margin-bottom: 16px;
}
.field-group label {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: 5px;
}

.form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.form-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.form-col label {
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

/* ── Error message ── */
.error-msg {
  color: var(--color-error);
  font-size: 0.82rem;
  margin-top: 4px;
}

/* ── Buttons ── */
.btn-primary-dark {
  background: var(--color-green);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary-dark:hover { background: var(--color-green-hover); }

.btn-danger-dark {
  background: var(--color-red);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}
.btn-danger-dark:hover { background: #c0392b; }

.btn-secondary-dark {
  background: var(--color-amber);
  color: #1a1a2e;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}
.btn-secondary-dark:hover { background: #f9b234; }

/* ── Dark table ── */
.dark-table {
  width: 100%;
  border-collapse: collapse;
}
.dark-table th {
  color: var(--color-text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-dark);
}
.dark-table td {
  color: #ddd;
  padding: 12px;
  border-bottom: 1px solid #1e3050;
  font-size: 0.9rem;
  vertical-align: middle;
}
.dark-table tr:last-child td { border-bottom: none; }
.dark-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Role badges ── */
.role-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}
.role-superuser   { background: #6c5ce7; color: white; }
.role-admin       { background: #0984e3; color: white; }
.role-user        { background: #2d4a70; color: #aaa;  }
.role-scalehouse  { background: #00cec9; color: #1a1a2e; }
.role-viewonly    { background: #636e72; color: #dfe6e9; }

/* ── Navbar ── */
.navbar-raptor { background: #0f0f23; }
.navbar-brand-raptor {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: 2px;
  line-height: 1;
}

/* ── Inline expand/collapse forms (admin users page) ── */
.inline-form      { display: none; margin-top: 8px; }
.inline-form.open { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Transaction status colours ── */
.action-available    { color: var(--color-green); }
.action-unavailable  { color: var(--color-red); }
.action-prioritized  { color: #ffd700; }
.action-reset-spaces { color: #a29bfe; }

/* ── Charts ── */
.chart             { display: flex; align-items: flex-end; }
.chart-bar-wrapper { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.chart-count       { margin-top: auto; line-height: 1; color: var(--color-text-dim); }
.chart-bar         { width: 100%; }
.chart-axis-label  { white-space: nowrap; color: var(--color-text-dim); }
.chart-axis-label--active { color: var(--color-text); }

.chart-bar--past    { background: #2d4a70; }
.chart-bar--current { background: var(--color-green); }
.chart-bar--today   { background: var(--color-green); }
.chart-bar--future  { background: #111827; }

.chart-hourly                  { height: 100px; gap: 2px; }
.chart-hourly .chart-bar-wrapper { gap: 2px; }
.chart-hourly .chart-count     { font-size: 0.6rem; }
.chart-hourly .chart-axis-label { font-size: 0.6rem; }
.chart-hourly .chart-bar       { border-radius: 2px 2px 0 0; }

.chart-weekly                  { height: 120px; gap: 8px; }
.chart-weekly .chart-bar-wrapper { gap: 4px; }
.chart-weekly .chart-count     { font-size: 0.72rem; }
.chart-weekly .chart-axis-label { font-size: 0.7rem; }
.chart-weekly .chart-bar       { border-radius: 4px 4px 0 0; transition: height 0.3s; }

/* ── Mobile page-card compression ── */
@media (max-width: 480px) {
  .page-card { margin: 12px; padding: 16px; }
  .dark-table th,
  .dark-table td { padding: 10px 4px; font-size: 0.8rem; }
}

/* ── Navbar dropdown ── */
.dropdown-menu-dark {
  background: var(--color-bg);
  border-color: var(--color-border);
}
.dropdown-menu-dark .dropdown-item       { color: var(--color-text); }
.dropdown-menu-dark .dropdown-item:hover { background: #2d3a4f; }
.dropdown-menu-dark .dropdown-divider    { border-color: var(--color-border); }
