:root {
  color-scheme: light;
  font-family: Inter, 'Segoe UI', sans-serif;
  color: #14233a;
  background: #f3f6fa;
  font-synthesis: none;
  --navy: #14233a;
  --navy-deep: #101e33;
  --muted: #52647c;
  --line: #e0e7ef;
  --teal: #008577;
  --teal-dark: #006d61;
  --mint: #46e1c7;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #12a998; outline-offset: 2px; }
h1, h2, p { margin: 0; }
button svg { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.loading { padding: 24px; }

.shell { display: grid; grid-template-columns: 222px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; background: var(--navy-deep); color: white; padding: 26px 16px 17px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding-left: 9px; color: white; font-size: 21px; font-weight: 750; line-height: 1; letter-spacing: -.035em; white-space: nowrap; }
.brand img { display: block; flex: none; }
.brand span { display: block; margin-top: 6px; font-size: 9px; font-weight: 650; letter-spacing: .16em; color: #b6c5da; }
.sidebar nav { display: grid; gap: 6px; margin-top: 45px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 45px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: #c0cce0; text-align: left; font-weight: 600; font-size: 14px; }
.nav-item:not(:disabled):hover { color: white; background: #203149; }
.nav-item.selected { background: #1f3a49; color: #6af0d6; }
.nav-item.selected:hover { color: #6af0d6; background: #264658; }
.nav-item:disabled { opacity: .42; }
.sidebar-footer { margin-top: auto; }
.account { display: flex; align-items: center; gap: 9px; border-top: 1px solid #2a3a52; padding: 17px 4px 8px; min-width: 0; }
.avatar { display: grid; place-items: center; flex: 0 0 35px; aspect-ratio: 1; border-radius: 9px; background: #30435f; color: #e8f0ff; font-size: 12px; font-weight: 700; }
.account-name { min-width: 0; }
.account-name strong, .account-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-name strong { font-size: 12px; }
.account-name small { font-size: 10px; color: #bdcbe0; margin-top: 4px; }
.exit { color: #bdcbe0; min-height: 40px; padding-left: 10px; }

.topbar { height: 66px; border-bottom: 1px solid var(--line); background: white; padding: 0 34px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.store-name { display: flex; align-items: center; gap: 11px; min-width: 0; font-size: 14px; font-weight: 650; }
.store-name svg { color: var(--teal-dark); flex: none; }
.store-name span, .store-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-name small { font-size: 12px; color: var(--muted); font-weight: 500; }
.store-name i { height: 16px; width: 1px; background: var(--line); flex: none; }
.mode-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid #f1dfb3; border-radius: 100px; color: #75490b; background: #fff7e4; font-weight: 700; font-size: 11px; white-space: nowrap; }
.mode-pill span { width: 7px; height: 7px; border-radius: 50%; background: #bf7d12; }
.mode-pill.test { background: #e5f9f5; color: #08685d; border-color: #c4ece5; }
.mode-pill.test span { background: #078877; }
.content { width: min(100%, 1450px); margin: 0 auto; padding: 26px 34px 22px; }
.content.standard { max-width: 1170px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 21px; }
h1 { font-size: clamp(26px, 3vw, 34px); line-height: 1.12; font-weight: 750; letter-spacing: -.04em; }
.page-heading p { margin-top: 6px; color: var(--muted); font-size: 14px; }
.keyboard-hint { display: flex; align-items: center; gap: 7px; white-space: nowrap; color: var(--muted); font-weight: 550; font-size: 12px; margin-bottom: 2px; }

.pos-grid { display: grid; grid-template-columns: minmax(0, 1.38fr) minmax(300px, 1fr); gap: 22px; align-items: stretch; }
.card { background: white; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 2px 5px #253d5710; min-width: 0; }
.card h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 730; letter-spacing: -.015em; }
.card h2 svg { color: var(--teal-dark); }
.keypad-card { padding: 17px; }
.amount-display { display: flex; justify-content: space-between; align-items: flex-end; gap: 5px; min-height: 96px; margin: 13px 0 13px; padding: 13px 14px 12px 16px; border-radius: 10px; color: white; background: linear-gradient(108deg, #14233a 24%, #173743 100%); overflow: hidden; }
.display-label { display: block; font-size: 10px; font-weight: 650; letter-spacing: .13em; color: #b3c8da; margin-bottom: 4px; }
.display-value { display: flex; align-items: baseline; gap: 8px; line-height: 1; font-weight: 750; font-size: clamp(30px, 4.4vw, 47px); letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.display-value span { color: #60ead3; font-size: .54em; }
.clear { align-self: center; color: #dce7f4; border: 1px solid #ffffff44; border-radius: 7px; background: #ffffff10; padding: 8px 10px; font-size: 12px; font-weight: 650; min-height: 41px; }
.clear:not(:disabled):hover { background: #ffffff25; }
.clear:disabled { opacity: .5; }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.key { display: grid; place-items: center; color: #17263e; border: 1px solid #dfe7ef; background: #f7f9fc; border-radius: 8px; min-height: 52px; font-size: 25px; font-weight: 680; line-height: 1; touch-action: manipulation; }
.key.utility-key { background: #edf2f8; color: #3e536c; }
.key:not(:disabled):hover { background: #e6f6f3; border-color: #9ed7ce; }
.key:not(:disabled):active { background: #ccefe9; }
.key:disabled, .department:disabled { opacity: .55; }
.departments { margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.text-button { background: transparent; border: 0; color: var(--teal-dark); font-weight: 700; padding: 5px 1px; font-size: 13px; }
.text-button:hover { text-decoration: underline; }
.department-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.department { display: flex; align-items: flex-start; gap: 8px; min-height: 54px; color: #182840; padding: 9px 8px; text-align: left; border: 1px solid var(--dept-border); border-radius: 8px; background: var(--dept-bg); touch-action: manipulation; }
.department:not(:disabled):hover { border-color: var(--dept-mark); }
.department:not(:disabled):active { background: white; }
.department > span:last-child { min-width: 0; }
.department strong, .department small { display: block; overflow-wrap: anywhere; }
.department strong { font-size: 13px; line-height: 1.2; }
.department small { margin-top: 4px; font-size: 11px; color: #415772; line-height: 1.15; }
.dept-dot { display: block; flex: 0 0 7px; height: 7px; border-radius: 50%; background: var(--dept-mark); margin-top: 5px; }
.aqua { --dept-bg: #eaf8f5; --dept-border: #cdece5; --dept-mark: #0b967f; }
.blue { --dept-bg: #edf4ff; --dept-border: #d9e8ff; --dept-mark: #4c80d0; }
.orange { --dept-bg: #fff6e9; --dept-border: #f4e5cc; --dept-mark: #be791b; }
.purple { --dept-bg: #f2effe; --dept-border: #e7dffc; --dept-mark: #8265c9; }
.rose { --dept-bg: #fff0f0; --dept-border: #f7dedf; --dept-mark: #c46677; }
.slate { --dept-bg: #edf2f8; --dept-border: #e0e8f2; --dept-mark: #6a81a2; }

.ticket { display: flex; flex-direction: column; align-self: start; min-height: 586px; position: sticky; top: 14px; }
.ticket-heading { display: flex; align-items: center; gap: 10px; padding: 17px 17px 14px; border-bottom: 1px solid var(--line); }
.section-mark { width: 40px; height: 40px; border-radius: 9px; flex: 0 0 40px; display: grid; place-items: center; color: var(--teal-dark); background: #e7f7f4; }
.ticket-heading p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.ticket-heading .icon-button { margin-left: auto; }
.icon-button { display: inline-grid; place-items: center; flex: none; width: 37px; height: 37px; padding: 0; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); }
.icon-button:not(:disabled):hover { background: #f0f4f8; color: var(--navy); }
.icon-button:disabled { color: #a5b2c2; }
.ticket-body { flex: 1; min-height: 230px; display: flex; flex-direction: column; max-height: 420px; overflow: auto; }
.ticket-empty { flex: 1; display: grid; align-content: center; justify-items: center; padding: 28px 16px; color: #263b55; text-align: center; min-height: 200px; }
.ticket-empty > div { width: 61px; height: 61px; margin-bottom: 13px; border-radius: 16px; display: grid; place-items: center; color: #627c9e; background: #eef3f9; }
.ticket-empty strong { font-size: 15px; }
.ticket-empty p { margin-top: 5px; color: var(--muted); font-size: 13px; }
.ticket-lines { list-style: none; margin: 0; padding: 0 17px; }
.ticket-lines li { display: grid; grid-template-columns: minmax(0, 1fr) max-content 31px; gap: 7px; align-items: center; padding: 9px 0; border-bottom: 1px solid #e9eef4; }
.ticket-lines li:last-child { border-bottom: 0; }
.ticket-lines strong { font-size: 13px; overflow-wrap: anywhere; }
.ticket-lines small, .receipt-summary small { color: var(--muted); font-size: 11px; display: block; margin-top: 2px; }
.ticket-lines b { font-size: 14px; font-variant-numeric: tabular-nums; }
.ticket-lines .icon-button { width: 31px; }
.ticket-footer { padding: 16px 17px 13px; border-top: 1px dashed #ced9e5; }
.total { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 13px; }
.total span { font-size: 15px; font-weight: 660; }
.total-count { display: none; }
.total strong { font-size: clamp(24px, 3vw, 33px); line-height: 1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.ticket-footer p { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); margin-top: 11px; font-size: 11px; }
.pos-footnote { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; font-size: 11px; color: var(--muted); }

.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 0 14px; border-radius: 8px; font-size: 14px; font-weight: 700; line-height: 1.2; }
.primary { color: white; background: var(--teal-dark); border: 1px solid var(--teal-dark); }
.primary:not(:disabled):hover { background: #005e54; }
.primary:disabled { color: #4f6279; background: #e6edf4; border-color: #e6edf4; }
.pay { width: 100%; min-height: 51px; }
.secondary { background: white; color: var(--navy); border: 1px solid #d3ddea; }
.secondary:not(:disabled):hover { background: #f1f6fb; }
.secondary:disabled { color: #6b7d93; }
.compact { min-height: 36px; padding: 0 10px; font-size: 12px; }
.notice { padding: 10px 12px; border: 1px solid #e9d6ae; border-radius: 7px; color: #653e12; background: #fff6e4; font-size: 13px; line-height: 1.4; }
.content > .notice { margin-bottom: 13px; }

.auth-shell { display: grid; grid-template-columns: minmax(360px, .85fr) minmax(0, 1fr); min-height: 100dvh; }
.auth-brand { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 48px; overflow: hidden; padding: 37px 35px; background: radial-gradient(ellipse at 65% 52%, #1d4e54 0%, var(--navy-deep) 71%); }
.auth-brand .brand { padding-left: 0; }
.auth-main { display: grid; place-items: center; padding: 34px 24px; background: #f7f9fc; }
.auth-inner { width: min(100%, 389px); }
.auth-inner > .section-mark { margin-bottom: 14px; width: 48px; height: 48px; }
.auth-inner > p { margin-top: 8px; color: var(--muted); font-size: 14px; }
.auth-inner form { margin-top: 24px; }
.auth-inner .auth-switch { margin-top: 12px; }
.demo-entry { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.demo-entry button { width: 100%; }
.auth-visual { width: 275px; height: 230px; position: relative; align-self: center; margin-block: auto; }
.mini-register { width: 168px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; border-radius: 14px; background: #fbfcfe; padding: 10px; box-shadow: 0 17px 42px #07102182; transform: rotate(-9deg); }
.mini-register div { grid-column: 1/-1; background: #14233a; color: #a7c1d8; font-size: 8px; letter-spacing: .12em; padding: 9px; border-radius: 7px; }
.mini-register strong { color: white; font-size: 26px; letter-spacing: -.04em; display: block; }
.mini-register small { color: var(--mint); }
.mini-register span { border-radius: 4px; background: #edf2f7; color: var(--navy); padding: 5px; text-align: center; font-weight: 750; }
.mini-receipt { position: absolute; width: 133px; top: 43px; right: 0; transform: rotate(12deg); padding: 12px 10px 15px; color: var(--navy); background: #edf9f7; box-shadow: 0 12px 32px #07102152; }
.mini-receipt div { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--teal-dark); }
.mini-receipt i { display: block; height: 4px; width: 80%; margin-top: 10px; border-radius: 5px; background: #c1d8d6; }
.mini-receipt i:nth-of-type(2) { width: 50%; }
.mini-receipt hr { border: 0; border-top: 1px dashed #9bbab7; margin-top: 13px; }
.mini-receipt strong { font-size: 17px; }

.form-stack, .settings-form { display: grid; gap: 13px; }
.form-feedback:empty { display: none; }
label { display: grid; gap: 6px; color: #263b55; font-size: 13px; font-weight: 650; min-width: 0; }
label > small { display: contents; font-size: .9em; font-weight: 450; color: var(--muted); }
input:not([type=checkbox], [type=radio]), select { width: 100%; min-width: 0; min-height: 43px; padding: 8px 10px; border: 1px solid #ccd9e7; border-radius: 7px; color: var(--navy); background: #fff; font-size: 15px; }
input::placeholder { color: #6d7f95; }
input[type=checkbox], input[type=radio] { accent-color: var(--teal-dark); }
.form-card { padding: 17px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.department-form { display: grid; gap: 10px; margin-top: 12px; }
.department-row { display: grid; grid-template-columns: 1.2fr 1fr .75fr 38px; align-items: end; gap: 9px; }
.delete-dept { margin-bottom: 3px; }
.check-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.check-row input { width: 17px; height: 17px; }
.settings-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; }
.success { color: var(--teal-dark); font-size: 13px; font-weight: 650; }
.fiscal-card { margin-top: 22px; }
.fiscal-card p { margin-top: 10px; color: var(--muted); font-size: 13px; }
.fiscal-card .secondary { margin-top: 11px; }
.system-id { overflow-wrap: anywhere; }

.history-card { padding: 0 17px; }
.history-list { list-style: none; padding: 0; margin: 0; }
.history-list li { display: grid; grid-template-columns: 40px minmax(0, 1fr) max-content minmax(75px, max-content) max-content; gap: 13px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.history-list li:last-child { border-bottom: 0; }
.history-list li > b { text-align: right; font-size: 14px; }
.history-item { overflow-wrap: anywhere; font-size: 13px; }
.history-item small { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.tag { display: inline-flex; width: fit-content; padding: 4px 8px; background: #e7f7f4; border-radius: 99px; color: #07655a; font-weight: 650; font-size: 11px; }
.tag.waiting { background: #fff4de; color: #714709; }
.empty-message { padding: 30px 10px; color: var(--muted); }

dialog { max-width: min(460px, calc(100% - 24px)); width: 100%; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: white; color: var(--navy); box-shadow: 0 22px 70px #16263c40; }
dialog::backdrop { background: #101e33a0; }
.dialog-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.dialog-heading h2 { flex: 1; font-size: 19px; letter-spacing: -.02em; }
dialog > p { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.dialog-action { width: 100%; margin-top: 12px; }
.payment-options { margin: 0; padding: 0; border: 0; display: grid; gap: 7px; }
.payment-options legend { font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.payment-options label { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 8px; min-height: 44px; padding: 6px 9px; cursor: pointer; }
.payment-options label:has(:checked) { border-color: #6abbaf; background: #eaf8f5; }
.payment-total { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: 14px; }
.payment-total strong { font-size: 24px; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.payment-rounding { font-size: 12px; margin: 2px 0 0; }
.payment-rounding:empty { display: none; }
.receipt-summary { background: #f5f8fc; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.receipt-summary ul { list-style: none; padding: 0; margin: 10px 0; max-height: 240px; overflow: auto; }
.receipt-summary li { display: flex; justify-content: space-between; gap: 6px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.receipt-summary + .notice, dialog .form-feedback:not(:empty) { margin-top: 9px; }

#print-copy { display: none; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 192px minmax(0, 1fr); }
  .content, .topbar { padding-left: 20px; padding-right: 20px; }
  .pos-grid { gap: 13px; grid-template-columns: minmax(0, 1.3fr) minmax(260px, 1fr); }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 70px minmax(0, 1fr); }
  .sidebar { padding-inline: 10px; }
  .sidebar .brand { padding: 0; justify-content: center; }
  .sidebar .brand div, .sidebar .account-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .sidebar .nav-item { justify-content: center; padding: 0; }
  .sidebar .nav-item span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .sidebar .account { justify-content: center; }
}

@media (max-width: 650px) {
  .shell { display: flex; flex-direction: column; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 8px 10px; }
  .sidebar nav { display: flex; gap: 4px; margin: 0 auto; }
  .sidebar .nav-item { width: 48px; min-height: 38px; }
  .sidebar .nav-item span { position: static; width: auto; height: auto; clip-path: none; font-size: 9px; }
  .sidebar .nav-item:not(.exit) { flex-direction: column; gap: 2px; min-width: 57px; }
  .sidebar .exit span, .sidebar .account { display: none; }
  .sidebar .exit { width: 37px; }
  .sidebar-footer { margin-top: 0; }
  .sidebar .brand img { width: 35px; height: 35px; }
  .topbar { height: 50px; padding: 0 12px; }
  .content { padding: 15px 10px 18px; }
  .content.pos { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .page-heading { margin-bottom: 13px; }
  .page-heading p { font-size: 12px; }
  .keyboard-hint { display: none; }
  .pos-grid { grid-template-columns: minmax(0, 1fr); }
  .keypad-card { padding: 12px; }
  .amount-display { min-height: 78px; margin: 9px 0; padding: 9px 12px; }
  .display-value { font-size: 34px; }
  .key { min-height: 48px; }
  .ticket { position: static; min-height: 0; }
  .ticket-body { min-height: 0; max-height: 285px; }
  .ticket-empty { min-height: 128px; padding: 14px 8px; }
  .ticket-empty > div { width: 42px; height: 42px; margin-bottom: 6px; }
  .ticket-empty svg { width: 23px; }
  .ticket-heading, .ticket-footer { padding: 11px 12px; }
  .ticket-footer { position: fixed; z-index: 2; inset: auto 0 0; padding-bottom: calc(9px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: white; box-shadow: 0 -3px 18px #14233a18; }
  .ticket-footer .total { margin-bottom: 7px; }
  .ticket-footer .pay { min-height: 45px; }
  .ticket-footer > p { display: none; }
  .total-count { display: inline; color: var(--muted); font-size: 11px; font-weight: 550; }
  .auth-shell { display: block; }
  .auth-brand { padding: 11px 15px; }
  .auth-visual { display: none; }
  .auth-main { padding: 27px 16px; }
  .field-grid { grid-template-columns: 1fr; }
  .department-row { grid-template-columns: 1fr 1fr 36px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .department-row label:first-child { grid-column: 1/-1; }
  .history-list li { grid-template-columns: minmax(0, 1fr) max-content max-content; gap: 6px 9px; }
  .history-list .section-mark { display: none; }
  .history-list .tag { grid-row: 2; grid-column: 1/-1; }
}

@media print {
  @page { margin: 5mm; }
  body { min-width: 0; color: black; background: white; }
  #app, #dialog, #announcement { display: none !important; }
  #print-copy { display: block; }
  .paper-inner { width: min(100%, 72mm); margin: 0 auto; font: 10pt 'Courier New', monospace; overflow-wrap: anywhere; }
  .paper-inner h1 { font-size: 12pt; letter-spacing: 0; }
  .paper-inner h1, .paper-inner p { text-align: center; margin: 3px 0; }
  .paper-inner ul { list-style: none; padding: 5px 0; margin: 5px 0; border-block: 1px dashed black; }
  .paper-inner li, .paper-total { display: flex; justify-content: space-between; gap: 4px; margin: 4px 0; break-inside: avoid; }
  .paper-inner li b, .paper-total strong { white-space: nowrap; }
}
