/* Arishma POS — Component Library */

/* ============================================================
   BUTTONS
   ============================================================ */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  min-height: 40px;
  font: inherit;
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  line-height: 1;
  color: #fff;
  background: var(--teal);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  transition: background var(--ease-fast), box-shadow var(--ease-fast), transform var(--ease-fast), border-color var(--ease-fast);
}
button:hover, .btn:hover {
  background: var(--teal-hover);
  box-shadow: var(--shadow-sm);
}
button:active, .btn:active { transform: scale(0.97); }
button:disabled, .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--muted);
}

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #991b1b; }

.btn-ghost {
  background: transparent;
  color: var(--teal);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--teal-soft);
  box-shadow: none;
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}
.btn-outline:hover {
  background: var(--surface-2);
  border-color: var(--muted);
}

.btn-sm {
  min-height: 32px;
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--text-sm);
  border-radius: var(--r-sm);
}

.btn-icon {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: var(--r-md);
}

.btn-block { width: 100%; }

:root[data-theme="dark"] .btn-secondary {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--border);
}
:root[data-theme="dark"] .btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--faint);
}

/* ============================================================
   FORMS
   ============================================================ */
label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--ink);
  margin-bottom: var(--sp-1);
}

input, select, textarea {
  width: 100%;
  min-height: 40px;
  padding: var(--sp-2) var(--sp-3);
  font: inherit;
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color var(--ease-fast), box-shadow var(--ease-fast);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--teal);
  box-shadow: var(--shadow-ring);
  outline: none;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { min-height: 100px; resize: vertical; }

input[type="checkbox"], input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--teal);
  cursor: pointer;
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--ink);
}

.form-group { margin-bottom: var(--sp-4); }
.form-group label { margin-bottom: var(--sp-1); }
.form-group .help { margin-top: var(--sp-1); }

.form-row {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
}
.form-row > * { flex: 1; min-width: 0; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-1) var(--sp-4);
}
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--ease-base);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border-light);
}
.card-header h3 {
  font-size: var(--text-md);
  font-weight: var(--fw-bold);
  margin: 0;
  color: var(--navy);
}
:root[data-theme="dark"] .card-header h3 { color: var(--ink); }

.card > h3 {
  font-size: var(--text-md);
  font-weight: var(--fw-bold);
  color: var(--navy);
  padding-bottom: var(--sp-3);
  margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border-light);
}
:root[data-theme="dark"] .card > h3 { color: var(--ink); border-bottom-color: var(--border); }

@media (max-width: 640px) { .card { padding: var(--sp-4); border-radius: var(--r-lg); } }

/* ============================================================
   TABLES
   ============================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-base);
}

thead th {
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  text-align: left;
  padding: var(--sp-3) var(--sp-3);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

td {
  padding: var(--sp-3) var(--sp-3);
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  color: var(--ink);
}

tbody tr { transition: background var(--ease-fast); }
tbody tr:hover td { background: rgba(15,118,110,.03); }
:root[data-theme="dark"] tbody tr:hover td { background: rgba(20,184,166,.04); }

/* Striped rows */
.table-striped tbody tr:nth-child(even) td { background: var(--surface-2); }
.table-striped tbody tr:nth-child(even):hover td { background: rgba(15,118,110,.04); }

/* Scroll wrapper for wide tables */
.table-scroll {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}
.table-scroll table { min-width: 900px; }
.table-scroll thead th { background: var(--surface); }

/* Numeric alignment */
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Totals row */
.totals-row td { font-weight: var(--fw-bold); border-top: 2px solid var(--border); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px 10px;
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  border-radius: var(--r-pill);
  white-space: nowrap;
  line-height: 1.6;
  border: 1px solid transparent;
}
.badge-neutral { background: var(--surface-3); color: var(--muted); border-color: var(--border); }
.badge-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.badge-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.badge-info { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.badge-purple { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
.badge-teal { background: var(--teal-soft); color: var(--teal); border-color: #99f6e4; }

:root[data-theme="dark"] .badge-neutral { background: var(--surface-3); color: var(--muted); }
:root[data-theme="dark"] .badge-success { background: rgba(22,163,74,.15); color: #4ade80; border-color: rgba(22,163,74,.3); }
:root[data-theme="dark"] .badge-warning { background: rgba(245,158,11,.15); color: #fbbf24; border-color: rgba(245,158,11,.3); }
:root[data-theme="dark"] .badge-danger { background: rgba(248,113,113,.15); color: #fca5a5; border-color: rgba(248,113,113,.3); }

/* Legacy chip aliases (backward compat during migration) */
.sale-chip { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--text-xs); font-weight: var(--fw-bold); white-space: nowrap; }
.sale-chip-final { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.sale-chip-credit { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.sale-chip-draft { background: var(--surface-3); color: var(--muted); }
.sale-chip-quotation { background: #dbeafe; color: #1e40af; }
.reg-chip { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--text-xs); font-weight: var(--fw-bold); }
.reg-chip-open { background: #d1fae5; color: var(--teal); }
.reg-chip-closed { background: var(--surface-3); color: var(--muted); }
.stock-chip { font-size: var(--text-xs); font-weight: var(--fw-bold); border-radius: var(--r-pill); padding: 3px 9px; border: 1px solid; white-space: nowrap; }
.stock-zero { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.stock-one { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.stock-ok { background: var(--teal-soft); color: #047857; border-color: #99f6e4; }
.chip { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--text-xs); font-weight: var(--fw-bold); }
.chip-active { background: var(--teal-soft); color: var(--teal); border: 1px solid rgba(15,118,110,.2); }
.chip-inactive { background: var(--surface-3); color: var(--muted); }
.vt-opt-chip { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--text-xs); font-weight: var(--fw-bold); background: #e0f2f1; color: var(--teal); border: 1px solid #99d5d2; margin: 1px 4px 1px 0; white-space: nowrap; }
.status-badge { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--text-xs); font-weight: var(--fw-semibold); background: var(--surface-3); color: var(--muted); }
.status-badge.status-active { background: var(--teal-soft); color: var(--teal); }

/* ============================================================
   MODALS
   ============================================================ */
.pos-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,32,64,.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh var(--sp-4) var(--sp-4);
  z-index: 1000;
  overflow-y: auto;
}
.pos-modal-overlay.pos-modal-show { display: flex; }

.pos-modal-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  width: min(540px, 100%);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  max-height: calc(88dvh - 32px);
  overflow: hidden;
}
.pos-modal-card-wide { width: min(680px, 100%); }

.pos-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  background: var(--surface-2);
}
.pos-modal-head h3 { margin: 0; font-size: var(--text-lg); font-weight: var(--fw-bold); }

.pos-modal-body {
  padding: var(--sp-4) var(--sp-6);
  overflow-y: auto;
  overflow-x: auto;
  flex: 1;
}
.pos-modal-body label { display: block; font-size: var(--text-base); font-weight: var(--fw-semibold); margin: var(--sp-3) 0 var(--sp-1); }
.pos-modal-body label:first-child { margin-top: 0; }
.pos-modal-body input, .pos-modal-body select, .pos-modal-body textarea { width: 100%; }

.pos-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
  background: var(--surface-2);
}

.pos-modal-x {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  background: var(--surface) !important;
  color: var(--muted) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--r-md) !important;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--ease-fast), color var(--ease-fast);
}
.pos-modal-x:hover { background: var(--surface-3) !important; color: var(--ink) !important; }

:root[data-theme="dark"] .pos-modal-head { background: var(--surface-2); }
:root[data-theme="dark"] .pos-modal-foot { background: var(--surface-2); }

/* Modal animations */
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-slide { from { opacity: 0; transform: translateY(-12px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.pos-modal-overlay.pos-modal-show { animation: modal-fade var(--ease-slow); }
.pos-modal-show .pos-modal-card { animation: modal-slide var(--ease-slow); }
@media (prefers-reduced-motion: reduce) {
  .pos-modal-overlay.pos-modal-show, .pos-modal-show .pos-modal-card { animation: none; }
}

@media (max-width: 640px) {
  .pos-modal-overlay { padding-top: 5vh; }
  .pos-modal-head, .pos-modal-foot { padding: var(--sp-3) var(--sp-4); }
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  background: #fef3c7;
  border: 1px solid var(--amber);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  margin: var(--sp-3) 0;
  font-size: var(--text-base);
  line-height: var(--lh-normal);
}
.alert-inline {
  display: inline-flex;
  background: #fef3c7;
  border: 1px solid var(--amber);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-pill);
  font-size: var(--text-sm);
}
:root[data-theme="dark"] .alert { background: rgba(245,158,11,.1); border-color: var(--amber); color: var(--ink); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
  justify-content: space-between;
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-light);
}
.pagination-info { font-size: var(--text-sm); color: var(--muted); }
.pagination-links { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: var(--sp-1) var(--sp-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
  transition: all var(--ease-fast);
}
.page-link:hover { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
.page-link.active, .page-active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
  font-weight: var(--fw-bold);
}
.page-link.disabled { color: var(--faint); pointer-events: none; }
.page-ellipsis { padding: var(--sp-1); color: var(--muted); }

/* Legacy pagination aliases */
.prod-pager { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; justify-content: space-between; margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--border-light); }
.prod-pager-info { font-size: var(--text-sm); color: var(--muted); }
.prod-pagesize label { font-size: var(--text-sm); }
.prod-pagesize select { min-height: 36px; width: auto; display: inline-block; }
.prod-page-links { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.prod-page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: var(--sp-1) var(--sp-2); border: 1px solid var(--border); border-radius: var(--r-sm); font-size: var(--text-sm); text-decoration: none; color: var(--ink); background: var(--surface); }
.prod-page-current, .prod-page-active { background: var(--teal); color: #fff; border-color: var(--teal); font-weight: var(--fw-bold); }
.prod-page-disabled { color: var(--faint); }
.prod-page-ellipsis { padding: var(--sp-1); color: var(--muted); }

.var-footer { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; justify-content: space-between; margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--border-light); }
.var-footer-info { font-size: var(--text-sm); color: var(--muted); }
.var-page-links { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.var-page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: var(--sp-1) var(--sp-2); border: 1px solid var(--border); border-radius: var(--r-sm); font-size: var(--text-sm); text-decoration: none; color: var(--ink); background: var(--surface); }
.var-page-current { background: var(--teal); color: #fff; border-color: var(--teal); font-weight: var(--fw-bold); }
.var-page-disabled { color: var(--faint); }
.var-page-ellipsis { padding: var(--sp-1); color: var(--muted); }

@media (max-width: 640px) { .pagination, .prod-pager, .var-footer { flex-direction: column; align-items: flex-start; } }

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state {
  background: var(--surface-2);
  border: 2px dashed var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-12) var(--sp-6);
  text-align: center;
  color: var(--muted);
}
.empty-state svg {
  width: 48px;
  height: 48px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 1.5;
  margin: 0 auto var(--sp-3);
  opacity: 0.4;
}
.empty-state b { display: block; font-size: var(--text-md); color: var(--ink); margin-bottom: var(--sp-2); }
.empty-state p { font-size: var(--text-base); margin: 0 0 var(--sp-4); max-width: 400px; margin-left: auto; margin-right: auto; line-height: var(--lh-relaxed); }

/* ============================================================
   FILTERS
   ============================================================ */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4);
}
.filters-card { padding: var(--sp-4) var(--sp-5); }

.filters-row {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  align-items: flex-end;
}
.filters-row label {
  display: flex;
  flex-direction: column;
  flex: 1 1 200px;
  min-width: 170px;
  margin: 0;
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
}
.filters-row input, .filters-row select { width: 100%; min-width: 170px; }
@media (min-width: 641px) {
  .filters-row input[type="date"] { min-width: 140px; }
  .filters-row label:has(> input[type="date"]) { min-width: 0; flex: 1 1 150px; }
}

.quick-filters {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-wrap: wrap;
  margin-top: var(--sp-3);
}
.quick-filters a {
  border-radius: var(--r-pill);
  padding: var(--sp-1) var(--sp-4);
  min-height: 32px;
  font-size: var(--text-sm);
  transition: all var(--ease-fast);
}
.quick-filters a:hover:not(.active-filter) {
  background: var(--teal-soft);
  color: var(--teal);
  text-decoration: none;
}
.active-filter { background: var(--teal) !important; color: #fff !important; }

@media (max-width: 640px) {
  .filters-row label { flex: 1 1 100%; min-width: 0; }
  .filters-row input, .filters-row select { min-width: 0; }
}

/* ============================================================
   TOASTS
   ============================================================ */
.prod-toast {
  position: fixed;
  top: var(--sp-4);
  right: var(--sp-4);
  z-index: 1100;
  max-width: 420px;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  background: var(--surface);
  animation: toast-in var(--ease-slow);
}
.prod-toast-ok { border: 2px solid var(--teal); color: var(--navy); }
.prod-toast-error { border: 2px solid var(--danger); color: var(--danger); }
.prod-toast-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  padding: 0;
  min-height: 36px;
  min-width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.prod-toast-hide { display: none; }

@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 640px) { .prod-toast { left: var(--sp-4); right: var(--sp-4); max-width: none; } }
@media (prefers-reduced-motion: reduce) { .prod-toast { animation: none; } }

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.kpis-hosted { grid-template-columns: repeat(4, 1fr); }

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  min-width: 0;
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--ease-base), transform var(--ease-base);
}
.kpi::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--teal-bright));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.kpi span {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}
.kpi b {
  font-size: var(--text-2xl);
  font-weight: var(--fw-extrabold);
  display: block;
  margin: var(--sp-2) 0 var(--sp-1);
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
}
.kpi small { color: var(--muted); font-size: var(--text-xs); line-height: var(--lh-relaxed); }
.kpi details summary { font-size: var(--text-xs); color: var(--muted); cursor: pointer; margin-top: var(--sp-1); }
.kpi details summary:hover { color: var(--teal); }

.kpi-dark { background: var(--navy); color: #fff; border-color: var(--navy); }
.kpi-dark::before { background: linear-gradient(90deg, var(--teal-bright), #14b8a6); }
.kpi-dark span, .kpi-dark small { color: #cbd5e1; }

@media (max-width: 1024px) { .kpis, .kpis-hosted { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .kpis, .kpis-hosted { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .kpi:hover { transform: none; } }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); margin-bottom: var(--sp-4); }
.kpi-row .kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: var(--sp-5); position: relative; overflow: hidden; transition: box-shadow var(--ease-base), transform var(--ease-base); }
.kpi-row .kpi-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--teal), var(--teal-bright)); }
.kpi-row .kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi-row .kpi-label { font-size: var(--text-xs); color: var(--muted); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--tracking-wide); }
.kpi-row .kpi-value { font-size: var(--text-2xl); font-weight: var(--fw-extrabold); display: block; margin: var(--sp-2) 0 var(--sp-1); letter-spacing: var(--tracking-tight); font-variant-numeric: tabular-nums; }
@media (max-width: 1024px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .kpi-row { grid-template-columns: 1fr; } }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-head { margin: var(--sp-1) 0 var(--sp-5); }
.page-head h2 { font-size: var(--text-2xl); font-weight: var(--fw-extrabold); letter-spacing: var(--tracking-tight); }
.page-head p { color: var(--muted); font-size: var(--text-base); margin: var(--sp-1) 0 0; }
@media (max-width: 640px) { .page-head h2 { font-size: var(--text-xl); } }

/* ============================================================
   FILTERED TOTALS BAR
   ============================================================ */
.filtered-totals-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-6);
  align-items: center;
  margin-top: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--text-base);
}
.filtered-totals-bar > span:first-child { font-weight: var(--fw-bold); }

/* Report actions row */
.report-actions { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4); }

/* ============================================================
   LOADING SKELETON
   ============================================================ */
@keyframes skeleton-pulse {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}
.skeleton {
  background: var(--surface-3);
  border-radius: var(--r-md);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}
.skeleton-text { height: 14px; margin-bottom: var(--sp-2); }
.skeleton-heading { height: 24px; width: 200px; margin-bottom: var(--sp-3); }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
