:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --ink: #142033;
  --muted: #65748b;
  --line: #dbe4ef;
  --line-strong: #c7d4e4;
  --brand: #0c8ed1;
  --brand-dark: #0b3f78;
  --brand-soft: #e9f6fd;
  --success: #118a57;
  --success-soft: #e8f7ef;
  --warning: #b7791f;
  --danger: #b42318;
  --danger-soft: #fff0ef;
  --shadow: 0 14px 36px rgba(15, 35, 63, 0.08);
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(12, 142, 209, 0.10), transparent 34rem),
    var(--bg);
  color: var(--ink);
  font: 15px/1.45 "Segoe UI", Calibri, Arial, sans-serif;
}

.app-page {
  --bs-primary: var(--brand);
  --bs-primary-rgb: 12, 142, 209;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
}

.topbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 18px rgba(15, 35, 63, 0.06);
  backdrop-filter: blur(12px);
}

.app-container {
  animation: pageFade 0.18s ease-out;
}

@keyframes pageFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--brand-dark);
  text-decoration: none;
  padding: 0;
}

.brand img {
  width: 76px;
  height: 46px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  padding: 4px;
}

.brand span {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  font-size: 18px;
  font-weight: 800;
}

.brand small {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  margin-left: auto;
  padding: 4px;
  border: 1px solid rgba(219, 228, 239, 0.72);
  border-radius: 999px;
  background: rgba(244, 247, 251, 0.72);
}

.topbar nav a {
  position: relative;
  color: #35506f;
  text-decoration: none;
  padding: 8px 13px;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.1;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  color: #35506f;
  padding: 8px 28px 8px 13px;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.1;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown summary::after {
  content: "v";
  position: absolute;
  right: 12px;
  top: 50%;
  color: currentColor;
  font-size: 10px;
  transform: translateY(-50%);
}

.topbar nav a:hover {
  background: #fff;
  color: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 35, 63, 0.08);
}

.nav-dropdown summary:hover {
  background: #fff;
  color: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 35, 63, 0.08);
}

.topbar nav a.active,
.nav-dropdown summary.active {
  background: linear-gradient(135deg, var(--brand), #0b67d1);
  color: #fff;
  box-shadow: 0 10px 24px rgba(12, 142, 209, 0.25);
}

.topbar nav a.active:hover,
.nav-dropdown summary.active:hover {
  color: #fff;
  box-shadow: 0 12px 28px rgba(12, 142, 209, 0.3);
}

.topbar nav a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--brand);
  transform: translateX(-50%);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 60;
}

.nav-dropdown:not([open]) .nav-dropdown-menu {
  display: none;
}

.nav-dropdown-menu a {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  border-radius: 10px !important;
  padding: 10px 12px !important;
  box-shadow: none !important;
}

.nav-dropdown-menu a.active::after {
  display: none;
}

.account-menu {
  position: relative;
  margin-left: 6px;
  flex: 0 0 auto;
}

.account-menu summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  min-width: 124px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  box-shadow: 0 6px 20px rgba(15, 35, 63, 0.05);
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-menu summary::after {
  content: "v";
  position: absolute;
  right: 10px;
  top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.account-menu summary span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  padding-right: 12px;
  text-transform: uppercase;
}

.account-menu summary strong {
  color: var(--ink);
  font-size: 14px;
  padding-right: 12px;
}

.account-menu div {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 150px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 40;
}

.account-menu div a {
  display: block;
  color: #27405f;
  text-decoration: none;
  border-radius: 7px;
  padding: 9px 10px;
  font-weight: 700;
}

.account-menu div a:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 20px;
}

.page-kicker {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

h1 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  margin: 28px 0 12px;
  color: var(--brand-dark);
  font-size: 19px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 12px 32px rgba(15, 35, 63, 0.065);
}

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

.admin-card {
  margin-bottom: 0;
}

.admin-card-wide {
  grid-column: 1 / -1;
}

.admin-card h2 {
  margin-top: 0;
}

.admin-section-head {
  margin: 0 0 16px;
}

.module-section {
  margin-top: 6px;
}

.module-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 16px;
  color: #24324a;
}

.module-heading h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #24324a;
}

.module-heading-icon {
  font-size: 21px;
  line-height: 1;
  color: #24324a;
}

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

.module-card {
  position: relative;
  min-height: 94px;
  display: flex;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  padding: 20px 18px 20px 22px;
  background: #fff;
  border: 1px solid #e9eef5;
  border-left: 4px solid var(--module-color, var(--brand));
  border-radius: 4px;
  box-shadow: 0 2px 9px rgba(15, 35, 63, 0.05);
  color: #17243b;
  text-decoration: none;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.module-card:hover {
  color: #17243b;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 35, 63, 0.11);
}

.module-card-green { --module-color: #22b455; }
.module-card-orange { --module-color: #ff6a00; }
.module-card-cyan { --module-color: #11a9c7; }
.module-card-red { --module-color: #f2364d; }
.module-card-blue { --module-color: #126ab3; }
.module-card-violet { --module-color: #7449dc; }
.module-card-yellow { --module-color: #f5b400; }
.module-card-navy { --module-color: #0c4f89; }

.module-icon {
  width: 22px;
  min-width: 22px;
  height: 22px;
  color: var(--module-color, var(--brand));
}

.module-icon::before {
  display: block;
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
  color: currentColor;
}

.module-icon-receipt::before { content: "▤"; }
.module-icon-building::before { content: "▥"; }
.module-icon-card::before { content: "▣"; }
.module-icon-percent::before { content: "%"; }
.module-icon-shield::before { content: "▢"; }
.module-icon-database::before { content: "▦"; }
.module-icon-audit::before { content: "✓"; }
.module-icon-users::before { content: "◉"; }

.module-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 3px;
}

.module-copy strong {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 850;
}

.module-copy small {
  max-width: 220px;
  color: #2d3a50;
  font-size: 12px;
  line-height: 1.25;
}

.module-count {
  position: absolute;
  right: 14px;
  bottom: -5px;
  font-size: 62px;
  line-height: 1;
  font-weight: 850;
  color: var(--module-color, var(--brand));
  opacity: 0.09;
  pointer-events: none;
}

.inline-form {
  display: inline-flex;
  margin-top: 6px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.inline-check input {
  width: auto;
  min-height: auto;
}

.compact-form {
  background: linear-gradient(180deg, #fff, var(--panel-soft));
}

.metric {
  margin-top: 4px;
  font-size: 30px;
  font-weight: 800;
  color: var(--brand-dark);
  letter-spacing: -0.02em;
}

.dashboard-stats {
  overflow: hidden;
}

.stats-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.stats-header h2 {
  margin: 0;
}

.stats-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4f7fb;
  flex: 0 0 auto;
}

.stats-toggle a {
  color: #35506f;
  text-decoration: none;
  padding: 8px 13px;
  border-radius: 999px;
  font-weight: 800;
}

.stats-toggle a.active {
  background: linear-gradient(135deg, var(--brand), #0b67d1);
  color: #fff;
  box-shadow: 0 8px 18px rgba(12, 142, 209, 0.22);
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stats-summary div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  padding: 13px 14px;
}

.stats-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats-summary strong {
  display: block;
  color: var(--brand-dark);
  font-size: 22px;
  margin-top: 4px;
}

.revenue-chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(30px, 1fr);
  gap: 8px;
  align-items: end;
  min-height: 190px;
  overflow-x: auto;
  padding: 10px 2px 2px;
}

.revenue-bar {
  display: grid;
  grid-template-rows: 140px auto;
  gap: 8px;
  min-width: 30px;
  text-align: center;
}

.bar-track {
  display: flex;
  align-items: flex-end;
  height: 140px;
  border-radius: 10px;
  background: #eef4fb;
  overflow: hidden;
}

.bar-track span {
  display: block;
  width: 100%;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, #18b6ff, var(--brand-dark));
}

.revenue-bar small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

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

label {
  display: block;
  color: #263a54;
  font-weight: 700;
  margin: 10px 0 4px;
}

.check-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: auto;
  margin: 14px 0 16px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: #263a54;
  cursor: pointer;
  user-select: none;
}

.check-option input {
  appearance: none;
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  border: 2px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  flex: 0 0 auto;
}

.check-option input:checked {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: inset 0 0 0 3px #fff;
}

.check-option:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

textarea { min-height: 92px; resize: vertical; }

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 0.22rem rgba(12, 142, 209, 0.16);
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #0b67d1);
  color: #fff;
  padding: 9px 16px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(12, 142, 209, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

button:hover,
.button:hover {
  color: #fff;
  filter: brightness(0.98);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(12, 142, 209, 0.26);
}

button.secondary,
.button.secondary {
  background: #f4f7fb;
  color: #27405f;
  box-shadow: none;
  border: 1px solid var(--line);
}

button.secondary:hover,
.button.secondary:hover {
  color: var(--brand-dark);
  background: var(--brand-soft);
  box-shadow: none;
}

.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.danger { background: var(--danger); }

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(15, 35, 63, 0.055);
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}

tr:last-child td { border-bottom: 0; }

tbody tr:nth-child(even) td {
  background: #fbfdff;
}

tbody tr:hover td {
  background: var(--brand-soft);
}

th {
  background: linear-gradient(180deg, #f7faff, #edf4fb);
  color: #20344f;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.list-toolbar {
  justify-content: flex-end;
  margin: 0 0 14px;
}

.notice,
.error {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-weight: 650;
}

.notice {
  background: var(--success-soft);
  border: 1px solid #b7e2cc;
  color: #0f633e;
}

.error {
  background: var(--danger-soft);
  border: 1px solid #f3b7b1;
  color: #8b1d14;
}

.split {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 16px;
}

.receipt {
  max-width: 520px;
  font-family: ui-monospace, Consolas, monospace;
  background: #fff;
  padding: 18px;
  border: 1px dashed #8ea4bd;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.receipt-paper-80 {
  width: 80mm;
  max-width: 80mm;
}

.receipt-paper-58 {
  width: 58mm;
  max-width: 58mm;
  font-size: 12px;
}

.receipt-head {
  text-align: center;
}

.receipt-head strong,
.receipt-head span,
.receipt-head small {
  display: block;
}

.receipt-head strong {
  color: var(--brand-dark);
  font-size: 18px;
  font-family: "Segoe UI", Calibri, Arial, sans-serif;
}

.receipt-tax-notice {
  display: block;
  margin-top: 6px;
  font-weight: 800;
}

.receipt-logo {
  display: block;
  width: auto;
  max-width: 230px;
  max-height: 120px;
  object-fit: contain;
  margin: 0 auto 10px;
}

.receipt-logo-small {
  max-width: 130px;
  max-height: 68px;
}

.receipt-logo-medium {
  max-width: 180px;
  max-height: 95px;
}

.receipt-logo-large {
  max-width: 250px;
  max-height: 135px;
}

.receipt-rksv {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.receipt-qr {
  width: 150px;
  height: 150px;
  image-rendering: crisp-edges;
}

.receipt-logo-preview {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.receipt-logo-preview span {
  color: var(--muted);
  font-weight: 800;
}

.receipt-logo-preview img {
  max-width: 160px;
  max-height: 72px;
  object-fit: contain;
}

.pos-shell {
  display: grid;
  grid-template-columns: minmax(360px, 440px) 1fr;
  gap: 18px;
  align-items: start;
}

.pos-cart,
.pos-products {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 640px;
  box-shadow: var(--shadow);
}

.pos-cart {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 86px;
}

.pos-products { padding: 18px; }

.pos-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.pos-card-header strong {
  display: block;
  font-size: 21px;
  color: #10243d;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cart-empty {
  margin: 16px;
  padding: 18px;
  border: 1px dashed #b8c6d8;
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--muted);
  text-align: center;
}

.cart-empty.wide { grid-column: 1 / -1; }

.cart-lines {
  padding: 8px 14px;
  flex: 1;
  overflow: auto;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr 112px 92px auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid #edf2f7;
  padding: 12px 0;
}

.cart-line-main strong { display: block; }

.cart-line-main span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.qty-control {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  gap: 4px;
}

.qty-control button {
  min-height: 32px;
  padding: 4px;
  background: #eef3f8;
  color: #20344f;
  box-shadow: none;
  border: 1px solid var(--line);
}

.qty-control input {
  min-height: 32px;
  padding: 5px;
  text-align: center;
}

.line-total {
  font-weight: 850;
  text-align: right;
}

.remove-line {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  background: var(--danger-soft);
  color: var(--danger);
  box-shadow: none;
  border: 1px solid #f3c0bc;
  padding: 0;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.discount-panel,
.payment-panel {
  border-top: 1px solid var(--line);
  padding: 8px 14px;
}

.discount-panel label,
.payment-panel label {
  margin-bottom: 7px;
  font-size: 13px;
}

.payment-panel input,
.payment-panel select,
.discount-panel input,
.discount-panel select {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 14px;
}

.discount-row {
  display: grid;
  grid-template-columns: 64px 1fr 70px;
  gap: 6px;
  align-items: center;
}

.payment-row {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.discount-row span,
.payment-row > span {
  color: #20344f;
  font-size: 13px;
  font-weight: 850;
}

.inline-control {
  display: grid;
  grid-template-columns: 1fr 70px;
  gap: 6px;
}

.customer-picker-control {
  grid-template-columns: 1fr 40px;
}

.voucher-check-control {
  grid-template-columns: 1fr 40px;
}

.icon-button {
  min-height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  line-height: 1;
}

.person-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-block;
}

.person-icon::before,
.person-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 2px solid currentColor;
}

.person-icon::before {
  top: 1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.person-icon::after {
  bottom: 1px;
  width: 16px;
  height: 8px;
  border-radius: 10px 10px 4px 4px;
  border-bottom-width: 2px;
}

.voucher-icon {
  position: relative;
  width: 20px;
  height: 14px;
  display: inline-block;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.voucher-icon::before,
.voucher-icon::after {
  content: "";
  position: absolute;
}

.voucher-icon::before {
  top: 50%;
  left: -3px;
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: 22px 0 0 #fff;
}

.voucher-icon::after {
  top: 2px;
  bottom: 2px;
  left: 8px;
  border-left: 2px dotted currentColor;
}

.cart-summary {
  background: linear-gradient(180deg, #f8fbff, #f1f7fd);
  border-top: 1px solid var(--line);
  padding: 6px 14px;
}

.cart-summary div {
  display: flex;
  justify-content: space-between;
  margin: 1px 0;
  font-size: 12px;
}

.cart-summary strong {
  font-size: 12px;
}

.cart-summary .total {
  color: #10243d;
  border-top: 1px solid var(--line);
  padding-top: 5px;
  margin-top: 4px;
  font-size: 14px;
}

.cart-summary .total strong {
  font-size: 16px;
}

.checkout-button {
  width: 100%;
  background: var(--success);
  font-size: 15px;
  padding: 10px;
  margin-top: 6px;
  box-shadow: 0 8px 18px rgba(17, 138, 87, 0.20);
}

.pos-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.search-box { margin: 0; }

.pos-type-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.pos-type-switch button {
  background: #f5f9fd;
  color: var(--brand-dark);
  border: 1px solid var(--line);
  box-shadow: none;
  min-height: 44px;
  font-weight: 850;
}

.pos-type-switch button.active {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

.category-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.category-tab {
  min-height: 84px;
  background: #f5f9fd;
  color: #20344f;
  border: 1px solid var(--line);
  text-align: left;
  padding: 15px 16px;
  box-shadow: none;
  font-weight: 850;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.category-tab strong {
  display: block;
  font-size: 16px;
  line-height: 1.15;
}

.category-tab small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.category-tab.active {
  background: var(--brand-dark);
  color: #fff;
  border-color: var(--brand-dark);
}

.category-tab.active small { color: #d8f0ff; }

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

.product-tile {
  min-height: 100px;
  background: #fff;
  color: #12233a;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  text-align: left;
  padding: 13px;
  border-radius: var(--radius);
  box-shadow: 0 7px 18px rgba(15, 35, 63, 0.05);
}

.product-tile:hover {
  border-color: var(--brand);
  box-shadow: 0 10px 24px rgba(12, 142, 209, 0.12);
}

.product-tile span {
  color: var(--brand);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.product-tile.service span { color: #0f766e; }

.product-tile strong {
  font-size: 15px;
  line-height: 1.18;
}

.product-tile em {
  color: var(--brand-dark);
  font-style: normal;
  font-weight: 850;
}

.login-brand {
  max-width: 460px;
  margin: 10px auto 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.login-brand img {
  display: block;
  width: min(300px, 100%);
  margin: 0 auto 14px;
}

.login-brand strong {
  display: block;
  color: #071a34;
  font-size: 22px;
}

.login-brand span {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
}

.auth-card {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 18%, rgba(24, 182, 255, 0.32), transparent 28rem),
    linear-gradient(135deg, #051935 0%, #0b4d8f 46%, #0aa3e8 100%);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
}

.login-hero {
  position: relative;
  display: flex;
  align-items: center;
  padding: 56px;
  color: #fff;
  overflow: hidden;
}

.login-hero::before,
.login-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}

.login-hero::before {
  width: 320px;
  height: 320px;
  right: -90px;
  top: 70px;
}

.login-hero::after {
  width: 180px;
  height: 180px;
  left: -45px;
  bottom: 80px;
}

.login-hero-content {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.login-hero img {
  width: min(330px, 100%);
  margin-bottom: 34px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
}

.login-kicker {
  display: inline-block;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.login-hero h1 {
  max-width: 520px;
  color: #fff;
  font-size: 48px;
  line-height: 1.02;
  font-weight: 850;
  margin-bottom: 18px;
}

.login-hero p {
  max-width: 520px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  margin-bottom: 26px;
}

.login-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.login-badges span {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 750;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 253, 0.98)),
    #f5f9fd;
}

.login-card {
  width: min(480px, 100%);
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
}

.login-card .card-body {
  border-top: 5px solid var(--brand);
}

.login-card .form-control {
  border-color: #c7d7ea;
  border-radius: 12px;
  min-height: 50px;
}

.login-card .form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 0.22rem rgba(12, 142, 209, 0.18);
}

.login-remember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #263a54;
  cursor: pointer;
}

.login-remember input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.login-remember span {
  width: 42px;
  height: 24px;
  position: relative;
  border-radius: 999px;
  background: #d9e5f2;
  transition: background 0.18s ease;
}

.login-remember span::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(18, 35, 58, 0.22);
  transition: transform 0.18s ease;
}

.login-remember input:checked + span {
  background: var(--brand);
}

.login-remember input:checked + span::after {
  transform: translateX(18px);
}

.login-submit {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #0c8ed1, #0b56c9);
  box-shadow: 0 14px 30px rgba(12, 142, 209, 0.28);
  font-weight: 800;
}

.login-footnote {
  margin: 18px auto 0;
  color: #65748b;
  font-size: 13px;
  font-weight: 700;
}

.field-hint {
  color: var(--muted);
  font-size: 11px;
  margin: 2px 0 5px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(12, 25, 43, 0.48);
  padding: 20px;
}

.modal-backdrop[hidden] { display: none; }

.modal-card {
  width: min(720px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 28px 80px rgba(4, 18, 38, 0.28);
  padding: 18px;
}

.wide-modal {
  width: min(1040px, 100%);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.modal-header strong {
  display: block;
  color: var(--brand-dark);
  font-size: 22px;
}

.modal-actions,
.receipt-actions {
  margin-bottom: 16px;
}

.modal-form .actions {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.customer-modal-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.35fr;
  gap: 18px;
}

.customer-results {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  max-height: 470px;
  overflow: auto;
}

.customer-result {
  display: block;
  width: 100%;
  min-height: auto;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
  text-align: left;
  padding: 10px 12px;
}

.customer-result:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.customer-result strong,
.customer-result span {
  display: block;
}

.customer-result span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.customer-history {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.customer-profile {
  display: grid;
  gap: 16px;
}

.customer-profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.customer-profile-head h2 {
  margin: 0 0 8px;
  color: var(--brand-dark);
}

.customer-profile-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.customer-contact-grid > div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  padding: 12px 14px;
}

.customer-contact-grid strong {
  display: block;
  color: var(--ink);
  margin-top: 3px;
}

.customer-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.customer-history-head h3 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 18px;
}

.customer-last-visit {
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  padding: 10px 12px;
  text-align: right;
}

.customer-last-visit span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.customer-last-visit strong {
  display: block;
  color: var(--brand-dark);
  font-size: 14px;
  margin-top: 3px;
}

.customer-history-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-receipts {
  margin-top: 12px;
}

@media print {
  @page {
    margin: 0;
  }

  body { background: #fff; }

  body.print-receipt-only {
    margin: 0 !important;
    background: #fff !important;
  }

  body.print-receipt-only .topbar,
  body.print-receipt-only .page-heading,
  body.print-receipt-only .notice,
  body.print-receipt-only .receipt-actions,
  body.print-receipt-only #pos-form,
  body.print-receipt-only #customer-modal,
  body.print-receipt-only .modal-backdrop:not(#receipt-modal):not(#customer-receipt-modal) {
    display: none !important;
  }

  body.print-receipt-only .app-container {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.print-receipt-only .app-container > :not(#print-receipt):not(#receipt-modal):not(#customer-receipt-modal) {
    display: none !important;
  }

  body.print-receipt-only #receipt-modal,
  body.print-receipt-only #customer-receipt-modal {
    position: static !important;
    display: block !important;
    background: transparent !important;
    padding: 0 !important;
  }

  body.print-receipt-only #receipt-modal .modal-header,
  body.print-receipt-only #receipt-modal .modal-actions,
  body.print-receipt-only #customer-receipt-modal .modal-header,
  body.print-receipt-only #customer-receipt-modal .modal-actions {
    display: none !important;
  }

  body.print-receipt-only .modal-card {
    width: auto !important;
    max-height: none !important;
    overflow: visible !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  body.print-receipt-only .receipt {
    display: block !important;
    border: 0;
    box-shadow: none;
    padding: 0;
    break-after: avoid;
    page-break-after: avoid;
  }

  body.print-receipt-only .receipt-paper-80 {
    width: 80mm !important;
    max-width: 80mm !important;
  }

  body.print-receipt-only .receipt-paper-58 {
    width: 58mm !important;
    max-width: 58mm !important;
  }

  body:not(.print-receipt-only) .topbar,
  body:not(.print-receipt-only) .page-heading,
  body:not(.print-receipt-only) .notice,
  body:not(.print-receipt-only) .actions,
  body:not(.print-receipt-only) .modal-header,
  body:not(.print-receipt-only) .modal-actions,
  body:not(.print-receipt-only) .pos-shell,
  body:not(.print-receipt-only) .pos-products,
  body:not(.print-receipt-only) .pos-cart { display: none !important; }
  .container { padding: 0; max-width: none; }
  body:not(.print-receipt-only) .modal-backdrop {
    position: static;
    display: block !important;
    background: transparent;
    padding: 0;
  }
  body:not(.print-receipt-only) .modal-card {
    width: auto;
    max-height: none;
    overflow: visible;
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  body:not(.print-receipt-only) .receipt {
    display: block !important;
    max-width: none;
    border: 0;
    box-shadow: none;
    padding: 0;
  }
}

@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-hero { min-height: auto; padding: 36px 24px; }
  .login-hero h1 { font-size: 36px; }
  .login-panel { padding: 24px; }
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-shell { grid-template-columns: 1fr; }
  .customer-modal-grid { grid-template-columns: 1fr; }
  .pos-cart { position: static; }
  .pos-toolbar { grid-template-columns: 1fr; }
  .cart-line { grid-template-columns: 1fr; align-items: stretch; }
  .line-total { text-align: left; }
}

@media (max-width: 800px) {
  .split { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar nav {
    justify-content: flex-start;
    border-radius: 14px;
    width: 100%;
  }
  .topbar nav a.active::after { display: none; }
  .nav-dropdown { width: 100%; }
  .nav-dropdown summary { display: inline-flex; }
  .nav-dropdown-menu {
    position: static;
    margin-top: 8px;
    width: 100%;
  }
  .account-menu { margin-left: 0; }
  .account-menu summary { align-items: flex-start; }
  .account-menu div { left: 0; right: auto; }
  .container { padding: 16px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .admin-grid { grid-template-columns: 1fr; }
  .module-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 82px; }
  .module-count { font-size: 52px; }
  .stats-header { align-items: stretch; flex-direction: column; }
  .stats-toggle { width: 100%; }
  .stats-toggle a { flex: 1; text-align: center; }
  .stats-summary { grid-template-columns: 1fr; }
  .customer-history-head { flex-direction: column; }
  .customer-last-visit { width: 100%; text-align: left; }
  .customer-history-summary { grid-template-columns: 1fr; }
  .pos-cart,
  .pos-products { min-height: auto; }
}
