:root {
  --navy: #061a38;
  --navy-2: #0d2c55;
  --cream: #fffaf0;
  --paper: #ffffff;
  --ink: #10213b;
  --muted: #607089;
  --line: #dce4e7;
  --mint: #dff7ef;
  --green: #14815d;
  --amber: #ffb41f;
  --amber-soft: #fff3cf;
  --red: #b9382f;
  --red-soft: #fff0ed;
  --purple: #6f4cff;
  --shadow: 0 18px 50px rgba(6, 26, 56, .12);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "DM Sans", system-ui, sans-serif; color: var(--ink); background: #f4f7f6; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #ffb41f; outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }

.sync-banner { min-height: 36px; display: flex; justify-content: center; gap: 10px; align-items: center; padding: 7px 18px; background: var(--amber); color: var(--navy); font-size: 13px; text-align: center; }
.login-shell { min-height: calc(100vh - 36px); padding: 54px 24px; display: grid; place-items: center; background: radial-gradient(circle at 12% 10%, rgba(67, 207, 173, .22), transparent 28%), linear-gradient(135deg, #071a36 0%, #0d2c55 58%, #103d61 100%); }
.login-card { width: min(1080px, 100%); min-height: 630px; display: grid; grid-template-columns: 1.1fr .9fr; grid-template-rows: auto 1fr; overflow: hidden; background: var(--cream); border-radius: 28px; box-shadow: 0 30px 90px rgba(0,0,0,.32); }
.brand-lockup { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 24px 32px; color: white; background: var(--navy); }
.brand-the { align-self: flex-start; margin-top: 1px; color: var(--amber); font-size: 8px; letter-spacing: .28em; }
.brand-name, .mini-brand { font-family: "Oswald", sans-serif; font-weight: 700; letter-spacing: .06em; }
.brand-name { font-size: 25px; }
.brand-rule { width: 1px; height: 32px; background: rgba(255,255,255,.4); }
.brand-line { max-width: 130px; font-size: 11px; line-height: 1.2; text-transform: uppercase; letter-spacing: .05em; }
.login-copy { padding: 74px 42px 64px 58px; background: linear-gradient(145deg, rgba(255,255,255,.0), rgba(255,180,31,.1)); }
.eyebrow { margin: 0 0 12px; color: var(--purple); font-size: 12px; font-weight: 700; letter-spacing: .16em; }
.login-copy h1, .page-heading h2 { margin: 0; color: var(--navy); font-family: "Oswald", sans-serif; text-transform: uppercase; line-height: .96; }
.login-copy h1 { font-size: clamp(52px, 6vw, 78px); }
.login-copy > p:last-child { max-width: 530px; margin-top: 24px; color: var(--muted); font-size: 17px; line-height: 1.65; }
.login-form { display: flex; flex-direction: column; justify-content: center; padding: 64px 58px; background: white; }
.login-form .forgot-pin-link { align-self:flex-start; min-height:44px; margin-top:8px; padding:8px 0; color:var(--purple); font-size:14px; font-weight:700; }
.forgot-pin-panel { display:grid; gap:12px; margin-top:12px; padding:16px; border:1px solid var(--line); border-radius:14px; background:#f4f7f6; }
.forgot-pin-panel p { margin:0; color:var(--muted); line-height:1.45; }
.forgot-pin-panel .button-wide { margin-top:0; }

label { display: grid; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #cdd8dc; border-radius: 11px; padding: 13px 14px; color: var(--ink); background: white; outline: none; transition: .2s ease; }
input:focus, select:focus, textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(111,76,255,.12); }
textarea { resize: vertical; }
.login-form label + label { margin-top: 18px; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 10px; padding: 11px 18px; font-weight: 700; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--purple); box-shadow: 0 8px 22px rgba(111,76,255,.22); }
.button-secondary { color: var(--navy); border-color: #b9c6cf; background: white; }
.button-wide { width: 100%; margin-top: 24px; }
.form-help { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.form-error { min-height: 18px; margin: 10px 0 0; color: var(--red); font-size: 13px; font-weight: 700; }

.app-shell { min-height: calc(100vh - 36px); }
.app-header { min-height: 92px; display: flex; justify-content: space-between; align-items: center; padding: 18px max(28px, calc((100vw - 1180px)/2)); color: white; background: var(--navy); }
.mini-brand { margin: 0 0 3px; color: var(--amber); font-size: 11px; letter-spacing: .14em; }
.app-header h1 { margin: 0; font-size: 24px; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.user-chip { padding: 8px 12px; border: 1px solid rgba(255,255,255,.24); border-radius: 999px; font-size: 13px; }
.text-button { border: 0; padding: 8px; color: white; background: transparent; text-decoration: underline; }
.tabs { position: sticky; top: 0; z-index: 4; display: flex; gap: 4px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; padding: 0 max(20px, calc((100vw - 1180px)/2)); border-bottom: 1px solid var(--line); background: white; }
.tab { flex: 0 0 auto; min-width: max-content; min-height: 58px; border: 0; border-bottom: 3px solid transparent; padding: 0 18px; color: var(--muted); background: white; font-weight: 700; white-space: nowrap; }
.tab.is-active { color: var(--navy); border-bottom-color: var(--amber); }
.view { display: none; width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 70px; }
.view.is-active { display: block; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 30px; }
.page-heading.narrow { max-width: 760px; }
.page-heading h2 { font-size: clamp(36px, 5vw, 58px); }
.page-heading p:last-child { max-width: 650px; margin: 14px 0 0; color: var(--muted); line-height: 1.55; }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.summary-card { min-height: 166px; display: grid; align-content: space-between; padding: 23px; border-radius: var(--radius); color: var(--navy); }
.summary-card.navy { color: white; background: var(--navy); }
.summary-card.green { background: var(--mint); }
.summary-card.amber { background: var(--amber-soft); }
.summary-card span, .summary-card small { font-weight: 600; }
.summary-card strong { font-family: "Oswald", sans-serif; font-size: 54px; line-height: 1; }
.summary-card small { opacity: .72; }
.attention-panel { display: flex; gap: 14px; align-items: center; margin-top: 18px; padding: 16px 20px; border: 1px solid #f0c0b7; border-radius: 14px; background: var(--red-soft); }
.attention-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: white; background: var(--red); font-weight: 700; }
.attention-panel p { margin: 3px 0 0; color: #7d3730; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 42px 0 18px; }
.section-heading.compact { margin-top: 36px; }
.section-heading h3 { margin: 0; font-size: 26px; }
.progress-label { color: var(--muted); font-size: 13px; font-weight: 700; }
.task-grid, .review-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.task-card, .review-card { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 6px 24px rgba(8,37,60,.05); }
.task-topline { display: flex; justify-content: space-between; align-items: center; }
.task-time { color: var(--purple); font-size: 11px; font-weight: 700; letter-spacing: .13em; }
.status-pill { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.status-pill.neutral { color: var(--muted); background: #eef2f3; }
.status-pill.pass { color: #0f6a4c; background: var(--mint); }
.status-pill.warning { color: #795400; background: var(--amber-soft); }
.status-pill.fail { color: #983029; background: var(--red-soft); }
.task-card h4 { margin: 18px 0 10px; font-size: 21px; }
.task-card ul, .review-list { margin: 0 0 22px; padding-left: 20px; color: var(--muted); line-height: 1.7; }
.check-count { margin: -2px 0 12px; color: var(--green); font-size: 13px; font-weight: 700; }
.task-card .full-diary-preview { display: grid; gap: 7px; margin-bottom: 24px; font-size: 14px; line-height: 1.45; }
.task-card .full-diary-preview li::marker { color: var(--green); }

.record-list { display: grid; gap: 10px; }
.record-row { display: grid; grid-template-columns: 64px 1.2fr .8fr 110px 90px; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.history-row { grid-template-columns:150px 1.2fr .65fr 100px 100px; cursor:pointer; }
.record-time { color: var(--muted); font-size: 12px; font-weight: 700; }
.record-main strong, .record-main small { display: block; }
.record-main small, .record-meta { color: var(--muted); font-size: 12px; }
.record-temp { font-family: "Oswald", sans-serif; font-size: 22px; text-align: right; }
.empty-state { padding: 34px; border: 1px dashed #bac8cc; border-radius: 15px; color: var(--muted); background: rgba(255,255,255,.55); text-align: center; }

.record-form { max-width: 820px; }
.form-section { display: grid; gap: 20px; margin-bottom: 18px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dynamic-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dynamic-fields > *, .field-row > * { min-width: 0; }
.field-full { grid-column: 1 / -1; }
.rule-card { padding: 16px 18px; border-left: 5px solid var(--amber); border-radius: 9px; background: var(--amber-soft); line-height: 1.5; }
.rule-card strong { display: block; margin-bottom: 3px; color: var(--navy); }
.rule-card span { color: #69511c; font-size: 13px; }
.rice-use-by { border-left-color: var(--green); background: var(--mint); }
.check-row { grid-template-columns: 22px 1fr; align-items: start; padding: 16px; border-radius: 12px; background: #f3f7f6; }
.check-row input { width: 18px; height: 18px; margin-top: 2px; }
.check-row strong, .check-row small { display: block; }
.check-row small { margin-top: 3px; color: var(--muted); font-weight: 400; line-height: 1.45; }
.result-panel { margin: 18px 0; padding: 18px 20px; border-radius: 13px; }
.result-panel.neutral { color: var(--muted); background: #eaf0f1; }
.result-panel.pass { color: #0c6849; background: var(--mint); }
.result-panel.warning { color: #755400; background: var(--amber-soft); }
.result-panel.fail { color: #8a2d26; background: var(--red-soft); }
.result-panel small { display: block; margin-top: 5px; line-height: 1.5; }
.action-fields { border-color: #f0c0b7; background: #fffafa; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.filter-bar { display: flex; margin-bottom: 18px; }
.filter-bar label { width: min(300px, 100%); }
.filter-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
.button-row,.action-buttons { display:flex; flex-wrap:wrap; gap:10px; }
.subtabs { display:flex; gap:8px; margin-bottom:20px; border-bottom:1px solid var(--line); }
.subtab { min-height:46px; border:0; border-bottom:3px solid transparent; padding:0 16px; color:var(--muted); background:transparent; font-weight:700; }
.subtab.is-active { color:var(--navy); border-bottom-color:var(--amber); }
.cleaning-list,.document-grid { display:grid; gap:12px; }
.document-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.cleaning-card,.document-card,.action-card,.inspection-section { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; padding:20px; border:1px solid var(--line); border-radius:var(--radius); background:white; }
.cleaning-card h3,.document-card h3,.action-card h3,.inspection-section h3 { margin:8px 0; }
.cleaning-card p,.document-card p,.action-card p { margin:5px 0; color:var(--muted); line-height:1.5; }
.cleaning-card details { margin-top:10px; }
.cleaning-complete { width:min(320px,100%); display:grid; gap:8px; }
.cleaning-checklist { display:grid; gap:18px; }
.cleaning-checklist-toolbar { position:sticky; top:106px; z-index:4; display:grid; grid-template-columns:1fr minmax(220px,320px); gap:18px; align-items:end; padding:18px; border:1px solid var(--line); border-radius:var(--radius); background:#fff; box-shadow:0 8px 24px rgba(8,37,60,.08); }
.cleaning-checklist-toolbar h3 { margin:5px 0 10px; font-size:22px; }
.cleaning-progress-track { height:10px; overflow:hidden; border-radius:999px; background:#e5ebe8; }
.cleaning-progress-track span { display:block; width:0; height:100%; border-radius:inherit; background:var(--green); transition:width .2s ease; }
.cleaning-task-card { padding:18px; border:2px solid var(--line); border-radius:var(--radius); background:#fff; }
.cleaning-task-card.is-outstanding { border-color:#d9a333; background:#fffdf7; }
.cleaning-task-card.is-completed { border-color:var(--green); background:#f2faf6; }
.cleaning-task-card.is-na { border-color:#aeb8c0; background:#f6f7f8; }
.cleaning-task-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.cleaning-task-heading h3,.cleaning-submission h3 { margin:5px 0; }
.cleaning-task-heading p,.cleaning-submission p { margin:4px 0; color:var(--muted); }
.cleaning-task-state { color:#815d09; font-size:12px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.is-completed .cleaning-task-state { color:var(--green); }
.cleaning-completed { display:flex; grid-template-columns:none; align-items:center; gap:10px; min-height:52px; padding:10px 14px; border:2px solid var(--green); border-radius:12px; color:var(--navy); background:#fff; font-size:18px; font-weight:800; white-space:nowrap; }
.cleaning-completed input { width:26px; height:26px; margin:0; accent-color:var(--green); }
.cleaning-attribution { min-height:20px; color:var(--green); font-size:13px; font-weight:700; }
.cleaning-task-card details { margin:10px 0; }
.cleaning-secondary-actions { display:flex; flex-wrap:wrap; gap:18px; margin-top:14px; padding-top:14px; border-top:1px solid var(--line); }
.cleaning-secondary-actions label { display:flex; grid-template-columns:none; align-items:center; gap:7px; min-height:40px; color:var(--muted); font-size:13px; font-weight:700; }
.cleaning-secondary-actions input { width:18px; height:18px; }
.cleaning-na-fields { margin-top:10px; }
.cleaning-submit-panel { display:grid; gap:14px; padding:20px; border:1px solid var(--line); border-radius:var(--radius); background:#fff; }
.cleaning-declaration { padding:15px; border:2px solid var(--navy); border-radius:12px; background:#f4f7f8; font-weight:800; }
.cleaning-submit-panel > .button { justify-self:end; }
.cleaning-submissions { display:grid; gap:12px; margin-top:34px; }
.cleaning-submission { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; padding:18px; border:1px solid var(--line); border-radius:var(--radius); background:#fff; }
.cleaning-verification { width:min(340px,100%); display:grid; gap:10px; }
.legacy-cleaning { margin-top:24px; padding:16px; border:1px solid var(--line); border-radius:var(--radius); background:#fff; }
.choice-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.choice-grid label,.status-options label { display:flex; grid-template-columns:none; align-items:center; gap:8px; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:white; }
.choice-grid input,.status-options input { width:18px; height:18px; }
fieldset { margin:0; border:1px solid var(--line); border-radius:14px; padding:16px; }
legend { padding:0 6px; font-weight:700; }
.diary-check { display:block; }
.diary-check legend { color:var(--navy); font-size:14px; line-height:1.45; }
.status-options { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.opening-check-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:12px; }
.opening-check-actions label { display:flex; grid-template-columns:none; align-items:center; gap:9px; min-height:50px; padding:10px 14px; border:1px solid var(--line); border-radius:12px; background:#fff; font-weight:750; }
.opening-check-actions input { width:23px; height:23px; margin:0; accent-color:var(--green); }
.opening-completed { flex:1 1 180px; color:var(--navy); }
.opening-report { flex:0 1 auto; color:#8a2d26; font-size:14px; }
.diary-check.opening-done { border-color:var(--green); background:#f2faf6; }
.diary-check.opening-has-issue { border-color:var(--red); background:#fffafa; }
.opening-issue-comment { border-left:5px solid var(--red); }
.check-detail { margin-top:12px; padding:14px; border-radius:12px; background:#f4f7f6; }
.issue-detail { display:grid; gap:12px; }
.issue-fields { display:grid; gap:14px; padding:16px; border-left:5px solid var(--amber); border-radius:12px; background:var(--amber-soft); }
.action-card.overdue { border-color:var(--red); box-shadow:0 0 0 2px rgba(185,56,47,.08); }
.detail-list { display:grid; gap:10px; }
.detail-list div { display:grid; grid-template-columns:170px 1fr; gap:12px; padding-bottom:10px; border-bottom:1px solid var(--line); }
.detail-list dt { font-weight:700; text-transform:capitalize; }
.detail-list dd { margin:0; overflow-wrap:anywhere; }
.detail-list pre { max-height:260px; overflow:auto; margin:0; white-space:pre-wrap; }
.inspection-section { display:block; margin-bottom:16px; }
.pack-cover { padding:30px; border:2px solid var(--navy); border-radius:18px; background:#fff; }
.pack-cover h3 { margin:4px 0 20px; font-size:34px; }
.pack-cover dl { display:grid; grid-template-columns:1fr 1fr; gap:10px 24px; }
.pack-cover dl div { display:grid; grid-template-columns:110px 1fr; gap:10px; padding:8px 0; border-bottom:1px solid var(--line); }
.pack-cover dt { font-weight:800; }
.pack-cover dd { margin:0; }
.inspection-nav { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0 24px; }
.inspection-nav a { padding:8px 11px; border:1px solid var(--line); border-radius:999px; color:var(--navy); background:#fff; font-size:13px; font-weight:700; text-decoration:none; }
.inspection-sheet { padding:0; overflow:hidden; }
.pack-section-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:18px 20px; color:#fff; background:var(--navy); }
.pack-section-heading h3 { margin:3px 0 0; color:#fff; }
.pack-section-heading .eyebrow { color:var(--amber); }
.pack-section-heading span { font-weight:800; }
.pack-guidance { margin:0; padding:12px 18px; border-bottom:1px solid var(--line); color:#5b6475; background:#fff9ec; }
.pack-table-wrap { width:100%; overflow-x:auto; }
.pack-table { width:100%; border-collapse:collapse; background:#fff; font-size:12px; }
.pack-table th,.pack-table td { min-width:92px; padding:9px 10px; border:1px solid #cfd8dc; text-align:left; vertical-align:top; overflow-wrap:anywhere; }
.pack-table th { color:var(--navy); background:#eaf3f0; font-size:11px; }
.pack-table tbody tr:nth-child(even) { background:#f8faf9; }
.pack-empty { margin:0; padding:24px; color:var(--muted); background:#fff; }

.review-card { position: relative; overflow: hidden; }
.review-card h3 { margin: 4px 0 10px; font-size: 25px; }
.review-card > p { color: var(--muted); line-height: 1.55; }
.review-card label { margin: 17px 0; }
.card-number { position: absolute; top: -20px; right: 12px; color: rgba(6,26,56,.05); font-family: "Oswald", sans-serif; font-size: 120px; line-height: 1; }
.calibration-panel { margin-bottom: 28px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 6px 24px rgba(8,37,60,.05); }
.calibration-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.calibration-heading h3 { margin: 0; color: var(--navy); font-size: 28px; }
.calibration-intro { max-width: 860px; margin: 12px 0 20px; color: var(--muted); line-height: 1.6; }
.calibration-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.calibration-methods article { position: relative; overflow: hidden; padding: 22px; border-radius: 16px; color: white; background: var(--navy); }
.calibration-methods article:nth-child(2) { color: var(--navy); background: var(--mint); }
.calibration-methods h4 { position: relative; margin: 0 0 10px; font-size: 20px; }
.calibration-methods ol { position: relative; margin: 0; padding-left: 20px; line-height: 1.55; }
.calibration-methods li + li { margin-top: 5px; }
.method-number { position: absolute; top: -12px; right: 12px; color: rgba(255,255,255,.08); font-family: "Oswald", sans-serif; font-size: 92px; font-weight: 700; }
.calibration-methods article:nth-child(2) .method-number { color: rgba(6,26,56,.07); }
.ideal-reading { position: relative; display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.25); }
.calibration-methods article:nth-child(2) .ideal-reading { border-top-color: rgba(6,26,56,.16); }
.ideal-reading span { font-size: 13px; font-weight: 700; }
.calibration-action-note { margin-top: 16px; padding: 16px 18px; border-left: 5px solid var(--amber); border-radius: 10px; color: #69511c; background: var(--amber-soft); line-height: 1.5; }
.calibration-form { display: grid; gap: 16px; padding: 20px; border-radius: 15px; background: #f4f7f6; }
.calibration-fields { grid-template-columns: 1.2fr .8fr .8fr; }
.calibration-results { display: grid; gap: 9px; margin-top: 18px; }
.calibration-manager-review, .manager-queue-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.calibration-manager-review p { margin: 4px 0 0; color: var(--muted); }
.manager-queue { display: grid; gap: 10px; margin-bottom: 24px; }
.manager-queue-card { margin-top: 0; }
.manager-queue-card small { display: block; margin-top: 4px; color: var(--muted); }
.record-amend { min-height: 38px; padding-left: 0; color: var(--purple); }
.audit-correction-actions { padding-top:16px; border-top:1px solid var(--line); }
.audit-correction-actions p { margin:0 0 14px; color:var(--muted); line-height:1.5; }
.audit-correction-actions .button { width:100%; }
.calibration-row { display: grid; grid-template-columns: 110px 1fr 100px 100px 90px; align-items: center; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.calibration-row small { display: block; color: var(--muted); }
.guidance-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.guidance-grid article { min-height: 210px; padding: 26px; border-radius: var(--radius); color: white; background: var(--navy); }
.guidance-grid article:nth-child(2), .guidance-grid article:nth-child(3) { color: var(--navy); background: var(--mint); }
.guide-temp { color: var(--amber); font-family: "Oswald", sans-serif; font-size: 45px; }
.guidance-grid article:nth-child(2) .guide-temp, .guidance-grid article:nth-child(3) .guide-temp { color: var(--green); }
.guidance-grid h3 { margin: 7px 0; }
.guidance-grid p { margin: 0; opacity: .82; line-height: 1.55; }
.scope-note { margin-top: 18px; padding: 22px 24px; border: 1px solid #e5cca0; border-radius: 15px; background: #fff9ec; }
.scope-note p { margin: 7px 0 0; color: #685c47; line-height: 1.55; }
.admin-notice { margin: -8px 0 22px; }
.admin-permission-card { margin-bottom:22px; padding:18px; border:1px solid var(--line); border-radius:14px; background:#fff; }
.admin-permission-card label { display:flex; grid-template-columns:none; align-items:flex-start; gap:12px; }
.admin-permission-card input { width:23px; height:23px; flex:0 0 auto; margin:2px 0 0; accent-color:var(--green); }
.admin-permission-card span,.admin-permission-card small { display:block; }
.admin-permission-card small { margin-top:5px; color:var(--muted); font-weight:500; line-height:1.45; }
.admin-add-form { display: grid; grid-template-columns: 1.4fr .8fr auto; align-items: end; gap: 14px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.staff-add-form { grid-template-columns: 1.2fr .7fr .7fr 1.2fr auto; margin-bottom: 14px; }
.admin-item-list { display: grid; gap: 10px; }
.admin-item-row { display: grid; grid-template-columns: 115px 1fr auto auto; align-items: center; gap: 10px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.admin-staff-row { grid-template-columns: 1.1fr .7fr .7fr 1.1fr auto auto auto; }
.admin-staff-row label { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.admin-staff-row label input { width: 18px; height: 18px; }
.pin-reset-section { margin-bottom:26px; padding:18px; border:1px solid var(--line); border-radius:var(--radius); background:#fff; }
.pin-reset-section .section-heading { margin-top:0; }
.pin-reset-request { display:grid; grid-template-columns:minmax(180px,1fr) minmax(170px,.7fr) auto; gap:12px; align-items:end; padding:14px; border:1px solid var(--line); border-radius:12px; background:#fffafa; }
.pin-reset-request div { display:grid; gap:3px; }
.pin-reset-request small { color:var(--muted); }
.admin-item-row .item-group { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.admin-item-row input { padding: 10px 12px; }
.admin-item-row button { min-height: 40px; }
.admin-reset { color: var(--purple); }
.official-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.official-links a { padding: 12px 15px; border-radius: 9px; color: white; background: var(--purple); font-weight: 700; text-decoration: none; }
.app-footer { width: min(1180px, calc(100% - 40px)); display: flex; justify-content: space-between; margin: 0 auto; padding: 25px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 10; max-width: 360px; padding: 13px 17px; border-radius: 10px; color: white; background: var(--navy); box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.dialog-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(6,26,56,.72); backdrop-filter: blur(4px); }
.dialog-card { width: min(760px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 26px; border-radius: 22px; background: #f7faf9; box-shadow: 0 30px 90px rgba(0,0,0,.34); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.dialog-heading h2 { margin: 0; color: var(--navy); font-family: "Oswald", sans-serif; font-size: 34px; text-transform: uppercase; }
.dialog-heading p:last-child { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
.dialog-close { width: 42px; height: 42px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; color: var(--navy); background: white; font-size: 26px; line-height: 1; }
.diary-check-list { display: grid; gap: 9px; margin-bottom: 20px; }
.diary-check { grid-template-columns: 24px 1fr; align-items: start; gap: 11px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: white; font-size: 14px; line-height: 1.42; }
.diary-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--green); }
.dialog-actions { margin-top: 20px; }
.record-detail-dialog { width:min(780px,calc(100vw - 28px)); }
.record-result-line { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; padding:14px 16px; border:1px solid var(--line); border-radius:14px; background:#f7faf9; }
.record-result-line strong { color:var(--navy); font-size:14px; text-align:right; }
.record-detail-section { margin-top:18px; padding:18px; border:1px solid var(--line); border-radius:16px; background:#fff; }
.record-detail-section > h3 { margin:0 0 14px; font-size:19px; }
.record-detail-section > p { margin:0; white-space:pre-wrap; }
.record-detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 22px; margin:0; }
.record-detail-field { padding:11px 0; border-bottom:1px solid var(--line); }
.record-detail-field dt { margin-bottom:4px; color:var(--muted); font-size:12px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
.record-detail-field dd { margin:0; color:var(--navy); font-size:16px; font-weight:700; overflow-wrap:anywhere; }
.record-completion { display:grid; gap:4px; padding:18px; border-radius:16px; color:#075b42; background:#e5f6ef; }
.record-completion strong { font-size:20px; }
.record-completion span { font-weight:650; }
.record-task-list { display:grid; gap:9px; }
.record-task { display:grid; grid-template-columns:32px 1fr; align-items:start; gap:10px; padding:12px; border-radius:12px; background:#f3faf7; }
.record-task > span { display:grid; place-items:center; width:30px; height:30px; border-radius:50%; color:#fff; background:var(--green); font-weight:900; }
.record-task.has-issue { background:#fff1ef; }
.record-task.has-issue > span { background:var(--red); }
.record-task div { display:grid; gap:3px; }
.record-task small { color:var(--muted); line-height:1.4; }
.record-timeline { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-bottom:16px; }
.record-timeline-long { grid-template-columns:repeat(2,minmax(0,1fr)); }
.record-timeline article { display:grid; grid-template-columns:34px 1fr; gap:10px; min-height:88px; padding:13px; border:1px solid var(--line); border-radius:13px; background:#f8faf9; }
.record-timeline article > span { display:grid; place-items:center; width:32px; height:32px; border-radius:50%; color:#fff; background:var(--navy); font-weight:900; }
.record-timeline article div { display:grid; align-content:start; gap:4px; }
.record-timeline small { color:var(--muted); font-weight:750; }
.record-timeline strong { color:var(--navy); }
.record-timeline em { color:var(--muted); font-size:13px; font-style:normal; }
.record-timeline .record-reading { border-color:var(--green); background:#ecf8f3; }
.record-timeline .record-reading > span { background:var(--green); }
.record-action-section { border-color:#e4b662; background:#fff9ec; }
.record-amendments { display:grid; gap:10px; }
.record-amendments article { display:grid; gap:5px; padding:12px; border-left:4px solid var(--violet); background:#f7f4ff; }
.record-amendments small { color:var(--muted); }
.trace-dashboard { display:grid; grid-template-columns:repeat(7,minmax(110px,1fr)); gap:10px; margin-bottom:30px; overflow-x:auto; padding-bottom:4px; }
.trace-dashboard article { min-width:110px; padding:14px; border:1px solid var(--line); border-radius:14px; background:#fff; }
.trace-dashboard span { display:block; min-height:36px; color:var(--muted); font-size:12px; font-weight:750; }
.trace-dashboard strong { color:var(--navy); font-family:"Oswald",sans-serif; font-size:28px; }
.traceability-subnav { display:flex; gap:8px; margin-bottom:20px; overflow-x:auto; padding-bottom:4px; }
.trace-panel { min-height:260px; }
.delivery-dialog { width:min(920px,calc(100vw - 28px)); }
.wizard-progress { height:7px; margin:-5px 0 12px; overflow:hidden; border-radius:999px; background:#dfe8e5; }
.wizard-progress span { display:block; width:20%; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--violet),var(--green)); transition:width .2s ease; }
.wizard-steps { display:grid; grid-template-columns:repeat(5,1fr); gap:7px; margin:0 0 24px; padding:0; list-style:none; }
.wizard-steps li { padding:8px 5px; border-radius:9px; color:var(--muted); background:#edf2f0; font-size:12px; font-weight:800; text-align:center; }
.wizard-steps li.is-current { color:#fff; background:var(--navy); }
.wizard-steps li.is-done { color:#075b42; background:#dff4eb; }
.delivery-step > h3 { margin:0 0 8px; font-size:24px; }
.delivery-step > p { color:var(--muted); }
.evidence-upload-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:20px 0; }
.camera-button { display:grid; place-items:center; min-height:92px; padding:18px; border:2px dashed var(--violet); border-radius:16px; color:#fff; background:var(--violet); font-weight:850; text-align:center; cursor:pointer; }
.camera-button.secondary { color:var(--navy); border-color:var(--line); background:#fff; }
.camera-button input,.evidence-actions input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.evidence-preview-list { display:grid; gap:10px; }
.evidence-preview { display:grid; grid-template-columns:88px 1fr; gap:14px; padding:12px; border:1px solid var(--line); border-radius:14px; background:#fff; }
.evidence-thumb { display:grid; place-items:center; width:88px; height:88px; overflow:hidden; border-radius:10px; color:#fff; background:var(--navy); font-family:"Oswald",sans-serif; font-size:24px; }
.evidence-thumb img { width:100%; height:100%; object-fit:cover; }
.evidence-preview > div:last-child { display:grid; grid-template-columns:1fr auto; gap:6px 12px; align-items:center; }
.evidence-preview select { grid-column:1 / -1; }
.evidence-actions { grid-column:1 / -1; display:flex; gap:16px; }
.extraction-warning { padding:12px 14px; border-left:5px solid var(--amber); background:var(--amber-soft); color:var(--navy)!important; font-weight:700; }
.confidence-field { padding-left:10px; border-left:5px solid var(--amber); }
.required-confidence { border-color:var(--red); }
.delivery-check-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:18px 0; }
.field-hint { display:block; margin-top:6px; color:var(--muted); font-size:12px; font-weight:650; }
.trace-product-sheet { max-height:min(58vh,620px); overflow:auto; overscroll-behavior:contain; border:1px solid var(--line); border-radius:14px; background:#fff; box-shadow:0 10px 30px rgba(6,28,59,.08); }
.trace-product-sheet table { width:max-content; min-width:100%; border-collapse:separate; border-spacing:0; }
.trace-product-sheet th,.trace-product-sheet td { min-width:132px; padding:7px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); vertical-align:middle; background:#fff; }
.trace-product-sheet th { position:sticky; top:0; z-index:3; min-width:132px; padding:10px 8px; color:#fff; background:var(--navy); font-size:12px; line-height:1.25; text-align:left; }
.trace-product-sheet th:first-child,.trace-product-sheet td:first-child { min-width:220px; }
.trace-product-sheet th:nth-child(3),.trace-product-sheet td:nth-child(3) { min-width:92px; }
.trace-product-sheet th:nth-child(4),.trace-product-sheet td:nth-child(4) { min-width:105px; }
.trace-product-sheet th:nth-child(12),.trace-product-sheet td:nth-child(12) { min-width:118px; }
.trace-product-sheet th:last-child,.trace-product-sheet td:last-child { min-width:150px; border-right:0; }
.trace-product-sheet tr:last-child td { border-bottom:0; }
.trace-product-sheet input,.trace-product-sheet select { width:100%; min-height:40px; padding:8px 9px; border-radius:8px; font-size:14px; }
.trace-product-sheet .trace-sticky-column { position:sticky; left:0; z-index:2; box-shadow:5px 0 9px rgba(6,28,59,.08); }
.trace-product-sheet th.trace-sticky-column { z-index:4; background:var(--navy); }
.trace-checkbox-cell label { display:flex; align-items:center; gap:7px; font-size:12px; }
.trace-checkbox-cell input { width:22px; min-height:22px; }
.trace-row-actions { white-space:nowrap; }
.trace-row-actions .text-button { margin-right:9px; }
.sheet-help { margin:9px 2px 0; color:var(--muted); font-size:13px; }
.wizard-actions { display:flex; align-items:center; }
.wizard-actions #saveDeliveryDraft { margin-right:auto; }
.trace-summary { display:grid; gap:16px; }
.trace-declaration { margin-top:18px; padding:16px; border:2px solid var(--green); border-radius:14px; background:#effaf5; }
.trace-history-card { display:grid; grid-template-columns:145px minmax(220px,1fr) 150px auto; align-items:center; gap:18px; padding:18px; border:1px solid var(--line); border-radius:16px; background:#fff; }
.trace-record-number { display:grid; gap:4px; }
.trace-record-number span { color:var(--violet); font-weight:850; }
.trace-history-card h3 { margin:0 0 5px; }
.trace-history-card p { margin:0 0 5px; }
.trace-history-card small { color:var(--muted); }
.trace-card-status { display:grid; justify-items:start; gap:7px; }
.trace-evidence-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:10px; }
.trace-evidence-grid a { display:grid; gap:5px; padding:9px; border:1px solid var(--line); border-radius:12px; color:var(--navy); background:#fff; text-decoration:none; }
.trace-evidence-grid a > span { display:grid; place-items:center; height:92px; overflow:hidden; border-radius:8px; color:#fff; background:var(--navy); font-family:"Oswald",sans-serif; font-size:24px; }
.trace-evidence-grid img { width:100%; height:100%; object-fit:cover; }
.trace-evidence-grid small { color:var(--muted); overflow-wrap:anywhere; }
.recall-card { padding:18px; border:1px solid var(--line); border-radius:16px; background:#fff; }
.recall-card h3 { margin-top:0; }
.recall-control { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:16px; padding:14px; border-radius:13px; background:#fff7e5; }
.recall-control .button { align-self:end; }
.trace-report-record .record-detail-grid { padding:14px 18px; }

@media (max-width: 820px) {
  .login-card { grid-template-columns: 1fr; }
  .brand-lockup { grid-column: 1; }
  .login-copy { padding: 48px 32px 26px; }
  .login-form { padding: 26px 32px 48px; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-card { min-height: 130px; }
  .task-grid, .review-grid, .guidance-grid { grid-template-columns: 1fr; }
  .calibration-methods { grid-template-columns: 1fr; }
  .calibration-fields { grid-template-columns: 1fr; }
  .calibration-row { grid-template-columns: 90px 1fr 70px; }
  .calibration-row .calibration-boiling { display: none; }
  .record-row { grid-template-columns: 55px 1fr 75px; }
  .history-row { grid-template-columns:110px 1fr 85px; }
  .record-meta { display: none; }
  .filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .document-grid { grid-template-columns:1fr; }
}

@media (max-width: 580px) {
  .sync-banner { align-items: flex-start; flex-direction: column; gap: 1px; text-align: left; }
  .login-shell { padding: 18px 12px; }
  .login-card { border-radius: 18px; }
  .brand-lockup { padding: 19px 22px; }
  .login-copy { padding: 38px 24px 20px; }
  .login-form { padding: 22px 24px 38px; }
  .login-copy h1 { font-size: 48px; }
  .app-header { align-items: flex-start; padding: 17px 20px; }
  .app-header h1 { font-size: 19px; }
  .header-actions { align-items: flex-end; flex-direction: column; gap: 3px; }
  .user-chip { font-size: 11px; }
  .tabs { padding-inline: 8px; }
  .tab { min-height: 52px; padding-inline: 13px; font-size: 13px; }
  .view { width: min(100% - 28px, 1180px); padding-top: 30px; scroll-margin-top: 58px; }
  .page-heading { align-items: stretch; flex-direction: column; gap: 18px; }
  .page-heading h2 { font-size: 39px; overflow-wrap: anywhere; }
  .field-row, .dynamic-fields { grid-template-columns: 1fr; }
  input, select, textarea { min-width: 0; font-size: 16px; }
  select { max-width: 100%; text-overflow: ellipsis; }
  .check-row span { min-width: 0; overflow-wrap: anywhere; }
  .form-section { padding: 18px; }
  .record-row { grid-template-columns: 48px 1fr 70px; gap: 8px; padding: 12px; }
  .history-row { grid-template-columns:90px 1fr 75px; }
  .record-temp { font-size: 18px; }
  .calibration-manager-review, .manager-queue-card { align-items: stretch; flex-direction: column; }
  .calibration-manager-review .button, .manager-queue-card .button { width: 100%; }
  .form-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .admin-add-form { grid-template-columns: 1fr; }
  .staff-add-form { grid-template-columns: 1fr; }
  .admin-item-row { grid-template-columns: 1fr auto; }
  .admin-staff-row { grid-template-columns: 1fr 1fr; }
  .admin-item-row .item-group { grid-column: 1 / -1; }
  .admin-item-row input { grid-column: 1 / -1; }
  .admin-staff-row select, .admin-staff-row label { grid-column: auto; }
  .pin-reset-request { grid-template-columns:1fr; }
  .app-footer { flex-direction: column; gap: 5px; }
  .dialog-backdrop { align-items: end; padding: 0; }
  .dialog-card { width: 100%; max-height: 92vh; padding: 22px 17px; border-radius: 22px 22px 0 0; }
  .dialog-heading h2 { font-size: 29px; }
  .calibration-panel { padding: 18px; }
  .calibration-heading { flex-direction: column; }
  .ideal-reading { flex-direction: column; gap: 4px; }
  .filter-grid,.choice-grid { grid-template-columns:1fr; }
  .cleaning-card,.action-card { flex-direction:column; }
  .cleaning-complete { width:100%; }
  .cleaning-checklist-toolbar { position:static; grid-template-columns:1fr; }
  .cleaning-task-heading,.cleaning-submission { flex-direction:column; }
  .cleaning-completed { width:100%; justify-content:center; }
  .cleaning-secondary-actions { gap:8px 18px; }
  .cleaning-submit-panel > .button { width:100%; justify-self:stretch; }
  .detail-list div { grid-template-columns:1fr; }
  .record-detail-grid,.record-timeline,.record-timeline-long { grid-template-columns:1fr; }
  .record-result-line { align-items:flex-start; flex-direction:column; }
  .record-result-line strong { text-align:left; }
  .record-detail-section { padding:14px; }
  .trace-dashboard { grid-template-columns:repeat(7,118px); }
  .evidence-upload-grid,.delivery-check-grid,.recall-control { grid-template-columns:1fr; }
  .wizard-steps li { font-size:11px; }
  .trace-history-card { grid-template-columns:1fr; gap:12px; }
  .trace-card-status { grid-template-columns:auto 1fr; align-items:center; }
  .trace-history-card .button-row { display:grid; grid-template-columns:1fr; }
  .wizard-actions { display:grid; grid-template-columns:1fr 1fr; }
  .wizard-actions #saveDeliveryDraft { grid-column:1 / -1; margin:0; }
  .evidence-preview { grid-template-columns:70px 1fr; }
  .evidence-thumb { width:70px; height:70px; }
  .pack-cover dl { grid-template-columns:1fr; }
  .pack-cover { padding:22px 18px; }
  .pack-section-heading { align-items:flex-start; }
}

@media print {
  @page { size:A4 landscape; margin:8mm; }
  .sync-banner,.app-header,.tabs,.app-footer,.no-print,.toast,.button:not(#printInspection) { display:none !important; }
  body { background:white; }
  .view { display:none !important; width:100%; padding:0; }
  #inspection.view.is-active,#history.view.is-active { display:block !important; }
  .record-row { break-inside:avoid; box-shadow:none; }
  .pack-cover { break-after:page; }
  .inspection-section { break-before:page; border:0; border-radius:0; }
  .pack-section-heading { padding:10px 12px; print-color-adjust:exact; -webkit-print-color-adjust:exact; }
  .pack-guidance { padding:7px 9px; print-color-adjust:exact; -webkit-print-color-adjust:exact; }
  .pack-table-wrap { overflow:visible; }
  .pack-table { font-size:7.5pt; }
  .pack-table th,.pack-table td { min-width:0; padding:4px 5px; }
  .pack-table tr { break-inside:avoid; }
}

.order-tab{display:flex;align-items:center;gap:.45rem}.order-badge{display:inline-grid;place-items:center;min-width:1.45rem;height:1.45rem;padding:0 .35rem;border-radius:999px;background:#d3132a;color:white;font-size:.76rem;font-weight:900}.order-list{display:grid;gap:1rem;margin:1.1rem 0 2rem}.order-card{background:#fff;border:1px solid #d9e0e7;border-left:6px solid #09254a;border-radius:18px;padding:1.1rem;box-shadow:0 9px 28px rgba(7,31,60,.08)}.order-card.pending{border-left-color:#f59d19}.order-card.ready{border-left-color:#168451}.order-card.cancelled,.order-card.collected{opacity:.7}.order-card-top{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.order-card h3{margin:.2rem 0}.order-meta{display:flex;flex-wrap:wrap;gap:.4rem .9rem;color:#566273;font-size:.9rem}.order-items{margin:.85rem 0;padding-left:1.2rem}.order-items li{margin:.3rem 0}.order-total{font-size:1.15rem;font-weight:900}.order-actions{display:flex;align-items:end;flex-wrap:wrap;gap:.65rem;margin-top:1rem}.order-actions label{max-width:170px}.order-actions input{min-height:42px}.order-menu-editor{display:grid;gap:.65rem;margin:1rem 0}.order-menu-row{display:grid;grid-template-columns:1.4fr .8fr .55fr auto;gap:.55rem;align-items:center;padding:.65rem;background:#f6f8fb;border-radius:12px}.order-menu-row input{min-width:0}.order-menu-row .check-row{margin:0}.form-note{color:#596579;font-size:.92rem}.section-heading.compact{margin-top:1.6rem}@media(max-width:700px){.order-card-top{display:block}.order-menu-row{grid-template-columns:1fr 1fr}.order-menu-row .menu-name{grid-column:1/-1}.order-heading .button-row{width:100%}.order-heading .button{flex:1}.order-actions .button{flex:1}.order-actions label{max-width:none;flex:1 1 120px}}
