@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* =========================================================
   SmartCore — Theme Tokens
   Primary (Lion gold): #ffc525
   ========================================================= */

:root,
[data-theme="light"] {
  /* Primary */
  --primary: #ffc525;
  --primary-dark: #e6a800;
  --primary-light: #ffe9a8;
  --primary-soft: #fff8e1;
  --primary-ink: #1a1400;

  /* Secondary */
  --secondary: #111827;
  --secondary-dark: #030712;
  --secondary-light: #374151;

  /* Background */
  --bg: #f5f5f7;
  --bg-primary: #f5f5f7;
  --bg-secondary: #ffffff;
  --bg-muted: #f3f4f6;
  --bg-dark: #111827;

  /* Text */
  --text: #111827;
  --text-main: #111827;
  --text-muted: #6b7280;
  --text-inverse: #ffffff;
  --text-on-primary: #111827;

  /* Border / surface */
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --card: #ffffff;
  --overlay: rgba(3, 7, 18, 0.55);

  /* Status */
  --success: #10b978;
  --success-soft: #ecfdf5;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --error: #ef4444;
  --error-soft: #fef2f2;
  --info: #3b82f6;
  --info-soft: #eff6ff;

  /* Shell */
  --sidebar-width: 260px;
  --topbar-height: 72px;
  --sidebar-bg: #ffffff;
  --topbar-bg: rgba(255, 255, 255, 0.9);

  /* Bootstrap bridge */
  --bs-primary: #ffc525;
  --bs-primary-rgb: 255, 197, 37;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-link-color: var(--primary-dark);
  --bs-link-hover-color: var(--primary);
}

[data-theme="dark"] {
  --bg: #0b0f17;
  --bg-primary: #0b0f17;
  --bg-secondary: #121826;
  --bg-muted: #1a2233;
  --bg-dark: #030712;

  --text: #f3f4f6;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-inverse: #111827;
  --text-on-primary: #111827;

  --border: #243044;
  --border-light: #1a2233;
  --card: #121826;
  --overlay: rgba(0, 0, 0, 0.7);

  --secondary: #e5e7eb;
  --secondary-dark: #f9fafb;
  --secondary-light: #9ca3af;

  --sidebar-bg: #0f1522;
  --topbar-bg: rgba(15, 21, 34, 0.92);

  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-link-color: var(--primary);
  --bs-link-hover-color: var(--primary-light);

  --primary-soft: rgba(255, 197, 37, 0.12);
  --primary-light: rgba(255, 197, 37, 0.28);
  --primary-dark: #ffc525;
  --success-soft: rgba(16, 185, 120, 0.14);
  --warning-soft: rgba(245, 158, 11, 0.14);
  --error-soft: rgba(239, 68, 68, 0.14);
  --info-soft: rgba(59, 130, 246, 0.16);
}

/* =========================================================
   Base
   ========================================================= */

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

html {
  margin: 0;
  min-height: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
}

body,
.app-body {
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  width: 100%;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.hidden { display: none !important; }

::selection {
  background: var(--primary);
  color: var(--text-on-primary);
}

/* =========================================================
   App shell + Sidebar + Topbar
   ========================================================= */

.app-body {
  display: block;
  min-height: 100vh;
}

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.28s ease;
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.2);
}

.app-shell {
  margin-left: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Storefront: desktop = header menu, no sidebar / no toggle */
.layout-store .sidebar-toggle-btn {
  display: inline-flex;
}
.layout-store .header-nav {
  display: none;
}
.layout-store .topbar-brand {
  display: inline-flex;
}

@media (min-width: 992px) {
  .layout-store .app-sidebar,
  .layout-store #sidebar-backdrop {
    display: none !important;
  }
  .layout-store .sidebar-toggle-btn {
    display: none !important;
  }
  .layout-store .app-topbar {
    padding-left: 1.25rem;
  }
  .layout-store .topbar-brand .brand-logo-header {
    margin-left: 1.25rem;
  }
  .layout-store .header-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    flex-wrap: wrap;
    gap: 0.15rem 0.35rem;
    min-width: 0;
    padding: 0 0.5rem;
  }
  .layout-store .app-shell {
    margin-left: 0;
  }

  /* Admin keeps desktop sidebar */
  .admin-body .app-sidebar {
    transform: translateX(0);
    box-shadow: none;
  }
  .admin-body .app-shell {
    margin-left: var(--sidebar-width);
  }
  .admin-body .sidebar-toggle-btn {
    display: none !important;
  }
}

@media (max-width: 991.98px) {
  .admin-body .app-sidebar {
    transform: translateX(-100%);
  }
  .admin-body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }
  .admin-body .app-shell {
    margin-left: 0;
  }
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1035;
  background: var(--overlay);
  backdrop-filter: blur(2px);
}

.sidebar-brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  border-bottom: 1px solid var(--border);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  font-size: 1.15rem;
  min-width: 0;
  text-decoration: none;
}

.brand-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: var(--primary);
  color: var(--text-on-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-text span { color: var(--text-muted); }

.sidebar-close {
  border: 0;
  background: var(--bg-muted);
  color: var(--text);
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-user-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .sidebar-user-avatar {
  background: rgba(255, 197, 37, 0.15);
  color: var(--primary);
}

.sidebar-user-meta strong {
  display: block;
  font-size: 0.85rem;
}

.sidebar-user-meta small {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
}

.sidebar-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.75rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: 0.2s ease;
}

.sidebar-link i {
  width: 1.1rem;
  text-align: center;
  color: var(--primary);
}

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

.sidebar-link.active {
  background: rgba(255, 197, 37, 0.15);
  color: var(--text);
  border: 1px solid rgba(255, 197, 37, 0.35);
}

.sidebar-footer {
  padding: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.sidebar-cart-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 0.75rem;
  background: var(--secondary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid #ef4444;
  background: transparent;
  color: #ef4444;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  text-decoration: none;
}
.sidebar-logout-btn:hover {
  background: #ef4444;
  color: #fff;
}

[data-theme="dark"] .sidebar-cart-btn {
  background: var(--primary);
  color: var(--text-on-primary);
}
[data-theme="dark"] .sidebar-logout-btn {
  border-color: #f87171;
  color: #f87171;
}
[data-theme="dark"] .sidebar-logout-btn:hover {
  background: #ef4444;
  color: #fff;
}

.cart-badge {
  margin-left: auto;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--primary);
  color: var(--text-on-primary);
  font-size: 0.65rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
}

/* Topbar */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  min-height: var(--topbar-height);
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 1rem 0 1.8rem;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.topbar-search {
  position: relative;
  flex: 1 1 12rem;
  max-width: 22rem;
  min-width: 0;
  margin: 0 0.35rem;
}
.topbar-search-toggle {
  flex-shrink: 0;
}
.topbar-search-close {
  display: none;
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.topbar-search-form {
  position: relative;
  display: flex;
  align-items: center;
}
.topbar-search-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  pointer-events: none;
  z-index: 1;
}
.topbar-search-input {
  width: 100%;
  height: 2.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-muted, #f3f4f6);
  color: var(--text);
  padding: 0 0.9rem 0 2.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.topbar-search-input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.78rem;
}
.topbar-search-input:focus {
  border-color: var(--primary);
  background: var(--card, #fff);
  box-shadow: 0 0 0 3px rgba(255, 197, 37, 0.18);
}
.topbar-search-results {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  background: var(--card, #fff);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  box-shadow: 0 12px 28px rgba(0,0,0,.12);
  max-height: 20rem;
  overflow-y: auto;
  z-index: 1080;
  padding: 0.35rem;
}
.topbar-search-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.55rem;
  border-radius: 0.65rem;
  text-decoration: none;
  color: inherit;
}
.topbar-search-item:hover,
.topbar-search-item.is-active {
  background: var(--bg-muted, #f3f4f6);
}
.topbar-search-item img {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: cover;
  border-radius: 0.45rem;
  background: var(--bg-muted);
  flex-shrink: 0;
}
.topbar-search-item strong {
  display: block;
  font-size: 0.8rem;
  line-height: 1.25;
}
.topbar-search-item small {
  display: block;
  color: var(--text-muted);
  font-size: 0.7rem;
}
.topbar-search-empty,
.topbar-search-more {
  padding: 0.65rem 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}
.topbar-search-more a {
  color: var(--primary-dark);
  font-weight: 800;
  text-decoration: none;
}

.topbar-left {
  gap: 0.35rem;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 900;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 2.55rem;
  height: 2.55rem;
  max-width: none;
  object-fit: contain;
  object-position: center;
  border-radius: 50%;
  background: #000;
  flex-shrink: 0;
  overflow: hidden;
}
.topbar-brand .brand-logo,
.topbar-brand .brand-logo-header {
  width: auto;
  height: 4.35rem;
  max-width: min(78vw, 22.5rem);
  border-radius: 0;
  object-fit: contain;
  object-position: left center;
  background: transparent;
  margin-left: 1.25rem;
}
.brand-logo-sm {
  width: 2.15rem;
  height: 2.15rem;
}
.brand-portal-label {
  display: inline;
  font-size: 0.68rem !important;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted) !important;
  margin-left: 0.25rem;
}
.footer-logo {
  display: block;
  width: 3.25rem;
  height: 3.25rem;
  max-width: none;
  object-fit: contain;
  object-position: center;
  border-radius: 50%;
  background: #000;
  flex-shrink: 0;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.footer-brand-name {
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--primary-dark);
  line-height: 1.1;
}
.brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.05;
}
.brand-owner {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.brand-owner a {
  color: var(--primary-dark);
  text-decoration: none;
}
.brand-owner a:hover { text-decoration: underline; }
.topbar-brand .brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.12rem;
  line-height: 1;
  min-width: 0;
}
.topbar-brand .brand-text-main {
  display: block !important;
  font-size: 1.05rem !important;
  font-weight: 900 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase;
  color: var(--text) !important;
  margin: 0 !important;
}
.topbar-brand .brand-text-sub {
  display: block !important;
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.22em !important;
  text-transform: uppercase;
  color: var(--primary-dark) !important;
  margin: 0 !important;
}
[data-theme="dark"] .topbar-brand .brand-text-sub {
  color: var(--primary) !important;
}
.topbar-brand:hover .brand-text-main {
  color: var(--primary-dark);
}
[data-theme="dark"] .topbar-brand:hover .brand-text-main {
  color: var(--primary);
}

.topbar-title {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.topbar-title strong {
  font-size: 0.85rem;
  font-weight: 800;
}

.header-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  transition: 0.15s ease;
}
.header-nav-link:hover {
  color: var(--text);
  background: var(--bg-muted);
}
.header-nav-link.active {
  color: var(--text-on-primary);
  background: var(--primary);
}
.header-nav-dashboard-dd {
  display: inline-flex;
  align-items: center;
}
.header-nav-dashboard-dd > .header-nav-link {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.header-nav-dashboard {
  color: var(--primary-dark);
  background: var(--primary-soft);
}
.header-nav-dashboard:hover,
.header-nav-dashboard.active,
.header-nav-dashboard.show {
  color: var(--text-on-primary);
  background: var(--primary);
}
.header-nav-dashboard-dd .dropdown-menu {
  border-radius: 0.85rem;
  border-color: var(--border-light);
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.12);
  min-width: 14rem;
}
.admin-topbar-menu {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  margin-right: 0.75rem;
}

.app-main {
  flex: 1;
  min-height: calc(100vh - var(--topbar-height) - 180px);
}

.app-content {
  max-width: 1400px;
}

/* =========================================================
   Bootstrap theme tweaks
   ========================================================= */

.btn-primary {
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-color: var(--text-on-primary);
  --bs-btn-hover-bg: var(--primary-dark);
  --bs-btn-hover-border-color: var(--primary-dark);
  --bs-btn-hover-color: var(--text-on-primary);
  --bs-btn-active-bg: var(--primary-dark);
  --bs-btn-active-border-color: var(--primary-dark);
  --bs-btn-active-color: var(--text-on-primary);
  font-weight: 800;
}

.btn-outline-primary {
  --bs-btn-color: var(--primary-dark);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary);
  --bs-btn-hover-border-color: var(--primary);
  --bs-btn-hover-color: var(--text-on-primary);
  font-weight: 800;
}

.btn-icon-ghost {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon-ghost:hover {
  background: var(--bg-muted);
  color: var(--text);
}

.user-chip {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.4rem;
  background: var(--primary);
  color: var(--text-on-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 900;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(255, 197, 37, 0.25);
}

/* Password show/hide */
.password-field {
  position: relative;
  display: block;
}
.password-field .form-control {
  padding-right: 2.75rem;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  width: 2.15rem;
  height: 2.15rem;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  z-index: 2;
}
.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--text);
  background: var(--bg-muted);
  outline: none;
}
.password-toggle.is-on {
  color: var(--primary-dark);
}
[data-theme="dark"] .password-toggle.is-on {
  color: var(--primary);
}

/* Dark mode — forms, alerts, dropdowns (account + storefront) */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] textarea.form-control {
  background-color: var(--bg-muted);
  border-color: var(--border);
  color: var(--text);
}

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

[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-select:disabled {
  background-color: var(--bg-secondary);
  color: var(--text-muted);
  opacity: 0.9;
}

[data-theme="dark"] .form-check-input {
  background-color: var(--bg-muted);
  border-color: var(--border);
}

[data-theme="dark"] .form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

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

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

[data-theme="dark"] .btn-link {
  color: var(--primary);
}

[data-theme="dark"] .alert-success {
  background: var(--success-soft);
  border-color: rgba(16, 185, 120, 0.35);
  color: #6ee7b7;
}

[data-theme="dark"] .alert-danger {
  background: var(--error-soft);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

[data-theme="dark"] .alert-light {
  background: var(--bg-muted);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .dropdown-menu {
  background: var(--card);
  border-color: var(--border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .dropdown-item {
  color: var(--text);
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
  background: var(--bg-muted);
  color: var(--text);
}

[data-theme="dark"] .dropdown-header {
  color: var(--text-muted);
}

[data-theme="dark"] .dropdown-divider {
  border-color: var(--border);
}

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

[data-theme="dark"] .eyebrow,
[data-theme="dark"] .filter-label {
  color: var(--primary);
}

[data-theme="dark"] .text-muted {
  color: var(--text-muted) !important;
}

[data-theme="dark"] .icon-box-lion {
  background: var(--primary-soft);
  color: var(--primary);
}

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

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

[data-theme="dark"] .btn-light {
  --bs-btn-bg: var(--bg-muted);
  --bs-btn-border-color: var(--border);
  --bs-btn-color: var(--text);
  --bs-btn-hover-bg: var(--card);
  --bs-btn-hover-border-color: var(--border);
  --bs-btn-hover-color: var(--text);
  --bs-btn-active-bg: var(--card);
  --bs-btn-active-border-color: var(--primary);
  --bs-btn-active-color: var(--text);
}

[data-theme="dark"] .text-dark {
  color: var(--text) !important;
}

[data-theme="dark"] .text-success {
  color: #6ee7b7 !important;
}

[data-theme="dark"] .text-primary {
  color: var(--primary) !important;
}

[data-theme="dark"] .progress {
  background-color: var(--bg-muted);
}

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

[data-theme="dark"] .table > :not(caption) > * > * {
  background-color: transparent;
  border-bottom-color: var(--border);
  color: var(--text);
  box-shadow: none;
}

[data-theme="dark"] .badge.text-bg-light {
  background-color: var(--bg-muted) !important;
  color: var(--text) !important;
}

[data-theme="dark"] .topbar-search-input {
  background: var(--bg-muted);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .topbar-search-results {
  background: var(--card);
  border-color: var(--border);
}

[data-theme="dark"] .topbar-search-item strong {
  color: var(--text);
}

[data-theme="dark"] .header-nav-dashboard {
  color: var(--primary);
  background: var(--primary-soft);
}

[data-theme="dark"] .footer-brand-name,
[data-theme="dark"] .brand-owner a {
  color: var(--primary);
}

[data-theme="dark"] .stat-card .value {
  color: var(--primary);
}

[data-theme="dark"] .account-page a:not(.btn):not(.account-list-item):not(.profile-quick-link),
[data-theme="dark"] .checkout-page a:not(.btn) {
  color: var(--primary);
}

[data-theme="dark"] .fw-black,
[data-theme="dark"] strong {
  color: inherit;
}

/* =========================================================
   Components
   ========================================================= */

.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.border-primary { border-color: var(--primary) !important; }
.bg-primary-soft { background-color: var(--primary-soft) !important; }

.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-error { color: var(--error) !important; }
.text-info { color: var(--info) !important; }
.text-muted-foreground { color: var(--text-muted); }

.text-lion { color: var(--primary) !important; }
.bg-lion { background-color: var(--primary) !important; }
.border-lion { border-color: var(--primary) !important; }

.eyebrow {
  display: block;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin-bottom: 0.25rem;
}

.section-title {
  font-size: 1.5rem !important;
  line-height: 1.15 !important;
  font-weight: 900 !important;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--text);
}

.section-title .accent,
.section-title span.accent { color: var(--primary); }

.title-underline {
  border-bottom: 3px solid var(--primary);
  padding-bottom: 2px;
}

.card,
.sc-card {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.badge-lion,
.badge-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: var(--primary);
  color: var(--text-on-primary);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.badge-flash,
.badge-error {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: var(--error);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.btn-lion,
.btn.btn-primary.btn-lion {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-on-primary);
}

.icon-box-lion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.9rem;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.pulse-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: var(--primary);
  animation: pulseDot 1.5s ease infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Footer */
.app-footer {
  position: relative;
  margin-top: auto;
  border-top: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 197, 37, 0.08) 0%, transparent 120px),
    var(--bg-secondary);
  overflow: hidden;
}
.footer-accent {
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 45%, #111827 100%);
}
.footer-inner {
  padding-top: 2.5rem;
  padding-bottom: 1rem;
  max-width: 1400px;
  margin: 0 auto;
}
.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
@media (min-width: 992px) {
  .footer-top {
    grid-template-columns: 1.4fr 1fr;
    align-items: start;
  }
}
.footer-brand-block .footer-text {
  max-width: 28rem;
  margin: 0.55rem 0 1.1rem;
}
.footer-owner-label {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.footer-owner-label a {
  color: var(--primary-dark);
  text-decoration: none;
}
.footer-owner-label a:hover { text-decoration: underline; }
.footer-bottom a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 800;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
[data-theme="dark"] .footer-brand-name { color: var(--primary); }

.footer-contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}
.footer-contact-row a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}
.footer-contact-row a i { color: var(--primary-dark); }
.footer-contact-row a:hover { color: var(--primary-dark); }

.footer-cols {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.25rem 2rem;
}

@media (min-width: 768px) {
  .footer-cols {
    flex-wrap: nowrap;
  }
}

.footer-col {
  flex: 1 1 0;
  min-width: 8.5rem;
}

.footer-heading {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
}
.footer-links li { margin-bottom: 0; }
.footer-links a {
  font-weight: 700;
  color: var(--text);
  font-size: 0.9rem;
}
.footer-links a:hover { color: var(--primary-dark); }

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}
.footer-legal a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 800;
}
.footer-legal a:hover { text-decoration: underline; }

.footer-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-faq-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.15rem;
  padding: 1.15rem 1.15rem 1.25rem;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
  margin-bottom: 1.5rem;
}
.footer-faq-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.footer-faq-note {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
}
.footer-faq {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}
@media (min-width: 768px) {
  .footer-faq {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.footer-faq-item {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  margin-bottom: 0;
  height: fit-content;
}
.footer-faq-item button {
  font-size: 0.82rem;
  padding: 0.8rem 0.95rem;
}
.footer-faq-item .faq-content {
  font-size: 0.82rem;
  color: var(--text-muted);
}
[data-theme="dark"] .footer-faq-item {
  background: var(--bg-muted);
}
[data-theme="dark"] .footer-faq-panel {
  background: var(--card);
  box-shadow: none;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 0 1.35rem;
  border-top: 1px solid var(--border);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Overlays used by pages */
.drawer-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: 0.3s ease;
}
.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.drawer-panel {
  transform: translateX(100%);
  transition: transform 0.35s ease;
}
.drawer-overlay.open .drawer-panel { transform: translateX(0); }

.modal-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.modal-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.faq-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}
.faq-item.open .faq-content {
  max-height: 500px;
  opacity: 1;
}
.faq-chevron { transition: transform 0.4s ease; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }

.wishlist-active {
  color: #fff !important;
  background-color: var(--error) !important;
}

/* =========================================================
   Admin portal shell (no storefront footer)
   ========================================================= */

.admin-body .app-footer { display: none !important; }

.admin-portal .panel {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 1rem;
  padding: 1.15rem;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
}
.admin-topbar .admin-topbar-menu {
  flex: 1;
  justify-content: flex-end;
}
.admin-topbar .topbar-right {
  margin-left: 0;
}

.admin-alerts {
  position: relative;
}
.admin-alerts-toggle {
  width: 2.35rem;
  height: 2.35rem;
}
.admin-alerts-badge {
  top: 0.15rem;
  right: 0.1rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.28rem;
  font-size: 0.62rem;
  line-height: 1.1rem;
  background: #dc2626;
  color: #fff;
}
.admin-alerts-badge.is-pulse {
  animation: admin-alert-pulse 1.2s ease-out 1;
}
@keyframes admin-alert-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}
.admin-alerts-menu {
  width: min(22rem, calc(100vw - 1.5rem));
  max-height: min(70vh, 32rem);
  overflow: auto;
  border-radius: 1rem;
  border: 1px solid var(--border-light);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
}
.admin-alerts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem 0.55rem;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}
.admin-alerts-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  padding: 0.75rem;
}
.admin-alerts-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.6rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-light);
  background: var(--bg-muted, #f8fafc);
  text-decoration: none;
  color: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  transition: border-color 0.15s, background 0.15s;
}
.admin-alerts-chip:hover {
  border-color: var(--primary);
  background: var(--primary-soft, #fff7ed);
  color: inherit;
}
.admin-alerts-chip i {
  color: var(--primary);
  width: 1rem;
  text-align: center;
}
.admin-alerts-chip span {
  flex: 1;
  min-width: 0;
}
.admin-alerts-chip strong {
  font-size: 0.85rem;
}
.admin-alerts-chip.has-alert strong {
  color: #dc2626;
}
.admin-alerts-list {
  border-top: 1px solid var(--border-light);
}
.admin-alerts-section-title {
  padding: 0.55rem 1rem 0.2rem;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-alerts-item {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.65rem 1rem;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid transparent;
}
.admin-alerts-item + .admin-alerts-item {
  border-top-color: var(--border-light);
}
.admin-alerts-item:hover {
  background: var(--bg-muted, #f8fafc);
  color: inherit;
}
.admin-alerts-item-icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft, #fff7ed);
  color: var(--primary);
  flex-shrink: 0;
  font-size: 0.75rem;
}
.admin-alerts-item-body {
  min-width: 0;
  flex: 1;
}
.admin-alerts-item-body strong {
  display: block;
  font-size: 0.82rem;
  line-height: 1.25;
}
.admin-alerts-item-body small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}
.admin-alerts-empty {
  padding: 1rem;
  text-align: center;
}
[data-theme="dark"] .admin-alerts-chip,
[data-theme="dark"] .admin-alerts-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.brand-text {
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.15;
  display: inline;
  min-width: 0;
}
.brand-text span {
  color: inherit;
  display: inline;
  font-size: inherit;
  letter-spacing: inherit;
}

.user-chip {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.4rem;
  background: var(--primary);
  color: var(--text-on-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 900;
}

/* =========================================================
   Responsive: phones + tablets
   ========================================================= */

.app-shell,
.app-main,
.app-content {
  min-width: 0;
  max-width: 100%;
}

.app-content {
  width: 100%;
  overflow-x: clip;
}

@media (max-width: 991.98px) {
  :root {
    --topbar-height: 66px;
  }

  .app-topbar {
    gap: 0.45rem;
    padding: 0 0.65rem 0 0.45rem;
  }

  .topbar-left,
  .topbar-right {
    gap: 0.35rem;
  }

  .brand-logo {
    width: 2.25rem;
    height: 2.25rem;
  }

  .topbar-brand .brand-logo,
  .topbar-brand .brand-logo-header {
    height: 3.65rem;
    max-width: min(72vw, 18rem);
    border-radius: 0;
    background: transparent;
  }

  .topbar-search {
    position: absolute;
    left: 0.55rem;
    right: 0.55rem;
    top: calc(100% + 0.35rem);
    max-width: none;
    flex: none;
    margin: 0;
    z-index: 1085;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  }
  .topbar-search.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }
  .topbar-search-form {
    background: var(--card, #fff);
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(0,0,0,.14);
  }
  .topbar-search-input {
    height: 2.55rem;
    font-size: 0.84rem;
    padding-right: 2.5rem;
    background: var(--card, #fff);
  }
  .topbar-search-close {
    display: inline-flex;
  }
  .topbar-search-results {
    left: 0;
    right: 0;
  }
  .header-nav {
    display: none !important;
  }

  .btn-icon-ghost {
    width: 2.2rem;
    height: 2.2rem;
  }

  .app-content.container-fluid {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  .footer-inner {
    padding-top: 1.75rem;
  }

  .footer-links a {
    font-size: 0.82rem;
  }
}

@media (max-width: 767.98px) {
  .brand-logo {
    width: 2rem;
    height: 2rem;
  }

  .topbar-brand .brand-logo,
  .topbar-brand .brand-logo-header {
    height: 3.1rem;
    max-width: min(68vw, 15rem);
    border-radius: 0;
    background: transparent;
  }

  .brand-portal-label {
    display: none;
  }

  .footer-logo {
    width: 2.75rem;
    height: 2.75rem;
  }

  .topbar-brand .brand-text {
    max-width: none;
    overflow: visible;
  }

  .topbar-brand .brand-text-main {
    font-size: 0.88rem !important;
    letter-spacing: 0.06em !important;
  }

  .topbar-brand .brand-text-sub {
    font-size: 0.58rem !important;
    letter-spacing: 0.16em !important;
  }

  .footer-brand-block {
    text-align: center;
  }

  .footer-brand-block .footer-text {
    margin-left: auto;
    margin-right: auto;
  }

  .footer-brand {
    justify-content: center;
  }

  .footer-contact-row {
    justify-content: center;
  }

  .footer-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 0.75rem;
    margin-top: 0.25rem;
  }

  .footer-col {
    min-width: 0;
    text-align: center;
    padding: 0.85rem 0.5rem;
    border: 1px solid var(--border-light);
    border-radius: 0.85rem;
    background: var(--card);
  }

  .footer-heading {
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.55rem;
    text-align: center;
  }

  .footer-links {
    gap: 0.4rem;
    align-items: center;
  }

  .footer-links a {
    font-size: 0.78rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
  }

  .footer-legal {
    justify-content: center;
    width: 100%;
  }

  .topbar-user-nav .btn {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }
}

@media (max-width: 575.98px) {
  /* Keep Collections|Shop and Help|Others as two horizontal rows on small phones */
  .footer-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 0.65rem;
  }

  .footer-col {
    padding: 0.85rem 0.45rem;
  }

  .app-content.container-fluid.py-4 {
    padding-top: 1rem !important;
    padding-bottom: 1.25rem !important;
  }
}

/* Tables / wide panels: scroll inside viewport */
.table-responsive,
.admin-portal .table-responsive,
.account-page .table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-portal .panel,
.card {
  max-width: 100%;
}
