/* ============================================================
   SFMS — Smart Futsal Management System
   Main Stylesheet
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
  --primary:       #1a6b3a;
  --primary-dark:  #124d2a;
  --primary-light: #25904f;
  --secondary:     #0d1b2a;
  --secondary-mid: #162333;
  --accent:        #f5c518;
  --accent-dark:   #d4a80e;
  --danger:        #e63946;
  --danger-dark:   #c0282f;
  --warning:       #fb8500;
  --warning-dark:  #d46f00;
  --success:       #2dc653;
  --success-dark:  #21a03e;
  --info:          #4895ef;
  --surface:       #1e2d3d;
  --surface-2:     #253547;
  --border:        #2e3f52;
  --text:          #e8f4f8;
  --text-muted:    #8fa8c0;
  --text-dim:      #5a7a96;

  --sidebar-w:     240px;
  --header-h:      60px;
  --radius:        8px;
  --radius-lg:     12px;
  --shadow:        0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg:     0 4px 20px rgba(0,0,0,0.5);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--secondary);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; color: var(--text); }

p { margin-bottom: 0.75rem; }
p:last-child { margin-bottom: 0; }

/* ---- Layout ---- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--secondary-mid);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.sidebar-brand .brand-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.sidebar-brand .brand-icon svg { width: 20px; height: 20px; fill: white; }

.sidebar-brand .brand-text { display: flex; flex-direction: column; }
.sidebar-brand .brand-name { font-weight: 700; font-size: 0.95rem; color: var(--text); line-height: 1.1; }
.sidebar-brand .brand-sub  { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.sidebar-nav { flex: 1; padding: 0.75rem 0; }

.nav-section { margin-bottom: 0.25rem; }
.nav-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 0.5rem 1rem 0.25rem;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  text-decoration: none;
  position: relative;
}

.nav-item:hover { background: var(--surface); color: var(--text); text-decoration: none; }

.nav-item.active {
  background: rgba(26, 107, 58, 0.2);
  color: var(--primary-light);
  border-right: 3px solid var(--primary-light);
}

.nav-item .nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.8; }
.nav-item.active .nav-icon { opacity: 1; }

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 700;
}

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ---- Main Content ---- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Page Header ---- */
.page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  position: sticky; top: 0; z-index: 50;
}

.page-title { font-size: 1.15rem; font-weight: 700; }
.page-subtitle { font-size: 0.8rem; color: var(--text-muted); margin-top: 1px; }

.page-actions { display: flex; gap: 0.5rem; align-items: center; flex-shrink: 0; }

/* ---- Breadcrumb ---- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--secondary-mid);
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb .sep { opacity: 0.4; }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* ---- Page Body ---- */
.page-body { padding: 1.5rem; flex: 1; }

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

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

.card-title { font-size: 0.95rem; font-weight: 700; }
.card-subtitle { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.card-body { padding: 1.25rem; }
.card-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon.green  { background: rgba(26,107,58,0.2); color: var(--primary-light); }
.stat-icon.yellow { background: rgba(245,197,24,0.2); color: var(--accent); }
.stat-icon.red    { background: rgba(230,57,70,0.2); color: var(--danger); }
.stat-icon.blue   { background: rgba(72,149,239,0.2); color: var(--info); }
.stat-icon.orange { background: rgba(251,133,0,0.2); color: var(--warning); }

.stat-icon svg { width: 22px; height: 22px; }

.stat-info { flex: 1; }
.stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1; color: var(--text); }
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; }
.stat-trend { font-size: 0.72rem; margin-top: 4px; }
.stat-trend.up   { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ---- Grid ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead tr {
  background: var(--surface-2);
  border-bottom: 2px solid var(--border);
}

thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

thead th.th-center { text-align: center; }
thead th.th-right  { text-align: right; }

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.03); }

tbody td {
  padding: 0.75rem 1rem;
  color: var(--text);
  vertical-align: middle;
}

tbody td.td-center { text-align: center; }
tbody td.td-right  { text-align: right; }
tbody td.td-muted  { color: var(--text-muted); font-size: 0.82rem; }
tbody td.td-num    { font-weight: 700; font-size: 1rem; }

.table-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
}
.table-empty .empty-icon { font-size: 2.5rem; margin-bottom: 0.5rem; opacity: 0.4; }
.table-empty p { font-size: 0.875rem; }

/* Standings special styles */
.standing-rank {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem;
}
.rank-1 { background: var(--accent); color: #000; }
.rank-2 { background: #c0c0c0; color: #000; }
.rank-3 { background: #cd7f32; color: #fff; }
.rank-n { background: var(--border); color: var(--text-muted); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover { opacity: 0.9; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary   { background: var(--primary);   color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger    { background: var(--danger);     color: white; }
.btn-danger:hover  { background: var(--danger-dark);  }
.btn-warning   { background: var(--warning);    color: white; }
.btn-warning:hover { background: var(--warning-dark); }
.btn-success   { background: var(--success);    color: white; }
.btn-success:hover { background: var(--success-dark); }
.btn-accent    { background: var(--accent);     color: #000; font-weight: 700; }
.btn-accent:hover  { background: var(--accent-dark); }
.btn-secondary { background: var(--surface-2);  color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-ghost     { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface); color: var(--text); }

.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { padding: 0.7rem 1.5rem; font-size: 1rem; }
.btn-icon { padding: 0.45rem; aspect-ratio: 1; }

.btn-group { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-success   { background: rgba(45,198,83,0.18);   color: var(--success); }
.badge-danger    { background: rgba(230,57,70,0.18);   color: var(--danger); }
.badge-warning   { background: rgba(251,133,0,0.18);   color: var(--warning); }
.badge-info      { background: rgba(72,149,239,0.18);  color: var(--info); }
.badge-accent    { background: rgba(245,197,24,0.18);  color: var(--accent); }
.badge-secondary { background: var(--border);           color: var(--text-muted); }
.badge-live      { background: var(--danger); color: white; animation: pulse-live 1.2s infinite; }

@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

/* Event type badges */
.event-gol          { color: var(--success); }
.event-kartu-kuning { color: var(--accent); }
.event-kartu-merah  { color: var(--danger); }
.event-foul         { color: var(--warning); }

/* ---- Forms ---- */
.form-group { margin-bottom: 1rem; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

label .req { color: var(--danger); margin-left: 2px; }

input[type=text], input[type=number], input[type=email],
input[type=date], input[type=time], input[type=search],
select, textarea {
  width: 100%;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  padding: 0.55rem 0.85rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(26,107,58,0.25);
}

input::placeholder, textarea::placeholder { color: var(--text-dim); }

select option { background: var(--secondary); color: var(--text); }

textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

.input-icon { position: relative; }
.input-icon input { padding-left: 2.4rem; }
.input-icon .icon {
  position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
  color: var(--text-dim); pointer-events: none;
  width: 16px; height: 16px;
}

.form-hint { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.25rem; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 0.25rem; }

/* Color swatch */
input[type=color] {
  width: 100%; height: 40px;
  padding: 2px 4px;
  cursor: pointer;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  backdrop-filter: blur(2px);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90vw; max-width: 560px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.2s;
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }

.modal-lg { max-width: 780px; }
.modal-xl { max-width: 1000px; }

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-title { font-size: 1rem; font-weight: 700; }

.modal-close {
  width: 30px; height: 30px;
  border: none; background: transparent;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  font-size: 1.25rem; line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }

.modal-body { padding: 1.25rem; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 0.5rem;
  flex-shrink: 0;
}

/* ---- Toast ---- */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  z-index: 9999; pointer-events: none;
}

.toast {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  max-width: 320px;
  pointer-events: all;
  opacity: 0; transform: translateX(40px);
  transition: opacity 0.25s, transform 0.25s;
  border-left: 3px solid transparent;
}
.toast.toast-show  { opacity: 1; transform: translateX(0); }
.toast.toast-hide  { opacity: 0; transform: translateX(40px); }

.toast-success { background: var(--surface-2); border-left-color: var(--success); }
.toast-error   { background: var(--surface-2); border-left-color: var(--danger);  }
.toast-warning { background: var(--surface-2); border-left-color: var(--warning); }
.toast-info    { background: var(--surface-2); border-left-color: var(--info);    }

.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--success); }
.toast-error   .toast-icon { color: var(--danger);  }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info    .toast-icon { color: var(--info);    }

/* ---- Confirm Dialog ---- */
.confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s;
}
.confirm-overlay.confirm-show { opacity: 1; pointer-events: all; }

.confirm-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  max-width: 400px; width: 90vw;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.15s;
}
.confirm-overlay.confirm-show .confirm-box { transform: scale(1); }
.confirm-msg { font-size: 0.9rem; margin-bottom: 1.25rem; line-height: 1.6; }
.confirm-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }

/* ---- Score Display ---- */
.score-display {
  display: flex; align-items: center; gap: 0.75rem;
  justify-content: center;
}
.score-team { text-align: center; flex: 1; max-width: 160px; }
.score-team-name { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; line-height: 1.2; }
.score-num {
  font-size: 3rem; font-weight: 900; line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.score-sep { font-size: 2rem; color: var(--text-dim); font-weight: 300; }

/* ---- Match Card ---- */
.match-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.match-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.match-card.live  { border-color: var(--danger); }

.match-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.75rem; color: var(--text-muted);
}

.match-teams {
  display: flex; align-items: center; gap: 0.75rem;
}
.match-team { flex: 1; text-align: center; }
.match-team-name { font-weight: 700; font-size: 0.9rem; line-height: 1.2; }
.match-score-box {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--secondary); border-radius: var(--radius);
  padding: 0.4rem 0.75rem;
}
.match-score { font-size: 1.75rem; font-weight: 900; min-width: 28px; text-align: center; line-height: 1; font-variant-numeric: tabular-nums; }
.match-score-vs { font-size: 0.75rem; color: var(--text-dim); }

/* ---- Team Color Dot ---- */
.team-dot {
  width: 12px; height: 12px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.2);
}

/* ---- Event Timeline ---- */
.event-list { display: flex; flex-direction: column; gap: 0.4rem; }

.event-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  background: var(--secondary-mid);
  font-size: 0.82rem;
}
.event-time { font-weight: 700; min-width: 36px; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.event-icon { font-size: 1rem; flex-shrink: 0; }
.event-desc { flex: 1; }
.event-team-tag { font-size: 0.72rem; color: var(--text-dim); }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.tab-btn {
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem; font-weight: 600;
  color: var(--text-muted);
  background: none; border: none; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  font-family: var(--font);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary-light); border-bottom-color: var(--primary-light); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- Filters / Search bar ---- */
.filter-bar {
  display: flex; gap: 0.75rem; align-items: center;
  flex-wrap: wrap; margin-bottom: 1rem;
}

.filter-bar input, .filter-bar select { flex: 1; min-width: 160px; max-width: 280px; }
.filter-bar .spacer { flex: 1; }

/* ---- Jersey Avatar ---- */
.jersey-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.75rem;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.15);
}

/* ---- Foul counter ---- */
.foul-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border);
  display: inline-block;
}
.foul-dot.active { background: var(--warning); }
.foul-dot.penalti { background: var(--danger); }
.foul-dots { display: flex; gap: 3px; align-items: center; }

/* ---- Loading / Splash ---- */
.splash-screen {
  position: fixed; inset: 0;
  background: var(--secondary);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1.5rem; z-index: 9999;
}

.splash-logo svg { width: 72px; height: 72px; }
.splash-title { font-size: 1.5rem; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.splash-sub   { font-size: 0.85rem; color: var(--text-muted); }

.progress-bar-wrap {
  width: 260px; height: 4px;
  background: var(--border); border-radius: 999px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  animation: progress-fill 1.4s ease-in-out forwards;
}
@keyframes progress-fill { from { width: 0; } to { width: 100%; } }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ---- Utilities ---- */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap { display: flex; gap: 0.75rem; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.gap-xs { gap: 0.25rem; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-dim    { color: var(--text-dim); }
.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.72rem; }
.text-lg { font-size: 1.1rem; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.p-0 { padding: 0 !important; }
.separator { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.hidden { display: none !important; }

/* Accent highlight */
.highlight { color: var(--accent); }
.text-primary { color: var(--primary-light); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

/* ---- Print Styles ---- */
@media print {
  .sidebar, .page-header, .breadcrumb, .page-actions,
  .btn, .filter-bar, #toast-container, .modal-overlay { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-body { padding: 0 !important; }
  body { background: white !important; color: black !important; }
  .card { border: 1px solid #ccc !important; box-shadow: none !important; background: white !important; }
  table { font-size: 11pt; }
  thead tr { background: #f0f0f0 !important; }
  tbody td, thead th { color: black !important; border-color: #ccc !important; }
  .badge { border: 1px solid #999 !important; color: black !important; background: white !important; }
}

/* ---- Responsive (min 1024px target, degrade gracefully) ---- */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  :root { --sidebar-w: 200px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 56px; }
  .nav-item span,
  .sidebar-brand .brand-text,
  .nav-section-label,
  .sidebar-footer { display: none; }
  .nav-item { justify-content: center; padding: 0.75rem; }
  .sidebar-brand { justify-content: center; padding: 1rem 0.5rem; }
  .grid-2, .grid-3, .form-row { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
