:root {
  --ink: #17211c;
  --muted: #66736c;
  --line: #d9e1dc;
  --panel: #ffffff;
  --bg: #f5f7f2;
  --accent: #0e7c61;
  --accent-2: #215f9a;
  --danger: #ba2d2d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button, input, select, .button {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 42px;
  padding: 0 12px;
  font: inherit;
}

button, .button {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.photo-link {
  min-height: 32px;
  padding: 0 9px;
  font-size: 12px;
}

.photo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

input, select { width: 100%; background: #fff; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
h1, h2, h3, p { margin: 0; }
.hidden { display: none !important; }
.eyebrow { color: var(--accent-2); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 800; }
.hint { color: var(--muted); font-size: 13px; }
.stack { display: grid; gap: 14px; }
.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.danger { background: var(--danger); border-color: var(--danger); }

.login-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 48px 24px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 249, 218, .22), rgba(239, 255, 246, .20)),
    url("/assets/mobile-cashier-bg.png") center / cover no-repeat;
}
.login-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 6%, rgba(255, 241, 166, .52), transparent 32%),
    linear-gradient(90deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .05));
  pointer-events: none;
}
.login-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: none;
}
.login-panel {
  position: relative;
  z-index: 1;
  width: min(390px, 100%);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .16)),
    rgba(255, 255, 255, .24);
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 40px;
  padding: 48px 32px 28px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.62),
    inset 0 -1px 0 rgba(255,255,255,.16),
    0 30px 84px rgba(42, 64, 48, .22);
  backdrop-filter: blur(44px) saturate(178%);
  -webkit-backdrop-filter: blur(44px) saturate(178%);
  display: grid;
  gap: 28px;
  overflow: hidden;
}
.login-panel::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.34), transparent 38%, rgba(255,255,255,.16));
  pointer-events: none;
}
.login-panel > * { position: relative; z-index: 1; }
.login-title {
  display: grid;
  gap: 8px;
}
.login-panel .eyebrow {
  color: rgba(38, 58, 51, .60);
  font-size: 12px;
  letter-spacing: .08em;
}
.login-panel h1 {
  font-size: 42px;
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: 0;
}
.login-panel .stack {
  gap: 16px;
}
.login-panel label {
  color: rgba(38, 58, 51, .72);
  font-size: 13px;
  font-weight: 800;
}
.login-panel input {
  min-height: 50px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .66);
  background: rgba(255, 255, 255, .34);
  padding: 0 16px;
  color: #10231e;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.50),
    0 12px 30px rgba(24, 69, 50, .08);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}
.login-panel input:focus {
  outline: none;
  border-color: rgba(20, 169, 130, .78);
  box-shadow:
    0 0 0 4px rgba(20, 169, 130, .14),
    inset 0 1px 0 rgba(255,255,255,.55);
}
.login-panel button {
  min-height: 52px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .58);
  background:
    linear-gradient(135deg, rgba(255, 212, 80, .95), rgba(19, 178, 134, .98)),
    var(--accent);
  color: #fff;
  box-shadow: 0 18px 46px rgba(18, 137, 103, .26);
  transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}
.login-panel button:hover {
  filter: saturate(1.04) brightness(1.02);
  transform: translateY(-1px);
}
.login-panel button:active {
  transform: translateY(1px) scale(.99);
}

.app { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar {
  background: #10231d;
  color: white;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .eyebrow { color: #88d9c4; }
.sidebar nav { display: grid; gap: 8px; }
.nav {
  justify-content: flex-start;
  background: transparent;
  border-color: transparent;
  color: #dfeee9;
}
.nav.active, .nav:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.08); }
.app-version {
  margin-top: auto;
  color: rgba(255,255,255,.52);
  font-size: 12px;
  font-weight: 700;
}
.system-switcher { border-top: 1px solid rgba(39,50,46,.12); padding-top: 14px; }
.system-switcher summary { cursor: pointer; color: #149477; font-size: 10px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.system-links { display: grid; gap: 7px; margin-top: 10px; }
.system-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border: 1px solid rgba(39,50,46,.12); border-radius: 8px; color: #27322e; background: rgba(255,255,255,.48); text-decoration: none; font-size: 12px; font-weight: 800; }
.system-link:hover { border-color: #149477; background: rgba(255,255,255,.82); }
.system-link small { color: #7d8881; font-size: 10px; }.system-link.current { color: #fff; border-color: #149477; background: #149477; }.system-link.current small { color: rgba(255,255,255,.78); }
.sso-button { width: 100%; margin-top: 16px; }

.content { padding: 28px; display: grid; align-content: start; gap: 22px; }
.tab { display: none; }
.tab.active { display: grid; gap: 22px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar h1 { font-size: 28px; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.metrics article, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.metrics span { color: var(--muted); font-size: 13px; font-weight: 700; }
.metrics strong { display: block; margin-top: 10px; font-size: 28px; }
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.selected-day-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: -10px; }
.selected-day-heading h2 { margin-top: 4px; font-size: 22px; }
.selected-day-metrics article { border-color: rgba(57,134,106,.28); background: linear-gradient(135deg, #fff, rgba(57,134,106,.055)); }
.desktop-statement-photos { display: grid; gap: 16px; }
.desktop-photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.desktop-photo-card { min-height: 150px; display: grid; gap: 8px; align-content: start; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); text-decoration: none; }
.desktop-photo-card img { width: 100%; height: 110px; object-fit: cover; border-radius: 5px; }
.desktop-photo-card strong { font-size: 13px; }
.desktop-photo-card small, .desktop-photo-card.empty span { color: var(--muted); font-size: 12px; }
.desktop-photo-card.empty { align-content: center; background: #f7faf7; }
.statement-photo-item { display: grid; gap: 8px; min-width: 0; }
.statement-photo-item .desktop-photo-card { min-height: 0; }
.statement-photo-delete { width: 100%; }
.dialog-statement-photos { margin-top: 0; }

.panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.panel-heading h3 { margin-top: 4px; }
.volume-legend { display: flex; gap: 14px; color: var(--muted); font-size: 12px; font-weight: 700; }
.volume-legend span { display: flex; align-items: center; gap: 6px; }
.volume-legend i { display: inline-block; width: 14px; }
.legend-bar { height: 9px; border-radius: 2px; background: var(--accent); }
.legend-line { height: 2px; background: #19352a; }
.monthly-volume { display: grid; grid-template-columns: repeat(31, minmax(62px, 1fr)); gap: 5px; min-height: 238px; margin-top: 20px; overflow-x: auto; padding: 10px 2px 0; }
.day-volume { min-width: 62px; display: grid; grid-template-rows: 24px 150px 38px; gap: 5px; padding: 0 3px; text-align: center; text-decoration: none; border: 1px solid transparent; border-radius: 7px; background: transparent; color: inherit; cursor: pointer; }
.day-volume:hover { background: rgba(57,134,106,.08); border-color: rgba(57,134,106,.2); }
.day-volume.selected { background: rgba(57,134,106,.12); border-color: var(--accent); box-shadow: 0 0 0 2px rgba(57,134,106,.12); }
.monthly-volume.loading .day-volume:not(.selected) { opacity: .45; }
.monthly-volume.loading .day-volume.selected { cursor: wait; }
.day-value { align-self: end; overflow: hidden; font-size: 9px; color: var(--muted); }
.day-chart { position: relative; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line); background: linear-gradient(to top, rgba(25,53,42,.035) 1px, transparent 1px); background-size: 100% 25%; }
.day-bar { width: min(18px, 75%); min-height: 2px; background: linear-gradient(180deg, var(--accent), #39866a); border-radius: 4px 4px 1px 1px; transition: height .25s ease; }
.day-count { position: absolute; z-index: 1; bottom: 4px; color: #fff; font-size: 10px; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.day-label { color: var(--muted); display: grid; gap: 1px; font-size: 10px; line-height: 1.2; }
.day-label strong { color: var(--text); font-size: 10px; }
.day-label small { font-size: 10px; font-weight: 700; }

.bars { display: grid; gap: 12px; margin-top: 16px; }
.bar-row { display: grid; gap: 6px; }
.bar-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.bar-track { height: 10px; background: #e9eee9; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 999px; }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: end; }
.form-grid .wide { grid-column: span 2; }
.inline-form { display: grid; grid-template-columns: 1fr 180px 140px; gap: 12px; align-items: center; }
.table-wrap { overflow-x: auto; padding: 0; }
.pagination-controls { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 12px; }
.pagination-controls button:disabled { opacity: .45; cursor: not-allowed; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
td:last-child { text-align: right; }
.small-btn { min-height: 32px; padding: 0 9px; font-size: 12px; }
.user-password,
.user-role {
  min-height: 34px;
  min-width: 170px;
}
.user-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}
.record-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  white-space: nowrap;
}

.receipt-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #f4f7f3;
  box-shadow: 0 28px 90px rgba(16, 35, 29, .30);
}
.receipt-dialog::backdrop {
  background: rgba(16, 35, 29, .48);
  backdrop-filter: blur(8px);
}
.receipt-dialog-head,
.receipt-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}
.statement-dialog { width: min(1000px, calc(100vw - 32px)); max-width: 1000px; }
.statement-dialog-body { display: grid; gap: 18px; padding: 20px; max-height: calc(100vh - 110px); overflow-y: auto; }
.receipt-dialog-head {
  border-bottom: 1px solid var(--line);
}
.receipt-dialog-head h2 {
  margin-top: 4px;
}
.dialog-close {
  width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
  font-size: 24px;
  line-height: 1;
}
.receipt-preview-shell {
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
}
.receipt-dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.record-receipt {
  width: 72mm;
  box-sizing: border-box;
  padding: 4mm;
  color: #000;
  background: #fff;
  font-family: "Courier New", monospace;
  font-size: 10pt;
  line-height: 1.35;
  box-shadow: 0 12px 34px rgba(16, 35, 29, .14);
}
.record-receipt-head {
  padding-bottom: 3mm;
  border-bottom: 1px dashed #000;
  text-align: center;
}
.record-receipt-head h1 {
  margin: 0 0 1mm;
  font-family: inherit;
  font-size: 15pt;
  letter-spacing: 0;
}
.record-receipt-head p,
.record-receipt-meta p,
.record-receipt-note {
  margin: 0;
}
.receipt-copy-label {
  display: block;
  margin-top: 2mm;
  font-size: 9pt;
  letter-spacing: .08em;
}
.record-receipt-meta {
  display: grid;
  gap: 1mm;
  padding: 3mm 0;
  border-bottom: 1px dashed #000;
}
.record-receipt-meta p {
  display: flex;
  justify-content: space-between;
  gap: 3mm;
}
.record-receipt-meta strong {
  max-width: 42mm;
  text-align: right;
  overflow-wrap: anywhere;
}
.record-receipt-items {
  width: 100%;
  min-width: 0;
  margin: 2mm 0;
  border-collapse: collapse;
  table-layout: fixed;
}
.record-receipt-items th,
.record-receipt-items td {
  padding: 1.5mm 0;
  border-bottom: 1px dotted #777;
  color: #000;
  font-family: inherit;
  font-size: 9pt;
  text-align: left;
  text-transform: none;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.record-receipt-items th:nth-child(1),
.record-receipt-items td:nth-child(1) {
  width: 42mm;
  padding-right: 2mm;
}
.record-receipt-items th:nth-child(2),
.record-receipt-items td:nth-child(2) {
  width: 22mm;
  text-align: right;
  white-space: nowrap;
}
.record-receipt-total {
  display: flex;
  justify-content: space-between;
  gap: 3mm;
  padding: 3mm 0;
  border-bottom: 1px dashed #000;
  font-size: 14pt;
  font-weight: 700;
}
.record-receipt-total strong {
  white-space: nowrap;
}
.record-receipt-note {
  padding-top: 3mm;
  overflow-wrap: anywhere;
}
.record-receipt-note:empty {
  display: none;
}
.record-receipt-footer {
  padding: 5mm 0 2mm;
  text-align: center;
  font-weight: 700;
}

#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--ink);
  color: white;
  padding: 12px 14px;
  border-radius: 6px;
  opacity: 0;
  transform: translateY(8px);
  transition: .2s;
  pointer-events: none;
  max-width: min(460px, calc(100vw - 40px));
}
#toast.show { opacity: 1; transform: translateY(0); }

@page {
  size: 80mm auto;
  margin: 0;
}

@media print {
  body.printing-receipt {
    width: 80mm;
    min-width: 80mm;
    margin: 0;
    padding: 0;
    background: #fff;
  }
  body.printing-receipt > *:not(#receiptPreviewDialog) {
    display: none !important;
  }
  body.printing-receipt #receiptPreviewDialog {
    position: static;
    display: block !important;
    width: 80mm;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: #fff;
    box-shadow: none;
  }
  body.printing-receipt .receipt-dialog-head,
  body.printing-receipt .receipt-dialog-actions {
    display: none !important;
  }
  body.printing-receipt .receipt-preview-shell {
    display: block;
    padding: 0;
    overflow: visible;
  }
  body.printing-receipt .record-receipt {
    width: 72mm;
    margin: 0;
    box-shadow: none;
  }
  body.printing-receipt .record-receipt:not(.office-copy) {
    break-after: page;
    page-break-after: always;
  }
  body.printing-receipt .record-receipt.office-copy {
    break-before: page;
    page-break-before: always;
  }
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics, .grid.two, .form-grid, .inline-form { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .content { padding: 18px; }
  .monthly-volume { grid-template-columns: repeat(31, 62px); }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .desktop-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* PC visual skin only — layout and data structure remain unchanged. */
:root {
  --ink: #27322e;
  --muted: #7d8881;
  --line: rgba(255,255,255,.82);
  --panel: rgba(255,253,238,.72);
  --bg: #fffdf2;
  --accent: #149477;
  --accent-2: #8a948e;
}
body {
  min-height: 100svh;
  color: #27322e;
  background: linear-gradient(180deg, rgba(255,246,203,.28), rgba(238,255,244,.22)), url("/assets/mobile-cashier-bg.png") center / cover fixed;
}
.app { background: rgba(255,253,242,.10); }
.sidebar {
  background: rgba(255,253,238,.72);
  border-right: 1px solid rgba(255,255,255,.82);
  box-shadow: 10px 0 40px rgba(47,55,48,.06);
  backdrop-filter: blur(22px) saturate(115%);
  -webkit-backdrop-filter: blur(22px) saturate(115%);
}
.sidebar .eyebrow { color: #149477; }
.sidebar h2, .sidebar .app-version { color: #27322e; }
.sidebar .nav { color: #27322e; background: transparent; }
.sidebar .nav:hover, .sidebar .nav.active { color: #27322e; background: rgba(255,255,255,.54); border-color: rgba(255,255,255,.82); }
.content { background: transparent; }
.content .panel, .content .metrics article {
  border-color: rgba(255,255,255,.82);
  background: rgba(255,255,248,.56);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 8px 22px rgba(49,56,51,.04);
  backdrop-filter: blur(20px) saturate(115%);
  -webkit-backdrop-filter: blur(20px) saturate(115%);
}
.content h1, .content h2, .content h3, .content strong, .content td, .content th { color: #27322e; }
.content .eyebrow { color: #8a948e; }
.content .hint, .content label, .content th { color: #7d8881; }
.content input, .content select { background: rgba(255,255,250,.73); border-color: rgba(255,255,255,.82); color: #27322e; }
.content button, .content .button { border-color: rgba(255,255,255,.82); box-shadow: 0 8px 22px rgba(49,56,51,.04); }
.content .ghost { background: rgba(255,255,255,.58); color: #27322e; }
.content .bar-track { background: rgba(255,255,255,.55); }
.content .bar-fill { background: #149477; }
.content .tab.active { animation: pcSoftIn .4s ease both; }
@keyframes pcSoftIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .content .tab.active { animation: none; } }
