/* ── Base CSS — Dental Inventory System ────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  /* Brand */
  --blue-950: #0f1f4a;
  --blue-900: #1e3a8a;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;

  /* Neutrals */
  --gray-950: #030712;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;
  --white:    #ffffff;

  /* Status */
  --green-600: #16a34a;
  --green-100: #dcfce7;
  --green-50:  #f0fdf4;
  --yellow-600: #ca8a04;
  --yellow-100: #fef9c3;
  --amber-600: #d97706;
  --amber-100: #fef3c7;
  --red-600:   #dc2626;
  --red-100:   #fee2e2;
  --red-50:    #fef2f2;
  --purple-600: #7c3aed;
  --purple-100: #ede9fe;

  /* Semantic */
  --color-bg:          var(--gray-50);
  --color-surface:     var(--white);
  --color-border:      var(--gray-200);
  --color-text:        var(--gray-900);
  --color-text-muted:  var(--gray-500);
  --color-primary:     var(--blue-600);
  --color-primary-hover: var(--blue-700);

  /* Sidebar */
  --sidebar-width: 240px;
  --sidebar-bg: var(--blue-950);
  --sidebar-text: #c7d7f5;
  --sidebar-active: var(--blue-600);

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Radius */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow:    0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);

  /* Typography */
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'Courier New', monospace;
  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 15px;
  --text-lg:   17px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  30px;

  /* Transition */
  --transition: 150ms ease;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

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

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

/* ── Page transitions ───────────────────────────────────────────────────────── */
@keyframes page-enter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  animation: page-enter 220ms ease both;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-body {
  padding: var(--space-8);
  flex: 1;
}

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-logo {
  padding: var(--space-6) var(--space-5);
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--blue-600);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  color: var(--white);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.2;
}

.sidebar-logo .logo-sub {
  color: var(--sidebar-text);
  font-size: var(--text-xs);
  opacity: 0.7;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) 0;
  scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section {
  margin-bottom: var(--space-4);
}

.nav-section-label {
  color: var(--sidebar-text);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 var(--space-5) var(--space-2);
  opacity: 0.5;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-5);
  color: var(--sidebar-text);
  font-size: var(--text-sm);
  font-weight: 450;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, padding-left 180ms ease;
  border-radius: 0;
  text-decoration: none;
  position: relative;
  z-index: 1;
}

.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: var(--white);
  padding-left: calc(var(--space-5) + 3px);
  text-decoration: none;
}

.nav-item:active {
  padding-left: calc(var(--space-5) + 1px);
  background: rgba(255,255,255,.10);
  transition: background 80ms ease, color 80ms ease, padding-left 80ms ease;
}

.nav-item.active {
  color: var(--white);
  font-weight: 500;
  padding-left: calc(var(--space-5) + 4px);
  overflow: hidden;
}

/* Skewed fill — contained within the nav item */
.nav-item.active::after {
  content: '';
  position: absolute;
  inset: 0;
  left: -16px;
  right: -8px;
  background: var(--blue-700);
  transform-origin: left center;
  transform: skewX(-14deg);
  z-index: -1;
  animation: nav-wipe 480ms cubic-bezier(.22,1,.36,1) both;
}

@keyframes nav-wipe {
  from { transform: skewX(-14deg) translateX(-115%); }
  to   { transform: skewX(-14deg) translateX(0%); }
}

/* Unified fill+bulge on .sidebar — expands leftward from the right edge bump */
.nav-active-fill {
  position: absolute;
  right: -16px;
  width: 16px;
  background: var(--blue-700);
  border-radius: 0 8px 8px 0;
  pointer-events: none;
  z-index: 0;
  transition: top    420ms cubic-bezier(.22,1,.36,1),
              height 420ms cubic-bezier(.22,1,.36,1);
}

.nav-active-fill.settled {
  animation: nav-fill-wipe 800ms cubic-bezier(.25,.1,.25,1) both;
}

@keyframes nav-fill-wipe {
  0%   { width: 16px; }
  100% { width: calc(100% + 16px); }
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--blue-500);
  border-radius: 0 2px 2px 0;
  z-index: 1;
  animation: nav-indicator 400ms cubic-bezier(.22,1,.36,1) 120ms both;
}

@keyframes nav-indicator {
  from { opacity: 0; transform: scaleY(.3); }
  to   { opacity: 1; transform: scaleY(1); }
}

.nav-icon {
  width: 18px; height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon { opacity: 1; }

.nav-item:hover .nav-icon { transform: scale(1.1); }
.nav-item:active .nav-icon { transform: scale(1.02); transition: transform 80ms ease; }

.nav-badge {
  margin-left: auto;
  background: var(--red-600);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
  line-height: 16px;
  transition: transform 200ms ease, background 200ms ease;
}

.nav-item:hover .nav-badge { transform: scale(1.1); }

.sidebar-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius);
  transition: background 180ms ease, gap 180ms ease;
}

.sidebar-user:hover {
  background: rgba(255,255,255,.06);
  gap: calc(var(--space-3) + 2px);
}

.user-avatar {
  width: 32px; height: 32px;
  background: var(--blue-700);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: var(--text-sm);
  font-weight: 600;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name {
  color: var(--white);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  color: var(--sidebar-text);
  font-size: var(--text-xs);
  opacity: 0.6;
}

/* ── Top Bar ──────────────────────────────────────────────────────────────────*/
.topbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 var(--space-8);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title { font-size: var(--text-xl); font-weight: 600; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

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

.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.card-title {
  font-size: var(--text-base);
  font-weight: 600;
}

.card-body { padding: var(--space-6); }

/* ── Stats Grid ─────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.stat-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.stat-value {
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1;
  color: var(--color-text);
}

.stat-value.critical { color: var(--red-600); }
.stat-value.warning { color: var(--amber-600); }
.stat-value.success { color: var(--green-600); }

.stat-note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ── Tables ─────────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

thead th {
  background: var(--gray-50);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }

tbody td {
  padding: var(--space-3) var(--space-4);
  color: var(--color-text);
  vertical-align: middle;
}

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

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.5;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}
.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  text-decoration: none;
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--gray-100);
  text-decoration: none;
}

.btn-danger {
  background: var(--red-600);
  color: white;
  border-color: var(--red-600);
}
.btn-danger:hover:not(:disabled) { background: #b91c1c; text-decoration: none; }

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--gray-100);
  color: var(--color-text);
  text-decoration: none;
}

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  border-radius: var(--radius);
}

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-700);
}

.form-label .required { color: var(--red-600); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  line-height: 1.5;
}

.form-control:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.form-control::placeholder { color: var(--gray-400); }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

textarea.form-control { resize: vertical; min-height: 80px; }

.form-hint {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--red-600);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-4);
}

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  text-transform: capitalize;
}

.badge-blue    { background: var(--blue-100);   color: var(--blue-900); }
.badge-green   { background: var(--green-100);  color: var(--green-600); }
.badge-yellow  { background: var(--yellow-100); color: var(--yellow-600); }
.badge-amber   { background: var(--amber-100);  color: var(--amber-600); }
.badge-red     { background: var(--red-100);    color: var(--red-600); }
.badge-purple  { background: var(--purple-100); color: var(--purple-600); }
.badge-gray    { background: var(--gray-100);   color: var(--gray-600); }

.carrier-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 62px;
  height: 20px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Modals ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-6);
  backdrop-filter: blur(2px);
  animation: fadeIn 150ms ease;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 200ms ease;
}

.modal-lg { max-width: 760px; }
.modal-sm { max-width: 420px; }

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

.modal-title { font-size: var(--text-lg); font-weight: 600; }

.modal-body {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* ── Alerts & Notices ───────────────────────────────────────────────────────── */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  border: 1px solid transparent;
}

.alert-info    { background: var(--blue-50);  border-color: var(--blue-100);   color: var(--blue-900); }
.alert-success { background: var(--green-50); border-color: var(--green-100);  color: var(--green-600); }
.alert-warning { background: var(--amber-100); border-color: var(--amber-600); color: #78350f; }
.alert-error   { background: var(--red-50);   border-color: var(--red-100);    color: var(--red-600); }

/* ── Toast Notifications ────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toast {
  background: var(--gray-900);
  color: white;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-lg);
  animation: slideInRight 200ms ease;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.toast.success { background: var(--green-600); }
.toast.error   { background: var(--red-600); }
.toast.warning { background: var(--amber-600); }

/* ── Search ─────────────────────────────────────────────────────────────────── */
.search-bar {
  position: relative;
  flex: 1;
  max-width: 360px;
}

.search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: var(--space-2) var(--space-3) var(--space-2) calc(var(--space-3) + 20px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  background: var(--gray-50);
  outline: none;
  transition: all var(--transition);
}

.search-input:focus {
  background: var(--color-surface);
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}

/* ── Filter Row ─────────────────────────────────────────────────────────────── */
.filter-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ── Product Image ──────────────────────────────────────────────────────────── */
.product-thumb {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--gray-100);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.product-thumb-placeholder {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  background: var(--gray-100);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 18px;
  flex-shrink: 0;
}

/* ── Tag Chips ──────────────────────────────────────────────────────────────── */
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--blue-50);
  color: var(--blue-900);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-full);
  padding: 1px 8px;
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: capitalize;
}

.tag-chip .remove-tag {
  cursor: pointer;
  opacity: 0.6;
  font-size: 14px;
  line-height: 1;
}
.tag-chip .remove-tag:hover { opacity: 1; }

/* ── Empty State ────────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-8);
  text-align: center;
  color: var(--color-text-muted);
  gap: var(--space-4);
}

.empty-icon {
  font-size: 48px;
  opacity: 0.4;
}

.empty-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--gray-600);
}

.empty-desc {
  font-size: var(--text-sm);
  max-width: 300px;
}

/* ── Loading ────────────────────────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: inherit;
}

/* ── Alert severity row colors ──────────────────────────────────────────────── */
tr.row-critical { background: var(--red-50) !important; }
tr.row-warning  { background: var(--amber-100) !important; }
tr.row-critical:hover { background: #fee2e2 !important; }

/* ── Divider ────────────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-4) 0;
}

/* ── Utility ────────────────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-muted { color: var(--color-text-muted); }
.text-right { text-align: right; }
.font-mono { font-family: var(--font-mono); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Animations ─────────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 200ms ease; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .page-body { padding: var(--space-4); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}