:root {
  color-scheme: light;
  --ink: #142039;
  --muted: #657086;
  --paper: #f6f8fb;
  --panel: #ffffff;
  --line: #dce2ec;
  --blue: #0c3471;
  --blue-2: #1257a8;
  --red: #c82632;
  --green: #20784f;
  --shadow: 0 18px 45px rgba(13, 36, 76, 0.12);
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

.view-hidden {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

.auth-locked .topbar,
.auth-locked .view-nav,
.auth-locked .app-shell {
  display: none;
}

.office-page:not(.auth-locked) .login-screen {
  display: none;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
  background: linear-gradient(180deg, var(--blue) 0, var(--blue) 42%, var(--paper) 42%);
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.login-logo {
  display: block;
  width: min(260px, 100%);
  height: auto;
  margin: 0 auto 4px;
  border-radius: 8px;
}

.login-card h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0;
}

.login-message {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.login-message.error {
  color: var(--red);
}

.login-help {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  padding: 10px;
  border-radius: 8px;
  background: #f6f8fb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.login-help strong {
  grid-column: 1 / -1;
  color: var(--ink);
}

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

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  background: var(--blue);
  color: white;
  border-bottom: 5px solid var(--red);
}

.staff-panel {
  display: grid;
  gap: 2px;
  min-width: 175px;
  margin-left: auto;
  color: white;
}

.staff-panel strong {
  font-size: 13px;
}

.staff-panel span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 700;
}

.staff-panel .ghost-button {
  justify-self: start;
  min-height: 28px;
  padding: 4px 9px;
  background: rgba(255, 255, 255, 0.16);
  color: white;
}

.brand-mark {
  display: grid;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  font-size: 22px;
  font-weight: 800;
}

.topbar h1 {
  margin: 2px 0 4px;
  font-size: clamp(24px, 3vw, 42px);
  line-height: 1;
  letter-spacing: 0;
}

.hours,
.eyebrow {
  margin: 0;
}

.eyebrow {
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar .eyebrow,
.topbar .hours {
  color: rgba(255, 255, 255, 0.86);
}

.icon-button,
.ghost-button,
.primary-button,
.service-card,
.qty-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.icon-button {
  margin-left: auto;
  padding: 10px 15px;
  background: white;
  color: var(--blue);
  font-weight: 800;
}

.header-link {
  text-decoration: none;
}

.topbar .header-link + .icon-button {
  margin-left: 0;
}

.staff-panel + .header-link {
  margin-left: 0;
}

.view-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px 0;
  background: var(--paper);
}

.view-tab {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--blue);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(13, 36, 76, 0.08);
}

.view-tab.active {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(330px, 0.8fr);
  gap: 18px;
  padding: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.service-panel {
  min-height: 520px;
}

.work-panel,
.ready-panel,
.operations-panel,
.settings-panel,
.summary-panel {
  grid-column: 1 / -1;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head.compact {
  align-items: center;
}

h2 {
  margin: 4px 0 0;
  font-size: 22px;
  letter-spacing: 0;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: white;
  color: var(--ink);
}

input[readonly] {
  background: #eef2f8;
  color: var(--blue);
  font-weight: 900;
}

textarea {
  resize: vertical;
}

.search-box {
  width: min(320px, 100%);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.topup-box,
.lookup-box {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
}

.topup-box h3,
.lookup-box h3 {
  margin: 4px 0 0;
  font-size: 18px;
}

.topup-form {
  display: grid;
  grid-template-columns: 1fr 130px 1fr 120px auto;
  gap: 10px;
  align-items: end;
}

.inline-action {
  width: auto;
  min-height: 39px;
  margin-top: 0;
  padding: 10px 14px;
}

.service-card {
  display: grid;
  gap: 8px;
  min-height: 148px;
  padding: 14px;
  text-align: left;
  background: #f9fbff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.service-card:hover {
  border-color: var(--blue-2);
  transform: translateY(-1px);
}

.service-card strong {
  font-size: 16px;
}

.service-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.price-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.price-line input {
  max-width: 92px;
  padding: 8px;
}

.form-grid,
.task-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.wide {
  grid-column: 1 / -1;
}

.document-checklist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
}

.document-checklist legend {
  padding: 0 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.document-checklist label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}

.document-checklist input {
  width: auto;
}

.cart-list,
.task-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.cart-item,
.task-item,
.sale-line {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfdff;
}

.item-top,
.task-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 132px;
}

.lookup-copy {
  width: fit-content;
  margin-top: 8px;
}

.id-lookup-box {
  margin-top: 14px;
}

.id-match-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.id-match-item {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.item-name,
.task-name {
  font-weight: 800;
}

.tracking-number {
  display: inline-block;
  width: fit-content;
  margin-top: 5px;
  padding: 5px 8px;
  border-radius: 8px;
  background: #eaf4ee;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.ready-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eaf4ee;
  color: var(--green);
}

.ready-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ready-toolbar span.sync-error {
  color: var(--red);
}

.ready-item {
  border-color: rgba(32, 120, 79, 0.35);
  background: #fbfffd;
}

.staff-log-box {
  display: grid;
  gap: 10px;
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
}

.staff-account-box {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
  overflow: hidden;
}

.staff-account-list {
  display: grid;
  gap: 8px;
}

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

.staff-account-row input,
.staff-account-row select {
  width: 100%;
  min-width: 0;
}

.service-price-list {
  display: grid;
  gap: 8px;
}

.service-price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.service-price-row span {
  display: grid;
  gap: 3px;
}

.service-price-row small {
  color: var(--muted);
  font-weight: 800;
}

.service-price-row input {
  width: 100%;
  min-width: 0;
}

.service-price-save {
  width: 100%;
  margin-top: 10px;
}

.staff-log-box h3 {
  margin: 4px 0 0;
  font-size: 18px;
}

.staff-log-list {
  display: grid;
  gap: 8px;
}

.staff-log-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.staff-log-item strong {
  color: var(--ink);
}

.history-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.report-center {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  overflow: hidden;
}

.report-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  max-width: 100%;
}

.report-controls select,
.report-controls input,
.report-controls button {
  width: 100%;
  min-width: 0;
}

.expense-panel {
  margin-top: 14px;
  overflow: hidden;
}

.drawer-panel {
  margin-top: 14px;
  overflow: hidden;
}

.expense-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  max-width: 100%;
}

.expense-form input,
.expense-form select,
.expense-form button {
  width: 100%;
  min-width: 0;
}

.expense-form #addExpense {
  grid-column: 1 / -1;
  justify-self: stretch;
}

.expense-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.expense-presets .qty-button {
  flex: 0 1 auto;
}

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

.drawer-form input,
.drawer-form button {
  width: 100%;
  min-width: 0;
}

.drawer-form #saveDrawer {
  grid-column: 1 / -1;
}

.mini-panel,
.report-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
}

.mini-head {
  display: grid;
  gap: 8px;
}

.mini-head h3 {
  margin: 0;
  font-size: 18px;
}

.history-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.history-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.voided-item {
  border-color: rgba(200, 38, 50, 0.35);
  background: #fff7f8;
  opacity: 0.82;
}

.voided-item strong {
  color: var(--red);
}

.history-item div,
.history-actions {
  display: grid;
  gap: 4px;
}

.history-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.history-actions {
  justify-items: end;
}

.report-box {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 700;
}

.audit-line {
  padding-top: 6px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.backup-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
}

.backup-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.file-button {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 8px;
  background: #edf2f9;
  color: var(--blue);
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
}

.file-button input {
  display: none;
}

.status-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.status-board div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.status-board span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-board strong {
  font-size: 22px;
}

.document-report {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.report-list {
  display: grid;
  gap: 8px;
}

.report-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
}

.report-item div {
  display: grid;
  gap: 3px;
}

.report-item span {
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.report-item strong {
  color: var(--ink);
}

.report-item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.item-sub,
.task-sub {
  color: var(--muted);
  font-size: 12px;
}

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

.qty-button,
.ghost-button {
  min-height: 34px;
  padding: 7px 11px;
  background: #edf2f9;
  color: var(--blue);
  font-weight: 800;
}

.remove-button {
  background: #ffecef;
  color: var(--red);
}

.totals {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.total-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.grand {
  color: var(--ink);
  font-size: 22px;
}

.primary-button {
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  background: var(--green);
  color: white;
  font-weight: 900;
}

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

.metric-row div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
}

.metric-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-row strong {
  font-size: 22px;
}

.receipt-preview {
  margin-top: 14px;
}

.flyer-reference {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
}

.flyer-reference img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f8;
}

.flyer-reference figcaption {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.receipt {
  max-width: 340px;
  padding: 16px;
  background: white;
  color: #111;
  border: 1px solid var(--line);
  font-family: "Courier New", monospace;
  font-size: 13px;
}

.receipt-logo {
  display: block;
  width: min(230px, 100%);
  height: auto;
  margin: 0 auto 8px;
}

.receipt h3,
.receipt p {
  margin: 0 0 5px;
  text-align: center;
}

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

.receipt-detail {
  margin: -2px 0 5px;
  color: #444;
  font-size: 12px;
}

.report-print {
  max-width: 520px;
  line-height: 1.5;
}

.receipt-note,
.receipt-link {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.signature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 18px 0 8px;
}

.signature-row span {
  display: block;
  padding-top: 20px;
  border-top: 1px solid #111;
  text-align: center;
  font-size: 11px;
}

.lookup-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.lookup-result {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  line-height: 1.45;
  background: white;
}

.lookup-source {
  display: inline-block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-page {
  background: linear-gradient(180deg, var(--blue) 0, var(--blue) 310px, var(--paper) 310px);
}

.client-hero {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 24px 18px 54px;
  color: white;
  text-align: center;
}

.client-logo {
  display: block;
  width: min(330px, 86vw);
  height: auto;
  margin-top: 8px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 12px 26px rgba(4, 18, 45, 0.22);
}

.client-hero .eyebrow {
  color: rgba(255, 255, 255, 0.86);
}

.client-hero h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

.client-hero p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 17px;
  line-height: 1.45;
}

.client-back {
  justify-self: end;
  padding: 9px 12px;
  border-radius: 8px;
  background: white;
  color: var(--blue);
  font-weight: 900;
}

.client-shell {
  display: grid;
  gap: 16px;
  width: min(860px, calc(100% - 28px));
  margin: -34px auto 40px;
}

.client-check,
.client-info {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.client-lookup {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.client-lookup input {
  min-height: 48px;
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-result {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
  line-height: 1.45;
}

.client-result strong {
  font-size: 22px;
}

.client-result.ready {
  border-color: rgba(32, 120, 79, 0.35);
  background: #effaf4;
}

.client-result.attention {
  border-color: rgba(200, 38, 50, 0.28);
  background: #fff5f6;
}

.status-pill {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-size: 13px;
  font-weight: 900;
}

.client-result dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.client-result dl div,
.client-info div {
  display: grid;
  gap: 3px;
}

.client-result dt,
.client-info strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.client-result dd,
.client-info span {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.client-info {
  grid-template-columns: repeat(3, 1fr);
}

.powered-by-fedtech {
  display: flex;
  justify-content: center;
  padding: 0 18px 18px;
  background: var(--paper);
}

.powered-by-fedtech img {
  display: block;
  width: min(150px, 38vw);
  height: auto;
  opacity: 0.78;
}

.auth-locked .powered-by-fedtech {
  display: none;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .checkout-panel {
    order: -1;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: start;
    flex-wrap: wrap;
    padding: 14px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .icon-button {
    align-self: center;
    padding: 9px 10px;
  }

  .app-shell {
    padding: 10px;
  }

  .section-head,
  .form-grid,
  .task-form,
  .metric-row,
  .history-layout,
  .status-board,
  .topup-form,
  .expense-form,
  .report-controls,
  .drawer-form,
  .document-checklist,
  .staff-account-row,
  .service-price-row,
  .lookup-form,
  .ready-toolbar,
  .client-lookup,
  .client-info {
    grid-template-columns: 1fr;
  }

  .ready-toolbar {
    display: grid;
  }

  .expense-form #addExpense {
    grid-column: 1;
  }

  .backup-actions {
    display: grid;
  }

  .section-head {
    display: grid;
    align-items: stretch;
  }
}

@media print {
  body > :not(.print-zone) {
    display: none !important;
  }

  .print-zone {
    display: block;
  }
}
