/* =========================================================
   GLOBAL DESIGN SYSTEM (FINAL CRM FOUNDATION)
   Phase 1 locked file
   Rules:
   - global shell + design tokens only
   - no page business logic
   - shared enterprise light theme
   - preserve existing class contracts used by current templates
   ========================================================= */

/* =========================
   1. TOKENS
   ========================= */
:root {
  /* Brand */
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: rgba(37, 99, 235, 0.12);
  --brand-ring: rgba(37, 99, 235, 0.16);

  /* Semantic Colors */
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.12);

  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.12);

  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);

  --info: #3b82f6;
  --info-soft: rgba(59, 130, 246, 0.12);

  --purple: #8b5cf6;
  --purple-soft: rgba(139, 92, 246, 0.12);

  /* Surfaces */
  --bg-app: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #eef2f7;
  --surface-elevated: #ffffff;
  
  /* New supporting tokens for extended UI */
  --surface-muted: #f8fafc;
  --surface-hover: rgba(15, 23, 42, 0.04);
  --shadow-soft: 0 6px 14px rgba(15, 23, 42, 0.06);

  /* Borders */
  --border: #e2e8f0;
  --border-soft: rgba(226, 232, 240, 0.82);
  --border-strong: #cbd5e1;

  /* Text */
  --text-main: #0f172a;
  --text-body: #475569;
  --text-muted: #7b8794;
  --text-soft: #94a3b8;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 20px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.14);

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

  /* Layout */
  --sidebar-width: 268px;
  --content-max-width: 100%;
  --page-x: 22px;
  --page-y: 20px;

  /* Light sidebar theme */
  --sidebar-bg: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  --sidebar-surface: rgba(255, 255, 255, 0.96);
  --sidebar-text: #526075;
  --sidebar-text-strong: #0f172a;
  --sidebar-hover: rgba(37, 99, 235, 0.06);
  --sidebar-active: linear-gradient(90deg, rgba(37, 99, 235, 0.14) 0%, rgba(37, 99, 235, 0.03) 100%);
  --sidebar-border: rgba(226, 232, 240, 0.92);
  --sidebar-footer-bg: rgba(248, 250, 252, 0.86);
}

/* =========================
   2. BASE RESET
   ========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg-app);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

button {
  border: 0;
  background: none;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

/* =========================
   3. ACCESSIBILITY HELPERS
   ========================= */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* =========================
   4. SHELL
   ========================= */
#sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-border);
}

.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-app);
  color: var(--text-main);
}

.app-layout {
  display: flex;
  width: 100%;
  height: 100%;
  min-width: 0;
}

.app-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.25s ease;
  box-shadow: var(--shadow-xs);
}

.app-sidebar__brand {
  min-height: 78px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--sidebar-border);
  background: rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
}

.app-sidebar__brand-link {
  display: flex;
  align-items: center;
  width: 100%;
  text-decoration: none;
}

.app-sidebar__brand-logo {
  width: 156px;
  max-width: 100%;
  height: auto;
}

.app-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 18px 12px;
}

.app-sidebar__section-label {
  padding: 0 12px;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.app-sidebar__footer {
  padding: 16px;
  border-top: 1px solid var(--sidebar-border);
  background: var(--sidebar-footer-bg);
  flex-shrink: 0;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.app-content {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  scroll-behavior: smooth;
}

/* =========================
   5. MOBILE HEADER
   ========================= */
.app-mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.app-mobile-header__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--text-body);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.app-mobile-header__toggle:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text-main);
}

.app-mobile-header__brand {
  min-width: 0;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.app-mobile-header__brand-logo {
  width: 122px;
  max-width: 100%;
  height: auto;
}

.app-mobile-header__profile {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
}

.app-mobile-header__profile-image,
.app-mobile-header__profile-fallback {
  width: 36px;
  height: 36px;
  border-radius: 999px;
}

.app-mobile-header__profile-image {
  object-fit: cover;
  border: 1px solid var(--border-soft);
}

.app-mobile-header__profile-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #2f6df6 0%, var(--brand) 100%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.2);
}

.app-mobile-header__title,
.app-mobile-header__spacer {
  display: none;
}

/* =========================
   6. SIDEBAR LINKS
   ========================= */
.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--sidebar-text);
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  text-decoration: none;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-strong);
  transform: translateX(2px);
}

.sidebar-link.active,
.sidebar-link[aria-current="page"] {
  background: var(--sidebar-active);
  color: var(--sidebar-text-strong);
  font-weight: 700;
  border-color: rgba(37, 99, 235, 0.1);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.03);
}

.sidebar-link.active::before,
.sidebar-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: #60a5fa;
}

.sidebar-link i {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* =========================
   7. SIDEBAR USER
   ========================= */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sidebar-user__avatar {
  flex-shrink: 0;
}

.sidebar-user__avatar-image,
.sidebar-user__avatar-fallback {
  width: 40px;
  height: 40px;
  border-radius: 999px;
}

.sidebar-user__avatar-image {
  object-fit: cover;
  border: 1px solid var(--border-soft);
}

.sidebar-user__avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #2f6df6 0%, var(--brand) 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.2);
}

.sidebar-user__content {
  flex: 1;
  min-width: 0;
}

.sidebar-user__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--sidebar-text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.sidebar-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--brand);
  transition: color 0.2s ease;
}

.sidebar-footer-link:hover {
  color: var(--brand-dark);
}

.sidebar-footer-link--danger {
  color: #dc2626;
}

.sidebar-footer-link--danger:hover {
  color: #b91c1c;
}

/* =========================
   8. BUTTON SYSTEM
   ========================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.btn:hover {
  background: rgba(15, 23, 42, 0.04);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-xs);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(180deg, #2f6df6 0%, var(--brand) 100%);
  border-color: var(--brand);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #2a63de 0%, var(--brand-dark) 100%);
  border-color: var(--brand-dark);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
}

.btn-secondary {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border-color: var(--border-soft);
  color: var(--text-main);
}

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

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-body);
  box-shadow: none;
}

.btn-ghost:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text-main);
}

.btn-danger {
  background: linear-gradient(180deg, #f35d5d 0%, var(--danger) 100%);
  border-color: var(--danger);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.16);
}

.btn-danger:hover {
  filter: brightness(0.96);
}

.btn-success {
  background: linear-gradient(180deg, #18c28d 0%, var(--success) 100%);
  border-color: var(--success);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.16);
}

.btn-success:hover {
  filter: brightness(0.96);
}

.btn-sm {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 11px;
  border-radius: var(--radius-sm);
}

.btn.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

/* =========================
   9. INPUT SYSTEM
   ========================= */
.input,
.select,
.textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  color: var(--text-main);
  font-size: 13px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.input,
.select {
  min-height: 40px;
  padding: 10px 12px;
}

.textarea {
  min-height: 100px;
  padding: 12px;
  resize: vertical;
}

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

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-ring);
  outline: none;
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: not-allowed;
}

.field-error-border {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

/* =========================
   10. CARD SYSTEM
   ========================= */
.panel-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.panel-card:hover {
  box-shadow: var(--shadow-md);
}

.panel-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-soft);
}

.panel-card__title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.panel-card__body {
  padding: 18px 20px;
}

.panel-card__eyebrow {
  margin: 0;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.panel-card__title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.panel-card__subtitle {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* =========================
   11. TABLE CARD SYSTEM
   ========================= */
.table-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
}

.table-card__body {
  overflow: auto;
}

.table-card table {
  width: 100%;
  border-collapse: collapse;
}

.table-card th {
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 12px;
  white-space: nowrap;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
}

.table-card td {
  padding: 12px;
  color: var(--text-body);
  vertical-align: middle;
}

.table-card tbody tr {
  transition: background-color 0.15s ease;
}

.table-card tbody tr:hover {
  background: rgba(15, 23, 42, 0.03);
}

.table-card__eyebrow {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.table-card__title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: var(--text-main);
}

.table-card__subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* =========================
   12. CHIP / STATUS SYSTEM
   ========================= */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.status-chip--pending {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.18);
  color: #b45309;
}

.status-chip--acknowledged {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.16);
  color: #2563eb;
}

.status-chip--in_process {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.16);
  color: #7c3aed;
}

.status-chip--quoted {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.16);
  color: #0891b2;
}

.status-chip--submitted {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.16);
  color: #059669;
}

.status-chip--supplier_followup {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.16);
  color: #d97706;
}

.status-chip--completed {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.16);
  color: #15803d;
}

.status-chip--redirected {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.16);
  color: #9333ea;
}

.status-chip--closed {
  background: rgba(100, 116, 139, 0.14);
  border-color: rgba(100, 116, 139, 0.18);
  color: #475569;
}

.status-chip--cancelled {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.16);
  color: #dc2626;
}

.status-chip--default {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.08);
  color: var(--text-body);
}

/* =========================
   NEW STAGE CHIP SUPPORT
   ========================= */

.status-chip--inquiry_created {
  background: var(--info-soft);
  color: var(--info);
}

.status-chip--rfq_sent {
  background: rgba(6, 182, 212, 0.12);
  color: #0891b2;
}

.status-chip--supplier_quoted {
  background: var(--purple-soft);
  color: var(--purple);
}

.status-chip--customer_approved {
  background: var(--success-soft);
  color: var(--success);
}

.status-chip--order_created {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}

.status-chip--in_production {
  background: rgba(234, 179, 8, 0.12);
  color: #b45309;
}

.status-chip--dispatched {
  background: rgba(59, 130, 246, 0.14);
  color: #2563eb;
}

.status-chip--delivered {
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
}

/* =========================
   13. ALERT / TOAST SYSTEM
   ========================= */
.alert {
  padding: 12px;
  border-radius: 12px;
  font-size: 13px;
}

.alert-success {
  background: var(--success-soft);
  color: var(--success);
}

.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.alert-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.alert-info {
  background: var(--info-soft);
  color: var(--info);
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  color: var(--text-main);
}

.toast--success {
  border-color: rgba(16, 185, 129, 0.18);
}

.toast--error {
  border-color: rgba(239, 68, 68, 0.18);
}

.toast--warning {
  border-color: rgba(245, 158, 11, 0.18);
}

.toast--info {
  border-color: rgba(59, 130, 246, 0.18);
}

/* =========================
   14. EMPTY STATES / HELPERS
   ========================= */
.empty-state {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.empty-state__icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-body);
  font-size: 20px;
}

.empty-state__title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: var(--text-main);
}

.empty-state__text {
  margin: 0;
  max-width: 520px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}

/* =========================
   15. SKELETON / LOADING
   ========================= */
.skeleton {
  background: linear-gradient(
    90deg,
    #f1f5f9 25%,
    #e2e8f0 50%,
    #f1f5f9 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}

.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.75;
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }

  100% {
    background-position: 200px 0;
  }
}

/* =========================
   16. GLOBAL LOADER
   ========================= */
.page-loader {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(248, 250, 252, 0.72);
  backdrop-filter: blur(2px);
  z-index: 1200;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.page-loader.active {
  display: flex;
  opacity: 1;
}

.page-loader__spinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 3px solid rgba(148, 163, 184, 0.25);
  border-top-color: var(--brand);
  animation: page-loader-spin 0.8s linear infinite;
}

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

/* =========================
   17. SCROLLBARS
   ========================= */
* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* =========================
   18. UTILITY SUPPORT
   ========================= */
.hidden {
  display: none !important;
}

.is-focused {
  position: relative;
}

.page-section {
  padding: var(--page-y) var(--page-x);
}

.page-section--tight {
  padding-top: 16px;
  padding-bottom: 16px;
}

/* =========================
   19. RESPONSIVE SHELL
   ========================= */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.32);
  z-index: 40;
  backdrop-filter: blur(2px);
}

@media (max-width: 1023.98px) {
  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .app-sidebar:not(.-translate-x-full) {
    transform: translateX(0);
  }

  .app-content {
    overflow-y: auto;
  }

  .page-section {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (min-width: 1024px) {
  .app-mobile-header {
    display: none !important;
  }

  .sidebar-overlay {
    display: none !important;
  }
}