:root {
  --ink: #14141f;
  --muted: #707287;
  --soft: #f4f4f7;
  --panel: #ffffff;
  --line: #e5e6eb;
  --accent: #080819;
  --green: #13b95f;
  --red: #e11d48;
  --orange: #f97316;
  --blue: #2563eb;
  --violet: #8b5cf6;
  --shadow: 0 12px 34px rgba(18, 18, 32, 0.08);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(145deg, rgba(17, 17, 27, 0.75), rgba(17, 17, 27, 0.85)),
    url("./assets/login_bg.png") center / cover no-repeat;
}

.login-card {
  width: min(440px, 100%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  letter-spacing: 0;
}

.login-card h1,
.view-title h1,
.section-title {
  margin: 0;
  letter-spacing: 0;
}

.login-card h1 {
  font-size: 26px;
}

.login-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: #55586a;
  font-size: 13px;
  font-weight: 700;
}

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

.textarea {
  min-height: 88px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: #b9bbca;
  box-shadow: 0 0 0 3px rgba(8, 8, 25, 0.08);
}

.login-hint {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.error-box {
  padding: 10px 12px;
  border: 1px solid #fecdd3;
  border-radius: 8px;
  background: #fff1f2;
  color: #be123c;
  font-weight: 700;
}

.app-shell {
  min-height: 100vh;
  background: #fff;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.titlebar {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
}

.titlebar strong {
  font-size: 16px;
  font-weight: 700;
}

.userbar {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.online-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 999px;
  background: var(--green);
}

.user-name {
  display: grid;
  line-height: 1.1;
  text-align: right;
}

.user-name b {
  color: var(--ink);
}

.navrow {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  margin: 0 12px 10px;
  padding: 10px;
  overflow-x: auto;
  border-radius: 8px;
  background: var(--soft);
}

.navrow .spacer {
  flex: 1 0 18px;
}

.nav-button,
.pill-button,
.tab-button,
.icon-button,
.primary-button,
.ghost-button,
.danger-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 7px 12px;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

.nav-button {
  border-color: transparent;
  background: transparent;
}

.nav-button.active,
.pill-button.active,
.tab-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.nav-button.locked {
  opacity: 0.45;
}

.primary-button {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.danger-button {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.ghost-button {
  background: #fff;
}

.icon-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
}

.icon-button.danger {
  color: var(--red);
  border-color: #fecdd3;
}

.icon-button.violet {
  color: #a855f7;
  border-color: #e9d5ff;
}

.lucide {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.main {
  padding: 22px 14px 44px;
}

.view-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.view-title h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
}

.view-title p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

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

.small {
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--soft);
  color: #4b5563;
  font-size: 12px;
  font-weight: 600;
}

.badge.blue {
  background: #dbeafe;
  color: #2563eb;
}

.badge.green {
  background: #dcfce7;
  color: #15803d;
}

.badge.orange {
  background: #ffedd5;
  color: #c2410c;
}

.badge.red {
  background: #ffe4e6;
  color: #be123c;
}

.toolbar,
.filterbar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.filterbar {
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.searchbox {
  position: relative;
  flex: 1;
}

.searchbox .lucide {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: #8b8ea0;
}

.searchbox input {
  padding-left: 44px;
  background: #f0f0f3;
  border-color: transparent;
  font-weight: 500;
  font-size: 13px;
}

.pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 28px;
}

.category-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}

.show-categories {
  margin: 4px 0 18px;
  color: #2d3040;
  font-weight: 600;
}

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

.product-card {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.product-card.disabled,
.product-card.out-of-stock,
.product-card:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.product-card.out-of-stock:hover,
.product-card:disabled:hover {
  transform: none;
  box-shadow: none;
}

.product-image,
.image-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  color: #8d91a2;
  background: #e9e9ee;
  flex-shrink: 0;
}

.image-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.image-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #8d91a2;
}

.image-fallback .lucide {
  width: 34px;
  height: 34px;
  stroke-width: 1.6;
}

.product-body {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 10px;
}

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

.product-name {
  margin: 0;
  font-size: 14px;
}

.product-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.info-row-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-icon {
  display: inline-flex;
  color: #8d91a2;
}

.info-icon .lucide {
  width: 16px;
  height: 16px;
}

.cart-panel,
.panel,
.table-panel,
.metric-card,
.report-box,
.drawer,
.kitchen-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.table-card {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
}

.table-card:hover,
.table-card:focus-visible {
  border-color: var(--blue);
}

.cart-panel {
  position: sticky;
  top: 135px;
  align-self: start;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 148px);
}

/* Head: always visible, never scrolls */
.cart-panel-head {
  flex-shrink: 0;
  overflow: hidden;
}

/* Body: takes remaining space and scrolls */
.cart-panel-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.cart-panel-body::-webkit-scrollbar {
  width: 4px;
}
.cart-panel-body::-webkit-scrollbar-track {
  background: transparent;
}
.cart-panel-body::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

/* Foot: always visible, never scrolls */
.cart-panel-foot {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
}

.cart-section {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.cart-section-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

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

.order-type {
  min-height: 56px;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: normal;
}

.order-type .lucide {
  width: 16px;
  height: 16px;
}

.cart-empty {
  display: grid;
  place-items: center;
  min-height: 138px;
  color: var(--muted);
  font-weight: 750;
}

.cart-items-section {
  max-height: 280px;
  overflow-y: auto;
}

.cart-items {
  display: grid;
  gap: 10px;
}

.cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.qty-control button {
  height: 32px;
  border: 0;
  background: #fff;
  font-weight: 900;
}

.qty-control span {
  text-align: center;
  font-weight: 900;
}

.totals {
  display: grid;
  gap: 10px;
}

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

.totals-row.total {
  font-size: 15px;
  font-weight: 700;
}

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

.discount-row input,
.discount-row button {
  min-height: 32px !important;
  font-size: 12px !important;
  padding: 4px 8px !important;
}

.payment-grid {
  grid-template-columns: 1fr 1fr;
}

.cash-box {
  padding: 12px;
  border: 1px solid #d9f5e5;
  border-radius: 8px;
  background: #f2fbf6;
}

.checkout-row {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
  padding: 16px;
}

.table-panel {
  overflow: auto;
}

.data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table th {
  color: #272938;
  font-size: 14px;
}

.data-table tr:nth-child(even) td {
  background: #fafafe;
}

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

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

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

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

.stat-tile {
  min-height: 86px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.stat-tile b {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.tab-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-row.segmented {
  padding: 6px;
  border: 0;
  border-radius: 8px;
  background: #e9e9ee;
}

.tab-row.segmented .tab-button {
  flex: 1;
}

.kitchen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.kitchen-card {
  padding: 16px;
}

.kitchen-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.order-lines {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.order-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--soft);
  font-weight: 600;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 330px;
  color: var(--muted);
  text-align: center;
}

.empty-state .lucide {
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  color: #9ca3af;
}

.empty-state h2 {
  color: #202334;
  margin: 0 0 10px;
}

.menu-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

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

.menu-card .product-image,
.menu-card .image-frame {
  aspect-ratio: 16 / 10;
}

.menu-card-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.upload-photo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.photo-preview {
  width: 96px;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f4f7;
  color: #8d91a2;
}

.photo-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.photo-upload-actions {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.photo-upload-button {
  min-height: 34px;
  align-self: flex-start;
  padding: 0 12px;
  font-size: 13px;
}

.image-status {
  max-width: 100%;
  font-size: 11px;
  word-break: break-word;
}

.menu-card-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
}

.menu-card-main h3 {
  margin: 0 0 8px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.toggle input {
  position: absolute;
  opacity: 0;
}

.toggle span {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #d5d7df;
}

.toggle span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.toggle input:checked + span {
  background: var(--accent);
}

.toggle input:checked + span::after {
  transform: translateX(20px);
}

.inventory-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
  padding: 18px 24px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #6b6475;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 22px;
}

.metric-card {
  min-height: 158px;
  padding: 24px;
}

.metric-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #242535;
  font-weight: 600;
}

.metric-value {
  margin-top: 24px;
  font-size: 24px;
  font-weight: 700;
}

.metric-value.green {
  color: var(--green);
}

.metric-value.red {
  color: #ff002e;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
}

.panel {
  padding: 24px;
}

.stock-list,
.transaction-list,
.summary-list,
.expense-list {
  display: grid;
  gap: 12px;
}

.stock-item,
.transaction-item,
.summary-row,
.expense-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.stock-head,
.transaction-head,
.summary-row,
.expense-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.progress {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #eaebf0;
  margin: 10px 0 7px;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.progress > span.low {
  background: var(--orange);
}

.progress > span.out {
  background: var(--red);
}

.form-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

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

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

.reports-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.reports-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.report-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
  overflow-x: auto;
}

.financial-summary {
  width: min(820px, 100%);
}

.summary-row {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 0;
}

.summary-row.strong {
  font-size: 19px;
  font-weight: 950;
}

.chart-card {
  min-height: 310px;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(var(--bars), minmax(18px, 1fr));
  gap: 10px;
  align-items: end;
  height: 260px;
  padding: 24px 18px 8px;
  border-left: 1px solid #9ca3af;
  border-bottom: 1px solid #9ca3af;
  background-image:
    linear-gradient(to top, rgba(209, 213, 219, 0.8) 1px, transparent 1px),
    linear-gradient(to right, rgba(209, 213, 219, 0.8) 1px, transparent 1px);
  background-size: 100% 25%, 8.33% 100%;
}

.bar {
  min-height: 2px;
  background: #22c55e;
}

.bar.blue {
  background: var(--blue);
}

.chart-labels {
  display: grid;
  grid-template-columns: repeat(var(--bars), minmax(18px, 1fr));
  gap: 10px;
  color: #6b7280;
  font-size: 11px;
  margin-top: 8px;
}

.chart-labels span {
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

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

.payment-methods-4,
.payment-methods-8 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.discount-section-clean,
.tip-section-clean {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.discount-presets {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.discount-btn {
  padding: 6px 4px !important;
  font-size: 11px !important;
  min-height: 32px !important;
}

.tip-preset-btn {
  padding: 6px 12px !important;
  font-size: 12px !important;
  min-height: 38px !important;
}

.method-card {
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  justify-content: end;
  background: rgba(8, 8, 25, 0.38);
}

.drawer {
  width: min(520px, 100vw);
  height: 100vh;
  overflow-y: auto;
  border-radius: 0;
  padding: 22px;
}

.drawer header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.drawer h2 {
  margin: 0;
}

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

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.locked-panel {
  display: grid;
  place-items: center;
  min-height: 420px;
  text-align: center;
  color: var(--muted);
}

.coming-soon-card {
  display: grid;
  gap: 14px;
  justify-items: center;
  max-width: 440px;
  padding: 48px 32px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.coming-soon-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 26px;
}

.coming-soon-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  text-align: center;
}

.coming-soon-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--soft);
  color: var(--muted);
}

.coming-soon-icon .lucide {
  width: 32px;
  height: 32px;
}

.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: #fef9c3;
  color: #92400e;
  font-size: 13px;
  font-weight: 800;
  border: 1px solid #fde68a;
}

.print-only {
  display: none;
}

.receipt-preview-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px;
  background: #13131a; /* dark container background */
  width: 100%;
  box-sizing: border-box;
}

.receipt-paper-wrapper {
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45));
}

.receipt-paper {
  width: 80mm;
  color: #000;
  background: #fbfbfa; /* thermal paper off-white */
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.35;
  padding: 5mm 4mm;
  box-sizing: border-box;
  
  /* Jagged edge tear effect for screen */
  clip-path: polygon(
    0% 4px, 4% 0%, 8% 4px, 12% 0%, 16% 4px, 20% 0%, 24% 4px, 28% 0%, 32% 4px, 36% 0%, 40% 4px, 44% 0%, 48% 4px, 52% 0%, 56% 4px, 60% 0%, 64% 4px, 68% 0%, 72% 4px, 76% 0%, 80% 4px, 84% 0%, 88% 4px, 92% 0%, 96% 4px, 100% 0%,
    100% calc(100% - 4px), 96% 100%, 92% calc(100% - 4px), 88% 100%, 84% calc(100% - 4px), 80% 100%, 76% calc(100% - 4px), 72% 100%, 68% calc(100% - 4px), 64% 100%, 60% calc(100% - 4px), 56% 100%, 52% calc(100% - 4px), 48% 100%, 44% calc(100% - 4px), 40% 100%, 36% calc(100% - 4px), 32% 100%, 28% calc(100% - 4px), 24% 100%, 20% calc(100% - 4px), 16% 100%, 12% calc(100% - 4px), 8% 100%, 4% calc(100% - 4px), 0% 100%
  );
}

.receipt-paper[data-paper-width="58"] {
  width: 58mm;
  padding-inline: 3mm;
  font-size: 10px;
}

.receipt-header {
  text-align: center;
  margin-bottom: 12px;
}

.receipt-restaurant-name {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.receipt-title {
  margin: 4px 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #333;
}

.receipt-supplier-details {
  margin-top: 6px;
  font-size: 9.5px;
  color: #444;
}

.receipt-supplier-details p {
  margin: 2px 0;
}

.receipt-supplier-trn strong {
  font-size: 10px;
  letter-spacing: 0.2px;
}

.receipt-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 10px;
}

.receipt-meta div {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.receipt-meta span {
  color: #444;
}

.receipt-meta b {
  text-align: right;
  font-weight: 700;
  word-break: break-all;
}

.receipt-rule {
  height: 1px;
  margin: 10px 0;
  border-top: 1px dashed #000;
}

.receipt-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.receipt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12mm 22mm;
  gap: 6px;
  align-items: center;
}

.receipt-row-head {
  font-weight: 800;
  border-bottom: 1px solid #000;
  padding-bottom: 4px;
  margin-bottom: 4px;
  font-size: 10.5px;
}

.receipt-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12mm 22mm;
  gap: 6px;
  align-items: flex-start;
  padding: 2px 0;
}

.receipt-item-name {
  font-weight: 700;
}

.receipt-item-unit-price {
  display: block;
  font-size: 9px;
  color: #555;
  margin-top: 1px;
}

.receipt-item-qty {
  text-align: right;
  font-weight: 600;
}

.receipt-item-total {
  text-align: right;
  font-weight: 700;
}

.receipt-row span:nth-child(2),
.receipt-row span:nth-child(3) {
  text-align: right;
}

.receipt-totals {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.receipt-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
}

.receipt-total span {
  color: #333;
}

.receipt-total b {
  font-weight: 700;
}

.receipt-total.grand {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #000;
  font-size: 13.5px;
  font-weight: 800;
}

.receipt-footer {
  margin-top: 12px;
  text-align: center;
}

.receipt-qr-code {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.receipt-note {
  font-size: 10px;
  color: #333;
  margin: 4px 0;
  line-height: 1.4;
}

.receipt-printed-by {
  font-size: 8px;
  color: #666;
  margin-top: 6px;
}

/* Elegant report sheet layout */
.print-report-sheet {
  width: 72mm;
  color: #000;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.35;
}

.print-report-sheet .report-header {
  text-align: center;
  margin-bottom: 12px;
}

.print-report-sheet .report-header h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
}

.print-report-sheet .report-header h2 {
  margin: 4px 0 8px;
  font-size: 12px;
  font-weight: 800;
  border-bottom: 1px solid #000;
  padding-bottom: 4px;
}

.report-meta-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 9.5px;
  text-align: left;
}

.report-meta-info div {
  display: flex;
  justify-content: space-between;
}

.report-divider {
  height: 1px;
  border-top: 1px dashed #000;
  margin: 8px 0;
}

.report-section {
  margin-bottom: 12px;
}

.report-section h3 {
  margin: 0 0 6px 0;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  border-bottom: 1px dashed #000;
  padding-bottom: 2px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
}

.report-table td {
  padding: 3px 0;
  font-size: 10px;
}

.report-table td strong {
  font-weight: 800;
}

.report-sheet-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 9px;
  border-top: 1px solid #000;
  padding-top: 8px;
}

.report-sheet-footer p {
  margin: 2px 0;
}

@media (max-width: 1400px) {
  .stat-grid-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 1280px) {
  .pos-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .cart-panel {
    position: static;
    max-height: none;
  }

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

@media (max-width: 760px) {
  .titlebar {
    height: auto;
    padding: 14px;
    align-items: start;
    flex-direction: column;
  }

  .userbar {
    width: 100%;
    justify-content: space-between;
  }

  .main {
    padding-inline: 10px;
  }

  .view-title,
  .reports-header,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .filterbar {
    flex-direction: column;
  }

  .order-type-grid,
  .metric-grid,
  .stat-grid-5,
  .two-col,
  .grid-2,
  .grid-3,
  .grid-4,
  .payment-methods,
  .payment-methods-4,
  .payment-methods-8 {
    grid-template-columns: 1fr;
  }

  .menu-card-grid {
    grid-template-columns: 1fr;
  }

  .checkout-row,
  .payment-grid,
  .discount-row {
    grid-template-columns: 1fr;
  }
}

@media print {
  .app-shell,
  .login-page {
    display: none !important;
  }
}

/* Sidebar Compacting Overrides */
.cart-panel .cart-section {
  padding: 10px 14px;
}

.cart-panel .cart-section.totals {
  gap: 8px;
  padding: 10px 14px;
}

.cart-panel .totals-row {
  font-size: 13px;
}

.cart-panel .totals-row.total {
  font-size: 14px;
  font-weight: 700;
  margin-top: 2px;
  border-top: 1px dashed var(--line);
  padding-top: 6px;
}

.cart-panel .input,
.cart-panel .select {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
}

.cart-panel .cash-box {
  padding: 8px 10px;
  border-radius: 6px;
}

.cart-panel .cash-box b {
  font-size: 12px;
}

.cart-panel .checkout-row {
  padding: 10px 14px;
  gap: 8px;
}

.cart-panel .checkout-row button {
  min-height: 36px;
  font-size: 13px;
}

.cart-panel .nav-button {
  padding: 6px 10px;
  min-height: 34px;
  font-size: 13px;
}

/* Day-by-Day Inventory Sheet Styles */
.daily-sheet-container {
  display: grid;
  gap: 20px;
  margin-top: 10px;
}

.daily-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--soft);
  padding: 16px 20px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

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

.date-nav-controls span {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}

.daily-sheet-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.daily-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.daily-table th,
.daily-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
}

.daily-table th {
  background: var(--soft);
  color: var(--ink);
  font-weight: 700;
  position: sticky;
  top: 0;
}

.daily-table tr:hover td {
  background: #fbfbfd;
}

.daily-table td .input {
  min-height: 32px;
  padding: 4px 8px;
  font-size: 13px;
  max-width: 90px;
  border-radius: 6px;
  text-align: center;
}

.daily-table td .input:disabled {
  background: var(--soft);
  color: var(--muted);
  border-color: transparent;
  font-weight: 600;
}

.variance-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
  text-align: center;
}

.variance-badge.negative {
  background: #ffe4e6;
  color: #e11d48;
}

.variance-badge.positive {
  background: #dbeafe;
  color: #2563eb;
}

.variance-badge.zero {
  background: #f3f4f6;
  color: #4b5563;
}

.daily-sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  background: var(--soft);
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
}

.audit-analysis-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.audit-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.audit-metric-item {
  padding: 12px;
  background: var(--soft);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.audit-metric-item span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.audit-metric-item b {
  display: block;
  font-size: 18px;
  margin-top: 4px;
}

.audit-insights {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.insight-group {
  margin-bottom: 12px;
}

.insight-group h4 {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 700;
}

.insight-group p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  background: #fff1f2;
  border-left: 4px solid #e11d48;
  border-radius: 0 6px 6px 0;
  margin-bottom: 8px;
  color: #9f1239;
  font-size: 13px;
}

.alert-item .lucide {
  color: #e11d48;
}

/* Toast Container */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  min-width: 320px;
  max-width: 450px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
}

.toast-item.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-item.success {
  border-left: 4px solid var(--green);
}

.toast-item.info {
  border-left: 4px solid var(--blue);
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-item.success .toast-icon {
  color: var(--green);
}

.toast-item.info .toast-icon {
  color: var(--blue);
}

.toast-message {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-close:hover {
  color: var(--ink);
}

/* Notification Container and Dropdown */
.notification-container {
  position: relative;
  display: flex;
  align-items: center;
}

.notification-bell {
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease;
  border: none;
  background: none;
  padding: 8px;
  position: relative;
  border-radius: 50%;
}

.notification-bell:hover {
  color: var(--accent);
  background: var(--soft);
}

.notification-bell .lucide {
  width: 20px;
  height: 20px;
}

.notification-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  height: 15px;
  min-width: 15px;
  padding: 0 3px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #fff;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 340px;
  max-height: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideDownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notification-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fafafa;
}

.notification-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.link-button {
  background: none;
  border: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.link-button:hover {
  text-decoration: underline;
}

.notification-list {
  overflow-y: auto;
  flex: 1;
}

.notification-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.notification-empty .lucide {
  width: 40px;
  height: 40px;
  opacity: 0.4;
  stroke-width: 1.5;
}

.notification-empty p {
  margin: 0;
  font-size: 13px;
  font-weight: 550;
}

.notification-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--soft);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease;
}

.notification-item:hover {
  background: var(--soft);
}

.notification-item.unread {
  background: #f0f5ff;
}

.notification-item-icon {
  width: 34px;
  height: 34px;
  background: var(--soft);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notification-item.unread .notification-item-icon {
  background: #dbeafe;
  color: var(--blue);
}

.notification-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.notification-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.notification-item-msg {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  white-space: normal;
}

.notification-item-time {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

.notification-item-details {
  font-size: 12px;
  color: var(--ink);
  background: rgba(243, 244, 246, 0.7);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 4px;
  line-height: 1.4;
}

.unread-dot {
  width: 7px;
  height: 7px;
  background: var(--blue);
  border-radius: 50%;
  position: absolute;
  right: 16px;
  top: 20px;
}
