:root {
  --brand-hue: 221;
  --brand-primary: hsl(var(--brand-hue), 83%, 53%);
  --brand-primary-dark: hsl(var(--brand-hue), 83%, 43%);
  --brand-primary-light: hsl(var(--brand-hue), 83%, 96%);
  --brand-primary-ink: #fff;

  --bg: hsl(220, 20%, 97%);
  --surface: #fff;
  --surface-alt: hsl(220, 14%, 96%);
  --text: hsl(222, 47%, 11%);
  --text-secondary: hsl(215, 16%, 47%);
  --muted: hsl(215, 20%, 65%);
  --line: hsl(220, 13%, 91%);

  --sidebar-bg: hsl(200, 14%, 96%);
  --sidebar-text: hsl(205, 17%, 27%);
  --sidebar-hover: hsla(205, 18%, 30%, 0.07);
  --sidebar-active: color-mix(in srgb, var(--brand-primary) 10%, var(--sidebar-bg));
  --sidebar-width: 260px;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-xs: 0 1px 2px hsla(222, 47%, 11%, 0.05);
  --shadow-sm: 0 1px 3px hsla(222, 47%, 11%, 0.06), 0 4px 12px hsla(222, 47%, 11%, 0.04);
  --shadow: 0 2px 4px hsla(222, 47%, 11%, 0.06), 0 8px 24px hsla(222, 47%, 11%, 0.05);
  --shadow-md: 0 4px 8px hsla(222, 47%, 11%, 0.07), 0 16px 40px hsla(222, 47%, 11%, 0.07);
  --shadow-lg: 0 8px 16px hsla(222, 47%, 11%, 0.08), 0 24px 60px hsla(222, 47%, 11%, 0.10);

  --transition: 0.2s ease;
  --transition-fast: 0.12s ease;

  /* Design tokens: surface, hierarchy and focus are shared by every module. */
  --content-max-width: 1480px;
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 22%, transparent);
  --surface-raised: #fff;
  --surface-subtle: hsl(220, 18%, 98%);
}

/* ─── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--brand-primary-dark); }
:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 3000;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: #fff;
  transform: translateY(-150%);
  transition: transform var(--transition-fast);
}
.skip-link:focus { transform: translateY(0); color: #fff; }

/* ─── App Shell ────────────────────────────────────────────────────── */
.app-shell { min-height: 100vh; display: flex; }

/* ─── Sidebar ──────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid var(--line);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.sidebar-brand:hover { color: var(--text); }
.sidebar-brand img { height: 32px; max-width: 120px; object-fit: contain; }
.sidebar-brand-icon {
  width: 32px; height: 32px;
  background: var(--brand-primary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; flex-shrink: 0;
}
.sidebar-nav { overflow-y: auto; padding: 12px 10px 24px; flex: 1; }
.sidebar-nav, .offcanvas-body {
  scrollbar-color: hsl(205 12% 43% / .8) transparent;
  scrollbar-width: auto;
}
.sidebar-nav::-webkit-scrollbar, .offcanvas-body::-webkit-scrollbar { width: 12px; }
.sidebar-nav::-webkit-scrollbar-track, .offcanvas-body::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb, .offcanvas-body::-webkit-scrollbar-thumb {
  min-height: 36px;
  border: 4px solid transparent;
  border-radius: 999px;
  background: hsl(205 12% 43% / .8);
  background-clip: padding-box;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover, .offcanvas-body::-webkit-scrollbar-thumb:hover {
  background: hsl(205 12% 36% / .92);
  background-clip: padding-box;
}
.sidebar-nav::-webkit-scrollbar-button, .offcanvas-body::-webkit-scrollbar-button { display: none; width: 0; height: 0; }

.nav-group {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  color: hsl(205, 12%, 43%);
  padding: 15px 10px 5px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sidebar-text);
  text-decoration: none;
  min-height: 44px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 450;
  transition: background var(--transition-fast), color var(--transition-fast);
  margin-bottom: 2px;
}
.nav-link:hover { background: var(--sidebar-hover); color: var(--text); }
.nav-link:focus-visible { outline: none; background: var(--sidebar-hover); box-shadow: var(--focus-ring); }
.nav-link.active {
  background: var(--sidebar-active);
  color: var(--text);
  font-weight: 650;
  box-shadow: inset 3px 0 0 var(--brand-primary);
}
.nav-link.active:focus-visible { box-shadow: inset 3px 0 0 var(--brand-primary), var(--focus-ring); }
.nav-link i { color: hsl(205, 12%, 48%); font-size: 16px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-link.active i { color: var(--brand-primary-dark); }

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* ─── Main content ─────────────────────────────────────────────────── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ─── Navigation loading state ────────────────────────────────────── */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  background: hsla(220, 20%, 97%, 0.78);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.page-loader[hidden] { display: none !important; }
.page-loader-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 600;
}
.page-loader-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--brand-primary-light);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
body.is-page-loading { cursor: progress; }
@media (prefers-reduced-motion: reduce) {
  .page-loader-spinner { animation: none; }
}

/* ─── Topbar ───────────────────────────────────────────────────────── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 12px clamp(14px, 2.2vw, 32px);
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .03);
}
.topbar h1 {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0;
  flex: 1;
  color: var(--text);
}
.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}
.connection-status.is-offline { color: hsl(0, 72%, 36%); background: hsl(0, 86%, 96%); border-color: hsl(0, 72%, 84%); }
.connection-status.is-syncing { color: var(--brand-primary-dark); background: var(--brand-primary-light); border-color: hsl(var(--brand-hue), 83%, 84%); }
.connection-status.has-pending { color: hsl(32, 86%, 28%); background: hsl(45, 96%, 94%); border-color: hsl(45, 86%, 78%); }

/* ─── Page ─────────────────────────────────────────────────────────── */
.page { padding: clamp(20px, 3vw, 34px) clamp(14px, 2.5vw, 36px) 56px; max-width: var(--content-max-width); width: 100%; }

.page h2, .page h3, .page h4 { color: var(--text); letter-spacing: -.025em; }
.page .text-muted { color: var(--text-secondary) !important; }

/* ─── Cards ────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .035);
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: 0 8px 24px rgba(15, 23, 42, .065); }
.card-body { padding: 18px; }

/* ─── KPI Cards ────────────────────────────────────────────────────── */
.kpi {
  padding: 18px 20px;
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  transition: transform var(--transition), box-shadow var(--transition);
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: inherit; }
.kpi .label {
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.kpi .value {
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -0.03em;
  margin-top: 4px;
  line-height: 1.15;
}
.kpi .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi::after { content: '\f135'; font-family: 'bootstrap-icons'; float: right; color: var(--muted); font-size: 13px; margin-top: -18px; opacity: .55; }
.kpi:hover::after { color: var(--brand-primary); opacity: 1; }

.dashboard-chart-card { height: 100%; padding: 20px; overflow: hidden; }
.dashboard-chart-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.dashboard-chart-heading h2 { margin: 0 0 3px; color: var(--text); font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.dashboard-chart-heading p { margin: 0; color: var(--text-secondary); font-size: 12px; }
.dashboard-chart-badge { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-subtle); color: var(--text-secondary); font-size: 11px; font-weight: 600; }
.dashboard-chart-badge i { color: var(--brand-primary); }
.dashboard-chart-plot { position: relative; width: 100%; height: 270px; }
.dashboard-chart-plot-compact { height: 270px; }
.dashboard-chart-empty { display: flex; min-height: 220px; align-items: center; justify-content: center; flex-direction: column; gap: 9px; color: var(--muted); font-size: 12px; text-align: center; }
.dashboard-chart-empty i { color: #cbd5e1; font-size: 26px; }

/* ─── Stock Badges ─────────────────────────────────────────────────── */
.badge-stock-ok { background: hsl(141, 78%, 93%); color: hsl(141, 72%, 24%); }
.badge-stock-low { background: hsl(45, 96%, 90%); color: hsl(32, 86%, 28%); }
.badge-stock-zero { background: hsl(0, 86%, 93%); color: hsl(0, 72%, 30%); }
.badge-indigo { background: hsl(238, 100%, 95%); color: hsl(238, 72%, 39%); }

/* ─── Tables ───────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table > :not(caption) > * > * { vertical-align: middle; }
.table-hover > tbody > tr { transition: background var(--transition-fast); }
.stock-journal-table { min-width: 980px; table-layout: fixed; }
.stock-journal-table th { white-space: nowrap; font-size: 12px; }
.stock-journal-table td { overflow-wrap: anywhere; }
.stock-journal-table td:nth-child(1),
.stock-journal-table td:nth-child(2),
.stock-journal-table td:nth-child(4),
.stock-journal-table td:nth-child(5),
.stock-journal-table td:nth-child(8) { white-space: nowrap; }
.stock-journal-table .journal-date { width: 138px; }
.stock-journal-table .journal-type { width: 122px; }
.stock-journal-table .journal-item { width: 190px; }
.stock-journal-table .journal-type-cell { padding-right: 16px; }
.stock-journal-table .journal-type-cell .badge { display: inline-flex; align-items: center; white-space: nowrap; }
.stock-journal-table .journal-item-cell { padding-left: 16px; }
.stock-journal-table .journal-qty { width: 74px; }
.stock-journal-table .journal-balance { width: 88px; }
.stock-journal-table .journal-user { width: 150px; }
.stock-journal-table .journal-note { width: 80px; }

/* ─── Thumbnails ───────────────────────────────────────────────────── */
.thumb {
  width: 40px; height: 40px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--line);
}

/* ─── Empty States ─────────────────────────────────────────────────── */
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty i { font-size: 40px; display: block; margin-bottom: 10px; opacity: 0.5; }

/* ─── Buttons ──────────────────────────────────────────────────────── */
.btn-primary, .bg-brand {
  background: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
}
.btn-primary:hover, .btn-brand:hover {
  background: var(--brand-primary-dark) !important;
  border-color: var(--brand-primary-dark) !important;
}
.btn {
  min-height: 38px;
  align-self: flex-start;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
}
.btn-sm { min-height: 31px; }
.btn-lg { min-height: 48px; }
.notification-preview-item { padding: 12px 10px; border-bottom: 1px solid var(--line); color: var(--text); border-radius: var(--radius-sm); }
.notification-preview-item:hover, .notification-preview-item.unread { background: var(--surface-alt); }

/* ─── Form Controls ────────────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--line);
  font-size: 14px;
  min-height: 40px;
  line-height: 1.35;
  padding: .55rem .75rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-select { padding-right: 2.25rem; }
.form-control::placeholder { color: hsl(215, 16%, 60%); opacity: 1; }
.form-control[type="number"] { text-align: right; }
textarea.form-control { min-height: 96px; resize: vertical; }
.form-control:focus, .form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px hsl(var(--brand-hue), 83%, 53%, 0.15);
}
.form-control.is-invalid:focus, .form-select.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .14); }
.form-label { font-size: 13px; font-weight: 550; color: var(--text); margin-bottom: 5px; }

/* Consistent section headers used by list, detail and form views. */
.page-header, .section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-header h2, .section-header h2 { margin-bottom: 4px; font-size: clamp(1.25rem, 2vw, 1.65rem); font-weight: 700; }
.page-header p, .section-header p { margin: 0; color: var(--text-secondary); font-size: 13px; }
.filter-bar { padding: 14px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius); }
.table thead th { background: var(--surface-subtle); color: var(--text-secondary); font-size: 11px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; border-bottom-width: 1px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody td { color: var(--text); }
.badge { font-weight: 650; letter-spacing: .01em; }

/* Bootstrap surfaces are normalized here so legacy views share the same system. */
.alert { border-radius: var(--radius); border-width: 1px; font-size: 13px; }
.alpine-flex { display: flex; }
.dropdown-menu, .modal-content, .offcanvas { border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.dropdown-menu { padding: 7px; }
.dropdown-item { border-radius: 7px; padding: 8px 10px; font-size: 13px; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--surface-alt); color: var(--text); }
.modal-header, .modal-footer { border-color: var(--line); padding: 16px 20px; }
.modal-body { padding: 20px; }
.lookup-modal-form { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.lookup-modal-form .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.modal-backdrop.show { opacity: .35; }
.modal-title { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.pagination { gap: 4px; }
.page-link { border-radius: 7px !important; border-color: var(--line); color: var(--text-secondary); min-width: 34px; text-align: center; }
.page-link:hover { background: var(--brand-primary-light); color: var(--brand-primary-dark); }
.page-item.active .page-link { background: var(--brand-primary); border-color: var(--brand-primary); }
.offcanvas { background: var(--sidebar-bg); color: var(--sidebar-text); }
.offcanvas.offcanvas-start { --bs-offcanvas-width: min(23rem, calc(100vw - 24px)); }
.offcanvas-header { gap: 16px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.offcanvas-header .btn-close { width: 40px; height: 40px; margin: 0 -8px 0 0; border-radius: var(--radius-sm); opacity: .65; }
.offcanvas-header .btn-close:hover { background-color: var(--sidebar-hover); opacity: 1; }
.offcanvas-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.offcanvas-brand .sidebar-brand-icon { width: 30px; height: 30px; border-radius: 7px; font-size: 15px; }
.offcanvas-brand img { width: auto; height: 30px; max-width: 112px; object-fit: contain; }
.offcanvas-body { padding: 10px 12px 20px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.offcanvas .nav-group { color: hsl(205, 12%, 43%); }
.offcanvas .nav-link { color: var(--sidebar-text); }
.offcanvas .nav-link:hover { color: var(--text); }
.offcanvas .nav-link.active { color: var(--text); }
.offcanvas-title { color: var(--text); font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.btn-outline-secondary { color: var(--text-secondary); border-color: var(--line); }
.btn-outline-secondary:hover { color: var(--text); background: var(--surface-alt); border-color: hsl(220, 13%, 80%); }
.btn-link { text-decoration: none; }
.btn-link:hover { text-decoration: underline; }
.progress { height: 7px; border-radius: 999px; background: var(--surface-alt); }
.progress-bar { border-radius: inherit; background: var(--brand-primary); }
.form-check-input:checked { background-color: var(--brand-primary); border-color: var(--brand-primary); }
.form-check-input:focus { box-shadow: var(--focus-ring); }
.input-group-text { border-color: var(--line); background: var(--surface-alt); color: var(--text-secondary); }
.list-group-item { border-color: var(--line); padding: 13px 15px; }
.list-group-item-action:hover { background: var(--surface-alt); }

/* ─── Auth Layout ──────────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 32px 20px;
  background: #f3f6fb;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.auth-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--brand-primary) 10%, transparent), transparent 52%),
    radial-gradient(circle at 100% 100%, rgba(56, 189, 248, .08), transparent 32%);
  pointer-events: none;
}
.auth-bg-watermark {
  position: absolute;
  right: -90px;
  bottom: -145px;
  width: min(48vw, 570px);
  opacity: .035;
  pointer-events: none;
  z-index: -1;
  filter: grayscale(1);
  transform: rotate(-12deg);
  user-select: none;
}
.auth-bg-watermark img { width: 100%; height: auto; display: block; }
.auth-login-shell { width: 100%; max-width: 448px; min-width: 0; position: relative; z-index: 1; }
.auth-login-card {
  position: relative;
  overflow: hidden;
  padding: 34px 38px 26px;
  border: 1px solid #e5eaf1;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(23, 43, 77, .09), 0 2px 8px rgba(23, 43, 77, .035);
}
.auth-login-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-primary), color-mix(in srgb, var(--brand-primary) 55%, #38bdf8));
}
.auth-login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.auth-login-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 13%, #e8edf4);
  border-radius: 13px;
  background: color-mix(in srgb, var(--brand-primary) 5%, #fff);
}
.auth-login-logo img { width: 100%; height: 100%; object-fit: contain; }
.auth-login-company { min-width: 0; overflow: hidden; color: #26364b; font-size: 14px; font-weight: 700; letter-spacing: -.015em; text-overflow: ellipsis; white-space: nowrap; }
.auth-kicker { color: var(--brand-primary-dark); font-size: 10px; font-weight: 750; letter-spacing: .12em; }
.auth-card-header { margin-bottom: 27px; }
.auth-card-header h1 { margin: 8px 0 7px; color: #172b4d; font-size: 28px; line-height: 1.2; letter-spacing: -.045em; font-weight: 750; }
.auth-card-header p { margin: 0; color: #6b778c; font-size: 13px; line-height: 1.6; }
.auth-form-intro { display: none; }
.auth-form .form-label { color: #344563; font-size: 12px; font-weight: 650; }
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-wrap > i { position: absolute; left: 14px; z-index: 2; color: #8592a5; font-size: 16px; pointer-events: none; transition: color var(--transition-fast); }
.auth-input-wrap .form-control { min-height: 47px; padding-left: 42px; padding-right: 44px; border: 1px solid #dfe5ed; border-radius: 10px; background: #fbfcfe; color: #172b4d; font-size: 13px; }
.auth-input-wrap:focus-within > i { color: var(--brand-primary); }
.auth-input-wrap .form-control:focus { border-color: var(--brand-primary); background: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 13%, transparent); }
.auth-password-toggle { position: absolute; right: 8px; z-index: 2; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #8592a5; }
.auth-password-toggle:hover, .auth-password-toggle:focus-visible { color: var(--brand-primary); background: color-mix(in srgb, var(--brand-primary) 8%, #fff); outline: none; }
.auth-forgot { color: var(--brand-primary-dark); font-size: 11px; font-weight: 650; }
.auth-forgot:hover { color: var(--brand-primary); text-decoration: underline; }
.auth-error { margin: -8px 0 16px; padding: 11px 12px; border: 1px solid hsl(0, 72%, 86%); border-radius: 9px; background: hsl(0, 86%, 97%); color: hsl(0, 65%, 37%); font-size: 12px; line-height: 1.4; }
.auth-submit { min-height: 47px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 10px; font-size: 13px; font-weight: 700; box-shadow: 0 6px 14px color-mix(in srgb, var(--brand-primary) 22%, transparent); transition: transform var(--transition-fast), box-shadow var(--transition-fast); }
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 9px 20px color-mix(in srgb, var(--brand-primary) 29%, transparent); }
.auth-submit:active { transform: translateY(0); }
.auth-submit i { font-size: 16px; transition: transform var(--transition-fast); }
.auth-submit:hover i { transform: translateX(3px); }
.auth-security-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 23px 0 0; color: #8995a7; font-size: 10px; text-align: center; }
.auth-security-note i { color: var(--brand-primary); }
.auth-field .invalid-feedback { margin-top: 5px; font-size: 11px; }
.auth-login-footer { margin: 18px 0 0; color: #929daf; font-size: 10px; text-align: center; }
.auth-login-footer span { margin: 0 4px; }

@media (max-width: 520px) {
  .auth-wrap { padding: 18px 14px; }
  .auth-login-card { padding: 28px 23px 23px; border-radius: 15px; }
  .auth-login-brand { margin-bottom: 29px; }
  .auth-card-header h1 { font-size: 25px; }
  .auth-login-footer { margin-top: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-submit, .auth-submit i { transition: none; }
}

/* ─── Timeline ─────────────────────────────────────────────────────── */
.timeline { border-left: 2px solid var(--line); margin-left: 8px; padding-left: 16px; }
.timeline-item { position: relative; padding-bottom: 14px; }
.timeline-item::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand-primary); position: absolute; left: -22px; top: 4px;
}

/* ─── Search ───────────────────────────────────────────────────────── */
.search-box { min-width: 180px; max-width: 280px; }

/* ─── Stock form qty ───────────────────────────────────────────────── */
.qty-lg { font-size: 24px; font-weight: 700; }
.stock-form { max-width: 680px; }
.stock-form .qty-lg { max-width: 180px; }

/* ─── Event Kiosk ──────────────────────────────────────────────────── */
.event-kiosk { background: hsl(222, 47%, 8%); color: #fff; min-height: 100vh; }
.event-kiosk .big-btn { min-height: 56px; font-size: 18px; }

/* ─── Signature Pad ────────────────────────────────────────────────── */
.sig-pad {
  border: 2px dashed var(--muted);
  border-radius: var(--radius);
  background: var(--surface);
  width: 100%;
  height: 180px;
  touch-action: none;
}

/* ─── Item Cards ───────────────────────────────────────────────────── */
.item-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  transition: background var(--transition-fast);
}
.item-card:hover { background: var(--surface-alt); }

/* ─── Toast Notifications ──────────────────────────────────────────── */
.toast-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}
.toast-item {
  padding: 14px 18px;
  border-radius: var(--radius);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.25s ease;
  line-height: 1.4;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
.toast-item.ok  { background: linear-gradient(135deg, hsl(158, 76%, 26%), hsl(158, 72%, 20%)); }
.toast-item.err { background: linear-gradient(135deg, hsl(0, 74%, 40%), hsl(0, 70%, 32%)); }
.toast-item.info { background: linear-gradient(135deg, hsl(221, 72%, 38%), hsl(221, 72%, 30%)); }
.toast-item::before { font-family: 'bootstrap-icons'; font-size: 16px; flex-shrink: 0; }
.toast-item.ok::before  { content: '\f26e'; }
.toast-item.err::before { content: '\f623'; }
.toast-item.info::before { content: '\f431'; }

/* ─── User Chip ────────────────────────────────────────────────────── */
.user-chip { display: flex; align-items: center; gap: 8px; }
.bell-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: hsl(0, 84%, 57%);
  border-radius: 50%;
  border: 1px solid var(--surface);
}
.notification-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(380px, calc(100vw - 24px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 1050;
}
.notification-popover-header,
.notification-popover-footer {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}
.notification-popover-footer { border-bottom: 0; border-top: 1px solid var(--line); justify-content: center; }
.notification-popover-header .btn { padding: 0; font-size: 12px; }
.notification-list { max-height: 360px; overflow-y: auto; }
.notification-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  color: var(--text);
}
.notification-row:hover, .notification-row:focus-visible { background: var(--surface-alt); outline: none; }
.notification-row.unread { background: hsl(var(--brand-hue), 83%, 97%); }
.notification-row-title { font-weight: 650; font-size: 13px; }
.notification-row-time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.notification-row-body { grid-column: 1 / -1; color: var(--text-secondary); font-size: 12px; line-height: 1.35; }
.notification-empty { padding: 24px 12px; color: var(--muted); text-align: center; font-size: 13px; }

/* ─── Password Strength ────────────────────────────────────────────── */
.pwd-strength { height: 4px; border-radius: 4px; transition: width 0.3s ease, background 0.3s ease; }

/* ─── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 991px) {
  .sidebar { display: none; }
  .page { padding: 14px 12px 32px; }
  .table-desktop { display: none !important; }
  .topbar { padding: 8px 14px; }
  .connection-status span { display: none; }
  .page-header, .section-header { flex-direction: column; align-items: stretch; }
  .page-header .btn-toolbar, .section-header .btn-toolbar { width: 100%; }
  .page-header .btn-toolbar .btn, .section-header .btn-toolbar .btn { flex: 1 1 auto; }
  .table-wrap { margin-inline: -12px; padding-inline: 12px; }
}
@media (min-width: 992px) {
  .table-mobile { display: none !important; }
}

/* ─── Item detail actions ──────────────────────────────────────────── */
.item-detail-header { align-items: flex-start; }
.item-detail-actions {
  align-self: flex-start;
  min-width: 0;
}
.event-detail-actions {
  align-self: flex-start;
  min-width: 0;
}
.event-detail-actions .btn { white-space: nowrap; }
.item-detail-actions .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
@media (max-width: 767.98px) {
  .dashboard-chart-card { padding: 16px; }
  .dashboard-chart-heading { margin-bottom: 10px; }
  .dashboard-chart-plot, .dashboard-chart-plot-compact { height: 245px; }
  .dashboard-chart-badge { font-size: 10px; }
  .item-detail-actions {
    width: 100%;
    margin-left: 0 !important;
  }
  .item-detail-actions .btn {
    flex: 1 1 auto;
  }
}

/* ─── Utility Micro-animations ─────────────────────────────────────── */
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

