:root {
  --vta-purple: #4b188f;
  --vta-violet: #7b2ff2;
  --vta-magenta: #b83280;
  --ink: #20172b;
  --muted: #70647d;
  --line: #e5dff0;
  --surface: #ffffff;
  --soft: #f7f2fb;
  --success: #16875f;
  --warning: #c07a12;
  --danger: #b42318;
  --shadow: 0 22px 55px rgba(44, 20, 82, 0.16);
}

body.theme-night {
  --ink: #f8f4ff;
  --muted: #c9bddd;
  --line: rgba(229, 223, 240, 0.16);
  --surface: #171020;
  --soft: #21152f;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  background:
    radial-gradient(circle at top left, rgba(184, 50, 128, 0.24), transparent 32%),
    linear-gradient(135deg, #100b18 0%, #221335 52%, #08060d 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(123, 47, 242, 0.18), transparent 30%),
    linear-gradient(135deg, #fbf8ff 0%, #efe5f8 48%, #fff 100%);
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at top left, rgba(123, 47, 242, 0.26), transparent 32%),
    linear-gradient(135deg, #100b18 0%, #221335 52%, #08060d 100%);
}

.login-screen.hidden {
  display: none;
}

.login-card {
  display: grid;
  gap: 16px;
  width: min(430px, 100%);
  padding: 28px;
  color: #f8f4ff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 30px;
  background: rgba(23, 16, 32, 0.92);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.login-logo {
  width: 142px;
  padding: 8px;
  border-radius: 22px;
  background: #07040b;
}

.login-card label {
  display: grid;
  gap: 8px;
  color: #c9bddd;
  font-size: 13px;
  font-weight: 900;
}

.login-card input {
  min-height: 50px;
  padding: 0 16px;
  color: #f8f4ff;
  border: 1px solid rgba(229, 223, 240, 0.18);
  border-radius: 999px;
  background: #130d1d;
  outline: 0;
}

.login-card button {
  min-height: 50px;
  color: #fff;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--vta-purple), var(--vta-violet));
  font-weight: 900;
}

.login-card p {
  color: #c9bddd;
  font-weight: 800;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

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

.shell {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 22px;
  min-height: 100vh;
  padding: 22px;
}

.sidebar,
.register,
.cart-panel,
.quick-area,
.management-view,
dialog {
  border: 1px solid rgba(75, 24, 143, 0.13);
  border-radius: 28px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow);
}

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

.brand-panel {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 118px;
  height: 82px;
  object-fit: contain;
  padding: 8px;
  border-radius: 24px;
  background: #171020;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 16px 30px rgba(75, 24, 143, 0.24);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
}

h2 {
  font-size: 34px;
}

h3 {
  font-size: 22px;
}

.brand-panel p,
.label,
.eyebrow,
.status-panel a {
  color: var(--muted);
}

.eyebrow,
.label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  background: var(--soft);
}

.status-panel strong {
  display: block;
  margin-top: 3px;
}

.status-panel a {
  overflow-wrap: anywhere;
  font-weight: 700;
  text-decoration: none;
}

.side-actions {
  display: grid;
  gap: 10px;
}

.side-actions button,
.ghost-button,
.scan-box button,
.pay-actions button,
menu button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 800;
}

.side-actions button {
  color: var(--vta-purple);
  background: #f1e8fa;
  text-align: left;
}

.theme-night .side-actions button,
.theme-night .ghost-button,
.theme-night .row-controls button,
.theme-night .icon-button,
.theme-night .segmented-button,
.theme-night .language-switch {
  color: #efe5ff;
  background: rgba(123, 47, 242, 0.2);
}

.theme-night .small-action {
  color: #efe5ff;
  background: rgba(123, 47, 242, 0.2);
}

.side-actions button.active,
.scan-box button,
.pay-actions button,
menu button:last-child {
  color: #fff;
  background: linear-gradient(135deg, var(--vta-purple), var(--vta-violet));
  box-shadow: 0 14px 30px rgba(75, 24, 143, 0.26);
}

.register {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px;
  min-width: 0;
}

.topbar,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.preference-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.segmented-button,
.language-switch {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 5px;
  border-radius: 999px;
  background: #f2e9fb;
  color: var(--vta-purple);
  font-weight: 900;
}

.segmented-button {
  gap: 8px;
  padding-left: 15px;
}

.segmented-button strong,
.language-switch button.active {
  display: grid;
  place-items: center;
  min-width: 58px;
  min-height: 36px;
  padding: 0 12px;
  color: #fff;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--vta-purple), var(--vta-violet));
}

.language-switch button {
  min-width: 44px;
  min-height: 36px;
  color: inherit;
  border-radius: 999px;
  background: transparent;
  font-weight: 900;
}

.scan-wrap {
  width: min(470px, 100%);
}

.scan-wrap label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.scan-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.theme-night .scan-box,
.theme-night .cart-row,
.theme-night .customer-card,
.theme-night .employee-card,
.theme-night .category-card,
.theme-night .metric-card,
.theme-night .report-panel,
.theme-night .settings-grid label,
.theme-night dialog {
  background: #130d1d;
}

.scan-box input,
dialog input,
dialog select,
dialog textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: 0;
  color: var(--ink);
  background: var(--surface);
}

.scan-box input {
  min-width: 0;
  border: 0;
  padding: 0 14px;
}

.scan-box input:focus,
dialog input:focus {
  box-shadow: 0 0 0 4px rgba(123, 47, 242, 0.16);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 20px;
  min-height: 0;
}

.quick-area,
.cart-panel,
.management-view {
  padding: 20px;
}

.app-view {
  display: none;
}

.app-view.active,
.workspace.app-view.active {
  display: grid;
}

.management-view {
  gap: 18px;
}

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

.tool-row input,
.tool-row select,
.settings-grid input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  outline: 0;
}

.data-table {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
}

.table-row {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 0.8fr 0.7fr 0.7fr auto;
  gap: 12px;
  align-items: center;
  min-width: 760px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.table-row:last-child {
  border-bottom: 0;
}

.table-row.header {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--soft);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  color: #fff;
  border-radius: 999px;
  background: var(--success);
  font-size: 12px;
  font-weight: 900;
}

.status-pill.low {
  background: var(--warning);
}

.status-pill.out {
  background: var(--danger);
}

.small-action {
  min-height: 36px;
  padding: 0 12px;
  color: var(--vta-purple);
  border-radius: 999px;
  background: #f2e9fb;
  font-weight: 900;
}

.customer-grid,
.employee-grid,
.category-grid,
.report-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.customer-card,
.employee-card,
.category-card,
.metric-card,
.report-panel,
.settings-grid label {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
}

.customer-card,
.employee-card,
.category-card,
.metric-card {
  display: grid;
  gap: 9px;
  padding: 18px;
}

.customer-card span,
.employee-card span,
.category-card span,
.metric-card span,
.mini-list span,
.settings-grid label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.customer-card strong,
.employee-card strong,
.category-card strong,
.metric-card strong {
  font-size: 24px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.report-tabs button {
  min-height: 42px;
  padding: 0 16px;
  color: var(--vta-purple);
  border-radius: 999px;
  background: #f2e9fb;
  font-weight: 900;
}

.report-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--vta-purple), var(--vta-violet));
  box-shadow: 0 14px 30px rgba(75, 24, 143, 0.22);
}

.theme-night .report-tabs button {
  color: #efe5ff;
  background: rgba(123, 47, 242, 0.2);
}

.theme-night .report-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--vta-purple), var(--vta-violet));
}

.report-panel h4 {
  margin: 0;
  font-size: 18px;
}

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

.mini-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.mini-row:first-child {
  border-top: 0;
}

.settings-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.settings-grid label {
  display: grid;
  gap: 9px;
  padding: 16px;
}

.import-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
}

.theme-night .import-panel {
  background: #130d1d;
}

.import-panel p {
  color: var(--muted);
  font-weight: 800;
}

.import-panel pre {
  overflow: auto;
  margin: 0;
  padding: 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
  font-size: 13px;
}

.import-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.import-panel input[type="file"] {
  min-height: 48px;
  padding: 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.settings-grid .toggle-line {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.toggle-line input {
  width: 24px;
  height: 24px;
  min-height: auto;
  accent-color: var(--vta-purple);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.quick-button {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 118px;
  padding: 18px;
  color: #fff;
  border-radius: 26px;
  text-align: left;
  box-shadow: 0 16px 30px rgba(45, 20, 75, 0.18);
}

.quick-button span {
  font-size: 17px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.quick-button strong {
  font-size: 25px;
}

.quick-button small {
  margin-top: 8px;
  font-weight: 800;
  opacity: 0.86;
}

.ghost-button {
  color: var(--vta-purple);
  background: #f2e9fb;
}

.cart-panel {
  display: flex;
  flex-direction: column;
  min-height: 640px;
}

.cart-items {
  display: grid;
  align-content: start;
  gap: 10px;
  flex: 1;
  margin: 18px 0;
  overflow: auto;
}

.customer-sale-tools {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--soft);
}

.customer-sale-tools button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.customer-sale-tools span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
  overflow-wrap: anywhere;
}

.empty-cart {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 24px;
  text-align: center;
}

.cart-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
}

.cart-row strong,
.cart-row span {
  display: block;
}

.cart-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.row-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-controls button,
.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--vta-purple);
  border-radius: 50%;
  background: #f1e8fa;
  font-weight: 900;
}

.totals {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 24px;
  background: var(--soft);
}

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

.grand-total {
  align-items: baseline;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 24px;
}

.pay-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

dialog {
  width: min(440px, calc(100vw - 32px));
  color: var(--ink);
  padding: 0;
}

dialog.wide-dialog {
  width: min(620px, calc(100vw - 32px));
}

.theme-night dialog {
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(32, 23, 43, 0.48);
  backdrop-filter: blur(3px);
}

form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

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

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

dialog input,
dialog select {
  min-height: 46px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface);
}

dialog input[type="color"] {
  height: 50px;
  padding: 5px;
}

dialog textarea {
  min-height: 90px;
  padding: 14px;
  color: var(--ink);
  background: var(--surface);
  resize: vertical;
}

.modal-toggle {
  grid-template-columns: 1fr auto;
  align-items: center;
}

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

.report-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.report-filters label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.report-filters input,
.report-filters select {
  min-height: 46px;
  width: 100%;
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  outline: 0;
}

.payment-summary div,
.balance-line {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--soft);
}

.payment-summary span,
.balance-line span,
.receipt-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.payment-summary strong,
.balance-line strong {
  font-size: 22px;
}

.payment-panel {
  display: none;
  gap: 12px;
}

.payment-panel.active {
  display: grid;
}

.receipt-preview {
  display: grid;
  gap: 10px;
  width: min(302px, 100%);
  max-height: 520px;
  overflow: auto;
  justify-self: center;
  padding: 14px 12px;
  color: #171020;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-family: "Courier New", monospace;
  font-size: 12px;
}

.receipt-brand {
  display: block;
  margin-bottom: 6px;
  color: #171020;
  font-family: Arial, sans-serif;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 0;
}

.receipt-logo {
  display: block;
  max-width: 178px;
  max-height: 72px;
  object-fit: contain;
  margin: 0 auto 8px;
  filter: grayscale(1) contrast(1.25);
}

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

.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.receipt-row span:first-child {
  text-align: left;
}

.receipt-row strong {
  text-align: right;
}

.receipt-divider {
  border-top: 1px dashed #9b8fb0;
}

.ticket-barcode {
  display: grid;
  place-items: end center;
  height: 46px;
  margin: 5px 0;
  padding-bottom: 2px;
  color: #171020;
  background: repeating-linear-gradient(90deg, #171020 0 2px, transparent 2px 4px, #171020 4px 5px, transparent 5px 8px);
  font-family: Arial, sans-serif;
  font-size: 10px;
  font-weight: 900;
}

menu {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 6px 0 0;
  padding: 0;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  max-width: 360px;
  padding: 14px 18px;
  color: #fff;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

  .sidebar {
    order: 2;
  }

  .quick-grid {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 12px;
  }

  .topbar,
  .section-head,
  .brand-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .preference-controls {
    flex-wrap: wrap;
  }

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

  .scan-box,
  .pay-actions,
  .customer-sale-tools,
  .tool-row,
  .customer-grid,
  .employee-grid,
  .category-grid,
  .report-grid,
  .settings-grid,
  .form-grid,
  .payment-summary,
  .report-filters {
    grid-template-columns: 1fr;
    border-radius: 28px;
  }

  .cart-panel {
    min-height: auto;
  }
}
