:root {
  color-scheme: light;
  --ink: #1a2825;
  --muted: #61716d;
  --line: #d7e0dc;
  --surface: #ffffff;
  --page: #f1f4f1;
  --green: #087d63;
  --green-dark: #075c4b;
  --green-soft: #dff3eb;
  --amber: #a75b12;
  --amber-soft: #fff0d8;
  --red: #b53c45;
  --red-soft: #fce7e8;
  --cyan: #127e87;
  --charcoal: #17312d;
  font-family: "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); font-size: 14px; line-height: 1.4; }
button { font: inherit; }
.topbar { position: sticky; z-index: 10; top: 0; height: 72px; padding: 0 max(22px, calc((100vw - 1280px) / 2)); display: flex; align-items: center; justify-content: space-between; background: var(--charcoal); border-bottom: 3px solid #e7a448; box-shadow: 0 2px 12px #14272333; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; color: var(--charcoal); background: #f6bd66; border-radius: 6px; font-size: 12px; font-weight: 900; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 13px; letter-spacing: .7px; }
.brand small { margin-top: 2px; color: #b6cac3; font-size: 9px; letter-spacing: 1px; }
.topbar-right { display: flex; align-items: center; gap: 12px; color: #c7d5d0; font-size: 12px; }
.manual-link, .back-link { color: var(--green-dark); font-size: 12px; font-weight: 700; text-decoration: none; }
.text-button { padding: 0; border: 0; color: var(--green-dark); background: transparent; cursor: pointer; font-weight: 700; }
.topbar-tab { height: 40px; padding: 0 13px; border: 1px solid transparent; border-radius: 4px; color: #b9ccc5; background: transparent; cursor: pointer; font-size: 12px; font-weight: 750; }
.topbar-tab:hover { color: #fff; background: #ffffff16; }
.topbar-tab.active { border-color: #ffffff33; color: #fff; background: #ffffff16; }
.connection { display: inline-flex; align-items: center; gap: 7px; color: #d5e5df; }
.connection i, .state-dot { width: 9px; height: 9px; border-radius: 50%; background: #42c99d; box-shadow: 0 0 0 3px #42c99d24; }
.state-dot-warn { background: var(--amber); }
.connection.offline { color: var(--red); }
.connection.offline i { background: var(--red); }
.page { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 34px 0 56px; }
.mode-banner { margin-bottom: 22px; padding: 12px 15px; border: 1px solid #ecc88e; border-left: 4px solid var(--amber); border-radius: 5px; color: #75430c; background: var(--amber-soft); font-size: 12px; font-weight: 750; }
.page-heading, .section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.page-heading { margin: 0 0 28px; align-items: center; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 7px; color: var(--green-dark); font-size: 10px; font-weight: 800; letter-spacing: 1.2px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 28px; line-height: 1.2; font-weight: 760; }
h2 { margin: 0; font-size: 18px; line-height: 1.25; font-weight: 760; }
h3 { margin: 0; font-size: 14px; }
.station-state { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid #b9ddce; border-radius: 5px; color: var(--green-dark); background: var(--green-soft); font-size: 12px; font-weight: 750; }
.heading-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: end; gap: 10px; }
.voice-button { min-height: 38px; padding: 0 13px; border: 1px solid #8eb7ba; border-radius: 4px; color: #075e65; background: #e3f5f4; cursor: pointer; font-size: 12px; font-weight: 800; }
.voice-button:hover { border-color: var(--cyan); background: #d5efee; }
.voice-status { margin: 8px 0 0; color: #075e65; font-size: 12px; font-weight: 650; }
.workflow-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 26px; border-top: 1px solid #c9ddd5; border-bottom: 1px solid #c9ddd5; background: #f8fbf9; }
.workflow-step { display: flex; align-items: center; gap: 11px; min-height: 80px; padding: 14px 18px; border-right: 1px solid #d9e5e0; color: #5c716b; }
.workflow-step:last-child { border-right: 0; }
.workflow-step > span { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border: 1px solid #b8cbc4; border-radius: 50%; color: #59736b; font-size: 10px; font-weight: 850; }
.workflow-step strong, .workflow-step small { display: block; }
.workflow-step strong { color: #29433d; font-size: 12px; }
.workflow-step small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.workflow-step.active { background: #e6f4ed; }
.workflow-step.active > span { border-color: var(--green); color: #fff; background: var(--green); }
.workflow-step.done > span { border-color: #85bca8; color: var(--green-dark); background: #d6eee4; }
.meters-section, .lockers-section, .orders-section { margin-top: 32px; }
.charge-section { margin-top: 32px; padding: 22px; border: 1px solid #c9ddd5; border-radius: 6px; background: var(--surface); box-shadow: 0 4px 18px #1427230b; }
.section-heading { margin-bottom: 15px; }
.muted, .count-label { color: var(--muted); font-size: 11px; }
.meter-grid, .locker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.meter-panel, .locker-panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: 0 3px 12px #14272308; }
.meter-panel { border-top: 3px solid var(--cyan); }
.locker-panel { border-top: 3px solid var(--green); }
.panel-heading, .locker-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-heading { margin-bottom: 15px; }
.device-status, .locker-pill { padding: 5px 9px; border-radius: 3px; color: var(--green-dark); background: var(--green-soft); font-size: 10px; font-weight: 800; white-space: nowrap; }
.device-status.offline { color: var(--red); background: var(--red-soft); }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.metric { min-height: 78px; padding: 11px 12px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric span, .metric small { display: block; color: var(--muted); font-size: 10px; }
.metric strong { display: inline-block; margin-top: 7px; color: #123d37; font-size: 19px; font-variant-numeric: tabular-nums; }
.metric strong.alarm { color: var(--red); }
.metric small { display: inline-block; margin-left: 4px; }
.metric-primary { background: #f6faf8; }
.meter-error { margin: 11px 0 0; color: var(--red); font-size: 11px; }
.section-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.charge-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.charge-mode-card { position: relative; display: flex; align-items: center; gap: 11px; min-height: 70px; padding: 14px; border: 1px solid var(--line); border-radius: 5px; background: #fbfcfb; cursor: pointer; }
.charge-mode-card:has(input:checked) { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.charge-mode-card.disabled { opacity: .5; }
.charge-mode-card input { accent-color: var(--green); }
.charge-mode-card strong, .charge-mode-card small { display: block; }
.charge-mode-card small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.charge-start-row { display: flex; align-items: end; gap: 12px; margin-top: 13px; }
.locker-select-label { flex: 1; color: var(--muted); font-size: 11px; }
.locker-select-label select { display: block; width: 100%; height: 42px; margin-top: 5px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: #fff; }
.charge-start-row .rent-button { max-width: 280px; }
.locker-panel { padding: 18px; }
.locker-heading { align-items: start; }
.locker-heading .eyebrow { margin-bottom: 4px; }
.locker-heading h3 { font-size: 17px; }
.locker-pill.rented { color: var(--amber); background: var(--amber-soft); }
.locker-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 15px; border-top: 1px solid var(--line); }
.locker-details div { min-height: 55px; padding: 10px 4px 8px 0; border-bottom: 1px solid var(--line); }
.locker-details div:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--line); }
.locker-details span, .locker-details strong { display: block; }
.locker-details span { color: var(--muted); font-size: 10px; }
.locker-details strong { margin-top: 5px; font-size: 12px; }
.locker-message { min-height: 31px; margin: 11px 0 9px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.rent-button { width: 100%; min-height: 42px; border: 0; border-radius: 4px; color: #fff; background: var(--green); font-weight: 800; cursor: pointer; box-shadow: 0 2px 4px #087d6330; }
.rent-button:hover:not(:disabled) { background: var(--green-dark); box-shadow: 0 3px 8px #087d6340; }
.rent-button:disabled { color: #78827f; background: #e3e8e6; cursor: not-allowed; }
.demo-door { width: 100%; min-height: 34px; margin-top: 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: #fff; font-size: 11px; cursor: pointer; }
.demo-door:hover { background: #f4f7f5; }
.stop-charge { width: 100%; min-height: 38px; border: 1px solid var(--amber); border-radius: 4px; color: #7b4a0d; background: var(--amber-soft); font-weight: 700; cursor: pointer; }
.stop-charge:hover:not(:disabled) { background: #ffe6ba; }
.stop-charge:disabled { opacity: .55; cursor: not-allowed; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: 0 3px 12px #14272308; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 11px; white-space: nowrap; }
th { color: #47625c; background: #e8f0ec; font-size: 10px; font-weight: 800; }
tbody tr:last-child td { border-bottom: 0; }
.empty-row { padding: 19px; color: var(--muted); text-align: center; }
.payment-dialog { width: min(430px, calc(100% - 28px)); padding: 25px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); box-shadow: 0 20px 60px #1f302b33; }
.payment-dialog::backdrop { background: #17231f77; }
.dialog-close { display: flex; justify-content: end; margin: -14px -12px 12px 0; }
.dialog-close button { width: 30px; height: 30px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; font-size: 22px; cursor: pointer; }
.payment-dialog h2 { margin-bottom: 14px; }
.payment-summary { padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 650; }
.payment-method { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 12px; }
.payment-method span { color: var(--muted); }
.dialog-note { margin: 13px 0 17px; color: var(--amber); font-size: 11px; line-height: 1.5; }
.qr-placeholder { display: grid; place-items: center; min-height: 110px; margin: 14px 0; border: 1px dashed #bfcac5; color: var(--muted); background: #f8faf9; font-size: 12px; text-align: center; }
.payment-qr { display: block; width: min(300px, 100%); aspect-ratio: 1; object-fit: contain; margin: 14px auto; border: 1px solid #d7e0dc; background: #fff; }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: min(420px, calc(100% - 40px)); padding: 12px 16px; border-radius: 5px; color: #fff; background: #25322f; box-shadow: 0 8px 24px #101a1744; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s, transform .18s; }
.toast.visible { opacity: 1; transform: translateY(0); }
.manual-login-page { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.manual-login { width: min(390px, 100%); padding: 28px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: 0 12px 36px #1f302b18; }
.manual-login h1 { margin-bottom: 8px; }
.manual-login label { display: block; margin-top: 18px; color: var(--muted); font-size: 11px; }
.manual-login input { display: block; width: 100%; height: 40px; margin-top: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: #fff; }
.manual-login .rent-button { margin-top: 22px; }
.manual-login .back-link { display: block; margin-top: 18px; text-align: center; }
.manual-error { margin: 15px 0 0; padding: 9px 10px; border-radius: 4px; color: var(--red); background: var(--red-soft); font-size: 11px; }
.manual-section { margin-top: 0; padding: 24px; border: 1px solid #c9ddd5; border-radius: 6px; background: var(--surface); box-shadow: 0 4px 18px #1427230b; }
.integrated-manual { min-height: 460px; }
.manual-inline-login { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) 180px; align-items: end; gap: 12px; max-width: 840px; margin-top: 22px; }
.manual-inline-login label { color: var(--muted); font-size: 11px; font-weight: 700; }
.manual-inline-login input { display: block; width: 100%; height: 42px; margin-top: 6px; padding: 0 11px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: #fff; outline: none; }
.manual-inline-login input:focus, .locker-select-label select:focus { border-color: var(--green); box-shadow: 0 0 0 3px #087d631c; }
.manual-inline-login .rent-button { min-height: 42px; }
.manual-charge-panel { margin-top: 20px; padding: 18px; border: 1px solid var(--line); border-left: 3px solid var(--cyan); border-radius: 5px; background: #fbfdfc; }
.manual-pricing-panel { margin-top: 20px; padding: 18px; border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 5px; background: #fffdf9; }
.manual-pricing-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(150px, .7fr); align-items: end; gap: 12px; }
.manual-pricing-form label { color: var(--muted); font-size: 11px; font-weight: 700; }
.manual-pricing-form label span { display: block; margin-top: 2px; color: #87938f; font-size: 10px; font-weight: 400; }
.manual-pricing-form input { display: block; width: 100%; height: 42px; margin-top: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: #fff; font-size: 14px; font-weight: 700; }
.manual-heading-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: end; gap: 10px; }
.manual-heading-actions .station-state { padding: 7px 9px; font-size: 11px; }
.manual-locker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.manual-locker-panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-top: 3px solid var(--amber); border-radius: 5px; background: #fff; }
.manual-status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 14px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.manual-status-grid div { min-height: 54px; padding: 9px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.manual-status-grid span, .manual-status-grid strong { display: block; }
.manual-status-grid span { color: var(--muted); font-size: 10px; }
.manual-status-grid strong { margin-top: 5px; font-size: 12px; }
.manual-actions, .manual-charge-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.manual-actions button, .manual-charge-actions button { flex: 1 1 130px; min-height: 38px; padding: 7px 10px; border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: 700; }
.manual-button { border: 1px solid #aebfba; color: #29433d; background: #fff; }
.manual-button:hover { border-color: var(--green); color: var(--green-dark); background: var(--green-soft); }
.manual-button.relay-on, .rent-button.relay-on { border-color: #0b8a6e; color: #fff; background: #0b8a6e; }
.danger-button { border: 1px solid var(--red); color: var(--red); background: var(--red-soft); }
.danger-button:hover { background: #f7dcd9; }
.manual-reset-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; padding: 18px; border: 1px solid #e8c77e; border-left: 3px solid var(--amber); border-radius: 5px; background: var(--amber-soft); }
.manual-reset-panel h3 { margin-bottom: 4px; }
.manual-reset-panel p:last-child { margin: 0; color: #795016; font-size: 11px; }
.reset-button { flex: 0 0 auto; min-height: 42px; padding: 0 16px; border: 1px solid #b86b16; border-radius: 4px; color: #fff; background: #b86b16; cursor: pointer; font-weight: 800; }
.reset-button:hover { background: #96540e; }
.manual-recovery-panel { margin-top: 20px; padding: 18px; border: 1px solid #efc0c2; border-left: 3px solid var(--red); border-radius: 5px; background: #fffafa; }
.manual-recovery-panel .manual-button { min-height: 38px; padding: 0 14px; font-weight: 800; }
.manual-page .locker-message { min-height: 28px; }

@media (max-width: 760px) {
  .topbar { height: auto; min-height: 64px; padding: 10px 16px; align-items: center; }
  .topbar-right { gap: 5px; font-size: 10px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand small { display: none; }
  .topbar-tab { height: 34px; padding: 0 8px; font-size: 11px; }
  #clock { display: none; }
  .page { width: calc(100% - 28px); padding-top: 22px; }
  .page-heading { align-items: start; flex-direction: column; gap: 12px; margin-bottom: 22px; }
  .heading-actions { width: 100%; justify-content: space-between; }
  h1 { font-size: 22px; }
  .section-heading { align-items: start; flex-direction: column; gap: 7px; }
  .meter-grid, .locker-grid { grid-template-columns: 1fr; }
  .workflow-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-step { min-height: 72px; padding: 12px; }
  .workflow-step:nth-child(2) { border-right: 0; }
  .workflow-step:nth-child(-n + 2) { border-bottom: 1px solid #d9e5e0; }
  .charge-mode-grid { grid-template-columns: 1fr; }
  .charge-start-row { align-items: stretch; flex-direction: column; }
  .charge-start-row .rent-button { max-width: none; }
  .metric { min-height: 67px; padding: 9px; }
  .metric strong { font-size: 16px; }
  .meter-panel, .locker-panel { padding: 14px; }
  .manual-locker-grid { grid-template-columns: 1fr; }
  .manual-inline-login { grid-template-columns: 1fr; }
  .manual-pricing-form { grid-template-columns: 1fr; }
  .manual-section { padding: 16px; }
  .manual-reset-panel { align-items: stretch; flex-direction: column; }
  .toast { right: 14px; bottom: 14px; }
}

@media (max-width: 380px) {
  .brand strong { font-size: 11px; }
  .connection { font-size: 0; }
  .connection i { width: 9px; height: 9px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
