:root {
  --bg: #0f172a;
  --bg-soft: #16213e;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-solid: #121b33;
  --text: #e5eefb;
  --muted: #96a4c4;
  --border: rgba(148, 163, 184, 0.15);
  --primary: #7c3aed;
  --primary-2: #2563eb;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 24px 60px rgba(2, 6, 23, 0.25);
  --table-head: rgba(30, 41, 59, 0.92);
  --table-row: rgba(15, 23, 42, 0.48);
  --table-hover: rgba(124, 58, 237, 0.12);
}

html[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-soft: #ffffff;
  --panel: rgba(255, 255, 255, 0.85);
  --panel-solid: #ffffff;
  --text: #172033;
  --muted: #6b7280;
  --border: rgba(15, 23, 42, 0.08);
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  --table-head: rgba(241, 245, 249, 0.98);
  --table-row: rgba(255, 255, 255, 0.98);
  --table-hover: rgba(37, 99, 235, 0.08);
}

html, body {
  min-height: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: radial-gradient(circle at top left, rgba(124, 58, 237, 0.25), transparent 25%),
              radial-gradient(circle at top right, rgba(37, 99, 235, 0.22), transparent 20%),
              var(--bg);
  color: var(--text);
}

.landing-body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: #0a1628;
  color: #fff;
}

.landing-shell {
  overflow-x: hidden;
}

.landing-container,
.landing-section .container {
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
}

.landing-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(180deg, #0a1628 0%, #0d1d38 100%);
}

.landing-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(0,201,167,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(0,201,167,0.04) 1px, transparent 1px);
  background-size: 80px 80px;
}

.landing-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
}

.landing-glow-teal {
  width: 760px;
  height: 760px;
  background: rgba(0,201,167,0.18);
  top: -180px;
  right: -60px;
}

.landing-glow-purple {
  width: 520px;
  height: 520px;
  background: rgba(124,111,255,0.14);
  bottom: -140px;
  left: -60px;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.landing-brand h1,
.footer-brand h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}

.landing-brand h1 span,
.footer-brand h3 span {
  color: #00c9a7;
}

.landing-brand p,
.footer-brand p {
  margin: 0;
  color: rgba(255,255,255,0.62);
}

.landing-brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: #00c9a7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.landing-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.landing-login-fab {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1200;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.landing-login-fab:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
}

.landing-hero .landing-container {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
  padding: 120px 0 80px;
}

.landing-hero-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.landing-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  width: fit-content;
}

.landing-chip-teal {
  background: rgba(0,201,167,0.12);
  border: 1px solid rgba(0,201,167,0.28);
  color: #00e5c0;
}

.landing-chip-soft {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.72);
}

.landing-hero h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.8rem, 7vw, 5.6rem);
  line-height: 1.03;
  letter-spacing: -0.05em;
  margin: 0;
}

.landing-copy {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.78);
  line-height: 1.75;
  max-width: 760px;
}

.landing-copy-centered {
  max-width: 860px;
  margin: 0 auto;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.centered-actions {
  justify-content: center;
}

.landing-tech-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.landing-hero-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.landing-feature-card,
.landing-glass-card,
.landing-module-card,
.landing-stat-box {
  background: #112040;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  padding: 28px;
}

.landing-feature-card.teal { border-top: 3px solid #00c9a7; }
.landing-feature-card.orange { border-top: 3px solid #ff7a45; }
.landing-feature-card.purple { border-top: 3px solid #7c6fff; }
.landing-feature-card.blue { border-top: 3px solid #3b9eff; }

.landing-feature-card h3,
.landing-glass-card h3,
.landing-module-card h3,
.landing-stat-box strong {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.landing-feature-card p,
.landing-glass-card p,
.landing-module-card p,
.landing-stat-box span {
  color: rgba(255,255,255,0.68);
  line-height: 1.6;
}

.landing-feature-icon,
.landing-big-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.landing-section {
  padding: 96px 0;
  background: #0a1628;
}

.landing-section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 5vw, 4.25rem);
  line-height: 1.08;
  margin-bottom: 24px;
}

.landing-section-label {
  color: #00c9a7;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.landing-card-grid {
  display: grid;
  gap: 20px;
}

.landing-card-grid.three { grid-template-columns: repeat(3, 1fr); }
.landing-card-grid.five { grid-template-columns: repeat(5, 1fr); }

.landing-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.landing-divider {
  width: 68px;
  height: 4px;
  border-radius: 999px;
  background: #00c9a7;
  margin-bottom: 26px;
}

.landing-feature-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.landing-feature-row {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.landing-feature-row span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #00c9a7;
  flex-shrink: 0;
  margin-top: 10px;
}

.landing-feature-row p {
  margin: 0;
  color: rgba(255,255,255,0.78);
  line-height: 1.6;
}

.landing-feature-row strong {
  color: #fff;
}

.landing-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.landing-stat-box strong {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 3rem;
  color: #00c9a7;
}

.compact-grid .landing-module-card {
  text-align: center;
}

.compact-grid .landing-module-card span {
  display: block;
  font-size: 2rem;
  margin-bottom: 10px;
}

.landing-showcase,
.landing-value,
.landing-problem,
.landing-cta {
  background: linear-gradient(180deg, #0b182e 0%, #0a1628 100%);
}

.landing-mock-window {
  background: #0b1829;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0,0,0,0.45);
}

.landing-mock-bar {
  background: #0e2040;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.landing-mock-bar span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.landing-mock-bar span:nth-child(1) { background: #ff5f57; }
.landing-mock-bar span:nth-child(2) { background: #febc2e; }
.landing-mock-bar span:nth-child(3) { background: #28c840; }
.landing-mock-bar strong {
  margin-left: auto;
  color: rgba(255,255,255,0.6);
  font-size: 0.95rem;
}

.landing-mock-body {
  display: flex;
  gap: 20px;
  padding: 26px;
}

.landing-mock-products {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.landing-mock-product {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
}

.landing-mock-product.active {
  background: rgba(0,201,167,0.08);
  border: 1px solid rgba(0,201,167,0.2);
}

.landing-mock-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  font-size: 1.5rem;
}

.landing-mock-product strong,
.landing-mock-product span {
  color: #fff;
}

.landing-mock-product small {
  display: block;
  color: rgba(255,255,255,0.55);
}

.landing-mock-summary {
  width: 260px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.landing-mock-summary h4 {
  color: rgba(255,255,255,0.68);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.landing-mock-summary div {
  display: flex;
  justify-content: space-between;
  color: rgba(255,255,255,0.76);
}

.landing-mock-summary .total {
  font-weight: 800;
  color: #fff;
}

.landing-mock-summary button {
  margin-top: auto;
  border: 0;
  border-radius: 12px;
  background: #00c9a7;
  color: #0a1628;
  font-weight: 800;
  padding: 14px;
}

.landing-footer {
  padding: 40px 0 56px;
  background: #08101f;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.landing-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 24px;
}

.landing-footer h4 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.landing-footer a {
  display: block;
  color: rgba(255,255,255,0.68);
  margin-bottom: 6px;
}

.dashboard-hero {
  align-items: center;
}

.dashboard-chip {
  margin-bottom: 14px;
}

.hero-inline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-action-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.quick-action-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  color: var(--text);
  text-align: center;
}

.quick-action-card span {
  font-size: 1.55rem;
}

.quick-action-card strong {
  font-size: 0.92rem;
}

.stat-sub {
  color: var(--muted);
  font-size: 0.75rem;
}

.list-card-dense {
  padding: 14px 16px;
}

.admin-card-grid {
  margin-top: 8px;
}

.admin-module-card {
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.admin-module-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0,201,167,0.24);
  background: var(--table-hover);
}

.report-chart-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  height: 100%;
}

.report-chart-card h4 {
  margin-bottom: 14px;
  font-size: 1rem;
  font-weight: 700;
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  display: inline-block;
}
.color-dot-lg {
  width: 18px;
  height: 18px;
}

.pos-step-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.product-grid-pos .product-card {
  min-height: 150px;
}

.pos-cart-panel {
  box-shadow: 0 28px 70px rgba(2, 6, 23, 0.22);
}

.branch-select-dropdown {
  min-width: 170px;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

body.sidebar-open {
  overflow: hidden;
}

a { text-decoration: none; }

.app-shell {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: 100vh;
  gap: 24px;
  padding: 24px;
}
body.sidebar-collapsed .app-shell {
  grid-template-columns: 92px 1fr;
}
body.page-pos .app-shell {
  gap: 16px;
}

.content-shell { min-width: 0; }

.glass-panel {
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 28px;
}

.sidebar {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 25;
  overflow: hidden;
}
.sidebar-brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.sidebar-collapse-toggle {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .sidebar-title,
body.sidebar-collapsed .sidebar-link {
  white-space: nowrap;
}
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .sidebar-title,
body.sidebar-collapsed .sidebar .btn-outline-light {
  display: none;
}
body.sidebar-collapsed .sidebar-nav .nav-link {
  font-size: 0;
  line-height: 0;
}
body.sidebar-collapsed .sidebar-nav .nav-link i {
  font-size: 1.1rem;
  line-height: 1;
}
body.sidebar-collapsed .brand {
  justify-content: center;
}
body.sidebar-collapsed .sidebar-brand-row {
  flex-direction: column;
  align-items: center;
}
body.sidebar-collapsed .sidebar-nav .nav-link {
  justify-content: center;
  padding: 14px 10px;
}
body.sidebar-collapsed .sidebar-nav .nav-link i {
  margin: 0;
}
body.sidebar-collapsed .sidebar form {
  display: flex;
  justify-content: center;
}
body.sidebar-collapsed .sidebar form .btn-outline-light {
  display: inline-flex;
  width: 44px !important;
  min-width: 44px;
  padding: 0;
  justify-content: center;
  overflow: hidden;
  color: transparent;
}
body.sidebar-collapsed .sidebar form .btn-outline-light i {
  color: var(--text);
  margin: 0;
}

.mobile-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.56);
  border: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
}

.mobile-sidebar-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
}

.brand strong { display: block; font-size: 1.2rem; }
.brand small { color: var(--muted); }

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
}

.brand-mark.xl { width: 72px; height: 72px; border-radius: 22px; }

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sidebar-nav .nav-link {
  color: var(--text);
  padding: 14px 16px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  background: rgba(124, 58, 237, 0.14);
}

.sidebar-title {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 18px 14px 8px;
  text-transform: uppercase;
}

.topbar {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar-title { font-size: 1.6rem; font-weight: 800; margin: 0; }
.topbar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.branch-compact-form { margin: 0; }
.small-label, .eyebrow, .muted-text { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; font-weight: 700; }
.user-pill {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,0.06);
}
.user-pill-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.theme-toggle-button,
.branch-apply-button {
  white-space: nowrap;
}
.user-avatar {
  width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: white; font-weight: 700;
}
.page-content { padding-bottom: 24px; }
.management-header {
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.management-header h2 { margin: 0; font-size: 1.8rem; font-weight: 800; }
.management-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-shell-narrow {
  width: min(100%, 760px);
  margin: 0 auto;
}
.desktop-table { display: block; }
.mobile-list { display: none; }
.mobile-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 18px;
}
.mobile-card h4 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
}
.mobile-card p { margin: 0; color: var(--muted); }
.mobile-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.mobile-card-line {
  margin-bottom: 8px;
  color: var(--text) !important;
}
.mobile-card-meta {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  margin-top: 10px;
}
.form-actions-sticky {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, transparent, var(--panel-solid) 25%);
  padding-top: 14px;
}
.hero-card {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 30px; border-radius: 30px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.22), rgba(37, 99, 235, 0.18));
  border: 1px solid var(--border);
}
.hero-card h2 { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { padding: 22px; display: flex; gap: 14px; align-items: center; }
.stat-icon {
  width: 56px; height: 56px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; color: var(--text);
}
.stat-label { margin: 0; color: var(--muted); }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-header h3 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.list-stack { display: flex; flex-direction: column; gap: 12px; }
.list-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(255,255,255,0.04); padding: 16px 18px; border-radius: 20px; border: 1px solid var(--border);
}
.empty-state { padding: 22px; text-align: center; border-radius: 20px; background: rgba(255,255,255,0.04); color: var(--muted); }
.table-modern { color: var(--text); }
.table-modern thead th {
  color: var(--muted) !important;
  border-bottom-color: var(--border) !important;
  font-weight: 600;
  background: var(--table-head) !important;
}
.table-modern tbody td,
.table-modern tbody th,
.table-modern > :not(caption) > * > * {
  color: var(--text) !important;
  background: var(--table-row) !important;
  border-bottom-color: var(--border) !important;
}
.table-modern tbody tr:hover td,
.table-modern tbody tr:hover th {
  background: var(--table-hover) !important;
}
.table-modern a,
.table-modern strong,
.table-modern span,
.table-modern td,
.table-modern th {
  color: var(--text) !important;
}
.table-modern .btn-link {
  color: var(--primary-2) !important;
}
.table-modern .text-warning,
.table-modern .small,
.table-modern .muted-text {
  color: var(--muted) !important;
}
.form-control, .form-select, .branch-switch-input {
  border-radius: 18px; border: 1px solid var(--border); background: rgba(255,255,255,0.04); color: var(--text); padding: 0.9rem 1rem;
}
.form-control::placeholder {
  color: var(--muted);
}
.form-control[readonly],
.form-select:disabled,
.form-control:disabled {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}
.form-select option,
select option {
  background: var(--panel-solid);
  color: var(--text);
}
.form-control-color-themed {
  min-height: 52px;
  padding: 0.35rem;
  background: var(--panel-solid);
}
.select-search-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.select-search-input {
  min-height: 44px;
}
.branch-switch-input { width: 78px; }
.form-control:focus, .form-select:focus, .form-check-input:focus, .branch-switch-input:focus {
  background: rgba(255,255,255,0.06); color: var(--text); border-color: rgba(124, 58, 237, 0.6); box-shadow: 0 0 0 0.2rem rgba(124, 58, 237, 0.18);
}
.form-check-input { cursor: pointer; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border: none; }
.btn-soft-primary, .btn-soft-secondary {
  border: 1px solid var(--border); border-radius: 999px; background: rgba(255,255,255,0.06); color: var(--text);
}
.btn-soft-primary:hover, .btn-soft-secondary:hover { background: rgba(255,255,255,0.12); color: var(--text); }
.btn-xl { padding: 1rem 1.4rem; font-size: 1.1rem; }
.soft-alert { border-radius: 18px; border: none; }
.modal-content {
  --bs-modal-bg: var(--panel-solid);
  --bs-modal-color: var(--text);
  --bs-modal-border-color: var(--border);
  --bs-modal-header-border-color: var(--border);
  --bs-modal-footer-border-color: var(--border);
  background: var(--panel-solid);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 24px;
}
.modal-dialog {
  --bs-modal-bg: var(--panel-solid);
  --bs-modal-color: var(--text);
}
.modal-header,
.modal-body,
.modal-footer {
  background: var(--panel-solid);
  color: var(--text);
}
.modal-header,
.modal-footer {
  border-color: var(--border);
}
.modal-title,
.modal-content label,
.modal-content .muted-text,
.modal-content .form-check-label,
.modal-content p,
.modal-content span,
.modal-content div,
.modal-content strong,
.modal-content small,
.modal-content td,
.modal-content th {
  color: var(--text);
}
.modal-content .table,
.modal-content .table > :not(caption) > * > * {
  color: var(--text);
  background: transparent;
  border-color: var(--border);
}
.modal-content .btn-soft-secondary,
.modal-content .btn-soft-primary {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.modal-backdrop.show {
  opacity: 0.7;
}
.btn-close {
  filter: invert(1) grayscale(1);
}
html[data-theme="light"] .btn-close {
  filter: none;
}
.auth-shell {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.login-card { width: min(100%, 520px); padding: 36px; }
.login-brand { display: flex; align-items: center; gap: 18px; }
.login-hint { padding: 16px; border-radius: 18px; background: rgba(255,255,255,0.04); color: var(--muted); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.product-grid-pos { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.pos-favorite-card {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(124, 58, 237, 0.12));
}
.page-pos .page-content {
  padding-top: 4px;
}
.page-pos .topbar {
  margin-bottom: 16px;
}
.page-pos .pos-panel {
  min-height: calc(100vh - 170px);
}
.product-card {
  text-align: left; padding: 18px; border-radius: 24px; border: 1px solid var(--border); background: rgba(255,255,255,0.04); color: var(--text); display: flex; flex-direction: column; gap: 6px;
}
.pos-colored-card {
  color: var(--pos-card-text, var(--text)) !important;
}
.pos-colored-card * {
  color: inherit !important;
}
.product-thumb {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.product-thumb-lg {
  width: 128px;
  height: 128px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.product-placeholder {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px dashed var(--border);
  background: rgba(255,255,255,0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
}
.product-placeholder-lg {
  width: 128px;
  height: 128px;
  border-radius: 20px;
  border: 1px dashed var(--border);
  background: rgba(255,255,255,0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.product-card:hover { transform: translateY(-2px); background: rgba(124, 58, 237, 0.12); }
.total-box {
  display: flex; justify-content: space-between; align-items: center; padding: 20px 22px; border-radius: 24px; background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(37, 99, 235, 0.16));
}
.total-box strong { font-size: 2rem; }
.sticky-panel { position: sticky; top: 24px; }
.search-results { display: flex; flex-direction: column; gap: 10px; }
.search-result-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 14px; border-radius: 18px; border: 1px solid var(--border); background: rgba(255,255,255,0.04); }
.search-result-item strong,
.search-result-item span,
.search-result-item .muted-text {
  color: var(--text);
}

@media (max-width: 1199px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 991px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 12px;
    left: 12px;
    bottom: 12px;
    width: min(86vw, 320px);
    transform: translateX(calc(-100% - 24px));
    transition: transform 0.22s ease;
    overflow-y: auto;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  body.sidebar-open .mobile-sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }
  .sticky-panel { position: static; }
  .management-header { flex-direction: column; align-items: stretch; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .mobile-sidebar-toggle {
    display: inline-flex;
  }

  .landing-hero .landing-container,
  .landing-split,
  .landing-footer-grid {
    grid-template-columns: 1fr;
  }

  .landing-card-grid.five,
  .landing-card-grid.three,
  .landing-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .topbar, .hero-card { flex-direction: column; align-items: stretch; }
  .stats-grid { grid-template-columns: 1fr; }
  .app-shell { padding: 12px; gap: 12px; }
  .sidebar, .topbar, .glass-panel { border-radius: 22px; }
  .sidebar-nav .nav-link { padding: 12px 14px; }
  .topbar { padding: 16px; }
  .topbar > div:first-child {
    width: 100%;
  }
  .topbar-title { font-size: 1.35rem; }
  .small-label { display: none; }
  .branch-switch-input { width: 64px; }
  .management-header { padding: 18px; }
  .management-header h2 { font-size: 1.45rem; }
  .desktop-table { display: none; }
  .mobile-list { display: flex; flex-direction: column; gap: 12px; }
  .form-shell-narrow { width: 100%; }
  .btn, .form-control, .form-select { min-height: 48px; }
  textarea.form-control { min-height: 110px; }
  .user-pill {
    width: auto;
    justify-content: center;
    padding: 6px 8px;
    min-height: 44px;
  }
  .user-pill-text {
    display: none;
  }
  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;
  }
  .topbar-actions form {
    width: 100%;
  }
  .branch-compact-form {
    display: flex !important;
    gap: 6px !important;
    align-items: center !important;
  }
  .branch-apply-button,
  .theme-toggle-button {
    min-width: 44px;
    min-height: 44px;
    padding: 0.55rem 0.8rem;
  }
  .theme-toggle-label {
    display: none;
  }
  .branch-apply-button {
    font-size: 0.85rem;
  }

  .landing-container,
  .landing-section .container {
    width: calc(100% - 28px);
  }

  .landing-login-fab {
    top: 14px;
    right: 14px;
    padding: 10px 14px;
    font-size: 0.92rem;
  }

  .landing-card-grid.five,
  .landing-card-grid.three,
  .landing-stat-grid {
    grid-template-columns: 1fr;
  }

  .landing-hero .landing-container {
    padding-top: 110px;
  }

  .landing-mock-body {
    flex-direction: column;
  }

  .landing-mock-summary {
    width: 100%;
  }
}
