/* StockSnap AI — Design System */
:root {
  --brand: #082A4A;
  --brand-dark: #051c32;
  --brand-light: #e8eef4;
  --accent: #D7A928;
  --accent-hover: #c49820;
  --accent-soft: rgba(215, 169, 40, 0.14);
  --ink: #172033;
  --muted: #6B7280;
  --line: #e5e9f0;
  --bg: #F5F7FA;
  --card: #fff;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --success: #198754;
  --warning: #F59E0B;
  --danger: #DC3545;
  --info: #0EA5E9;
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --bottom-nav-h: 72px;
  --shadow-sm: 0 1px 3px rgba(8, 42, 74, 0.06);
  --shadow: 0 4px 20px rgba(8, 42, 74, 0.08);
  --shadow-lg: 0 12px 40px rgba(8, 42, 74, 0.12);
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
  overflow: hidden;
}

.app-sidebar__brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.app-sidebar__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
}

.app-sidebar__logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--brand-dark);
  flex-shrink: 0;
}

.app-sidebar__logo-text {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
}

.app-sidebar__logo-tagline {
  font-size: 0.7rem;
  opacity: 0.65;
  font-weight: 400;
}

.app-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.75rem 1rem;
}

.app-sidebar__section {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.45;
  padding: 0.75rem 0.75rem 0.35rem;
  font-weight: 600;
}

.app-sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.75);
  font-weight: 500;
  font-size: 0.875rem;
  transition: all var(--transition);
  margin-bottom: 2px;
}

.app-sidebar__link i { font-size: 1.15rem; width: 1.25rem; text-align: center; opacity: 0.85; }

.app-sidebar__link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.app-sidebar__link.active {
  background: rgba(215, 169, 40, 0.18);
  color: var(--accent);
}

.app-sidebar__link.active i { opacity: 1; }

.app-sidebar__footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.app-sidebar__user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
}

.app-sidebar__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
}

.app-sidebar__user-name { font-size: 0.85rem; font-weight: 600; line-height: 1.2; }
.app-sidebar__user-role { font-size: 0.7rem; opacity: 0.55; }

.app-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.app-topbar__toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.35rem;
  color: var(--brand);
  cursor: pointer;
  padding: 0.25rem;
}

.app-topbar__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  flex: 1;
}

.app-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-content {
  flex: 1;
  padding: 1.25rem;
  padding-bottom: calc(var(--bottom-nav-h) + 1.25rem);
}

/* ── Bottom Nav (Mobile) ── */
.app-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-h);
  background: var(--card);
  border-top: 1px solid var(--line);
  display: none;
  align-items: stretch;
  justify-content: space-around;
  z-index: 1050;
  box-shadow: 0 -4px 20px rgba(8, 42, 74, 0.08);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.app-bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition);
  padding: 0.35rem 0;
}

.app-bottom-nav__item i { font-size: 1.25rem; }

.app-bottom-nav__item.active { color: var(--brand); }

.app-bottom-nav__item--scan {
  position: relative;
  top: -18px;
}

.app-bottom-nav__scan-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #e8bc3a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-dark);
  font-size: 1.5rem;
  box-shadow: 0 6px 20px rgba(215, 169, 40, 0.45);
  transition: transform var(--transition), box-shadow var(--transition);
  border: 3px solid var(--card);
}

.app-bottom-nav__scan-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 28px rgba(215, 169, 40, 0.55);
  color: var(--brand-dark);
}

.app-bottom-nav__item--scan span { margin-top: 0.15rem; }

/* ── Cards ── */
.ss-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.ss-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}

.ss-card__body { padding: 1.25rem; }
.ss-card__footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--line);
  background: rgba(245, 247, 250, 0.5);
}

/* ── KPI Cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.kpi-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--kpi-accent, var(--brand));
}

.kpi-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  background: var(--kpi-bg, var(--brand-light));
  color: var(--kpi-accent, var(--brand));
}

.kpi-card__label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.kpi-card__value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
}

.kpi-card__change {
  font-size: 0.7rem;
  margin-top: 0.35rem;
  font-weight: 600;
}

.kpi-card__change.up { color: var(--success); }
.kpi-card__change.down { color: var(--danger); }

/* ── Buttons ── */
.btn-ss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}

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

.btn-ss-primary {
  background: var(--brand);
  color: #fff;
}
.btn-ss-primary:hover:not(:disabled) { background: var(--brand-dark); color: #fff; }

.btn-ss-accent {
  background: var(--accent);
  color: var(--brand-dark);
}
.btn-ss-accent:hover:not(:disabled) { background: var(--accent-hover); color: var(--brand-dark); }

.btn-ss-outline {
  background: transparent;
  color: var(--brand);
  border: 1.5px solid var(--line);
}
.btn-ss-outline:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-light); color: var(--brand); }

.btn-ss-ghost {
  background: transparent;
  color: var(--muted);
  border: none;
}
.btn-ss-ghost:hover:not(:disabled) { background: var(--brand-light); color: var(--brand); }

.btn-ss-danger {
  background: var(--danger);
  color: #fff;
}
.btn-ss-danger:hover:not(:disabled) { background: #b02a37; color: #fff; }

.btn-ss-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-ss-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-ss-block { width: 100%; }

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

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.form-control-ss {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--card);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control-ss:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(8, 42, 74, 0.1);
}

.form-control-ss::placeholder { color: #adb5bd; }

.form-control-ss.is-invalid { border-color: var(--danger); }

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

.input-group-ss {
  display: flex;
  align-items: stretch;
}

.input-group-ss__prefix {
  display: flex;
  align-items: center;
  padding: 0 0.85rem;
  background: var(--brand-light);
  border: 1.5px solid var(--line);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-weight: 600;
  color: var(--brand);
  font-size: 0.875rem;
  white-space: nowrap;
}

.input-group-ss .form-control-ss {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.input-password-wrap { position: relative; }

.input-password-wrap .form-control-ss { padding-right: 2.75rem; }

.input-password-toggle {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1rem;
}

.form-check-ss {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.form-check-ss input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  cursor: pointer;
}

/* ── Tables ── */
.ss-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.ss-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
  background: rgba(245, 247, 250, 0.8);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.ss-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.ss-table tbody tr:hover { background: rgba(232, 238, 244, 0.35); }
.ss-table tbody tr:last-child td { border-bottom: none; }

/* ── Badges ── */
.badge-ss {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.3;
}

.badge-ss-success { background: rgba(25, 135, 84, 0.12); color: var(--success); }
.badge-ss-warning { background: rgba(245, 158, 11, 0.14); color: #b45309; }
.badge-ss-danger { background: rgba(220, 53, 69, 0.12); color: var(--danger); }
.badge-ss-info { background: rgba(14, 165, 233, 0.12); color: var(--info); }
.badge-ss-brand { background: var(--brand-light); color: var(--brand); }
.badge-ss-muted { background: rgba(107, 114, 128, 0.12); color: var(--muted); }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.empty-state__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--brand-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.75rem;
  color: var(--brand);
}

.empty-state__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.empty-state__text {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0 0 1.25rem;
}

/* ── Page Header ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.page-header__title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 0.2rem;
  color: var(--ink);
}

.page-header__subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.page-header__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── Auth Layout ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 50%, #0a3d6b 100%);
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(215, 169, 40, 0.06);
  top: -150px;
  right: -100px;
}

.auth-page::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  bottom: -80px;
  left: -60px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem 1.75rem;
  position: relative;
  z-index: 1;
}

.auth-card__logo {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-card__logo-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--brand-dark);
  margin-bottom: 0.75rem;
}

.auth-card__title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 0.25rem;
}

.auth-card__subtitle {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0;
}

/* ── Wizard Steps ── */
.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.5rem;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 0;
}

.wizard-step__dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--line);
  color: var(--muted);
  transition: all var(--transition);
}

.wizard-step.active .wizard-step__dot {
  background: var(--brand);
  color: #fff;
}

.wizard-step.done .wizard-step__dot {
  background: var(--success);
  color: #fff;
}

.wizard-step__line {
  width: 40px;
  height: 2px;
  background: var(--line);
}

.wizard-step.done + .wizard-step .wizard-step__line,
.wizard-step.done .wizard-step__line { background: var(--success); }

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

/* ── Upload Zone ── */
.upload-zone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: rgba(245, 247, 250, 0.5);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-zone__icon {
  font-size: 2.5rem;
  color: var(--brand);
  margin-bottom: 0.75rem;
}

.upload-zone__title {
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.upload-zone__hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}

.upload-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
}

.upload-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-preview-item__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(220, 53, 69, 0.9);
  color: #fff;
  border: none;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Processing ── */
.processing-card {
  text-align: center;
  padding: 3rem 1.5rem;
}

.processing-spinner {
  width: 64px;
  height: 64px;
  border: 4px solid var(--brand-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.5rem;
}

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

.processing-progress {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin: 1.5rem 0;
}

.processing-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  border-radius: 999px;
  transition: width 0.5s ease;
}

/* ── Review Items ── */
.review-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition);
}

.review-item.low-confidence {
  border-color: var(--warning);
  background: rgba(245, 158, 11, 0.04);
}

.review-item__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.review-item__name {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0;
}

.review-item__meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.review-item__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem;
}

.sticky-action-bar {
  position: fixed;
  bottom: var(--bottom-nav-h);
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 -4px 20px rgba(8, 42, 74, 0.1);
  z-index: 1020;
}

.sticky-action-bar__summary {
  font-size: 0.85rem;
  color: var(--muted);
}

.sticky-action-bar__summary strong {
  color: var(--ink);
  font-size: 1rem;
}

/* ── List Cards (Mobile) ── */
.list-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 0.65rem;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition);
}

.list-card:hover {
  box-shadow: var(--shadow);
  color: inherit;
}

.list-card__icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.list-card__body { flex: 1; min-width: 0; }
.list-card__title { font-weight: 600; font-size: 0.9rem; margin: 0 0 0.15rem; }
.list-card__sub { font-size: 0.75rem; color: var(--muted); margin: 0; }
.list-card__chevron { color: var(--muted); font-size: 0.85rem; }

/* ── More Menu ── */
.more-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.more-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.more-menu-item:hover {
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: var(--shadow);
}

.more-menu-item__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--brand-light);
  color: var(--brand);
}

/* ── Flash Messages ── */
.flash-container {
  position: fixed;
  top: calc(var(--topbar-h) + 0.75rem);
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 360px;
  width: calc(100% - 2rem);
}

.flash-toast {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.flash-toast.success { background: var(--success); color: #fff; }
.flash-toast.error { background: var(--danger); color: #fff; }
.flash-toast.warning { background: var(--warning); color: #fff; }
.flash-toast.info { background: var(--info); color: #fff; }

/* ── Loading Overlay ── */
.ss-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 28, 50, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  backdrop-filter: blur(2px);
}

.ss-loading-overlay__box {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.ss-loading-overlay__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--brand-light);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 0.75rem;
}

/* ── Error Pages ── */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  background: var(--bg);
}

.error-page__code {
  font-size: 5rem;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
  margin: 0 0 0.5rem;
}

.error-page__title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.error-page__text {
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 400px;
}

/* ── Filters Bar ── */
.filters-bar {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: center;
}

.filters-bar .form-control-ss {
  width: auto;
  min-width: 140px;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
}

.search-input-wrap i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.search-input-wrap .form-control-ss {
  padding-left: 2.25rem;
}

/* ── Chart Container ── */
.chart-container {
  position: relative;
  height: 260px;
}

/* ── Shop/Type Select Cards ── */
.select-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.select-card {
  padding: 1rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--card);
}

.select-card:hover { border-color: var(--brand-light); }

.select-card.selected {
  border-color: var(--brand);
  background: var(--brand-light);
}

.select-card__icon {
  font-size: 1.5rem;
  color: var(--brand);
  margin-bottom: 0.5rem;
}

.select-card__label {
  font-weight: 600;
  font-size: 0.85rem;
}

/* ── Responsive ── */
@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-100%);
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .app-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 28, 50, 0.5);
    z-index: 1035;
  }

  .app-sidebar-backdrop.show { display: block; }

  .app-main { margin-left: 0; }

  .app-topbar__toggle { display: block; }

  .app-bottom-nav { display: flex; }

  .app-content {
    padding-bottom: calc(var(--bottom-nav-h) + 1.5rem);
  }

  .sticky-action-bar {
    bottom: var(--bottom-nav-h);
  }

  .d-desktop-only { display: none !important; }
}

@media (min-width: 992px) {
  .d-mobile-only { display: none !important; }

  .app-content {
    padding-bottom: 1.25rem;
  }

  .sticky-action-bar {
    bottom: 0;
    left: var(--sidebar-w);
  }
}

@media (max-width: 575.98px) {
  .page-header { flex-direction: column; }
  .page-header__actions { width: 100%; }
  .page-header__actions .btn-ss { flex: 1; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .more-menu-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Utilities ── */
.text-muted { color: var(--muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-brand { color: var(--brand) !important; }
.text-accent { color: var(--accent) !important; }
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.d-flex { display: flex !important; }
.align-items-center { align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.flex-wrap { flex-wrap: wrap !important; }
.w-100 { width: 100% !important; }
