:root {
  --bg: #eef4ff;
  --panel: #ffffff;
  --panel-strong: #f3f7ff;
  --ink: #0d1324;
  --muted: #657187;
  --line: #d9e2f4;
  --accent: #586bff;
  --accent-dark: #2238b8;
  --green: #2f7d57;
  --gold: #d8b94f;
  --blue: #29b6f6;
  --violet: #8b5cf6;
  --shadow: 0 18px 42px rgba(13, 19, 36, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-theme="dark"] .login-screen {
  background:
    radial-gradient(circle at 24% 16%, rgba(79, 214, 255, 0.24), transparent 26%),
    radial-gradient(circle at 78% 72%, rgba(167, 139, 250, 0.22), transparent 28%),
    radial-gradient(circle at 50% 102%, rgba(244, 212, 99, 0.16), transparent 30%),
    linear-gradient(135deg, #040713 0%, #0b1023 48%, #111a35 100%);
}

body[data-theme="dark"] .login-card {
  background: linear-gradient(180deg, rgba(12, 18, 36, 0.94), rgba(8, 12, 25, 0.92));
}

body[data-theme="dark"] .login-logo,
body[data-theme="dark"] .brand-logo {
  background: #050814;
}

body[data-theme="dark"] .login-tab {
  border-color: rgba(79, 214, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #d9e7ff;
}

body[data-theme="dark"] .login-tab.is-active {
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #ffffff;
}

.runtime-error-panel {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: grid;
  gap: 8px;
  max-width: 760px;
  padding: 16px;
  border: 1px solid rgba(239, 68, 68, 0.38);
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.96);
  color: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

.runtime-error-panel span {
  color: #fecaca;
  font-size: 13px;
}

.runtime-error-panel button {
  justify-self: start;
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  background: #4fd6ff;
  color: #05111f;
  font-weight: 800;
  cursor: pointer;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(41, 182, 246, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(139, 92, 246, 0.16), transparent 32%),
    linear-gradient(135deg, rgba(216, 185, 79, 0.08), transparent 42%),
    var(--bg);
  transition: background-color 160ms ease, color 160ms ease;
}

body[data-theme="dark"] {
  --bg: #050814;
  --panel: #0c1224;
  --panel-strong: #111a32;
  --ink: #f7fbff;
  --muted: #aab7d4;
  --line: #243252;
  --accent: #6577ff;
  --accent-dark: #3446d8;
  --green: #67c995;
  --gold: #f4d463;
  --blue: #4fd6ff;
  --violet: #a78bfa;
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
  background:
    radial-gradient(circle at top left, rgba(79, 214, 255, 0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(167, 139, 250, 0.16), transparent 30%),
    radial-gradient(circle at 50% 0, rgba(244, 212, 99, 0.08), transparent 28%),
    var(--bg);
}

body.is-locked {
  overflow: hidden;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 24% 16%, rgba(79, 214, 255, 0.24), transparent 26%),
    radial-gradient(circle at 78% 72%, rgba(167, 139, 250, 0.22), transparent 28%),
    radial-gradient(circle at 50% 102%, rgba(244, 212, 99, 0.16), transparent 30%),
    linear-gradient(135deg, #040713 0%, #0b1023 48%, #111a35 100%);
  overflow: auto;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(79, 214, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 139, 250, 0.07) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
  pointer-events: none;
}

.login-stage {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  min-height: min(680px, calc(100vh - 56px));
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 420px);
  gap: 24px;
  align-items: stretch;
}

.login-visual {
  position: relative;
  min-height: 560px;
  border: 1px solid rgba(79, 214, 255, 0.18);
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 48% 42%, rgba(79, 214, 255, 0.2), transparent 28%),
    radial-gradient(circle at 66% 58%, rgba(167, 139, 250, 0.22), transparent 32%),
    linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

.login-visual::before,
.login-visual::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.9;
}

.login-visual::before {
  width: 180px;
  height: 180px;
  left: -48px;
  top: 52px;
  background: radial-gradient(circle, rgba(79, 214, 255, 0.36), transparent 68%);
}

.login-visual::after {
  width: 220px;
  height: 220px;
  right: -58px;
  bottom: -42px;
  background: radial-gradient(circle, rgba(244, 212, 99, 0.24), transparent 66%);
}

.login-orbit {
  position: absolute;
  inset: 92px 92px auto auto;
  width: 330px;
  aspect-ratio: 1;
  border: 1px solid rgba(79, 214, 255, 0.32);
  border-radius: 999px;
  box-shadow:
    0 0 0 28px rgba(88, 107, 255, 0.06),
    0 0 70px rgba(79, 214, 255, 0.22);
}

.login-visual-logo {
  position: absolute;
  width: min(620px, 88%);
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 26px 44px rgba(0, 0, 0, 0.55));
}

.login-character {
  position: absolute;
  left: 42px;
  bottom: 38px;
  width: 142px;
  height: 132px;
  border: 1px solid rgba(79, 214, 255, 0.22);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(12, 18, 36, 0.96), rgba(30, 43, 82, 0.92));
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.12);
}

.character-screen {
  position: absolute;
  inset: 16px 18px 48px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(79, 214, 255, 0.24), rgba(167, 139, 250, 0.26)),
    #071025;
  border: 1px solid rgba(79, 214, 255, 0.28);
}

.character-screen::before,
.character-screen::after {
  content: "";
  position: absolute;
  top: 28px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #4fd6ff;
  box-shadow: 0 0 16px rgba(79, 214, 255, 0.7);
}

.character-screen::before {
  left: 28px;
}

.character-screen::after {
  right: 28px;
}

.character-base {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 20px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--accent), var(--violet));
  box-shadow: 0 0 24px rgba(79, 214, 255, 0.3);
}

.login-card {
  width: 100%;
  border: 1px solid rgba(79, 214, 255, 0.22);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(12, 18, 36, 0.94), rgba(8, 12, 25, 0.92));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
  padding: 26px;
  display: grid;
  gap: 16px;
  text-align: center;
  align-content: center;
  color: #f7fbff;
  backdrop-filter: blur(18px);
}

.login-logo {
  width: min(310px, 100%);
  height: 210px;
  object-fit: contain;
  justify-self: center;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 28%, rgba(79, 214, 255, 0.12), transparent 48%),
    #050814;
  box-shadow: inset 0 0 0 1px rgba(79, 214, 255, 0.14);
}

.login-card h1 {
  margin: 4px 0 0;
  font-size: 1.65rem;
  letter-spacing: 0;
}

.login-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.login-tab {
  min-height: 40px;
  border: 1px solid rgba(79, 214, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #d9e7ff;
}

.login-tab.is-active {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(88, 107, 255, 0.24);
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-card .eyebrow,
.login-card .field span {
  color: #9fdcff;
}

.login-card .field input {
  border-color: rgba(79, 214, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.login-card .field input::placeholder {
  color: rgba(217, 231, 255, 0.58);
}

.login-card .field input:focus {
  border-color: #4fd6ff;
  box-shadow: 0 0 0 3px rgba(79, 214, 255, 0.16), 0 0 28px rgba(79, 214, 255, 0.12);
}

.login-card .checkout-button {
  min-height: 46px;
  background: linear-gradient(135deg, var(--blue), var(--accent), var(--violet));
  box-shadow: 0 16px 34px rgba(88, 107, 255, 0.34);
  font-weight: 900;
}

.login-card .ghost-button {
  border-color: rgba(79, 214, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: #d9e7ff;
}

.login-message {
  min-height: 20px;
  margin: 0;
  color: #4fd6ff;
  font-weight: 700;
}

.login-message[data-tone="success"] {
  color: var(--green);
}

.auth-debug-panel {
  border: 1px solid rgba(79, 214, 255, 0.2);
  border-radius: 10px;
  background: rgba(5, 8, 20, 0.54);
  padding: 10px 12px;
  text-align: left;
}

.auth-debug-panel summary {
  cursor: pointer;
  color: #9fdcff;
  font-size: 0.78rem;
  font-weight: 800;
}

.auth-debug-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  max-height: 180px;
  overflow: auto;
}

.auth-debug-list article {
  display: grid;
  gap: 2px;
  border-left: 3px solid #ef4444;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.auth-debug-list article.is-success {
  border-left-color: #27d08b;
}

.auth-debug-list span,
.auth-debug-list small {
  color: rgba(217, 231, 255, 0.72);
  font-size: 0.72rem;
}

.login-note {
  margin: 0;
  color: #aab7d4;
  font-size: 0.78rem;
}

@media (max-width: 860px) {
  .login-stage {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .login-visual {
    min-height: 220px;
  }

  .login-visual-logo {
    width: min(420px, 88%);
    top: 48%;
  }

  .login-orbit,
  .login-character {
    display: none;
  }

  .login-logo {
    height: 160px;
  }
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(36, 29, 27, 0.5);
  backdrop-filter: blur(6px);
}

.auth-card {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(36, 29, 27, 0.22);
  padding: 22px;
  display: grid;
  gap: 16px;
}

.end-day-card {
  width: min(920px, 100%);
  max-height: calc(100vh - 28px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(36, 29, 27, 0.22);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.auth-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.auth-card-top h2 {
  margin: 4px 0 0;
  font-size: 1.3rem;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease, color 140ms ease, transform 140ms ease;
}

button:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 107, 255, 0.08);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 390px;
  min-height: 100vh;
}

.is-admin .app-shell {
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar,
.cart-panel {
  background: rgba(255, 253, 250, 0.92);
  border-color: var(--line);
  border-style: solid;
  padding: 24px;
}

.sidebar {
  border-width: 0 1px 0 0;
}

.cart-panel {
  border-width: 0 0 0 1px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-logo {
  width: 72px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: #050814;
  box-shadow: var(--shadow);
}

.empty-icon {
  width: 16px;
  height: 32px;
  border-radius: 7px 7px 5px 5px;
  background: linear-gradient(#f2d7a2 0 22%, #fffdfa 22% 34%, #2f7d57 34%);
  position: relative;
}

.empty-icon::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  top: -7px;
  left: 4px;
  border-radius: 3px 3px 0 0;
  background: #f2d7a2;
}

.brand h1,
.topbar h2,
.cart-heading h2 {
  margin: 0;
}

.brand h1 {
  font-size: 1.12rem;
}

.brand p,
.eyebrow,
.field span,
.status-panel span {
  color: var(--muted);
  font-size: 0.82rem;
}

.brand p,
.eyebrow {
  margin: 2px 0 0;
}

.field {
  display: grid;
  gap: 8px;
}

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 107, 255, 0.14);
}

.tabs {
  display: grid;
  gap: 8px;
  margin: 22px 0;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 16px;
}

.shop-nav {
  gap: 14px;
  max-height: 54vh;
  overflow: auto;
  padding-right: 3px;
}

.nav-group {
  display: grid;
  gap: 7px;
}

.nav-group h2 {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tab,
.ghost-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  text-align: left;
  padding: 0 12px;
}

.tab span {
  color: inherit;
  font-size: 0.74rem;
  opacity: 0.78;
}

.tab.is-active {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.mode-switch .tab {
  justify-content: space-between;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-only-action {
  display: none;
}

.ghost-button {
  text-align: center;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.status-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
}

.status-panel div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.status-panel strong {
  display: block;
  margin-top: 4px;
  font-size: 1.1rem;
}

.end-day-summary,
.cash-management-summary,
.day-closing-list {
  display: grid;
  gap: 12px;
}

.end-day-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.end-day-kpis div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-strong);
}

.end-day-kpis span,
.day-closing-row span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.end-day-kpis strong {
  display: block;
  margin-top: 5px;
}

.end-day-items {
  display: grid;
  gap: 8px;
  max-height: 28vh;
  overflow: auto;
  padding-right: 3px;
}

.end-day-cashiers {
  display: grid;
  gap: 8px;
}

.end-day-cashiers-head,
.end-day-cashiers-total,
.end-day-cashier-group summary {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 120px 140px;
  align-items: center;
  gap: 10px;
}

.end-day-cashiers-head {
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--accent-dark);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
}

.end-day-cashier-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.end-day-cashier-group summary {
  min-height: 42px;
  padding: 9px 10px;
  cursor: pointer;
}

.end-day-cashier-group summary span,
.end-day-invoice-list span,
.end-day-cashiers-total span {
  color: var(--muted);
  font-size: 0.78rem;
}

.end-day-invoice-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.end-day-invoice-list div {
  display: grid;
  grid-template-columns: 110px minmax(180px, 1fr) 120px;
  gap: 8px;
  padding: 8px 10px;
}

.end-day-invoice-list div + div {
  border-top: 1px solid var(--line);
}

.end-day-cashiers-total {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff7ea;
}

.end-day-items-head,
.end-day-items-row,
.end-day-items-total {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 72px 120px 130px;
  align-items: center;
  gap: 10px;
}

.end-day-items-head {
  position: sticky;
  top: 0;
  z-index: 2;
  border-radius: 8px;
  padding: 10px;
  background: var(--accent-dark);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
}

.end-day-items-row,
.end-day-items-total {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.end-day-items-row span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.end-day-items-total {
  background: #fff7ea;
}

.day-closing-head,
.day-closing-row {
  display: grid;
  grid-template-columns: 110px 150px 120px 120px 110px 110px minmax(220px, 1fr);
  align-items: center;
  gap: 10px;
}

.day-closing-head {
  position: sticky;
  top: 0;
  z-index: 2;
  border-radius: 8px;
  padding: 10px;
  background: var(--accent-dark);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
}

.day-closing-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.catalog-area {
  padding: 24px;
  min-width: 0;
}

.topbar,
.cart-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.register-search {
  width: min(520px, 100%);
  margin: 0 auto;
}

.register-search input {
  min-height: 52px;
  border-color: rgba(88, 107, 255, 0.36);
  box-shadow: 0 12px 28px rgba(36, 29, 27, 0.08);
  font-size: 1.02rem;
}

.clerk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.system-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.is-online,
.status-pill.is-synced {
  border-color: rgba(47, 125, 87, 0.28);
  background: rgba(47, 125, 87, 0.1);
  color: var(--green);
}

.status-pill.is-offline,
.status-pill.is-pending {
  border-color: rgba(88, 107, 255, 0.28);
  background: rgba(88, 107, 255, 0.1);
  color: var(--accent);
}

.status-pill.is-overdue {
  border-color: rgba(216, 185, 79, 0.36);
  background: rgba(216, 185, 79, 0.14);
  color: var(--gold);
}

.branch-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  gap: 7px;
  border: 1px solid rgba(88, 107, 255, 0.28);
  border-radius: 999px;
  padding: 0 12px;
  background: linear-gradient(135deg, rgba(79, 214, 255, 0.18), rgba(216, 185, 79, 0.18));
  color: var(--accent-dark);
  font-family: "Segoe UI Semibold", "Trebuchet MS", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 950;
  letter-spacing: 0;
  white-space: nowrap;
}

.branch-badge.branch-sipcity {
  border-color: rgba(79, 214, 255, 0.38);
  background: linear-gradient(135deg, rgba(79, 214, 255, 0.24), rgba(88, 107, 255, 0.22));
  color: #dff8ff;
  box-shadow: 0 12px 28px rgba(79, 214, 255, 0.18);
}

.branch-badge.branch-capetown {
  border-color: rgba(244, 212, 99, 0.44);
  background: linear-gradient(135deg, rgba(244, 212, 99, 0.24), rgba(167, 139, 250, 0.22));
  color: #fff2b3;
  box-shadow: 0 12px 28px rgba(244, 212, 99, 0.16);
}

.branch-badge::before {
  display: none;
  content: "";
}

.branch-badge.is-offline::before {
  background: #b83152;
  box-shadow: 0 0 0 3px rgba(184, 49, 82, 0.14);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--green);
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  width: min(520px, 100%);
  margin: 0 auto;
}

body:not(.is-admin) .topbar {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}

.product-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  min-height: 222px;
  display: grid;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.product-card.needs-reorder {
  border-color: rgba(88, 107, 255, 0.38);
}

.product-photo {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(88, 107, 255, 0.08), transparent 44%),
    #faf6ef;
  overflow: hidden;
}

.product-photo img {
  width: 100%;
  height: 112px;
  object-fit: cover;
  display: block;
}

.image-upload {
  position: absolute;
  right: 8px;
  bottom: 8px;
}

.image-upload input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.image-upload span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(36, 29, 27, 0.82);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(36, 29, 27, 0.18);
  cursor: pointer;
}

.product-art {
  height: 50px;
  display: flex;
  align-items: end;
  gap: 7px;
}

.bottle {
  width: 22px;
  height: 42px;
  border-radius: 8px 8px 5px 5px;
  background: var(--accent);
  position: relative;
}

.bottle::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 12px;
  top: -10px;
  left: 6px;
  border-radius: 4px 4px 0 0;
  background: inherit;
}

.bottle.short {
  height: 32px;
  background: var(--gold);
}

.bottle.wide {
  width: 28px;
  background: var(--blue);
}

.product-name {
  font-weight: 760;
  line-height: 1.2;
}

.product-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.inventory-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.inventory-strip span {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #f8f3ec;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.2;
}

.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.price {
  font-weight: 800;
}

.add-button,
.checkout-button {
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  min-height: 40px;
  padding: 0 14px;
}

.add-button:disabled,
.checkout-button:disabled {
  cursor: not-allowed;
  background: #b9b0aa;
}

.reorder-badge {
  position: absolute;
  top: 12px;
  right: -34px;
  width: 120px;
  transform: rotate(34deg);
  background: var(--accent);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
  padding: 4px 0;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  font-size: 0.9rem;
}

.cart-items {
  display: grid;
  gap: 10px;
  overflow: auto;
  max-height: 34vh;
  padding-right: 2px;
}

.empty-cart {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 190px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.empty-icon {
  filter: grayscale(0.2);
}

.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.line-title {
  margin: 0 0 4px;
  font-weight: 730;
}

.line-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.qty-controls {
  display: grid;
  grid-template-columns: 34px 30px 34px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.qty-controls button {
  border: 0;
  min-height: 34px;
  background: #ffffff;
}

.qty-controls span {
  text-align: center;
  font-weight: 760;
}

.sale-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.control-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.payment-buttons,
.receipt-actions,
.end-day-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.end-day-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding-top: 8px;
  background: var(--panel);
}

.payment-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.payment-button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.split-payment-box,
.invoice-payment-box {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-strong);
}

.compact select {
  min-height: 40px;
}

.totals {
  display: grid;
  gap: 8px;
  margin: auto 0 0;
}

.totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.totals dt {
  color: var(--muted);
}

.totals dd {
  margin: 0;
  font-weight: 760;
}

.grand-total {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 1.35rem;
}

.checkout-button {
  width: 100%;
  min-height: 52px;
  font-weight: 800;
  background: var(--accent-dark);
}

.receipt {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.no-results {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
}

.lookup-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 360px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.82);
  color: var(--muted);
  text-align: center;
  padding: 28px;
}

.lookup-empty strong {
  color: var(--ink);
  font-size: 1.25rem;
}

.lookup-empty span {
  max-width: 440px;
}

.admin-panel {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.sales-panel {
  display: grid;
  gap: 18px;
}

.admin-subtabs {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 253, 250, 0.88);
  box-shadow: var(--shadow);
}

.admin-subtab {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
  text-align: left;
}

.admin-subtab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.admin-tab-panel {
  min-width: 0;
  grid-column: 2;
}

.backend-nav-title {
  display: grid;
  gap: 3px;
  padding: 4px 2px 8px;
  border-bottom: 1px solid var(--line);
}

.backend-nav-title span,
.backend-nav-group {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.backend-nav-title strong {
  font-size: 1.08rem;
}

.backend-nav-group {
  padding-top: 8px;
}

.sales-toolbar {
  display: grid;
  grid-template-columns: 220px minmax(220px, 1fr) 180px;
  gap: 12px;
}

.admin-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-kpis div,
.admin-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.94);
  box-shadow: var(--shadow);
}

.admin-kpis div {
  padding: 16px;
}

.admin-kpis span,
.employee-row span,
.admin-product-row span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-kpis strong {
  display: block;
  margin-top: 6px;
  font-size: 1.28rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-panel {
  display: grid;
  gap: 14px;
  position: relative;
  overflow: hidden;
  padding: 2px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 8% 0%, rgba(79, 214, 255, 0.16), transparent 28%),
    radial-gradient(circle at 92% 8%, rgba(167, 139, 250, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(244, 212, 99, 0.08), transparent 42%);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-panel .admin-kpis div {
  min-height: 116px;
  border-radius: 18px;
  border-color: rgba(79, 214, 255, 0.24);
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(8, 13, 29, 0.94), rgba(18, 27, 58, 0.9)),
    var(--panel);
  box-shadow: 0 18px 42px rgba(13, 19, 36, 0.16);
}

.dashboard-panel .admin-kpis div:nth-child(1) {
  background: linear-gradient(145deg, #2238b8, #4fd6ff);
}

.dashboard-panel .admin-kpis div:nth-child(2) {
  background: linear-gradient(145deg, #5424b8, #a78bfa);
}

.dashboard-panel .admin-kpis div:nth-child(3) {
  background: linear-gradient(145deg, #0f7b66, #67c995);
}

.dashboard-panel .admin-kpis div:nth-child(4) {
  background: linear-gradient(145deg, #9a7114, #f4d463);
  color: #101521;
}

.dashboard-panel .admin-kpis div span {
  color: rgba(255, 255, 255, 0.78);
}

.dashboard-panel .admin-kpis div:nth-child(4) span {
  color: rgba(16, 21, 33, 0.72);
}

.dashboard-panel .admin-kpis div strong {
  font-size: 1.5rem;
}

.desktop-update-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(520px, calc(100vw - 36px));
  padding: 14px;
  border: 1px solid rgba(79, 214, 255, 0.28);
  border-radius: 18px;
  color: #f7fbff;
  background:
    linear-gradient(145deg, rgba(8, 13, 29, 0.96), rgba(23, 34, 68, 0.94)),
    #050814;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.desktop-update-panel strong,
.desktop-update-panel span {
  display: block;
}

.desktop-update-panel span {
  margin-top: 3px;
  color: #aab7d4;
  font-size: 0.9rem;
}

.desktop-update-panel[data-status="downloaded"] {
  border-color: rgba(244, 212, 99, 0.5);
  box-shadow: 0 24px 70px rgba(244, 212, 99, 0.18);
}

.desktop-update-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.desktop-update-actions .ghost-button,
.desktop-update-actions .checkout-button {
  min-height: 38px;
  border-radius: 12px;
}

.backend-module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.backend-module-card {
  display: grid;
  gap: 6px;
  min-height: 102px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.backend-module-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 107, 255, 0.1);
}

.backend-module-card span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.dashboard-list {
  display: grid;
  gap: 8px;
}

.dashboard-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.dashboard-list-row span,
.placeholder-panel span,
.settings-grid span,
.settings-card .check-field span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.placeholder-panel {
  display: grid;
  gap: 6px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel-strong);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.settings-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-strong);
}

.settings-panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.settings-card {
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-strong);
}

.settings-card h4 {
  margin: 4px 0 0;
}

.settings-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.diagnostics-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(79, 214, 255, 0.06);
  padding: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  overflow: auto;
}

.diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.diagnostics-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--panel);
}

.diagnostics-grid .wide {
  grid-column: 1 / -1;
}

.diagnostics-grid dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.diagnostics-grid dd {
  margin: 4px 0 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
}

.check-field input {
  width: 18px;
  height: 18px;
}

.single-admin-panel {
  grid-template-columns: minmax(0, 1fr);
}

.admin-section {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.stock-section {
  justify-items: center;
}

.stock-section .section-heading,
.stock-section .field,
.stock-section .form-row,
.stock-section .helper-text,
.stock-section .inventory-count-summary,
.stock-section .inventory-count-table,
.stock-section .stock-movement-registry,
.stock-section .stock-invoice-actions,
.stock-section .stock-invoice-box,
.stock-section .checkout-button {
  width: min(520px, 100%);
}

.stock-section .inventory-count-table {
  width: 100%;
}

.stock-section .section-heading {
  justify-content: center;
  text-align: center;
}

.inventory-count-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.inventory-count-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.inventory-count-summary div {
  padding: 12px;
  text-align: center;
}

.inventory-count-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.inventory-count-summary strong {
  display: block;
  margin-top: 5px;
}

.stock-invoice-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stock-invoice-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-strong);
}

.stock-invoice-box h4 {
  margin: 4px 0 0;
  font-size: 1rem;
}

.stock-invoice-lines {
  display: grid;
  gap: 8px;
}

.stock-invoice-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px 92px 96px 74px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.stock-invoice-line span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.inventory-count-table {
  display: grid;
  gap: 8px;
  max-height: 62vh;
  overflow: auto;
  padding-right: 3px;
}

.count-report-box {
  width: 100%;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-strong);
}

.count-report-box h4 {
  margin: 4px 0 0;
  font-size: 1rem;
}

.inventory-count-report {
  display: grid;
  gap: 8px;
  max-height: 46vh;
  overflow: auto;
  padding-right: 3px;
}

.count-report-section,
.document-variance-section {
  display: grid;
  gap: 8px;
}

.variance-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
}

.variance-section-title.is-profit {
  border-color: rgba(47, 125, 87, 0.28);
  background: rgba(47, 125, 87, 0.08);
}

.variance-section-title.is-loss {
  border-color: rgba(88, 107, 255, 0.28);
  background: rgba(88, 107, 255, 0.08);
}

.variance-section-title span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.inventory-count-head,
.inventory-count-row,
.count-report-head,
.count-report-row,
.count-report-total {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) 90px 120px 100px 120px 120px;
  align-items: center;
  gap: 10px;
}

.inventory-count-head,
.count-report-head {
  position: sticky;
  top: 0;
  z-index: 2;
  border-radius: 8px;
  padding: 10px;
  background: var(--accent-dark);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
}

.inventory-count-row,
.count-report-row,
.count-report-total {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.inventory-count-row,
.admin-product-row {
  cursor: pointer;
}

.inventory-count-row.is-selected,
.admin-product-row.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 107, 255, 0.1);
}

.inventory-count-head,
.inventory-count-row {
  grid-template-columns: minmax(260px, 1.3fr) 90px 120px 100px 120px 174px;
}

.count-report-total {
  background: #fff7ea;
  font-weight: 800;
}

.document-total-row {
  background: #fff7ea;
  font-weight: 800;
}

.inventory-count-row span,
.count-report-row span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.inventory-count-row input {
  min-width: 0;
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: #ffffff;
}

.count-action-cell {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.count-action-cell select {
  min-width: 0;
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: #ffffff;
  color: var(--ink);
}

.count-action-cell .saved-status {
  grid-column: 1 / -1;
}

.count-status {
  min-height: 32px;
  border-radius: 8px;
  display: grid !important;
  place-items: center;
  background: rgba(47, 125, 87, 0.1);
  color: var(--green) !important;
  font-weight: 800;
}

.count-status.needs-reorder {
  background: rgba(88, 107, 255, 0.1);
  color: var(--accent) !important;
}

.stock-movement-registry {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-strong);
}

.stock-movement-registry .section-heading span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.stock-movement-table {
  display: grid;
  gap: 8px;
  max-height: 36vh;
  overflow: auto;
  padding-right: 3px;
}

.stock-movement-head,
.stock-movement-row {
  display: grid;
  grid-template-columns: 150px 140px 70px 90px minmax(140px, 0.8fr) minmax(180px, 1fr);
  align-items: center;
  gap: 8px;
}

.stock-movement-head {
  position: sticky;
  top: 0;
  z-index: 1;
  border-radius: 8px;
  padding: 10px;
  background: var(--accent-dark);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
}

.stock-movement-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.stock-movement-row span {
  color: var(--muted);
  font-size: 0.8rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.section-heading h3 {
  margin: 0;
  font-size: 1.05rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.full-button {
  justify-content: center;
}

.employee-list {
  display: grid;
  gap: 8px;
}

.employee-row,
.admin-table-head,
.admin-product-row {
  display: grid;
  align-items: center;
  gap: 10px;
}

.employee-row {
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 180px) auto minmax(240px, 0.9fr) auto auto auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
  cursor: pointer;
}

.employee-row.is-open {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 107, 255, 0.1);
}

.employee-role-edit {
  display: grid;
  gap: 4px;
}

.employee-role-edit span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.employee-role-edit select {
  min-height: 36px;
}

.employee-credential-edit {
  display: grid;
  grid-template-columns: repeat(2, minmax(100px, 1fr));
  gap: 8px;
}

.employee-credential-edit label {
  display: grid;
  gap: 4px;
}

.employee-credential-edit span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.employee-credential-edit input {
  min-height: 36px;
}

.user-account-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
}

.employee-access-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  cursor: default;
}

.employee-access-editor > div:first-child strong {
  display: block;
}

.employee-access-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.employee-access-actions .checkout-button,
.save-action-row .checkout-button {
  max-width: 260px;
}

.danger-button {
  border-color: rgba(239, 68, 68, 0.36);
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.danger-button:hover {
  border-color: rgba(239, 68, 68, 0.62);
  background: rgba(239, 68, 68, 0.16);
}

.compact-save-cell,
.save-action-row {
  display: grid;
  gap: 4px;
  align-items: center;
}

.save-action-row {
  grid-template-columns: minmax(180px, 260px) auto;
  margin-top: 10px;
}

.saved-status {
  min-height: 20px;
  color: var(--green);
  font-size: 0.86rem;
  font-weight: 900;
  opacity: 0;
  transition: opacity 140ms ease;
}

.saved-status.is-visible {
  opacity: 1;
}

.permission-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-strong);
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mini-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 10px;
}

.admin-search {
  min-width: min(320px, 100%);
}

.product-create-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-strong);
}

.product-create-panel h4 {
  margin: 4px 0 0;
  font-size: 1rem;
}

.product-create-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(120px, 0.7fr)) repeat(3, minmax(110px, 0.55fr)) minmax(140px, 0.6fr);
  gap: 10px;
  align-items: end;
}

.product-create-action {
  display: grid;
  gap: 6px;
}

.product-create-action .checkout-button {
  min-height: 40px;
}

.admin-table {
  display: grid;
  gap: 8px;
  max-height: 58vh;
  overflow: auto;
  padding-right: 3px;
}

.admin-table-head,
.admin-product-row {
  grid-template-columns: 76px minmax(240px, 1.5fr) 130px 110px 110px 90px 100px 96px;
}

.admin-table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px;
  border-radius: 8px;
  background: var(--accent-dark);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-product-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.admin-product-image {
  width: 58px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 0.7rem;
  text-align: center;
}

.admin-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.margin-pill {
  min-height: 36px;
  border: 1px solid rgba(47, 125, 87, 0.28);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(47, 125, 87, 0.1);
  color: var(--green);
  font-size: 0.9rem;
}

.admin-product-row input,
.admin-product-row select {
  min-width: 0;
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: #ffffff;
}

.readonly-cell,
.readonly-hint {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  align-items: center;
  padding: 0 9px;
  background: var(--panel-strong);
  color: var(--ink);
  font-size: 0.86rem;
}

.readonly-hint {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.product-row-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.selected-product-actions {
  position: sticky;
  top: 8px;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.7fr) auto;
  align-items: end;
  gap: 12px;
  border: 1px solid rgba(88, 107, 255, 0.22);
  border-radius: 8px;
  padding: 12px;
  background: rgba(88, 107, 255, 0.08);
  box-shadow: 0 16px 38px rgba(36, 29, 27, 0.12);
}

.selected-product-actions span,
.selected-product-actions small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.selected-product-actions strong {
  display: block;
  margin-top: 3px;
}

.selected-product-summary {
  align-self: center;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.selected-product-photo {
  width: 58px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 0.7rem;
  text-align: center;
}

.selected-product-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-image-upload {
  grid-column: 1 / -1;
  display: inline-flex;
  width: max-content;
}

.admin-image-upload input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.admin-image-upload span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(88, 107, 255, 0.92);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(88, 107, 255, 0.18);
}

.selected-product-editor {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) repeat(3, minmax(100px, 0.65fr)) 88px;
  gap: 8px;
  align-items: end;
}

.selected-product-editor label,
.selected-margin-preview {
  display: grid;
  gap: 4px;
}

.selected-product-editor label span,
.selected-margin-preview span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.selected-product-editor input,
.selected-product-editor select,
.selected-margin-preview strong {
  min-width: 0;
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: #ffffff;
  color: var(--ink);
}

.selected-margin-preview strong {
  display: grid;
  place-items: center;
  background: rgba(47, 125, 87, 0.1);
  color: var(--green);
}

.selected-product-buttons {
  display: grid;
  gap: 8px;
  justify-items: stretch;
  min-width: 138px;
}

.danger-button {
  border-color: rgba(88, 107, 255, 0.28);
  color: var(--accent);
}

.empty-admin {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 14px;
  text-align: center;
}

.helper-text {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.supplier-comparison {
  display: grid;
  gap: 8px;
}

.reports-panel {
  display: grid;
  gap: 14px;
}

.reports-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(150px, 180px) minmax(150px, 180px) minmax(170px, 190px) minmax(320px, 0.9fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 253, 250, 0.94);
  box-shadow: var(--shadow);
}

.report-actions {
  display: grid;
  grid-template-columns: repeat(7, minmax(42px, 1fr));
  gap: 6px;
  align-self: end;
  min-width: 0;
}

.report-action-button {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
}

.report-action-icon {
  width: 21px;
  height: 21px;
  display: block;
}

.report-action-print .report-action-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.report-action-gmail {
  background: #ffffff;
}

.report-action-whatsapp {
  background: #e9fff1;
  border-color: rgba(37, 211, 102, 0.38);
}

.brand-icon path {
  stroke: none;
}

.gmail-red {
  fill: #ea4335;
}

.gmail-blue {
  fill: #4285f4;
}

.gmail-yellow {
  fill: #fbbc05;
}

.gmail-green {
  fill: #34a853;
}

.whatsapp-bubble {
  fill: #25d366;
}

.whatsapp-phone {
  fill: #ffffff;
}

.report-period-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: end;
}

.report-period-tabs button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.report-period-tabs button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.compare-periods {
  align-self: end;
  min-height: 44px;
}

.reports-dashboard-body {
  display: grid;
  gap: 14px;
}

.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.report-kpi-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-strong);
}

.report-kpi-card span,
.report-kpi-card small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.report-kpi-card strong {
  display: block;
  margin-top: 5px;
  font-size: 1.18rem;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.analytics-section {
  min-width: 0;
}

.mini-chart {
  min-height: 220px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-strong);
}

.svg-report-chart {
  overflow: hidden;
}

.svg-report-chart svg {
  width: 100%;
  height: 190px;
  display: block;
}

.chart-axis {
  stroke: rgba(88, 107, 255, 0.2);
  stroke-width: 2;
}

.chart-area {
  fill: rgba(79, 214, 255, 0.16);
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  fill: var(--gold);
  stroke: #ffffff;
  stroke-width: 2;
}

.chart-label-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(34px, 1fr));
  gap: 6px;
}

.mini-chart span:not(.status-pill) {
  display: block;
  min-height: 8px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--accent), var(--gold));
}

.mini-chart small {
  color: var(--muted);
  font-size: 0.68rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-table {
  display: grid;
  gap: 8px;
  overflow: auto;
  max-height: 58vh;
  padding-right: 3px;
}

.analytics-head,
.analytics-row {
  display: grid;
  align-items: center;
  gap: 8px;
  min-width: 1180px;
}

.product-report-table .analytics-head,
.product-report-table .analytics-row {
  grid-template-columns: minmax(200px, 1.3fr) 90px 70px 110px 100px 110px 110px 80px 100px 80px 100px;
}

.reorder-forecast-table .analytics-head,
.reorder-forecast-table .analytics-row {
  grid-template-columns: minmax(220px, 1fr) 100px 130px 120px 110px 130px;
  min-width: 780px;
}

.credit-report-table .analytics-head,
.credit-report-table .analytics-row {
  grid-template-columns: 130px 130px minmax(170px, 1fr) 110px 110px 120px 120px 130px;
  min-width: 980px;
}

.analytics-head {
  position: sticky;
  top: 0;
  z-index: 1;
  border-radius: 8px;
  padding: 10px;
  background: var(--accent-dark);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
}

.analytics-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.analytics-row span {
  color: var(--muted);
  font-size: 0.82rem;
}

.hourly-product-grid,
.export-center-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.export-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.export-action-button .report-action-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hourly-product-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-strong);
}

.hourly-product-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
}

.documents-panel {
  display: grid;
  gap: 14px;
}

.documents-toolbar {
  display: grid;
  grid-template-columns: 220px 180px 180px minmax(320px, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 253, 250, 0.94);
  box-shadow: var(--shadow);
}

.document-actions {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 92px;
  gap: 8px;
  align-self: end;
}

.document-preview-actions {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 92px;
  gap: 8px;
  align-items: end;
  min-width: min(360px, 100%);
}

.document-section {
  min-width: 0;
}

.document-preview-section {
  min-width: 0;
}

.document-report {
  display: grid;
  gap: 12px;
}

.sales-history-browser {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.18fr);
  gap: 12px;
  align-items: start;
}

.sales-history-files {
  display: grid;
  gap: 8px;
  max-height: 62vh;
  overflow: auto;
  padding-right: 3px;
}

.sales-history-file {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.sales-history-file.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 107, 255, 0.1);
}

.sales-history-file span,
.sales-history-file small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.sales-history-inline-preview {
  min-width: 0;
}

.document-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.document-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-strong);
}

.document-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.document-summary strong {
  display: block;
  margin-top: 5px;
}

.credit-sales-list {
  display: grid;
  gap: 12px;
}

.credit-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.credit-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-strong);
}

.credit-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.credit-summary strong {
  display: block;
  margin-top: 5px;
}

.credit-cashier-picker {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-strong);
}

.cashier-clearance-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.cashier-clearance-summary button {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 4px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.cashier-clearance-summary button.is-active {
  border-color: var(--accent);
  background: rgba(88, 107, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(88, 107, 255, 0.1);
}

.cashier-clearance-summary span,
.cashier-clearance-summary small,
.selected-cashier-heading span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.selected-cashier-heading {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.selected-cashier-heading div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.selected-cashier-heading strong {
  display: block;
  margin-top: 4px;
}

.credit-table {
  display: grid;
  gap: 8px;
  max-height: 58vh;
  overflow: auto;
  padding-right: 3px;
}

.credit-head,
.credit-row {
  display: grid;
  grid-template-columns: 110px 130px minmax(180px, 1fr) 110px 120px 100px 190px;
  align-items: center;
  gap: 10px;
}

.credit-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent-dark);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
}

.credit-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
}

.end-day-warning {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(184, 49, 82, 0.32);
  border-radius: 8px;
  padding: 14px;
  background: rgba(184, 49, 82, 0.08);
}

.shift-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-strong);
}

.shift-status-card div {
  display: grid;
  gap: 3px;
}

.shift-status-card span,
.shift-status-card small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.quick-expense-card {
  max-width: 420px;
}

.cashier-quick-expenses {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.cashier-quick-title {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.cashier-quick-expense-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.cashier-quick-expense-grid button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 7px;
  background: var(--panel-strong);
  color: var(--ink);
  font-weight: 800;
}

.expenses-panel {
  min-width: 0;
}

.expenses-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
}

.expense-entry-section,
.expense-dashboard-section,
.expense-approval-section,
.expense-history-section {
  min-width: 0;
}

.expense-category-manager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.expense-actions,
.expense-actions-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.expense-dashboard-section,
.expense-history-section {
  grid-column: 2;
}

.expense-approval-section {
  grid-column: 1;
}

.expense-list {
  display: grid;
  gap: 8px;
  max-height: 58vh;
  overflow: auto;
}

.expense-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 110px 130px 150px minmax(180px, auto);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.expense-row span,
.expense-row small {
  color: var(--muted);
  font-size: 0.82rem;
}

.expense-row div {
  display: grid;
  gap: 3px;
}

.expense-report-table .analytics-head,
.expense-report-table .analytics-row {
  grid-template-columns: 150px 130px 110px 130px 100px 120px minmax(220px, 1fr);
  min-width: 980px;
}

.branch-list,
.branch-inventory-summary,
.transfer-history,
.branch-pricing-table {
  display: grid;
  gap: 8px;
}

.branch-row,
.transfer-row,
.branch-price-head,
.branch-price-row {
  display: grid;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.branch-row {
  grid-template-columns: minmax(180px, 1fr) 100px 90px 120px auto;
}

.transfer-row {
  grid-template-columns: 120px minmax(180px, 0.9fr) minmax(220px, 1.2fr) 100px 150px;
}

.branch-price-head,
.branch-price-row {
  grid-template-columns: minmax(240px, 1fr) 110px 140px 90px 90px 70px;
}

.branch-price-head {
  background: var(--accent-dark);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
}

.branch-summary-card,
.transfer-notice {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-strong);
}

.branch-summary-card span,
.branch-row span,
.transfer-row span,
.transfer-row small,
.branch-price-row span,
.transfer-notice span {
  color: var(--muted);
  font-size: 0.82rem;
}

.transfer-form {
  display: grid;
  gap: 12px;
  margin: 12px 0;
}

.branch-inventory-report-table .analytics-head,
.branch-inventory-report-table .analytics-row {
  grid-template-columns: 150px minmax(220px, 1fr) 100px 90px 130px 130px;
  min-width: 880px;
}

.transfer-report-table .analytics-head,
.transfer-report-table .analytics-row {
  grid-template-columns: 120px 140px 140px minmax(220px, 1fr) 70px 120px 160px;
  min-width: 980px;
}

.end-day-warning > div:first-child {
  display: grid;
  gap: 4px;
}

.end-day-warning span,
.unpaid-invoice-list span {
  color: var(--muted);
  font-size: 0.82rem;
}

.unpaid-invoice-list {
  display: grid;
  gap: 7px;
  max-height: 190px;
  overflow: auto;
}

.unpaid-invoice-list div {
  display: grid;
  grid-template-columns: 130px minmax(140px, 1fr) minmax(110px, 0.8fr) 120px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--panel-strong);
}

.approval-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.approval-pin-field {
  max-width: 320px;
}

.pending-invoice-management {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.credit-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.pending-invoice-table {
  display: grid;
  gap: 8px;
  max-height: 50vh;
  overflow: auto;
}

.pending-invoice-head,
.pending-invoice-row {
  display: grid;
  grid-template-columns: 130px 130px minmax(150px, 1fr) 110px 120px 120px minmax(260px, 1.2fr);
  align-items: center;
  gap: 10px;
}

.pending-invoice-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent-dark);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
}

.pending-invoice-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
}

.pending-invoice-row .invoice-actions {
  display: grid;
  grid-template-columns: 82px minmax(76px, 1fr) auto auto;
  gap: 6px;
}

.pending-invoice-row input,
.pending-invoice-row select {
  min-width: 0;
}

.readonly-customer {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.inline-admin-section {
  margin-top: 14px;
}

.reorder-report {
  display: grid;
  gap: 10px;
}

.reorder-file-card {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-strong);
  color: var(--ink);
  text-align: left;
}

.reorder-file-card span,
.reorder-file-card small,
.reorder-file-toolbar span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.reorder-file-card strong {
  font-size: 1.15rem;
}

.reorder-file-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.reorder-file-toolbar strong {
  display: block;
  margin-top: 3px;
}

.reorder-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.reorder-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-strong);
}

.reorder-summary span,
.reorder-row small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.reorder-summary strong {
  display: block;
  margin-top: 5px;
}

.reorder-table {
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow: auto;
  padding-right: 3px;
}

.reorder-head,
.reorder-row {
  display: grid;
  grid-template-columns: 100px minmax(180px, 1fr) 90px 100px 100px;
  align-items: center;
  gap: 10px;
}

.reorder-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent-dark);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
}

.reorder-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
}

.inventory-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.inventory-action-bar .ghost-button {
  min-height: 38px;
  padding: 0 14px;
}

.credit-row input,
.invoice-actions select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--panel);
  color: var(--ink);
}

.invoice-actions {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.invoice-actions small {
  color: var(--muted);
  font-weight: 800;
}

.damage-entry {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 140px 120px minmax(180px, 1fr) 120px;
  gap: 10px;
  align-items: end;
}

.document-table {
  display: grid;
  gap: 8px;
  max-height: 58vh;
  overflow: auto;
  padding-right: 3px;
}

.document-head,
.document-row {
  display: grid;
  align-items: center;
  gap: 10px;
}

.document-head {
  position: sticky;
  top: 0;
  z-index: 2;
  border-radius: 8px;
  padding: 10px;
  background: var(--accent-dark);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
}

.document-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.document-row span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.document-preview {
  min-width: 0;
}

.document-preview-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.document-preview-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 2px solid var(--ink);
}

.document-preview-top h4 {
  margin: 4px 0 0;
  font-size: 1.2rem;
}

.document-preview-top span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: right;
}

.document-preview-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 14px 16px;
  background: var(--panel-strong);
}

.document-preview-kpis div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.document-preview-kpis span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.document-preview-kpis strong {
  display: block;
  margin-top: 4px;
}

.document-preview-table {
  max-height: 44vh;
  overflow: auto;
}

.document-preview-table table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.document-preview-table th {
  position: sticky;
  top: 0;
  background: var(--accent-dark);
  color: #ffffff;
  text-align: left;
}

.document-preview-table th,
.document-preview-table td {
  border: 1px solid var(--line);
  padding: 8px;
  vertical-align: top;
}

.supplier-invoice-table .document-head,
.supplier-invoice-table .document-row {
  grid-template-columns: 130px 110px minmax(180px, 1fr) 120px 104px;
}

.damage-loss-table .document-head,
.damage-loss-table .document-row {
  grid-template-columns: 120px 110px minmax(240px, 1fr) 70px 120px minmax(180px, 0.8fr) 104px;
}

.inventory-document-table .document-head,
.inventory-document-table .document-row {
  grid-template-columns: minmax(240px, 1.2fr) 120px 90px 90px 90px 120px 120px 104px;
}

.report-view-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.report-view-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.report-view-tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.report-bars {
  display: grid;
  gap: 12px;
}

.report-row {
  display: grid;
  gap: 7px;
}

.report-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.88rem;
}

.report-row-top span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.report-row-top strong {
  white-space: nowrap;
}

.report-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #eadfd5;
}

.report-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.product-profit-table {
  display: grid;
  gap: 8px;
  max-height: 62vh;
  overflow: auto;
  padding-right: 3px;
}

.product-profit-head,
.product-profit-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) 70px 120px 120px 130px 90px;
  align-items: center;
  gap: 10px;
}

.product-profit-head {
  position: sticky;
  top: 0;
  z-index: 2;
  border-radius: 8px;
  padding: 10px;
  background: var(--accent-dark);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
}

.product-profit-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.product-profit-row span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.profit-text {
  color: var(--green);
}

.loss-text {
  color: var(--accent);
}

body[data-theme="dark"] .login-screen {
  background:
    radial-gradient(circle at top, rgba(101, 119, 255, 0.2), transparent 36%),
    var(--bg);
}

body[data-theme="dark"] .login-card,
body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .cart-panel,
body[data-theme="dark"] .auth-card,
body[data-theme="dark"] .end-day-card,
body[data-theme="dark"] .admin-subtabs,
body[data-theme="dark"] .admin-kpis div,
body[data-theme="dark"] .admin-section,
body[data-theme="dark"] .product-create-panel,
body[data-theme="dark"] .stock-movement-registry,
body[data-theme="dark"] .reports-toolbar,
body[data-theme="dark"] .documents-toolbar {
  background: rgba(21, 27, 33, 0.95);
}

body[data-theme="dark"] .login-logo,
body[data-theme="dark"] .brand-logo,
body[data-theme="dark"] .login-tab,
body[data-theme="dark"] .tab,
body[data-theme="dark"] .theme-switch-button,
body[data-theme="dark"] .ghost-button,
body[data-theme="dark"] .icon-button,
body[data-theme="dark"] .clerk,
body[data-theme="dark"] .status-pill,
body[data-theme="dark"] .product-card,
body[data-theme="dark"] .cart-line,
body[data-theme="dark"] .payment-button,
body[data-theme="dark"] .receipt,
body[data-theme="dark"] .admin-subtab,
body[data-theme="dark"] .backend-module-card,
body[data-theme="dark"] .dashboard-list-row,
body[data-theme="dark"] .check-field,
body[data-theme="dark"] .stock-invoice-line,
body[data-theme="dark"] .inventory-count-row,
body[data-theme="dark"] .count-report-row,
body[data-theme="dark"] .employee-row,
body[data-theme="dark"] .mini-button,
body[data-theme="dark"] .admin-product-row,
body[data-theme="dark"] .stock-movement-row,
body[data-theme="dark"] .selected-product-actions,
body[data-theme="dark"] .variance-section-title,
body[data-theme="dark"] .document-row,
body[data-theme="dark"] .credit-row,
body[data-theme="dark"] .pending-invoice-row,
body[data-theme="dark"] .unpaid-invoice-list div,
body[data-theme="dark"] .end-day-warning,
body[data-theme="dark"] .shift-status-card,
body[data-theme="dark"] .cashier-quick-expense-grid button,
body[data-theme="dark"] .expense-row,
body[data-theme="dark"] .branch-row,
body[data-theme="dark"] .transfer-row,
body[data-theme="dark"] .branch-price-row,
body[data-theme="dark"] .branch-summary-card,
body[data-theme="dark"] .transfer-notice,
body[data-theme="dark"] .document-preview-card,
body[data-theme="dark"] .document-preview-kpis div,
body[data-theme="dark"] .sales-history-file,
body[data-theme="dark"] .report-view-tab,
body[data-theme="dark"] .report-period-tabs button,
body[data-theme="dark"] .report-kpi-card,
body[data-theme="dark"] .mini-chart,
body[data-theme="dark"] .analytics-row,
body[data-theme="dark"] .hourly-product-card,
body[data-theme="dark"] .product-profit-row,
body[data-theme="dark"] .reorder-row,
body[data-theme="dark"] .reorder-summary div,
body[data-theme="dark"] .reorder-file-card,
body[data-theme="dark"] .end-day-cashier-group,
body[data-theme="dark"] .end-day-cashiers-total,
body[data-theme="dark"] .comparison-row,
body[data-theme="dark"] .sale-row,
body[data-theme="dark"] .cashier-pending-invoices,
body[data-theme="dark"] .cashier-invoice-doc,
body[data-theme="dark"] .day-closing-row,
body[data-theme="dark"] .end-day-items-row {
  background: #19212a;
  color: var(--ink);
}

body[data-theme="dark"] .danger-button {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(127, 29, 29, 0.32);
  color: #fecaca;
}

body[data-theme="dark"] .field input,
body[data-theme="dark"] .field select,
body[data-theme="dark"] .admin-product-row input,
body[data-theme="dark"] .admin-product-row select,
body[data-theme="dark"] .selected-product-editor input,
body[data-theme="dark"] .selected-product-editor select,
body[data-theme="dark"] .selected-margin-preview strong,
body[data-theme="dark"] .inventory-count-row input,
body[data-theme="dark"] .count-action-cell select,
body[data-theme="dark"] .credit-row input,
body[data-theme="dark"] .pending-invoice-row input,
body[data-theme="dark"] .pending-invoice-row select,
body[data-theme="dark"] .invoice-actions select,
body[data-theme="dark"] .tracking-tabs button {
  background: #0f151b;
  color: var(--ink);
  border-color: var(--line);
}

body[data-theme="dark"] input::placeholder {
  color: #7f8b96;
}

body[data-theme="dark"] .field input:focus,
body[data-theme="dark"] .field select:focus,
body[data-theme="dark"] .admin-product-row input:focus,
body[data-theme="dark"] .admin-product-row select:focus,
body[data-theme="dark"] .selected-product-editor input:focus,
body[data-theme="dark"] .selected-product-editor select:focus,
body[data-theme="dark"] .inventory-count-row input:focus,
body[data-theme="dark"] .count-action-cell select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(101, 119, 255, 0.18);
}

body[data-theme="dark"] .product-photo,
body[data-theme="dark"] .inventory-strip span,
body[data-theme="dark"] .status-panel div,
body[data-theme="dark"] .pos-summary-card div,
body[data-theme="dark"] .system-menu,
body[data-theme="dark"] .receipt-actions,
body[data-theme="dark"] .end-day-kpis div,
body[data-theme="dark"] .split-payment-box,
body[data-theme="dark"] .invoice-payment-box,
body[data-theme="dark"] .lookup-empty,
body[data-theme="dark"] .placeholder-panel,
body[data-theme="dark"] .settings-grid div,
body[data-theme="dark"] .settings-card,
body[data-theme="dark"] .inventory-count-summary div,
body[data-theme="dark"] .stock-invoice-box,
body[data-theme="dark"] .count-report-box,
body[data-theme="dark"] .permission-box,
body[data-theme="dark"] .helper-text,
body[data-theme="dark"] .document-summary div,
body[data-theme="dark"] .credit-summary div,
body[data-theme="dark"] .credit-cashier-picker,
body[data-theme="dark"] .cashier-clearance-summary button,
body[data-theme="dark"] .selected-cashier-heading div,
body[data-theme="dark"] .document-preview-kpis,
body[data-theme="dark"] .sale-detail-top div,
body[data-theme="dark"] .comparison-summary,
body[data-theme="dark"] .end-day-items-total,
body[data-theme="dark"] .count-report-total {
  background: var(--panel-strong);
}

body[data-theme="dark"] .empty-cart,
body[data-theme="dark"] .no-results,
body[data-theme="dark"] .empty-admin {
  background: rgba(21, 27, 33, 0.72);
}

body[data-theme="dark"] .qty-controls button {
  background: #19212a;
  color: var(--ink);
}

body[data-theme="dark"] .status-pill.is-online,
body[data-theme="dark"] .status-pill.is-synced {
  border-color: rgba(103, 201, 149, 0.32);
  background: rgba(103, 201, 149, 0.12);
  color: var(--green);
}

body[data-theme="dark"] .status-pill.is-offline,
body[data-theme="dark"] .status-pill.is-pending {
  border-color: rgba(101, 119, 255, 0.34);
  background: rgba(101, 119, 255, 0.14);
  color: #ff9ab2;
}

body[data-theme="dark"] .status-pill.is-overdue {
  border-color: rgba(221, 176, 96, 0.38);
  background: rgba(221, 176, 96, 0.15);
  color: var(--gold);
}

body[data-theme="dark"] .report-track {
  background: #2b3540;
}

body[data-theme="dark"] .tab.is-active,
body[data-theme="dark"] .login-tab.is-active,
body[data-theme="dark"] .admin-subtab.is-active,
body[data-theme="dark"] .payment-button.is-active,
body[data-theme="dark"] .report-view-tab.is-active {
  background: var(--accent);
  color: #ffffff;
}

body[data-theme="dark"] .add-button:disabled,
body[data-theme="dark"] .checkout-button:disabled {
  background: #46515c;
}

@media print {
  body {
    background: #ffffff;
    --bg: #ffffff;
    --panel: #ffffff;
    --panel-strong: #f3f7ff;
    --ink: #0d1324;
    --muted: #657187;
    --line: #d9e2f4;
    --accent: #586bff;
    --accent-dark: #2238b8;
  }

  body * {
    visibility: hidden;
  }

  .reports-panel,
  .reports-panel * {
    visibility: visible;
  }

  .reports-panel {
    position: absolute;
    inset: 0;
    display: block;
    padding: 18px;
    background: #ffffff;
  }

  .sidebar,
  .cart-panel,
  .admin-subtabs,
  .report-actions,
  .report-view-tabs {
    display: none !important;
  }

  [data-report-view-panel][hidden] {
    display: none !important;
  }

  .reports-toolbar,
  .admin-kpis,
  .reports-grid,
  .product-profit-table {
    break-inside: avoid;
  }
}

.comparison-summary,
.comparison-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.comparison-summary {
  padding: 12px;
  background: var(--panel-strong);
}

.comparison-summary span,
.comparison-row span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.comparison-summary strong {
  display: block;
  margin-top: 4px;
}

.comparison-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, auto) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.comparison-row.is-best {
  border-color: rgba(47, 125, 87, 0.55);
  box-shadow: 0 0 0 3px rgba(47, 125, 87, 0.1);
}

.sales-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(320px, 1.05fr);
  gap: 14px;
}

.sales-list {
  display: grid;
  gap: 8px;
  max-height: 58vh;
  overflow: auto;
  padding-right: 3px;
}

.sale-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.sale-row.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 107, 255, 0.1);
}

.sale-row small,
.sale-detail-top span,
.sale-meta dt {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.sale-details {
  display: grid;
  gap: 14px;
}

.sale-detail-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sale-detail-top div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-strong);
}

.sale-detail-top strong {
  display: block;
  margin-top: 5px;
}

.sale-meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.sale-meta div,
.sale-lines div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.sale-meta dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
}

.sale-lines {
  display: grid;
  gap: 8px;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .sidebar {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .catalog-area {
    grid-column: 2;
    grid-row: 2;
  }

  .cart-panel {
    grid-column: 2;
    grid-row: 1;
    border-width: 1px 0 0;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: flex;
    flex-direction: column;
  }

  .sidebar,
  .catalog-area,
  .cart-panel {
    padding: 18px;
  }

  .sidebar {
    order: 1;
  }

  .cart-panel {
    order: 2;
  }

  .catalog-area {
    order: 3;
  }

  .sidebar,
  .cart-panel {
    border-width: 0 0 1px;
  }

  .quick-actions,
  .status-panel,
  .pos-summary-card,
  .sale-controls,
  .payment-buttons,
  .receipt-actions,
  .end-day-actions,
  .end-day-kpis,
  .admin-panel,
  .admin-kpis,
  .admin-grid,
  .dashboard-grid,
  .backend-module-grid,
  .settings-grid,
  .settings-panels,
  .permission-grid,
  .reports-grid,
  .analytics-grid,
  .reports-toolbar,
  .report-actions,
  .documents-toolbar,
  .document-actions,
  .document-preview-actions,
  .damage-entry,
  .inventory-count-summary,
  .stock-invoice-actions,
  .form-row,
  .sales-toolbar,
  .sales-layout,
  .sales-history-browser {
    grid-template-columns: 1fr;
  }

  .admin-subtabs {
    position: static;
  }

  .admin-tab-panel {
    grid-column: 1;
  }

  .admin-table {
    overflow-x: auto;
  }

  .admin-table-head,
  .admin-product-row,
  .inventory-count-head,
  .inventory-count-row,
  .stock-movement-head,
  .stock-movement-row,
  .count-report-head,
  .count-report-row,
  .count-report-total,
  .product-profit-head,
  .product-profit-row,
  .day-closing-head,
  .day-closing-row,
  .end-day-items-head,
  .end-day-items-row,
  .end-day-items-total,
  .supplier-invoice-table .document-head,
  .supplier-invoice-table .document-row,
  .damage-loss-table .document-head,
  .damage-loss-table .document-row,
    .inventory-document-table .document-head,
    .inventory-document-table .document-row {
    grid-template-columns: 76px 240px 130px 110px 110px 90px 100px 96px;
    width: max-content;
    min-width: 100%;
  }

  .selected-product-actions {
    grid-template-columns: 1fr;
  }

  .selected-product-editor {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .product-create-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .inventory-count-head,
  .inventory-count-row {
    grid-template-columns: 260px 90px 120px 100px 120px 174px;
  }

  .stock-movement-head,
  .stock-movement-row {
    grid-template-columns: 150px 140px 70px 90px 160px 220px;
  }

  .employee-row {
    grid-template-columns: 260px 180px 110px 260px 110px 100px 100px;
    width: max-content;
    min-width: 100%;
  }

  .count-report-head,
  .count-report-row,
  .count-report-total {
    grid-template-columns: 260px 90px 120px 100px 120px 120px;
  }

  .product-profit-head,
  .product-profit-row {
    grid-template-columns: 260px 70px 120px 120px 130px 90px;
  }

  .day-closing-head,
  .day-closing-row {
    grid-template-columns: 110px 150px 120px 120px 110px 110px 220px;
  }

  .end-day-items-head,
  .end-day-items-row,
  .end-day-items-total {
    grid-template-columns: 240px 72px 120px 130px;
  }

  .supplier-invoice-table .document-head,
  .supplier-invoice-table .document-row {
    grid-template-columns: 130px 110px 180px 120px 104px;
  }

  .damage-loss-table .document-head,
  .damage-loss-table .document-row {
    grid-template-columns: 120px 110px 240px 70px 120px 180px 104px;
  }

  .inventory-document-table .document-head,
  .inventory-document-table .document-row {
    grid-template-columns: 240px 120px 90px 90px 90px 120px 120px 104px;
  }

  .stock-invoice-line {
    grid-template-columns: 220px 54px 92px 96px 74px;
    width: max-content;
    min-width: 100%;
  }

  .topbar,
  .cart-heading,
  .document-preview-top,
  .document-preview-section .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .register-search {
    width: 100%;
    margin: 0;
  }

  .product-grid {
    width: 100%;
  }

}

/* Premium POS redesign layer */
.app-shell {
  grid-template-columns: 280px minmax(500px, 1fr) 460px;
  gap: 16px;
  min-height: 100vh;
  padding: 16px;
}

.is-admin .app-shell {
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar,
.cart-panel,
.catalog-area {
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.sidebar,
.cart-panel {
  height: calc(100vh - 32px);
  position: sticky;
  top: 16px;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

.cart-panel {
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.catalog-area {
  min-width: 0;
  padding: 18px;
}

.brand {
  margin-bottom: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.brand-logo {
  width: 92px;
  height: 66px;
}

.sidebar-toggle {
  margin-left: auto;
}

.branch-card {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  border: 1px solid rgba(79, 214, 255, 0.22);
  border-radius: 12px;
  padding: 12px 14px;
  background:
    linear-gradient(135deg, rgba(79, 214, 255, 0.14), transparent 58%),
    linear-gradient(315deg, rgba(167, 139, 250, 0.14), transparent 64%),
    var(--panel-strong);
}

.branch-card span {
  color: var(--muted);
  font-size: 0.78rem;
}

.branch-card strong {
  text-align: center;
  color: var(--ink);
  font-size: 1.2rem;
  font-family: "Segoe UI Semibold", "Trebuchet MS", Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
}

.branch-card.branch-sipcity {
  border-color: rgba(79, 214, 255, 0.32);
  background:
    linear-gradient(135deg, rgba(79, 214, 255, 0.18), transparent 58%),
    linear-gradient(315deg, rgba(88, 107, 255, 0.16), transparent 64%),
    var(--panel-strong);
}

.branch-card.branch-capetown {
  border-color: rgba(244, 212, 99, 0.36);
  background:
    linear-gradient(135deg, rgba(244, 212, 99, 0.18), transparent 58%),
    linear-gradient(315deg, rgba(167, 139, 250, 0.16), transparent 64%),
    var(--panel-strong);
}

.branch-card.branch-sipcity strong {
  color: #0b91d6;
}

.branch-card.branch-capetown strong {
  color: #b38a00;
}

.branch-card small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.74rem;
}

.branch-selector {
  min-width: 178px;
}

.branch-selector span {
  color: #9fdcff;
}

.branch-selector select {
  min-height: 40px;
  border: 1px solid rgba(79, 214, 255, 0.26);
  border-radius: 999px;
  padding: 0 42px 0 14px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(79, 214, 255, 0.2), rgba(167, 139, 250, 0.18)),
    #0b1023;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
}

.branch-selector.branch-sipcity select {
  border-color: rgba(79, 214, 255, 0.4);
  background:
    linear-gradient(135deg, rgba(79, 214, 255, 0.24), rgba(88, 107, 255, 0.22)),
    #0b1023;
}

.branch-selector.branch-capetown select {
  border-color: rgba(244, 212, 99, 0.44);
  background:
    linear-gradient(135deg, rgba(244, 212, 99, 0.24), rgba(167, 139, 250, 0.22)),
    #0b1023;
}

.mode-switch {
  margin-top: 0;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  max-height: none;
  overflow: visible;
  padding: 0;
}

.mode-switch .tab,
.tabs .tab,
.quick-actions .ghost-button {
  min-height: 44px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, #ffffff 8%);
  font-weight: 800;
}

.front-nav .tab {
  justify-content: center;
}

.tabs .tab {
  flex: 1 1 calc(50% - 8px);
}

.tab.is-active {
  box-shadow: 0 12px 30px rgba(88, 107, 255, 0.2);
}

.quick-actions {
  grid-template-columns: 1fr;
  margin-top: 0;
}

.status-panel,
.pos-summary-card {
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 0;
}

.status-panel div,
.pos-summary-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 12px;
}

.status-panel strong,
.pos-summary-card strong {
  margin: 0;
}

.system-menu {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  overflow: hidden;
}

.system-menu summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 900;
}

.system-menu-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.theme-switch-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  display: grid;
  grid-template-columns: 1fr 46px 1fr;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.theme-switch-button > span:first-child {
  text-align: right;
}

.theme-switch-button > span:last-child {
  text-align: left;
}

.theme-switch-track {
  position: relative;
  width: 46px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f4eee6;
}

.theme-switch-track span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent);
  transition: transform 160ms ease, background-color 160ms ease;
}

.theme-switch-button.is-dark .theme-switch-track {
  background: #0f151b;
  border-color: var(--accent);
}

.theme-switch-button.is-dark .theme-switch-track span {
  transform: translateX(22px);
  background: #ffffff;
}

.pos-summary-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 0;
}

.pos-summary-card div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.pos-summary-card span {
  color: var(--muted);
  font-size: 0.78rem;
}

.category-filter-bar {
  margin-top: 14px;
}

.topbar {
  position: sticky;
  top: 16px;
  z-index: 5;
  display: grid;
  grid-template-columns: max-content minmax(320px, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 14px;
  background:
    radial-gradient(circle at 78% 18%, rgba(244, 212, 99, 0.28), transparent 22%),
    linear-gradient(135deg, #050814 0%, #0c1224 34%, #586bff 72%, #8b5cf6 100%);
  box-shadow: 0 20px 46px rgba(88, 107, 255, 0.18);
  backdrop-filter: blur(18px);
}

.topbar-brand-title {
  color: #ffffff;
  font-family: "Segoe UI Semibold", "Trebuchet MS", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.05rem, 2vw, 1.72rem);
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 0 0 24px rgba(79, 214, 255, 0.34);
  white-space: nowrap;
}

.workspace-copy {
  display: none !important;
}

.topbar-status {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.topbar-status #networkStatus,
.topbar-status #syncStatus {
  display: none;
}

body:not(.is-admin) .topbar {
  text-align: left;
}

.register-search {
  width: 100%;
}

.topbar .register-search span {
  color: rgba(255, 255, 255, 0.78);
}

.register-search input {
  min-height: 58px;
  border-width: 1px;
  border-color: rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding-left: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
  font-size: 1.04rem;
  font-weight: 760;
}

.register-search:focus-within input {
  box-shadow: 0 0 0 4px rgba(239, 24, 63, 0.22), 0 22px 46px rgba(0, 0, 0, 0.2);
}

.clerk,
.status-pill {
  min-height: 38px;
  background: color-mix(in srgb, var(--panel) 88%, #ffffff 12%);
}

.product-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  align-items: stretch;
  width: 100%;
  max-width: none;
  gap: 18px;
  margin: 18px 0 0;
}

.cashier-pending-invoices {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.cashier-pending-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cashier-pending-top h3 {
  margin: 2px 0 0;
  font-size: 1.02rem;
}

.cashier-pending-total {
  display: grid;
  gap: 3px;
  justify-items: end;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--accent);
  color: #ffffff;
}

.cashier-pending-total span {
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0.86;
}

.cashier-pending-total strong {
  font-size: 1rem;
}

.cashier-pending-list {
  display: grid;
  gap: 10px;
}

.cashier-invoice-doc {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-strong);
}

.cashier-invoice-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.cashier-invoice-summary small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.cashier-invoice-detail {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.cashier-invoice-doc footer,
.cashier-invoice-lines div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cashier-invoice-doc header strong {
  display: block;
}

.cashier-invoice-doc header span,
.cashier-invoice-meta span,
.cashier-invoice-lines span,
.cashier-invoice-doc footer span {
  color: var(--muted);
  font-size: 0.8rem;
}

.cashier-invoice-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}

.cashier-invoice-meta strong {
  overflow-wrap: anywhere;
}

.cashier-invoice-lines {
  display: grid;
  gap: 7px;
}

.cashier-invoice-doc footer {
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.cashier-invoice-tracking {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(130px, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.cashier-invoice-tracking > div {
  display: grid;
  gap: 4px;
}

.cashier-invoice-tracking > div > span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.tracking-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.tracking-tabs button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 800;
}

.tracking-tabs button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

body.is-cashier-only .front-nav,
body.is-cashier-only .quick-actions,
body.is-cashier-only .pos-summary-card,
body.is-cashier-only .category-filter-bar,
body.is-cashier-only .sale-controls,
body.is-cashier-only #receiptActions,
body.is-cashier-only #receipt,
body.is-cashier-only #sidebarToggleButton,
body.is-cashier-only #heldSaleCount,
body.is-cashier-only #holdSaleButton,
body.is-cashier-only #resumeSaleButton {
  display: none !important;
}

body.is-admin .front-nav,
body.is-admin .system-menu,
body.is-admin #endDayButton,
body.is-admin #themeToggleButton,
body.is-admin #sidebarToggleButton {
  display: none !important;
}

body.is-admin .admin-only-action {
  display: block;
}

body.is-admin .app-shell {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  min-height: 100vh;
  padding: 0;
}

body.is-admin .sidebar {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: 0;
  z-index: 30;
  flex-direction: row;
  align-items: center;
  height: auto;
  min-height: 72px;
  overflow: visible;
  border-width: 0 0 1px;
  border-radius: 0;
  padding: 10px 18px;
}

body.is-admin .brand {
  min-width: 240px;
  padding: 0;
  border-bottom: 0;
}

body.is-admin .brand-logo {
  width: 86px;
  height: 54px;
}

body.is-admin .branch-card {
  min-width: 190px;
  max-width: 240px;
  padding: 8px 10px;
}

body.is-admin .quick-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  min-width: 140px;
}

body.is-admin .quick-actions .ghost-button {
  min-width: 118px;
}

body.is-admin .catalog-area {
  grid-column: 1;
  grid-row: 2;
  min-height: calc(100vh - 72px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 16px;
  background: transparent;
}

body.is-admin .topbar {
  position: static;
  grid-template-columns: max-content minmax(220px, 1fr) auto;
  margin-bottom: 14px;
}

body.is-admin .admin-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  width: 100%;
}

body.is-admin .admin-subtabs {
  position: sticky;
  top: 72px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
}

body.is-admin .backend-nav-title {
  flex: 0 0 auto;
  min-width: 190px;
  padding: 0 12px 0 2px;
  border-right: 1px solid var(--line);
  border-bottom: 0;
}

body.is-admin .backend-nav-group {
  display: none;
}

body.is-admin .admin-subtab {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 12px;
  text-align: center;
}

body.is-admin .admin-tab-panel {
  grid-column: 1;
  width: 100%;
  min-height: calc(100vh - 214px);
}

body.is-admin .admin-section,
body.is-admin .documents-panel,
body.is-admin .reports-panel {
  width: 100%;
}

body.is-admin .credit-table,
body.is-admin .sales-history-files,
body.is-admin .document-preview-table,
body.is-admin .product-profit-table,
body.is-admin .admin-table {
  max-height: calc(100vh - 340px);
}

body.is-cashier-only .system-menu {
  margin-top: auto;
  border: 0;
  background: transparent;
}

body.is-cashier-only .system-menu summary {
  display: none;
}

body.is-cashier-only .system-menu-panel {
  display: grid;
  border: 0;
  padding: 0;
}

body.is-cashier-only .system-menu-panel > button:not(#logoutButton):not(#myInvoicesButton) {
  display: none;
}

.cashier-only-action {
  display: none;
}

body.is-cashier-only .cashier-only-action {
  display: block;
}

body.is-cashier-only #cashierThemeToggleButton {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 45;
  display: grid;
  width: min(260px, calc(100vw - 36px));
  min-height: 48px;
  box-shadow: 0 18px 44px rgba(36, 29, 27, 0.22);
}

body.is-cashier-only .cashier-sidebar-invoices[hidden] {
  display: none !important;
}

body.is-cashier-only .cashier-sidebar-invoices.cashier-only-action:not([hidden]) {
  display: grid;
}

.cashier-sidebar-invoices {
  display: grid;
  gap: 10px;
  max-height: min(58vh, 620px);
  overflow: auto;
  padding: 2px 2px 8px;
}

.cashier-sidebar-invoices .cashier-pending-top {
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
}

.cashier-sidebar-invoices .cashier-pending-top h3 {
  font-size: 1rem;
}

.cashier-sidebar-invoices .cashier-pending-total {
  width: 100%;
}

.cashier-sidebar-invoices .cashier-pending-list {
  gap: 8px;
}

.cashier-sidebar-invoices .cashier-invoice-doc {
  padding: 10px;
}

.cashier-sidebar-invoices .cashier-invoice-summary {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.cashier-sidebar-invoices .cashier-invoice-tracking {
  grid-template-columns: minmax(0, 1fr);
}

.cashier-sidebar-invoices .cashier-invoice-lines div,
.cashier-sidebar-invoices .cashier-invoice-doc footer {
  align-items: flex-start;
}

body.is-cashier-only .payment-buttons {
  grid-template-columns: 1fr;
}

body.is-cashier-only .cart-tools {
  grid-template-columns: 1fr;
}

.product-grid-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(49, 95, 131, 0.1), transparent 50%),
    var(--panel-strong);
}

.product-grid-heading h3 {
  margin: 2px 0 0;
}

.product-grid-heading span {
  color: var(--muted);
  font-weight: 800;
}

.product-card {
  min-height: 270px;
  padding: 12px;
  border-color: color-mix(in srgb, var(--line) 84%, transparent);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 36%),
    var(--panel);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  box-shadow: 0 18px 42px rgba(36, 29, 27, 0.14);
}

.product-photo {
  min-height: 132px;
  background:
    radial-gradient(circle at top, rgba(88, 107, 255, 0.12), transparent 62%),
    var(--panel-strong);
}

.product-photo img {
  height: 132px;
  object-fit: contain;
  padding: 6px;
}

.product-name {
  min-height: 42px;
  font-size: 0.96rem;
}

.inventory-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inventory-strip span {
  display: grid;
  place-items: center;
  min-height: 30px;
  font-weight: 800;
}

.stock-ok {
  color: var(--green) !important;
}

.stock-low {
  color: var(--accent) !important;
}

.add-button {
  min-height: 44px;
  min-width: 82px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  font-weight: 900;
}

.cart-heading {
  margin-bottom: 0;
}

.cart-items {
  flex: 1;
  max-height: none;
  min-height: 160px;
}

.cart-line {
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(88, 107, 255, 0.06), transparent 58%),
    var(--panel);
  animation: cart-pop 180ms ease;
}

@keyframes cart-pop {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.qty-controls {
  grid-template-columns: 42px 34px 42px;
  border-radius: 8px;
}

.qty-controls button {
  min-height: 42px;
  font-weight: 900;
}

.cart-tools,
.quick-cash-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.cart-context {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-strong);
}

.sale-controls {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(47, 125, 87, 0.08), transparent 52%),
    var(--panel-strong);
}

.payment-buttons {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.payment-button {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 64px;
  border-radius: 8px;
  background: var(--panel);
}

.payment-button span {
  display: grid;
  place-items: center;
  min-width: 34px;
  min-height: 22px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 900;
}

.payment-button strong {
  font-size: 0.88rem;
}

.payment-button.is-active span {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.cash-terminal,
.split-payment-box,
.invoice-payment-box {
  margin-top: 10px;
}

.totals {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.grand-total {
  border: 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--panel-strong);
  font-size: 1.45rem;
}

.cart-panel > .checkout-button {
  position: sticky;
  bottom: 0;
  min-height: 64px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 18px 40px rgba(88, 107, 255, 0.28);
  font-size: 1.02rem;
}

.receipt-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-strong);
}

.sidebar-collapsed .app-shell {
  grid-template-columns: 96px minmax(500px, 1fr) 460px;
}

.sidebar-collapsed .sidebar {
  padding: 14px 10px;
}

.sidebar-collapsed .brand {
  justify-content: center;
}

.sidebar-collapsed .brand > div,
.sidebar-collapsed .branch-card,
.sidebar-collapsed .status-panel,
.sidebar-collapsed .system-menu,
.sidebar-collapsed .quick-actions,
.sidebar-collapsed .tabs .tab span,
.sidebar-collapsed .tab span {
  display: none;
}

.sidebar-collapsed .brand-logo {
  width: 48px;
  height: 48px;
}

.sidebar-collapsed .tabs .tab,
.sidebar-collapsed .mode-switch .tab {
  justify-content: center;
  padding: 0 8px;
  min-width: 0;
}

body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .cart-panel,
body[data-theme="dark"] .catalog-area {
  background: rgba(21, 27, 33, 0.84);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.36);
}

body[data-theme="dark"] .topbar {
  background:
    linear-gradient(135deg, #0f0f10 0%, #171719 32%, #586bff 100%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.36);
}

body[data-theme="dark"] .branch-card,
body[data-theme="dark"] .product-grid-heading,
body[data-theme="dark"] .cart-context,
body[data-theme="dark"] .sale-controls,
body[data-theme="dark"] .grand-total {
  background:
    linear-gradient(135deg, rgba(101, 119, 255, 0.14), transparent 58%),
    var(--panel-strong);
}

body[data-theme="dark"] .register-search input {
  background: #101820;
  box-shadow: 0 18px 50px rgba(101, 119, 255, 0.12);
}

body[data-theme="dark"] .product-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 38%),
    #19212a;
}

body[data-theme="dark"] .product-card:hover {
  box-shadow: 0 20px 60px rgba(101, 119, 255, 0.16);
}

@media (max-width: 1220px) {
  .app-shell,
  .sidebar-collapsed .app-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .sidebar {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .catalog-area {
    grid-column: 2;
    grid-row: 2;
  }

  .cart-panel {
    grid-column: 2;
    grid-row: 1;
    height: auto;
    position: static;
    overflow: visible;
  }
}

@media (max-width: 820px) {
  .app-shell,
  .sidebar-collapsed .app-shell {
    display: flex;
    flex-direction: column;
    padding: 10px;
  }

  .sidebar,
  .cart-panel,
  .catalog-area {
    height: auto;
    position: static;
    margin-bottom: 10px;
  }

  .sidebar {
    order: 1;
  }

  .cart-panel {
    order: 2;
  }

  .cart-panel > .checkout-button {
    position: static;
  }

  .catalog-area {
    order: 3;
  }

  .topbar {
    position: static;
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  }

  .credit-summary,
  .credit-head,
  .credit-row,
  .expenses-layout,
  .expense-dashboard-section,
  .expense-history-section,
  .expense-approval-section,
  .expense-row,
  .expense-category-manager {
    grid-template-columns: 1fr;
    grid-column: 1;
  }
}

body[data-theme="dark"] .login-screen {
  background:
    radial-gradient(circle at 24% 16%, rgba(79, 214, 255, 0.24), transparent 26%),
    radial-gradient(circle at 78% 72%, rgba(167, 139, 250, 0.22), transparent 28%),
    radial-gradient(circle at 50% 102%, rgba(244, 212, 99, 0.16), transparent 30%),
    linear-gradient(135deg, #040713 0%, #0b1023 48%, #111a35 100%);
}

body[data-theme="dark"] .login-card {
  background: linear-gradient(180deg, rgba(12, 18, 36, 0.94), rgba(8, 12, 25, 0.92));
}

body[data-theme="dark"] .login-logo,
body[data-theme="dark"] .brand-logo {
  background: #050814;
}

body[data-theme="dark"] .login-tab {
  border-color: rgba(79, 214, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #d9e7ff;
}

body[data-theme="dark"] .login-tab.is-active {
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #ffffff;
}
