/* ==========================================================================
   CubePOS — Main Stylesheet
   Stack: Bootstrap 5 + Font Awesome 6 + Custom
   Design: Modern dark sidebar, clean cards, Inter font
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 0px;
  --topbar-height: 62px;

  /* Brand (overridden per-shop via inline style in base.html) */
  --shop-primary:       #2563eb;
  --shop-accent:        #7dd3fc;
  --shop-primary-rgb:   37, 99, 235;
  --shop-accent-rgb:    125, 211, 252;
  --theme-hover:        #1d4ed8;
  --theme-soft:         #eff6ff;
  --theme-border:       rgba(var(--shop-primary-rgb, 37, 99, 235), .18);
  --theme-on-primary:   #ffffff;
  --theme-pwa-bg:       #f8fafc;

  /* Bootstrap primary override — keeps btn-primary, links, focus rings in sync */
  --bs-primary:         var(--shop-primary);
  --bs-primary-rgb:     var(--shop-primary-rgb);
  --bs-link-color:      var(--shop-primary);
  --bs-link-hover-color: var(--shop-accent);
  --bs-focus-ring-color: rgba(var(--shop-primary-rgb), .25);
  --accent:             var(--shop-primary);
  --accent-hover:       var(--theme-hover);
  --accent-lt:          var(--theme-soft);
  --accent-bd:          var(--theme-border);

  /* Sidebar */
  --sidebar-bg:         #ffffff;
  --sidebar-border:     #e5e7eb;
  --sidebar-text:       #64748b;
  --sidebar-text-hover: #111827;
  --sidebar-active-bg:  var(--theme-soft);
  --sidebar-active-txt: var(--theme-hover);

  /* Topbar */
  --topbar-bg:          #ffffff;
  --topbar-border:      #e5e7eb;

  /* Content */
  --content-bg:         #f8fafc;
  --card-bg:            #ffffff;
  --card-border:        #e5e7eb;
  --card-shadow:        0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --card-shadow-hover:  0 4px 12px rgba(0,0,0,.1);

  /* Border aliases (used in template inline styles) */
  --border:             #e5e7eb;
  --border-lt:          #f3f4f6;

  /* Typography */
  --text-primary:       #111827;
  --text-secondary:     #6b7280;
  --text-muted:         #9ca3af;

  /* Border radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;

  /* Transitions */
  --transition: 0.18s ease;
}

[data-bs-theme="dark"] {
  --topbar-bg:          #1f2937;
  --topbar-border:      #374151;
  --content-bg:         #111827;
  --card-bg:            #1f2937;
  --card-border:        #374151;
  --text-primary:       #f9fafb;
  --text-secondary:     #d1d5db;
  --text-muted:         #9ca3af;
  --sidebar-bg:         #0d1117;
  --sidebar-border:     #1f2937;
  --sidebar-text:       #9ca3af;
  --sidebar-text-hover: #f9fafb;
  --sidebar-active-bg:  #1f2937;
  --sidebar-active-txt: #ffffff;

  /* Border aliases — dark */
  --border:             #374151;
  --border-lt:          #1f2937;

  /* Bootstrap dark overrides */
  --bs-body-bg:         #111827;
  --bs-body-color:      #f9fafb;
  --bs-secondary-bg:    #1f2937;
  --bs-tertiary-bg:     #374151;
  --bs-border-color:    #374151;
}

/* Dark mode — Bootstrap component overrides */
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .dropdown-menu {
  background-color: var(--card-bg);
  border-color: var(--card-border);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .card-header {
  background: #262f3d;
  border-bottom-color: var(--card-border);
}

[data-bs-theme="dark"] .card-header[style] {
  background: #262f3d !important;
  border-color: var(--card-border) !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: #1f2937;
  border-color: #374151;
  color: var(--text-primary);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: #1f2937;
  border-color: var(--shop-primary);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(var(--shop-primary-rgb), .2);
}

[data-bs-theme="dark"] .form-control::placeholder { color: var(--text-muted); }

.list-group {
  --bs-list-group-bg: transparent;
}

.list-group-item {
  background: transparent;
}

[data-bs-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255,255,255,.03);
  --bs-table-hover-bg: rgba(255,255,255,.05);
  --bs-table-border-color: var(--card-border);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .table thead tr,
[data-bs-theme="dark"] .table thead th {
  background: #202a38 !important;
  color: var(--text-muted) !important;
  border-color: var(--card-border) !important;
}

[data-bs-theme="dark"] .table tbody tr,
[data-bs-theme="dark"] .table td {
  border-color: var(--card-border) !important;
}

[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * {
  --bs-table-accent-bg: rgba(255,255,255,.045);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .batch-detail > td {
  background: #151d2a !important;
  border-color: var(--card-border) !important;
}

[data-bs-theme="dark"] .batch-detail [style*="background:#fff"],
[data-bs-theme="dark"] .batch-detail [style*="background:#fefefe"] {
  background: var(--card-bg) !important;
  border-color: var(--card-border) !important;
}

[data-bs-theme="dark"] .dashboard-wrapper [style*="background:#fafafa"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="background: #fafafa"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="background:#fff"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="background: #fff"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="background:#fefefe"] {
  background: var(--card-bg) !important;
  border-color: var(--card-border) !important;
}

[data-bs-theme="dark"] .dashboard-wrapper [style*="background:#f1f5f9"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="background: #f1f5f9"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="background:#f3f4f6"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="background: #f3f4f6"] {
  background: var(--bs-secondary-bg) !important;
  border-color: var(--card-border) !important;
  color: var(--text-secondary) !important;
}

[data-bs-theme="dark"] .dashboard-wrapper [style*="background:#ecfdf5"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="background: #ecfdf5"] {
  background: rgba(16,185,129,.16) !important;
  color: #34d399 !important;
}

[data-bs-theme="dark"] .dashboard-wrapper [style*="background:#fffbeb"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="background: #fffbeb"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="background:#fef3c7"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="background: #fef3c7"] {
  background: rgba(245,158,11,.16) !important;
  color: #fbbf24 !important;
  border-color: rgba(245,158,11,.28) !important;
}

[data-bs-theme="dark"] .dashboard-wrapper [style*="background:#fef2f2"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="background: #fef2f2"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="background:#fee2e2"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="background: #fee2e2"] {
  background: rgba(239,68,68,.15) !important;
  color: #f87171 !important;
  border-color: rgba(239,68,68,.28) !important;
}

[data-bs-theme="dark"] .dropdown-item { color: var(--text-secondary); }
[data-bs-theme="dark"] .dropdown-item:hover { background: #354355 !important; color: var(--text-primary); }
[data-bs-theme="dark"] .dropdown-divider { border-color: var(--border); }

[data-bs-theme="dark"] .modal-content {
  background: var(--card-bg);
  border-color: var(--card-border);
}
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer { border-color: var(--card-border); }

[data-bs-theme="dark"] .input-group-text {
  background: #1f2937;
  border-color: #374151;
  color: var(--text-secondary);
}

[data-bs-theme="dark"] .pagination .page-link {
  background: var(--card-bg);
  border-color: var(--card-border);
  color: var(--text-secondary);
}
[data-bs-theme="dark"] .pagination .page-item.active .page-link {
  background: var(--shop-primary);
  border-color: var(--shop-primary);
  color: #fff;
}

[data-bs-theme="dark"] .btn-outline-secondary {
  border-color: var(--border);
  color: var(--text-secondary);
}
[data-bs-theme="dark"] .btn-outline-secondary:hover {
  background: var(--sidebar-active-bg);
  color: var(--text-primary);
}

[data-bs-theme="dark"] hr { border-color: var(--border); }

/* ── Import-page colour overrides ─────────────────────────────── */
[data-bs-theme="dark"] .dashboard-wrapper [style*="background:#eff6ff"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="background: #eff6ff"] {
  background: rgba(37,99,235,.15) !important;
  color: #93c5fd !important;
  border-color: rgba(37,99,235,.3) !important;
}
[data-bs-theme="dark"] .dashboard-wrapper [style*="background:#bfdbfe"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="border:1px solid #bfdbfe"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="border-color:#bfdbfe"] {
  border-color: rgba(37,99,235,.3) !important;
}
[data-bs-theme="dark"] .dashboard-wrapper [style*="background:#f0fdf4"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="background: #f0fdf4"] {
  background: rgba(16,185,129,.12) !important;
  color: #6ee7b7 !important;
  border-color: rgba(16,185,129,.25) !important;
}
[data-bs-theme="dark"] .dashboard-wrapper [style*="background:#bbf7d0"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="border:1px solid #bbf7d0"] {
  border-color: rgba(16,185,129,.25) !important;
}
[data-bs-theme="dark"] .dashboard-wrapper [style*="background:#fff7ed"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="background: #fff7ed"] {
  background: rgba(217,119,6,.12) !important;
  color: #fcd34d !important;
  border-color: rgba(217,119,6,.28) !important;
}
[data-bs-theme="dark"] .dashboard-wrapper [style*="background:#fed7aa"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="border:1px solid #fed7aa"] {
  border-color: rgba(217,119,6,.28) !important;
}
[data-bs-theme="dark"] .dashboard-wrapper [style*="background:var(--theme-soft, #eff6ff)"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="background: var(--theme-soft, #eff6ff)"] {
  background: rgba(var(--shop-primary-rgb), .14) !important;
  color: var(--shop-accent) !important;
  border-color: rgba(var(--shop-primary-rgb), .28) !important;
}
[data-bs-theme="dark"] .dashboard-wrapper [style*="background:var(--theme-border, rgba(37,99,235,.20))"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="border:1px solid var(--theme-border, rgba(37,99,235,.20))"] {
  border-color: rgba(var(--shop-primary-rgb), .28) !important;
}
[data-bs-theme="dark"] .dashboard-wrapper [style*="background:#fff5f5"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="background: #fff5f5"] {
  background: rgba(239,68,68,.12) !important;
  border-color: rgba(239,68,68,.28) !important;
}
[data-bs-theme="dark"] .dashboard-wrapper [style*="border:1px solid #fca5a5"],
[data-bs-theme="dark"] .dashboard-wrapper [style*="background:#fca5a5"] {
  border-color: rgba(239,68,68,.3) !important;
}
/* nav-tabs in dark mode */
[data-bs-theme="dark"] .nav-tabs { border-color: var(--card-border); }
[data-bs-theme="dark"] .nav-tabs .nav-link { color: var(--text-secondary); }
[data-bs-theme="dark"] .nav-tabs .nav-link.active {
  background: var(--card-bg);
  border-color: var(--card-border);
  color: var(--text-primary);
}
[data-bs-theme="dark"] .nav-tabs .nav-link:hover { color: var(--text-primary); }

[data-bs-theme="dark"] .topbar {
  background: var(--topbar-bg);
  border-bottom-color: var(--topbar-border);
}

[data-bs-theme="dark"] .breadcrumb-item a { color: var(--text-muted); }
[data-bs-theme="dark"] .breadcrumb-item.active { color: var(--text-secondary); }

/* --------------------------------------------------------------------------
   2. Base Reset & Typography
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--content-bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   3. Dashboard Layout
   -------------------------------------------------------------------------- */
.dashboard-body,
.portal-body {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

.dashboard-wrapper {
  position: relative;
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--content-bg);
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  transition: width var(--transition), min-width var(--transition);
  z-index: 100;
  scrollbar-width: thin;
  scrollbar-color: var(--sidebar-border) transparent;
}

.sidebar.collapsed {
  width: 0;
  min-width: 0;
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  padding: 0 20px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand > a {
  width: 100%;
  height: 100%;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-logo-text {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--shop-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.sidebar-brand-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

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

.brand-sub {
  font-size: 11px;
  color: var(--sidebar-text);
  margin-top: 1px;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-section {
  padding: 0 12px 8px;
}

.nav-section-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-text);
  padding: 8px 8px 4px;
  opacity: 0.6;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 450;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  margin-bottom: 1px;
}

.sidebar-nav .nav-link:hover {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-hover);
}

.sidebar-nav .nav-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-txt);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--shop-primary);
}

.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 13px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  background: var(--shop-primary);
  color: #fff;
  padding: 1px 7px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}

/* Sidebar Footer */
.sidebar-footer {
  border-top: 1px solid var(--sidebar-border);
  padding: 12px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--shop-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sidebar-text-hover);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-logout {
  color: var(--sidebar-text);
  padding: 4px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color var(--transition);
  font-size: 14px;
}

.user-logout:hover { color: #ef4444; }

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

/* ── Topbar ── */
.topbar {
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.sidebar-toggle:hover {
  background: var(--content-bg);
  color: var(--text-primary);
}

.breadcrumb { font-size: 13px; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

.topbar-action {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 15px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  position: relative;
}

.topbar-action:hover {
  background: var(--content-bg);
  color: var(--text-primary);
}

.topbar-action #themeIcon,
.topbar-action #posThemeIcon {
  color: currentColor !important;
  line-height: 1;
  font-size: 18px;
}

.notification-dot {
  position: absolute;
  top: 6px; right: 7px;
  width: 7px; height: 7px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid var(--topbar-bg);
}

.btn-ghost {
  background: none;
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--content-bg);
  color: var(--text-primary);
}

/* ── Page Content ── */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 28px 40px;
  background: var(--content-bg);
}

/* ── Mobile pull-to-refresh indicator ── */
.pull-refresh-indicator {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 8px);
  left: 50%;
  z-index: 1200;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 999px;
  background: var(--card-bg, #ffffff);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .16);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-50%, 0, 0);
  transition: transform .18s ease, opacity .18s ease;
}
.pull-refresh-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(var(--shop-primary-rgb, 37, 99, 235), .24);
  border-top-color: var(--shop-primary, #2563eb);
  border-radius: 50%;
  transform: rotate(0deg);
}
.pull-refresh-indicator.ready .pull-refresh-spinner,
.pull-refresh-indicator.refreshing .pull-refresh-spinner {
  animation: cubeposPullRefreshSpin .72s linear infinite;
}
@keyframes cubeposPullRefreshSpin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   4. Page Header
   -------------------------------------------------------------------------- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 4px 0 0;
}

.pwa-install-reminder {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
}

.pwa-install-reminder[hidden] {
  display: none !important;
}

.pwa-install-reminder-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: rgba(79, 70, 229, .1);
  color: var(--accent);
}

.pwa-install-reminder-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.pwa-install-reminder-copy strong,
.pwa-install-reminder-copy span {
  display: block;
}

.pwa-install-reminder-copy strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

.pwa-install-reminder-copy span {
  margin-top: 2px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.pwa-install-reminder-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.pwa-install-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1080;
  background: rgba(15, 23, 42, .46);
  backdrop-filter: blur(4px);
}

body.pwa-install-modal-open {
  overflow: hidden;
}

.pwa-install-modal-backdrop[hidden],
.pwa-install-modal[hidden] {
  display: none !important;
}

.pwa-install-modal {
  position: fixed;
  inset: 0;
  z-index: 1081;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.pwa-install-modal-card {
  position: relative;
  width: min(880px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  overflow: auto;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: 0 24px 80px rgba(15, 23, 42, .28);
  padding: 22px;
}

.pwa-install-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-secondary);
}

.pwa-install-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(280px, 1fr);
  gap: 22px;
  align-items: center;
}

.pwa-install-modal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.pwa-install-modal-title {
  margin: 0;
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.pwa-install-modal-copy {
  margin: 10px 0 14px;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.6;
}

.pwa-install-modal-steps {
  margin: 0 0 18px;
  padding-left: 20px;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.8;
}

.pwa-install-modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pwa-guide-visual {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.pwa-guide-phone {
  position: relative;
  min-height: 330px;
  border: 8px solid #111827;
  border-radius: 30px;
  background: #f8fafc;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(15, 23, 42, .18);
}

.pwa-guide-phone-top {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 52px;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #111827;
  z-index: 2;
}

.pwa-guide-browserbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 24px 12px 10px;
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
}

.pwa-guide-screen {
  padding: 10px 12px 14px;
}

.pwa-guide-app-title {
  margin-bottom: 12px;
  color: #0f172a;
  font-size: 20px;
  font-weight: 800;
}

.pwa-guide-menu {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}

.pwa-guide-menu > div,
.pwa-guide-sheet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 10px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.pwa-guide-highlight {
  outline: 3px solid #ef4444;
  outline-offset: 1px;
  background: #fff1f2;
  color: #991b1b !important;
}

.pwa-guide-screen-dim {
  min-height: 258px;
  display: flex;
  align-items: flex-end;
  background:
    linear-gradient(rgba(15, 23, 42, .58), rgba(15, 23, 42, .58)),
    linear-gradient(180deg, #f8fafc, var(--theme-soft, #eff6ff));
}

.pwa-guide-bottom-sheet {
  width: 100%;
  padding: 14px;
  border-radius: 18px 18px 0 0;
  background: #fff;
}

.pwa-guide-sheet-title {
  margin-bottom: 10px;
  color: #0f172a;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
}

.pwa-guide-app-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--shop-primary), var(--shop-accent));
  color: #fff;
  font-weight: 900;
}

.pwa-guide-sheet-row .fa-chevron-right {
  margin-left: auto;
  color: #94a3b8;
}

@media (max-width: 575.98px) {
  .pwa-install-reminder {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .pwa-install-reminder-actions {
    width: 100%;
  }
  .pwa-install-reminder-actions .btn {
    flex: 1 1 0;
  }
  .pwa-install-modal {
    padding: 12px;
    align-items: flex-start;
  }
  .pwa-install-modal-card {
    padding: 18px;
    max-height: calc(100vh - 24px);
  }
  .pwa-install-modal-grid {
    grid-template-columns: 1fr;
  }
  .pwa-guide-visual {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   5. Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--card-border);
  padding: 16px 20px;
}

.card-title { font-size: 14.5px; font-weight: 600; color: var(--text-primary); }
.card-body { padding: 20px; }

/* --------------------------------------------------------------------------
   6. Stat Cards
   -------------------------------------------------------------------------- */
.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--transition), transform var(--transition);
  min-width: 0;
  overflow: hidden;
}

.stat-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-1px);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.stat-label {
  max-width: 100%;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-value {
  display: block;
  max-width: 100%;
  min-width: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-top: 2px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.stat-value small {
  font-size: 14px !important;
}

/* Soft color helpers */
.bg-primary-soft  { background: rgba(var(--shop-primary-rgb, 37, 99, 235), .12); }
.bg-success-soft  { background: rgba(16, 185, 129, .12); }
.bg-warning-soft  { background: rgba(245, 158, 11, .12); }
.bg-danger-soft   { background: rgba(239, 68, 68, .12); }
.bg-info-soft     { background: rgba(14, 165, 233, .12); }

.text-primary  { color: var(--shop-primary) !important; }
.text-success  { color: #10b981 !important; }
.text-warning  { color: #f59e0b !important; }
.text-danger   { color: #ef4444 !important; }
.text-info     { color: #0ea5e9 !important; }

/* --------------------------------------------------------------------------
   7. Quick Actions
   -------------------------------------------------------------------------- */
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 12px;
  background: var(--content-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 500;
  text-align: center;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  min-width: 0;
  overflow: hidden;
}

.quick-action span {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.quick-action:hover {
  background: var(--card-bg);
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
  color: var(--shop-primary);
}

/* --------------------------------------------------------------------------
   8. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.btn-primary {
  background: var(--shop-primary);
  border-color: var(--shop-primary);
  color: #fff;
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--shop-primary) 85%, #000);
  border-color: color-mix(in srgb, var(--shop-primary) 85%, #000);
}

.mobile-more-btn {
  width: 36px;
  min-width: 36px;
  height: 34px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mobile-more-menu {
  min-width: 190px;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15,23,42,.12);
  padding: 6px;
}
.mobile-more-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 7px;
  font-size: 13px;
  padding: 8px 10px;
}
.mobile-more-menu .dropdown-item i {
  width: 16px;
  text-align: center;
  color: var(--text-muted);
}
.mobile-more-menu .dropdown-item.text-danger i {
  color: #dc2626;
}
.table-more {
  display: inline-flex;
  justify-content: flex-end;
}

.sales-search-form .input-group-sm,
.sales-search-form .form-control,
.sales-search-form .input-group-text,
.sales-search-btn,
.sales-search-clear {
  min-height: 36px;
}

.payment-method-fee-group {
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
}

.payment-method-fee-group > .form-control,
#settingsForm .payment-method-fee-group > input.form-control {
  flex: 1 1 auto;
  min-width: 0;
  width: 1%;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.payment-method-fee-group > .input-group-text,
#settingsForm .payment-method-fee-group > .input-group-text {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  white-space: nowrap;
}

.sales-search-btn,
.sales-search-clear {
  white-space: nowrap;
  padding-inline: 14px !important;
  align-self: stretch;
}

.sales-mobile-meta {
  max-width: 180px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.mobile-table-meta {
  max-width: 190px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.sales-mobile-meta > div,
.mobile-table-meta > div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proof-modal-body {
  padding: 16px;
  background: var(--content-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.proof-modal-image {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  margin: 0 auto;
  border-radius: 10px;
  object-fit: contain;
  background: var(--card-bg);
}

.btn-ghost-muted {
  background: none;
  border: none;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   9. Tables
   -------------------------------------------------------------------------- */
.table { font-size: 13.5px; }
.table th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); }
.table td { vertical-align: middle; }

/* --------------------------------------------------------------------------
   10. Badges
   -------------------------------------------------------------------------- */
.badge.bg-primary-soft { background: rgba(var(--shop-primary-rgb), .15) !important; color: var(--shop-primary); font-weight: 600; }
.badge.bg-success-soft { background: rgba(16,185,129,.15) !important; color: #10b981; font-weight: 600; }
.badge.bg-warning-soft { background: rgba(245,158,11,.15) !important; color: #f59e0b; font-weight: 600; }
.badge.bg-danger-soft  { background: rgba(239,68,68,.15) !important;  color: #ef4444; font-weight: 600; }
.badge {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.dashboard-wrapper .form-control-sm,
.dashboard-wrapper .form-select-sm,
.dashboard-wrapper .btn-sm {
  min-height: calc(1.5em + .5rem + 2px);
}

.dashboard-wrapper .btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   11. Public / Landing Layout
   -------------------------------------------------------------------------- */

/* ── Base ── */
.public-body { background: #ffffff; }

/* ── Navbar ── */
.public-navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  padding: 0;
  height: 62px;
  display: flex;
  align-items: center;
  transition: box-shadow 0.2s ease;
}
.public-navbar .container { height: 100%; position: relative; overflow: visible; }
.public-navbar .container > .d-flex { height: 100%; }
.public-navbar-row {
  position: relative;
}
.public-navbar.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,.07); }

/* Brand */
.public-brand {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  text-decoration: none !important;
  flex-shrink: 0;
}
.public-brand:hover { color: var(--shop-primary); }
.public-brand-logo {
  width: 32px; height: 32px;
  background: var(--shop-primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.public-brand-img {
  width: 112px;
  height: auto;
  display: block;
}
.public-footer-brand-img {
  width: 104px;
  height: auto;
  display: block;
}

/* Desktop nav links */
.pub-nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: #475569;
  text-decoration: none !important;
  transition: background 0.12s, color 0.12s;
}
.pub-nav-link:hover { background: #f1f5f9; color: #0f172a; }
.pub-nav-link.active { background: var(--theme-soft); color: var(--theme-hover); font-weight: 600; }

/* Nav divider */
.pub-nav-divider { width: 1px; height: 20px; background: #e2e8f0; }

/* Ghost button */
.pub-ghost-btn {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: #475569;
  text-decoration: none !important;
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  display: inline-flex; align-items: center;
}
.pub-ghost-btn:hover { background: #f1f5f9; color: #0f172a; border-color: #e2e8f0; }

/* Language switcher pills */
.pub-lang-btn {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
  padding: 3px 8px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  line-height: 1.6;
}
.pub-lang-btn:hover { background: #f1f5f9; color: #475569; }
.pub-lang-btn.active { background: var(--theme-soft); color: var(--theme-hover); border-color: var(--theme-border); }

/* Hamburger */
.pub-hamburger {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: #475569;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.12s;
  flex-shrink: 0;
}
.pub-hamburger:hover { background: #f1f5f9; }

@media (min-width: 992px) {
  .public-navbar-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 20px;
  }
  .public-navbar-brand {
    justify-self: start;
    min-width: 0;
  }
  .public-navbar-center {
    justify-self: center;
    min-width: 0;
  }
  .public-navbar-actions {
    justify-self: end;
    min-width: 0;
  }
}

/* Mobile menu */
.pub-mobile-menu {
  display: none;
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: none;
}
.pub-mobile-menu.open { display: block; }
.pub-mobile-link {
  display: block;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  text-decoration: none !important;
  border-radius: 8px;
  margin-bottom: 2px;
  transition: background 0.1s;
}
.pub-mobile-link:hover { background: #f8fafc; }
.pub-mobile-link--cta { color: var(--theme-hover); font-weight: 600; }
.pub-mobile-divider { height: 1px; background: #f1f5f9; margin: 8px 12px; }

/* ── Hero ── */
.hero-section {
  padding: 88px 0 72px;
  background: linear-gradient(150deg, #f8faff 0%, #f0f0ff 60%, #fafaff 100%);
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(var(--shop-primary-rgb), .08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(var(--shop-primary-rgb), .08);
  color: var(--theme-hover);
  border: 1px solid var(--theme-border);
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 14px;
  letter-spacing: .01em;
}

.hero-title {
  font-size: clamp(2.1rem, 4.5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.13;
  color: #0f172a;
  letter-spacing: -.02em;
}

.text-gradient {
  background: linear-gradient(135deg, var(--shop-primary) 0%, var(--shop-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 16px;
  color: #64748b;
  max-width: 500px;
  line-height: 1.75;
}

.public-body,
.public-body main,
.public-body section,
.public-body footer {
  color: #0f172a;
}

.public-body .text-muted,
.public-body .section-subtitle,
.public-body .hero-subtitle,
.public-body .stat-lbl,
.public-body .step-card p,
.public-body .feature-card p,
.public-body .footer-links a,
.public-body .public-footer .text-muted {
  color: #64748b !important;
}

html[data-bs-theme="dark"] .public-body,
html[data-bs-theme="dark"] .public-body main,
html[data-bs-theme="dark"] .public-body section,
html[data-bs-theme="dark"] .public-body footer,
html[data-bs-theme="dark"] .public-body .section-title,
html[data-bs-theme="dark"] .public-body .hero-title,
html[data-bs-theme="dark"] .public-body .step-card h5,
html[data-bs-theme="dark"] .public-body .feature-card h5,
html[data-bs-theme="dark"] .public-body .public-brand,
html[data-bs-theme="dark"] .public-body .pub-mobile-link {
  color: #0f172a !important;
}

html[data-bs-theme="dark"] .public-body .text-muted,
html[data-bs-theme="dark"] .public-body .section-subtitle,
html[data-bs-theme="dark"] .public-body .hero-subtitle,
html[data-bs-theme="dark"] .public-body .stat-lbl,
html[data-bs-theme="dark"] .public-body .step-card p,
html[data-bs-theme="dark"] .public-body .feature-card p,
html[data-bs-theme="dark"] .public-body .footer-links a,
html[data-bs-theme="dark"] .public-body .public-footer .text-muted {
  color: #64748b !important;
}

html[data-bs-theme="dark"] .public-body .hero-section,
html[data-bs-theme="dark"] .public-body .public-navbar,
html[data-bs-theme="dark"] .public-body .pub-mobile-menu,
html[data-bs-theme="dark"] .public-body .feature-card,
html[data-bs-theme="dark"] .public-body .step-card,
html[data-bs-theme="dark"] .public-body .public-footer {
  background-color: #ffffff !important;
}

.public-body .btn-outline-secondary,
html[data-bs-theme="dark"] .public-body .btn-outline-secondary {
  color: #475569 !important;
  border-color: #94a3b8 !important;
  background: #ffffff !important;
}

.public-body .btn-outline-secondary:hover,
html[data-bs-theme="dark"] .public-body .btn-outline-secondary:hover {
  color: #0f172a !important;
  border-color: #64748b !important;
  background: #f8fafc !important;
}

/* Hero mockup */
.hero-image-wrapper { display: flex; justify-content: center; align-items: center; }

.hero-mockup {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(var(--shop-primary-rgb), .14), 0 4px 16px rgba(0,0,0,.06);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.mockup-bar {
  background: #f8fafc;
  padding: 10px 14px;
  display: flex;
  gap: 6px;
  border-bottom: 1px solid #f1f5f9;
}
.mockup-bar span {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.mockup-bar span:nth-child(1) { background: #fca5a5; }
.mockup-bar span:nth-child(2) { background: #fcd34d; }
.mockup-bar span:nth-child(3) { background: #6ee7b7; }
.mockup-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  border: 1px solid #f1f5f9;
}
.mockup-stat strong { color: var(--theme-hover); font-size: 16px; font-weight: 700; }

/* Cell chips */
.cell-chip {
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
}
.cell-chip.vacant      { background: #ecfdf5; color: #059669; }
.cell-chip.occupied    { background: var(--theme-soft); color: var(--theme-hover); }
.cell-chip.maintenance { background: #fef3c7; color: #d97706; }

/* ── Features ── */
.features-section { background: #ffffff; }
.section-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--theme-hover);
}
.section-title  { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; color: #0f172a; letter-spacing: -.02em; }
.section-subtitle { font-size: 15px; max-width: 520px; margin: 0 auto; color: #64748b; line-height: 1.7; }

.feature-card {
  padding: 28px 26px;
  border: 1px solid #e8edf3;
  border-radius: var(--radius-lg);
  height: 100%;
  background: #fff;
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
}
.feature-card:hover {
  box-shadow: 0 10px 32px rgba(var(--shop-primary-rgb), .1);
  transform: translateY(-3px);
  border-color: rgba(var(--shop-primary-rgb), .25);
}
.feature-icon {
  width: 46px; height: 46px;
  background: linear-gradient(135deg, var(--shop-primary), var(--shop-accent));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: #fff;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.feature-card h5 { font-size: 15px; font-weight: 700; color: #0f172a; margin-bottom: 6px; }
.feature-card p  { font-size: 13.5px; color: #64748b; line-height: 1.65; margin: 0; }

/* ── CTA section ── */
.cta-section {
  background: linear-gradient(135deg, var(--shop-primary) 0%, var(--shop-accent) 100%);
  padding: 72px 0;
  text-align: center;
  color: #fff;
}
.cta-section,
.cta-section h2,
.cta-section p,
.cta-section .section-label,
.cta-section a:not(.btn-white) {
  color: #ffffff;
}
.cta-section h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800; margin-bottom: 12px; }
.cta-section p  { font-size: 15.5px; opacity: .85; max-width: 480px; margin: 0 auto 28px; line-height: 1.7; }
html[data-bs-theme="dark"] .cta-section,
html[data-bs-theme="dark"] .cta-section h2,
html[data-bs-theme="dark"] .cta-section p,
html[data-bs-theme="dark"] .cta-section .section-label,
html[data-bs-theme="dark"] .cta-section a:not(.btn-white) {
  color: #ffffff !important;
}
.btn-white {
  background: #fff;
  color: var(--theme-hover);
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 28px;
  text-decoration: none !important;
  display: inline-flex; align-items: center; gap: 6px;
  transition: opacity 0.12s, transform 0.12s;
}
.btn-white:hover { opacity: .92; transform: translateY(-1px); color: var(--theme-hover); }

/* ── Pricing card ── */
.pricing-card {
  background: #fff;
  border: 2px solid #e8edf3;
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  height: 100%;
  transition: box-shadow 0.18s, border-color 0.18s;
  position: relative;
}
.pricing-card.featured {
  border-color: var(--shop-primary);
  box-shadow: 0 8px 40px rgba(var(--shop-primary-rgb), .14);
}
.pricing-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,.08); }
.pricing-badge {
  position: absolute;
  top: -13px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--shop-primary), var(--shop-accent));
  color: #fff;
  font-size: 11px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  white-space: nowrap;
}
.pricing-name  { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #94a3b8; margin-bottom: 8px; }
.pricing-price { font-size: 2.6rem; font-weight: 800; color: #0f172a; line-height: 1; }
.pricing-price sup { font-size: 1.2rem; font-weight: 700; vertical-align: top; padding-top: 8px; }
.pricing-price sub { font-size: .85rem; font-weight: 500; color: #64748b; }
.pricing-desc  { font-size: 13.5px; color: #64748b; line-height: 1.6; margin-top: 8px; }
.pricing-list  { list-style: none; padding: 0; margin: 20px 0; }
.pricing-list li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13.5px; color: #374151;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
}
.pricing-list li:last-child { border-bottom: none; }
.pricing-list li i { color: var(--theme-hover); flex-shrink: 0; margin-top: 2px; }
.pricing-list li.muted { color: #94a3b8; }
.pricing-list li.muted i { color: #cbd5e1; }

/* ── Auth card ── */
.auth-page {
  min-height: calc(100vh - 62px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, #f8faff 0%, #f0f0ff 60%, #fafaff 100%);
  padding: 40px 16px;
}
.auth-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0,0,0,.07);
  padding: 40px 36px;
  width: 100%;
  max-width: 440px;
}
.auth-logo {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 28px;
  text-decoration: none !important;
}
.auth-logo-box {
  width: 40px; height: 40px;
  background: var(--shop-primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
}
.auth-logo-text { font-size: 20px; font-weight: 800; color: #0f172a; }
.auth-title { font-size: 22px; font-weight: 800; color: #0f172a; text-align: center; margin-bottom: 4px; }
.auth-subtitle { font-size: 14px; color: #64748b; text-align: center; margin-bottom: 24px; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: #94a3b8; font-size: 12.5px;
  margin: 20px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: #e2e8f0;
}
.auth-footer { font-size: 13.5px; color: #64748b; text-align: center; margin-top: 20px; }
.auth-footer a { color: var(--theme-hover); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* ── Footer ── */
.public-footer {
  background: #f8fafc;
  border-top: 1px solid #e8edf3;
  padding: 48px 0 24px;
}
.footer-brand { font-size: 16px; font-weight: 800; color: #0f172a; }
.footer-heading {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: #94a3b8;
  margin-bottom: 12px;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { font-size: 13.5px; color: #64748b; text-decoration: none; transition: color 0.12s; }
.footer-links a:hover { color: var(--theme-hover); }
.footer-bottom {
  border-top: 1px solid #e8edf3;
  margin-top: 36px;
  padding-top: 20px;
}

.py-6 { padding-top: 5rem; padding-bottom: 5rem; }
.py-7 { padding-top: 6rem; padding-bottom: 6rem; }

/* --------------------------------------------------------------------------
   12. Utilities
   -------------------------------------------------------------------------- */
.text-monospace { font-family: 'Menlo', 'Consolas', monospace; font-size: 12px; }

/* Scrollbar styling */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ── Topbar user button ── */
.topbar-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px 5px 6px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.topbar-user-btn:hover,
.topbar-user-btn[aria-expanded="true"] {
  background: var(--content-bg);
  border-color: var(--accent-bd);
}
.topbar-user-btn::after { display: none; }
.topbar-avatar {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  border-radius: 6px;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Topbar lang buttons ── */
.topbar-lang-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
}
.topbar-lang-btn:hover { border-color: var(--border); color: var(--text-primary); }
.topbar-lang-btn.active {
  background: var(--accent-lt);
  color: var(--accent);
  border-color: var(--accent-bd);
}

/* ── Sidebar overlay (mobile) ── */
.sidebar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, visibility .18s ease;
}
.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ── Active nav left-bar accent ── */
.sidebar-nav .nav-link.active {
  border-left: 3px solid var(--accent, #2563eb) !important;
  padding-left: calc(16px - 3px);
}

[data-bs-theme="dark"] .sidebar-nav .nav-link.active,
[data-bs-theme="dark"] .sidebar-nav .nav-link:hover {
  background: #1f2937 !important;
  color: #f9fafb !important;
}

[data-bs-theme="dark"] .topbar-lang-btn.active {
  background: #1f2937 !important;
  color: #f9fafb !important;
  border-color: #374151 !important;
}

/* --------------------------------------------------------------------------
   Alert — vertically center dismissible close button
   -------------------------------------------------------------------------- */
.alert-dismissible {
  display: flex;
  align-items: center;
  padding-right: 3rem;
}
.alert-dismissible .btn-close {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

/* --------------------------------------------------------------------------
   13. Responsive
   -------------------------------------------------------------------------- */

/* Tablet (769px – 1024px): keep sidebar, compress grid/table layouts */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar { width: 220px; min-width: 220px; }
  .page-content { padding: 24px 20px 32px; }
  .stat-grid,
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
  /* Collapse wide tables: hide lower-priority columns */
  .table .d-tablet-none { display: none !important; }
}

@media (max-width: 768px) {
  .public-navbar {
    min-height: 72px;
    height: auto;
    padding: 10px 0;
  }
  .public-navbar .container {
    height: auto;
  }
  .public-navbar .container > .d-flex {
    height: auto;
    min-height: 48px;
  }
  .hero-section {
    padding: 56px 0 48px;
  }
  .hero-title {
    font-size: clamp(2rem, 12vw, 3rem);
    line-height: 1.06;
  }
  .hero-badge {
    margin-top: 8px;
  }
}

@media (max-width: 768px) {
  .dashboard-body,
  .portal-body {
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    background: var(--topbar-bg);
  }
  .dashboard-body.sidebar-open,
  .portal-body.sidebar-open {
    overflow: hidden;
  }
  .dashboard-wrapper {
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    background: var(--topbar-bg);
  }
  html,
  body {
    background: var(--topbar-bg);
  }
  .main-content {
    background: var(--content-bg);
    flex: 1 1 auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
  }
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform var(--transition);
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-top: env(safe-area-inset-top);
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  .sidebar-overlay {
    position: fixed;
    top: calc(var(--topbar-height) + env(safe-area-inset-top));
    left: 0;
    right: 0;
    bottom: 0;
  }
  .sidebar-nav {
    padding-bottom: 24px;
  }
  .sidebar-footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .page-content {
    flex: 0 0 auto;
    min-height: calc(100vh - var(--topbar-height) - env(safe-area-inset-top));
    min-height: calc(100dvh - var(--topbar-height) - env(safe-area-inset-top));
    overflow: visible;
    padding: 20px 16px calc(32px + env(safe-area-inset-bottom));
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 98;
    height: calc(var(--topbar-height) + env(safe-area-inset-top));
    min-height: calc(var(--topbar-height) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 16px 0;
    align-items: center;
  }
  .topbar-left,
  .topbar-right {
    gap: 6px;
    min-width: 0;
  }
  .topbar-right {
    flex: 0 0 auto;
  }
  .topbar-lang-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
  }
  .topbar-action {
    width: 34px;
    height: 34px;
  }
  .topbar-user-btn {
    width: 40px;
    height: 34px;
    justify-content: center;
    padding: 0;
    border-radius: 10px;
  }
  .topbar-user-btn .fa-chevron-down {
    display: none;
  }
  .topbar-avatar {
    width: 26px;
    height: 26px;
  }
  .stat-grid,
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
  /* Stack form rows on mobile */
  .row.g-3 > [class*="col-md"] { margin-bottom: 0; }
  .sales-search-form {
    max-width: none !important;
    width: 100%;
  }
  .sales-search-form .input-group {
    min-width: 0;
    flex: 1 1 0;
  }
  .sales-status-filter {
    width: 100%;
    margin-left: 0 !important;
    overflow-x: auto;
    flex-wrap: nowrap !important;
    padding-bottom: 2px;
  }
  .sales-status-filter .btn {
    white-space: nowrap;
    flex: 0 0 auto;
  }
  .table th,
  .table td {
    white-space: nowrap;
  }
  .table td:first-child,
  .table th:first-child {
    white-space: normal;
  }
  .proof-modal .modal-content {
    min-height: 100dvh;
    border-radius: 0 !important;
  }
  .proof-modal-body {
    flex: 1 1 auto;
    padding: 12px;
  }
  .proof-modal-image {
    max-height: calc(100dvh - 150px);
    width: 100%;
  }
}
