/* ============================================================
   Ducenta Squared Asset Management — UI Design System
   Aesthetic: Institutional-grade, dark sidebar, clean data
   Fonts: DM Sans (UI) + DM Mono (numbers/code)
   ============================================================ */

:root {
  --bg:           #f5f6f8;
  --surface:      #ffffff;
  --surface-2:    #f0f2f5;
  --border:       #e2e5ea;
  --border-strong:#cdd2db;

  --sidebar-bg:   #0e1c2f;
  --sidebar-hover:#162940;
  --sidebar-active:#1e3a58;
  --sidebar-text: #94a9c0;
  --sidebar-text-active: #e8f0f8;

  --navy:         #1a3a5c;
  --blue:         #2e6da4;
  --blue-light:   #4a9fd4;
  --blue-pale:    #ddeef8;

  --text-primary: #1a2332;
  --text-secondary:#4e5f72;
  --text-muted:   #8596a8;

  --green:        #1a7f4b;
  --green-bg:     #e8f6ee;
  --red:          #b53535;
  --red-bg:       #fceaea;
  --amber:        #8a5c00;
  --amber-bg:     #fff4d6;

  --radius:       8px;
  --radius-sm:    5px;
  --sidebar-w:    240px;
  --shadow:       0 1px 4px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.05);
  --shadow-card:  0 2px 8px rgba(0,0,0,.06);
}

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

html { font-size: 15px; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  line-height: 1.55;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  border-right: 1px solid rgba(255,255,255,.05);
}

.sidebar-brand {
  padding: 1.4rem 1.25rem 1.2rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.brand-abbr {
  width: 36px; height: 36px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .03em;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.brand-name {
  color: #e0eaf5;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.2;
}

.nav-links {
  list-style: none;
  padding: .75rem 0;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem 1.25rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: all .15s;
  border-left: 3px solid transparent;
}

.nav-link svg {
  width: 16px; height: 16px;
  flex-shrink: 0;
  opacity: .7;
}

.nav-link:hover {
  color: var(--sidebar-text-active);
  background: var(--sidebar-hover);
}

.nav-link.active {
  color: var(--sidebar-text-active);
  background: var(--sidebar-active);
  border-left-color: var(--blue-light);
}

.nav-link.active svg { opacity: 1; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.07);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .6rem;
  font-size: .8rem;
  color: var(--sidebar-text);
  text-decoration: none;
}

.user-chip:hover { color: #fff; }

.user-role-badge {
  padding: 2px 7px;
  border-radius: 3px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.role-admin    { background: #2e5ca4; color: #cfe2ff; }
.role-employee { background: #1a5c3a; color: #c9f0db; }
.role-guest    { background: #5c4a1a; color: #f5e4b0; }

.logout-btn {
  display: block;
  font-size: .8rem;
  color: #6a8099;
  text-decoration: none;
  transition: color .15s;
}
.logout-btn:hover { color: #94b4cc; }

/* ── Main content ─────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2rem 2.25rem;
  min-height: 100vh;
}

/* ── Page header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -.01em;
}

.page-sub {
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: .2rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-narrow { max-width: 680px; }

.card-header {
  padding: 1rem 1.25rem .85rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-sub {
  font-size: .8rem;
  color: var(--text-muted);
}

/* ── Profile grid ─────────────────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
  max-width: 1000px;
}

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

/* ── Dashboard grid ───────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.25rem;
  align-items: start;
}

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

.chart-card .chart-wrap { height: 300px; padding: 1rem; }

.strategy-table-wrap { border-top: 1px solid var(--border); overflow-x: auto; }

.strategy-summary-table { width: 100%; }

.strategy-summary-table thead th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
  padding: .5rem .5rem;
  border-bottom: 1px solid var(--border);
}

.strategy-summary-table tbody td {
  padding: .45rem .5rem;
  font-size: .78rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.strategy-summary-table tbody tr:last-child td { border-bottom: none; }

.strategy-swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: .45rem;
  vertical-align: middle;
  flex-shrink: 0;
}
.chart-card-wide .chart-wrap-wide { height: 280px; padding: 1rem; }
.table-card { overflow: hidden; }

/* ── Tables ───────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; }
.table-scroll-limited {
  /* Keep clients tables in a dedicated scroll area with a consistent height. */
  display: block;
  height: clamp(360px, calc(100dvh - 300px), 72dvh);
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
}

.data-table th {
  background: var(--surface-2);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: .75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .65rem 1rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  /* Stick headers when the table container scrolls vertically */
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table td {
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8f9fb; }

.th-sortable {
  cursor: pointer;
  user-select: none;
}
.th-sortable:hover { background: #e8eaef; }
.th-sortable::after {
  content: ' ⇅';
  opacity: 0.25;
  font-size: .7rem;
  font-weight: 400;
}
.th-sortable.sort-active::after { opacity: 1; }
.th-sortable[data-dir="asc"].sort-active::after  { content: ' ↑'; }
.th-sortable[data-dir="desc"].sort-active::after { content: ' ↓'; }

/* Compact search input that fits inside card-header flex rows */
.table-search {
  width: 180px;
  padding: .35rem .65rem;
  font-size: .82rem;
}

.total-row td {
  background: var(--surface-2);
  border-top: 2px solid var(--border-strong);
  font-size: .85rem;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem 1rem !important;
  font-size: .85rem;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.btn-primary:hover { background: var(--navy); border-color: var(--navy); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

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

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

.btn-sm { padding: .3rem .7rem; font-size: .78rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { width: 14px; height: 14px; }

/* ── Forms ────────────────────────────────────────────────── */
.form-stacked { padding: 1.5rem; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.span-full { grid-column: 1 / -1; }
.form-divider {
  grid-column: 1 / -1;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 1rem 0 .25rem;
  border-top: 1px solid var(--border);
  margin-top: .5rem;
}
.form-actions {
  display: flex;
  gap: .75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.field-group { display: flex; flex-direction: column; gap: .35rem; }
.field-label { font-size: .8rem; font-weight: 600; color: var(--text-secondary); }
.field-help  { font-size: .75rem; color: var(--text-muted); }
.field-error { font-size: .78rem; color: var(--red); }

.form-input, .select-input, select, input[type=text],
input[type=email], input[type=password], input[type=date],
input[type=number], textarea {
  width: 100%;
  padding: .45rem .75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text-primary);
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}

.form-input:focus, .select-input:focus, select:focus,
input:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46,109,164,.12);
}

.select-input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238596a8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2rem; }

.inline-form {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem;
}

/* ── Filters ──────────────────────────────────────────────── */
.filter-bar { padding: 1.25rem; margin-bottom: 1.25rem; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .85rem;
  margin-bottom: 1rem;
}

/* ── Toggle switch ────────────────────────────────────────── */
.pill-toggle {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  cursor: pointer;
  user-select: none;
  color: var(--text-secondary);
  font-size: .84rem;
  font-weight: 600;
}

.pill-toggle-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.pill-toggle-switch {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #d2d9e3;
  border: 1px solid #c4ccd8;
  position: relative;
  transition: background .18s ease, border-color .18s ease;
}

.pill-toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.22);
  transition: transform .18s ease;
}

.pill-toggle-input:checked + .pill-toggle-switch {
  background: var(--blue);
  border-color: var(--blue);
}

.pill-toggle-input:checked + .pill-toggle-switch::after {
  transform: translateX(18px);
}

.pill-toggle-input:focus-visible + .pill-toggle-switch {
  box-shadow: 0 0 0 3px rgba(46,109,164,.2);
}

.pill-toggle-label {
  line-height: 1.1;
}

/* ── Tabs ─────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: .25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.25rem;
}

.tab-btn {
  padding: .55rem 1.1rem;
  font-size: .875rem;
  font-weight: 500;
  font-family: inherit;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
}

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

/* ── Stats row ────────────────────────────────────────────── */
.stats-row {
  display: flex;
  gap: .85rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 130px;
  flex: 1;
}

.stat-green { border-left: 3px solid var(--green); }
.stat-red   { border-left: 3px solid var(--red); }
.stat-amber { border-left: 3px solid #d4890a; }

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  color: var(--text-primary);
  letter-spacing: -.02em;
}

.stat-label {
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-secondary);
  white-space: nowrap;
}

.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.badge-amber  { background: var(--amber-bg);  color: var(--amber); }
.badge-gray   { background: var(--surface-2); color: var(--text-muted); }

.action-insert { background: var(--green-bg); color: var(--green); }
.action-update { background: var(--blue-pale); color: var(--blue); }
.action-delete { background: var(--red-bg);   color: var(--red); }

/* ── Alert banner ─────────────────────────────────────────── */
.alert-banner {
  padding: .75rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid #8ad4ae; }
.alert-error   { background: var(--red-bg);   color: var(--red);   border: 1px solid #f0aaaa; }
.alert-info    { background: var(--blue-pale); color: var(--blue);  border: 1px solid #a8ceea; }
.alert-warn    { color: #b06a00; }

.messages-container { margin-bottom: 1.25rem; }
.message { padding: .75rem 1rem; border-radius: var(--radius-sm); font-size: .875rem; margin-bottom: .5rem; }

/* ── Typography helpers ───────────────────────────────────── */
.font-mono { font-family: 'DM Mono', monospace; font-size: .8rem; }
.text-right { text-align: right; }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.text-warn  { color: #b06a00; }

/* ── Login page ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  width: 100%;
  background: var(--sidebar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
  width: 380px;
  padding: 2.25rem 2rem;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.logo-mark {
  width: 44px; height: 44px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}

.login-firm {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.login-subtitle {
  font-size: .8rem;
  color: var(--text-muted);
}

.login-form { display: flex; flex-direction: column; gap: .85rem; }

.login-footer-link {
  margin-top: 1.25rem;
  text-align: center;
  font-size: .82rem;
  color: var(--text-muted);
}

.login-footer-link a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}

.login-footer-link a:hover { text-decoration: underline; }

/* ── Expandable account rows ──────────────────────────────── */
.aum-data-row { cursor: pointer; }
.aum-data-row:hover { background: var(--surface-2); }
.aum-data-row.is-open { background: var(--blue-pale); }

.aum-account-cell { display: flex; align-items: center; gap: .4rem; }

.row-expand-icon {
  display: inline-block;
  width: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: .75rem;
  transition: transform .15s;
}
.row-expand-icon::before { content: '›'; font-weight: 700; }
.aum-data-row.is-open .row-expand-icon { transform: rotate(90deg); color: var(--blue); }

.holdings-detail-row td { padding: 0; background: var(--surface-2); }

.holdings-detail-wrap { padding: .75rem 1rem .75rem 2rem; }

.holdings-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
}
.holdings-mini-table th {
  font-size: .69rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  padding: .3rem .6rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.holdings-mini-table td {
  padding: .3rem .6rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.holdings-mini-table tbody tr:last-child td { border-bottom: none; }
.holdings-mini-table tbody tr:hover { background: var(--surface); }

.holdings-loading, .holdings-empty {
  font-size: .8rem;
  color: var(--text-muted);
  padding: .5rem 0;
  margin: 0;
}

/* ── Feature Requests ─────────────────────────────────────── */
.fr-form-card { margin-bottom: 0; }

.fr-form { padding: 1.25rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: 1rem; }

.fr-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 800px) { .fr-form-row { grid-template-columns: 1fr; } }

.fr-textarea {
  min-height: 110px;
  resize: vertical;
}

.fr-form-actions { display: flex; justify-content: flex-end; }

.fr-desc-cell {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
}

/* Status dropdown */
.fr-status-select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-radius: 1rem;
  padding: .25rem .75rem;
  font-size: .75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .55rem center;
  padding-right: 1.6rem;
}

.fr-status-select.status-submitted    { background-color: #e8f0fe; color: #1a3a8f; }
.fr-status-select.status-inprogress   { background-color: #fff8e1; color: #7a5c00; }
.fr-status-select.status-onhold       { background-color: #f3e5f5; color: #6a1b9a; }
.fr-status-select.status-completed    { background-color: #e8f5e9; color: #1b5e20; }
.fr-status-select.status-cancelled    { background-color: #fce4ec; color: #880e4f; }

.fr-action-cell { width: 36px; text-align: center; }
.user-actions-cell { white-space: nowrap; display: flex; gap: .4rem; align-items: center; }

/* ── Client Relations status badges ─────────────────────────────────────── */
.cr-status-active   { background: #e8f5e9; color: #1b5e20; border-radius: 4px; padding: .15rem .5rem; font-size: .78rem; font-weight: 600; }
.cr-status-inactive { background: #f1f3f5; color: #6b7280; border-radius: 4px; padding: .15rem .5rem; font-size: .78rem; font-weight: 600; }
.cr-status-hold     { background: #fff8e1; color: #7a5c00; border-radius: 4px; padding: .15rem .5rem; font-size: .78rem; font-weight: 600; }

/* Follow-up date highlights */
td.fu-soon    { background: #fff8e1; color: #7a5c00; font-weight: 600; }
td.fu-overdue { background: #fdecea; color: #b71c1c; font-weight: 600; }

.btn-icon-only {
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s;
}
.btn-icon-only:hover { color: var(--blue); background: var(--blue-pale); }

/* Modal */
.fr-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.fr-modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0,0,0,.3);
  width: min(680px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
}

.fr-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.fr-modal-header .btn-icon-only {
  font-size: 1.4rem;
  line-height: 1;
  padding: .1rem .4rem;
}

/* ── Usage / Audit ──────────────────────────────────────────────────────── */
.usage-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.usage-stat-card {
  text-align: center;
  padding: 1.5rem 1rem;
}

.usage-stat-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--blue);
  font-family: 'DM Mono', monospace;
  line-height: 1;
}

.usage-stat-warn .usage-stat-value { color: var(--red); }

.usage-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.usage-tables-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.5rem;
}

.usage-role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
}
.usage-role-badge.role-admin    { background: #e8f0fe; color: #1a3a8f; }
.usage-role-badge.role-employee { background: var(--green-bg); color: var(--green); }
.usage-role-badge.role-guest    { background: var(--surface-2); color: var(--text-secondary); }

.audit-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}
.audit-badge.audit-login        { background: var(--green-bg); color: var(--green); }
.audit-badge.audit-logout       { background: var(--surface-2); color: var(--text-secondary); }
.audit-badge.audit-page         { background: var(--blue-pale); color: var(--navy); }
.audit-badge.audit-login_failed { background: var(--red-bg); color: var(--red); }

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