:root {
  color-scheme: light;
  --navy: #0b2e59;
  --blue: #155db8;
  --orange: #f36c17;
  --orange-dark: #d9580d;
  --green: #157a44;
  --ink: #15253a;
  --muted: #657386;
  --line: #dce3eb;
  --wash: #f4f7fa;
  --card: #fff;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--wash); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; overflow-x: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.topbar { background: var(--navy); color: #fff; padding: 28px clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.mobile-nav { display: none; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(25px, 4vw, 36px); letter-spacing: .02em; }
h2 { font-size: 20px; }
.eyebrow, .label { color: var(--muted); font-size: 13px; margin-bottom: 5px; }
.topbar .eyebrow { color: #b9d0ee; }
.version { border: 1px solid #507bab; color: #d7e8fb; padding: 7px 10px; border-radius: 99px; font-size: 12px; white-space: nowrap; }
.top-link { color: #fff; border: 1px solid #507bab; border-radius: 99px; padding: 8px 12px; text-decoration: none; font-size: 14px; font-weight: 800; white-space: nowrap; }
.top-link:hover { background: rgba(255, 255, 255, .1); }
.layout { max-width: 1180px; margin: 0 auto; padding: 24px clamp(14px, 3vw, 28px) 44px; display: grid; grid-template-columns: minmax(310px, .95fr) minmax(360px, 1.05fr); gap: 20px; }
.layout > * { min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 24px rgba(20, 51, 82, .06); }
.entry { padding: 24px; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.muted { color: var(--muted); font-size: 13px; text-align: right; }
label, .field-label { display: block; font-size: 14px; font-weight: 700; margin: 16px 0 8px; }
.control { width: 100%; min-height: 48px; border: 1px solid #bdc9d7; border-radius: 10px; padding: 0 13px; color: var(--ink); background: #fff; }
.control:focus { outline: 3px solid #cde1fb; border-color: var(--blue); }
.hotel-search { margin-bottom: 9px; }
.categories { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.category { min-height: 48px; border: 1px solid #b9c7d7; background: #fff; color: var(--ink); border-radius: 10px; font-weight: 700; }
.category.active { border-color: var(--navy); background: var(--navy); color: #fff; }
.stepper { display: grid; grid-template-columns: 76px 1fr 76px; align-items: center; border: 1px solid #bdc9d7; border-radius: 12px; overflow: hidden; }
.stepper button { min-height: 70px; border: 0; background: #eef3f8; color: var(--navy); font-size: 34px; }
.stepper input { min-width: 0; width: 100%; border: 0; background: #fff; text-align: center; color: var(--navy); font-size: 38px; font-weight: 800; }
.stepper input:focus { outline: 3px solid #cde1fb; outline-offset: -3px; }
.primary, .secondary { width: 100%; border: 0; border-radius: 11px; min-height: 56px; margin-top: 20px; font-weight: 800; font-size: 18px; }
.primary { background: var(--orange); color: #fff; }
.primary:hover { background: var(--orange-dark); }
.primary:disabled { opacity: .6; cursor: wait; }
.notice { min-height: 24px; margin-top: 12px; font-weight: 700; color: var(--green); }
.notice.error { color: #b42318; }
.overview { display: grid; gap: 20px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat { padding: 20px; }
.stat p { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.stat strong { color: var(--navy); font-size: 36px; }
.stat span { color: var(--muted); }
.totals-card { padding: 24px; }
.text-button { border: 0; background: transparent; color: var(--blue); font-weight: 700; padding: 6px; }
.hotel-totals { display: grid; gap: 11px; }
.hotel-row { display: grid; grid-template-columns: minmax(110px, 1fr) 52px; gap: 12px; align-items: center; }
.hotel-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hotel-total { color: var(--navy); text-align: right; font-weight: 800; }
.bar { grid-column: 1 / -1; height: 8px; background: #e7edf4; border-radius: 99px; overflow: hidden; margin-top: -4px; }
.bar i { display: block; height: 100%; background: var(--blue); border-radius: inherit; }
.records { grid-column: 1 / -1; padding: 24px; }
.statistics { grid-column: 1 / -1; padding: 24px; }
.filters { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)) auto; gap: 12px; align-items: end; }
.filters label { margin: 0; font-size: 13px; }
.filters .control { margin-top: 7px; }
.filters .secondary { width: auto; min-height: 48px; margin: 0; padding: 0 22px; font-size: 15px; background: var(--navy); color: #fff; }
.report-actions { display: flex; gap: 8px; }
.compact { width: auto; min-height: 40px; margin: 0; padding: 0 14px; font-size: 14px; background: var(--navy); color: #fff; }
.outline { border: 1px solid var(--navy); background: #fff; color: var(--navy); border-radius: 10px; font-weight: 800; }
.report-result { margin-top: 22px; }
.report-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.report-summary div { border: 1px solid var(--line); background: #f8fafc; border-radius: 10px; padding: 14px; }
.report-summary span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.report-summary strong { color: var(--navy); font-size: 18px; }
.report-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 20px; }
.report-group { margin-top: 20px; }
.hotel-category-totals { display: grid; gap: 12px; }
.hotel-category-group { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.hotel-category-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: #f0f5fb; padding: 12px 14px; color: var(--navy); }
.hotel-category-title h3 { margin: 0; }
.hotel-category-title > strong { font-size: 17px; }
.hotel-category-group p { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 15px; }
.hotel-category-group p:last-child { border-bottom: 0; }
.hotel-category-group p strong { color: var(--navy); }
h3 { font-size: 15px; margin: 0 0 10px; }
.report-list { display: grid; gap: 7px; }
.report-list p { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 6px 0; font-size: 14px; }
.print-audit { margin-top: 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 14px; }
th { color: var(--muted); text-align: left; font-weight: 700; background: #f8fafc; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td:nth-child(4), td:nth-child(5) { font-weight: 800; color: var(--navy); }
.empty { color: var(--muted); padding: 22px 0; text-align: center; }
.hotel-admin { grid-column: 1 / -1; padding: 22px 24px; display: flex; gap: 22px; align-items: end; justify-content: space-between; }
.hotel-form { width: min(460px, 100%); display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.hotel-form .secondary { margin: 0; min-height: 48px; width: auto; padding: 0 22px; background: var(--navy); color: #fff; font-size: 15px; }
footer { color: var(--muted); text-align: center; font-size: 13px; padding: 0 20px 28px; }

@media (max-width: 760px) {
  body { padding-bottom: 78px; overflow-x: hidden; }
  .topbar { position: sticky; top: 0; z-index: 10; padding: 14px 18px; }
  .topbar h1 { font-size: 23px; }
  .topbar .eyebrow { display: none; }
  .top-link { font-size: 12px; padding: 7px 9px; }
  .mobile-nav { position: fixed; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; z-index: 30; left: 0; right: 0; bottom: 0; padding: 9px 12px calc(9px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.97); border-top: 1px solid var(--line); box-shadow: 0 -5px 18px rgba(20,51,82,.08); }
  .mobile-nav a { color: var(--navy); text-align: center; text-decoration: none; font-size: 13px; font-weight: 800; padding: 9px 3px; border-radius: 8px; background: #edf4fb; }
  .mobile-nav a.active { color: #fff; background: var(--navy); }
  .layout { width: 100%; grid-template-columns: minmax(0, 1fr); padding: 10px 10px 24px; gap: 12px; overflow: hidden; }
  .entry, .totals-card, .records, .statistics, .hotel-admin { min-width: 0; }
  .entry, .totals-card, .records, .statistics { padding: 18px; }
  .entry { padding-bottom: 8px; }
  .section-heading { gap: 8px; margin-bottom: 16px; }
  .section-heading .muted { max-width: 110px; font-size: 12px; }
  #entrySection, #statistics, #records, #hotelAdmin { scroll-margin-top: 72px; }
  .overview { gap: 14px; }
  .stat strong { font-size: 30px; }
  .control { min-height: 54px; font-size: 16px; }
  .categories { grid-template-columns: repeat(2, 1fr); }
  .category { min-height: 54px; font-size: 16px; }
  .stepper { grid-template-columns: 72px 1fr 72px; }
  .stepper button { min-height: 68px; }
  .primary { position: sticky; bottom: 70px; z-index: 5; min-height: 60px; margin-bottom: 4px; box-shadow: 0 8px 18px rgba(243,108,23,.32); }
  .hotel-admin { display: block; padding: 18px; }
  .hotel-form { margin-top: 14px; }
  .filters, .report-summary, .report-columns { grid-template-columns: 1fr; }
  .report-actions { flex-wrap: wrap; }
  .report-actions .compact { flex: 1; min-height: 46px; }
  .table-wrap { margin: 0 -18px; padding: 0 18px; }
}

@media print {
  body { background: #fff; }
  .topbar, .mobile-nav, .entry, .overview, .records, .hotel-admin, footer, .filters, .report-actions, .label, .print-audit, #summaryWorkerInput, #summaryNotice { display: none !important; }
  .layout { display: block; padding: 0; max-width: none; }
  .statistics { display: block; border: 0; box-shadow: none; padding: 0; }
  .section-heading { margin-bottom: 16px; }
  .report-summary { grid-template-columns: repeat(4, 1fr); }
  .report-columns { grid-template-columns: 1fr 1fr; }
}
