:root {
  --ink: #1d2925;
  --muted: #68756f;
  --paper: #f4f2eb;
  --card: #fffefa;
  --line: #e3e0d7;
  --green-950: #102f27;
  --green-900: #163d31;
  --green-800: #1d5141;
  --green-700: #286a55;
  --green-100: #e5f0eb;
  --accent: #dbad50;
  --accent-light: #f5e7c5;
  --danger: #b6473d;
  --danger-light: #faeae7;
  --blue: #406b8f;
  --blue-light: #e8f0f6;
  --shadow: 0 20px 50px rgba(31, 48, 41, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif; font-size: 14px; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; height: 100dvh; display: grid; grid-template-columns: 244px minmax(0, 1fr); overflow: hidden; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 18px 20px; color: #eef7f2; background: var(--green-950); overflow-y: auto; z-index: 30; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 10px; }
.brand-mark { display: grid; place-items: center; flex: 0 0 60px; height: 44px; padding: 4px; border-radius: 12px; background: rgba(255,255,255,.96); overflow: hidden; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: .08em; font-size: 17px; }
.brand small { margin-top: 3px; color: #92a9a0; font-size: 9px; letter-spacing: .15em; }
.nav { margin-top: 42px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 48px; margin: 5px 0; padding: 8px 12px; border-radius: 12px; color: #afc2ba; font-weight: 600; transition: .2s ease; }
.nav-item span { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; font-family: STKaiti, KaiTi, serif; font-size: 15px; }
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { color: var(--green-950); background: var(--accent); box-shadow: 0 10px 20px rgba(0,0,0,.14); }
.nav-item.active span { border-color: rgba(16,47,39,.18); }
.nav-section { margin: 28px 12px 8px; color: #69857a; font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 18px 4px 0; border-top: 1px solid rgba(255,255,255,.09); }
.user-mini { min-width: 0; display: flex; align-items: center; gap: 9px; flex: 1; }
.avatar { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 50%; color: var(--green-900); background: var(--accent-light); font-weight: 700; }
.user-mini span:last-child { min-width: 0; }
.user-mini strong, .user-mini small, .person-cell strong, .person-cell small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-mini strong { font-size: 12px; }
.user-mini small { margin-top: 2px; color: #88a097; font-size: 10px; }
.text-button { padding: 5px; border: 0; color: #99afa6; background: transparent; cursor: pointer; }
.text-button:hover { color: white; }

.main { min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.topbar { flex-shrink: 0; z-index: 25; min-height: 88px; display: flex; align-items: center; gap: 18px; padding: 16px clamp(22px, 4vw, 58px); border-bottom: 1px solid var(--line); background: rgba(244,242,235,.96); }
.topbar h1 { margin: 3px 0 0; font-family: STKaiti, KaiTi, serif; font-size: clamp(24px, 3vw, 33px); font-weight: 700; }
.eyebrow { margin: 0; color: var(--green-700); font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.profile-link { margin-left: auto; padding-bottom: 2px; border-bottom: 1px solid var(--green-700); color: var(--green-700); font-size: 12px; font-weight: 700; }
.menu-button { display: none; border: 0; color: var(--green-900); background: transparent; font-size: 23px; cursor: pointer; }
.content { flex: 1; min-height: 0; overflow: auto; max-width: 1500px; width: 100%; margin: 0 auto; padding: 32px clamp(20px, 4vw, 58px) 60px; }
.site-footer { flex-shrink: 0; padding: 0 20px 24px; color: #8b9691; font-size: 10px; text-align: center; }
.site-footer a:hover, .guest-icp a:hover { color: var(--green-700); }
.guest-icp { position: fixed; right: 24px; bottom: 18px; z-index: 5; color: #8b9691; font-size: 10px; }

.flash-stack { position: fixed; right: 26px; top: 22px; z-index: 100; width: min(420px, calc(100vw - 40px)); }
.flash { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 9px; padding: 14px 16px; border: 1px solid; border-radius: 12px; background: white; box-shadow: var(--shadow); font-weight: 600; }
.flash button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 18px; }
.flash-success { border-color: #b9d7c8; color: #24664f; background: #eff8f3; }
.flash-warning { border-color: #ead39a; color: #846422; background: #fff8e7; }
.flash-error { border-color: #e4b6b0; color: #9d3b34; background: #fff1ef; }

.hero-card { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 30px; min-height: 200px; padding: clamp(28px, 4vw, 48px); border-radius: 22px; color: #eef7f2; background: var(--green-900); box-shadow: var(--shadow); }
.hero-card::after { content: ""; position: absolute; right: 16%; top: 18px; width: 230px; height: 160px; background: url("/static/sanyou-logo.png") center / contain no-repeat; opacity: .045; transform: rotate(-7deg); pointer-events: none; }
.hero-card .eyebrow { color: var(--accent); }
.hero-card h2 { margin: 10px 0 8px; font: 700 clamp(29px, 4vw, 43px)/1.2 STKaiti, KaiTi, serif; }
.hero-card p:last-child { max-width: 700px; margin: 0; color: #b8ccc4; line-height: 1.8; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; padding: 11px 20px; border: 1px solid transparent; border-radius: 11px; font-weight: 700; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--green-700); box-shadow: 0 10px 22px rgba(40,106,85,.2); }
.button-primary:hover { background: var(--green-800); }
.button-accent { position: relative; z-index: 1; flex: 0 0 auto; color: var(--green-950); background: var(--accent); }
.button-accent span { font-size: 20px; }
.button-secondary { color: white; background: var(--green-900); }
.button-ghost { border-color: var(--line); background: transparent; }
.button-danger { color: white; background: var(--danger); }
.button-wide { width: 100%; }
.button:disabled { color: #8d9692; background: #e8e9e6; box-shadow: none; cursor: not-allowed; transform: none; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.metric-grid.compact { margin-top: 0; }
.metric-card { display: flex; align-items: center; gap: 17px; min-height: 130px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: 0 8px 24px rgba(38,54,47,.035); }
.metric-icon { display: grid; place-items: center; flex: 0 0 46px; height: 46px; border-radius: 14px; font-family: STKaiti, KaiTi, serif; font-size: 19px; font-weight: 700; }
.metric-icon.green { color: var(--green-700); background: var(--green-100); }
.metric-icon.amber { color: #956e1f; background: var(--accent-light); }
.metric-icon.blue { color: var(--blue); background: var(--blue-light); }
.metric-icon.red { color: var(--danger); background: var(--danger-light); }
.metric-card small, .metric-card strong, .metric-card p { display: block; }
.metric-card small { color: var(--muted); font-size: 12px; font-weight: 700; }
.metric-card strong { margin-top: 4px; font: 700 30px/1.1 Georgia, serif; }
.metric-card p { margin: 5px 0 0; color: #9a9f9c; font-size: 10px; }

.split-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .7fr); gap: 20px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: 0 10px 30px rgba(38,54,47,.04); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 28px 20px; }
.panel-heading h2 { margin: 6px 0 0; font: 700 23px/1.2 STKaiti, KaiTi, serif; }
.panel-heading p:last-child { margin: 6px 0 0; color: var(--muted); line-height: 1.6; }
.panel-heading > a:not(.button) { color: var(--green-700); font-size: 12px; font-weight: 700; }
.job-list { padding: 0 16px 16px; }
.job-row { display: grid; grid-template-columns: minmax(145px, 1.4fr) 120px minmax(90px, .7fr) auto 18px; align-items: center; gap: 16px; padding: 16px 12px; border-top: 1px solid #ece9e1; transition: background .18s ease; }
.job-row:hover { border-radius: 12px; background: #f7f5ef; }
.date-block strong, .date-block small { display: block; }
.date-block strong { font-family: Georgia, serif; }
.date-block small, .operator { margin-top: 5px; color: var(--muted); font-size: 10px; }
.meal-pills { display: inline-flex; gap: 5px; }
.meal-pills i { padding: 4px 7px; border-radius: 7px; color: var(--green-700); background: var(--green-100); font-size: 10px; font-style: normal; font-weight: 700; }
.meal-pills i:last-child { color: #795a1c; background: var(--accent-light); }
.meal-pills i.muted { color: #aaa; background: #eee; opacity: .45; }
.status { display: inline-flex; align-items: center; justify-content: center; width: max-content; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.status-completed { color: #257054; background: #e5f3ec; }
.status-failed { color: #a23d35; background: var(--danger-light); }
.status-processing { color: #85651d; background: #fff2d2; }
.status-large { padding: 9px 14px; font-size: 12px; }
.chevron { color: #98a29e; font-size: 22px; }
.workflow-panel { padding-bottom: 12px; }
.steps { margin: 0; padding: 0 26px 22px; list-style: none; }
.steps li { position: relative; display: flex; gap: 14px; padding: 11px 0 21px; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 43px; bottom: 0; width: 1px; background: var(--line); }
.steps li > span { position: relative; z-index: 1; display: grid; place-items: center; flex: 0 0 31px; height: 31px; border-radius: 50%; color: var(--green-700); background: var(--green-100); font-family: Georgia, serif; font-weight: 700; }
.steps strong { font-size: 13px; }
.steps p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.empty { padding: 45px 25px 55px; text-align: center; color: var(--muted); }
.empty > span { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%; color: var(--green-700); background: var(--green-100); font: 700 20px STKaiti, KaiTi, serif; }
.empty h3 { margin: 0 0 5px; color: var(--ink); }
.empty p { margin: 0; }

.order-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(330px, .8fr); align-items: start; gap: 20px; }
.input-panel { padding-bottom: 24px; }
.format-badge, .count-badge { padding: 6px 10px; border-radius: 8px; color: var(--green-700); background: var(--green-100); font-size: 10px; font-weight: 800; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 150px; margin: 0 28px; border: 1.5px dashed #b9c8c1; border-radius: 14px; background: #f7faf8; cursor: pointer; transition: .2s ease; }
.dropzone:hover, .dropzone.dragging { border-color: var(--green-700); background: var(--green-100); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-mark { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 9px; border-radius: 50%; color: var(--green-700); background: white; font-size: 20px; box-shadow: 0 5px 15px rgba(35,75,60,.1); }
.dropzone strong { font-size: 13px; }
.dropzone small { margin-top: 5px; color: var(--muted); }
.divider { display: flex; align-items: center; gap: 12px; margin: 23px 28px; color: #9b9f9c; font-size: 10px; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { color: #35433e; font-size: 12px; font-weight: 700; }
.field > small { color: var(--muted); font-size: 10px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #d9d7cf; border-radius: 10px; outline: none; color: var(--ink); background: white; transition: border-color .18s, box-shadow .18s; }
.field input, .field select { height: 44px; padding: 0 13px; }
.field textarea { padding: 14px; resize: vertical; line-height: 1.65; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(40,106,85,.1); }
.textarea-field { margin: 0 28px; }
.textarea-field small { text-align: right; }
.side-stack { display: grid; gap: 20px; }
.check-panel { padding-bottom: 26px; }
.check-panel .button-stack, .check-panel .helper, .check-panel .validation-status, .check-panel .validation-stale { width: calc(100% - 56px); margin-left: 28px; }
.button-stack { display: grid; gap: 9px; }
.helper { color: var(--muted); font-size: 10px; line-height: 1.6; text-align: center; }
.validation-status { margin-bottom: 16px; padding: 13px 14px; border: 1px solid; border-radius: 11px; }
.validation-status strong { display: block; font-size: 12px; }
.validation-status p { margin: 5px 0 0; font-size: 10px; line-height: 1.55; }
.validation-ok { border-color: #b9d7c8; color: #24664f; background: #eff8f3; }
.validation-error { border-color: #e4b6b0; color: #9d3b34; background: #fff1ef; }
.validation-stale { margin-top: 10px; margin-bottom: 0; padding: 10px 12px; border-radius: 9px; color: #8a671c; background: #fff5d9; font-size: 10px; line-height: 1.5; }
.checklist { margin: 0 28px 23px; padding: 0; list-style: none; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eeece5; color: #4d5a55; }
.checklist li span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; color: var(--green-700); background: var(--green-100); font-weight: 800; }
.results-panel { padding-bottom: 22px; }
.result-summary { display: flex; align-items: center; gap: 13px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.result-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-weight: 900; }
.result-icon.good { color: #267055; background: var(--green-100); }
.result-icon.bad { color: var(--danger); background: var(--danger-light); }
.result-summary strong, .result-summary small { display: block; }
.result-summary small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.issue-list { display: grid; gap: 9px; max-height: 410px; padding: 16px 20px; overflow-y: auto; }
.issue-list.horizontal { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); max-height: none; }
.issue { padding: 12px 13px; border-left: 3px solid; border-radius: 5px 10px 10px 5px; }
.issue-error { border-color: var(--danger); background: var(--danger-light); }
.issue-warning { border-color: var(--accent); background: #fff8e8; }
.issue strong { font-size: 10px; }
.issue p { margin: 5px 0 0; font-size: 12px; line-height: 1.5; }
.issue code { display: block; margin-top: 7px; padding: 5px 7px; border-radius: 5px; background: rgba(255,255,255,.65); font-size: 10px; white-space: pre-wrap; }
details { margin: 0 20px; border-top: 1px solid var(--line); }
summary { padding: 15px 0; color: var(--green-700); cursor: pointer; font-weight: 700; }
details pre { max-height: 280px; padding: 12px; overflow: auto; border-radius: 9px; background: #f2f2ed; font-size: 10px; line-height: 1.6; }

.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; margin-bottom: 20px; }
.detail-head h2 { margin: 8px 0 4px; font: 700 31px STKaiti, KaiTi, serif; }
.detail-head p:last-child { margin: 0; color: var(--muted); }
.back-link { display: inline-block; margin-bottom: 24px; color: var(--green-700); font-size: 11px; font-weight: 700; }
.error-banner { margin-bottom: 20px; padding: 18px 22px; border: 1px solid #e6bab5; border-radius: 13px; color: #963a33; background: var(--danger-light); }
.error-banner p { margin: 6px 0 0; }
.download-panel, .warning-panel, .table-panel, .floor-summary-panel { margin-top: 20px; }
.file-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 0 28px 28px; }
.file-grid a { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; transition: .18s ease; }
.file-grid a:hover { border-color: #a7bdb3; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(32,61,49,.07); }
.file-grid a.downloading { border-color: var(--green-700); background: var(--green-100); }
.file-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: white; font-family: Georgia, serif; font-weight: 700; }
.file-icon.excel { background: #287658; }
.file-icon.text { background: #5f7181; }
.file-icon.image { color: var(--green-950); background: var(--accent); font-family: STKaiti, KaiTi, serif; }
.file-grid strong, .file-grid small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-grid strong { font-size: 12px; }
.file-grid small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.file-grid b { color: var(--green-700); font-size: 10px; }
.mobile-download-note { display: none; margin: -9px 28px 23px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.browser-guide { margin-bottom: 16px; padding: 18px 20px; border: 1px solid #ead39a; border-radius: 16px; color: #846422; background: #fff8e7; }
.browser-guide strong { display: block; font-size: 15px; }
.browser-guide p { margin: 8px 0 14px; line-height: 1.7; font-size: 13px; }
.browser-guide .button { min-height: 44px; }
.browser-guide-panel { padding-bottom: 28px; }
.browser-steps { margin: 0 28px 8px; padding: 0; list-style: none; }
.browser-steps li { display: grid; gap: 4px; padding: 14px 0; border-bottom: 1px solid #eeece5; }
.browser-steps li span { color: var(--muted); font-size: 12px; line-height: 1.6; }
.browser-guide-actions { justify-content: flex-start; flex-wrap: wrap; }
.browser-guide-panel .form-actions,
.image-preview-panel .form-actions { margin: 24px 28px 0; }
.image-preview-panel { padding-bottom: 28px; }
.preview-figure { margin: 0 28px 8px; }
.preview-figure img { display: block; width: 100%; border: 1px solid var(--line); border-radius: 12px; background: white; }
.preview-figure figcaption { margin-top: 10px; color: var(--muted); font-size: 12px; text-align: center; }
.floor-summary-wrap { padding: 0 28px 28px; }
.floor-summary-table { min-width: 760px; }
.floor-summary-table caption { padding: 16px 12px; color: white; background: var(--green-900); font: 700 18px/1.3 STKaiti, KaiTi, serif; }
.floor-summary-table thead th { color: white; background: #2f6654; text-align: center; }
.floor-summary-table td { text-align: center; font-variant-numeric: tabular-nums; }
.floor-summary-table tbody tr:nth-child(even) { background: #f8f7f2; }
.floor-summary-table .col-spicy { color: var(--danger); background: var(--danger-light); }
.floor-summary-table .col-mild { color: var(--green-700); background: var(--green-100); }
.floor-summary-table .is-total td { color: var(--green-900); background: var(--accent-light); font-weight: 800; }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { position: sticky; top: 0; z-index: 3; padding: 14px 20px; color: #3f4a45; background: #eef3f0; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-align: left; white-space: nowrap; box-shadow: inset 0 -1px 0 var(--line); }
td { padding: 14px 20px; border-bottom: 1px solid #eceae3; color: #4b5752; font-size: 13px; vertical-align: middle; }
tbody tr:hover { background: #faf9f5; }
.taste { display: inline-flex; padding: 4px 8px; border-radius: 8px; font-size: 10px; font-weight: 700; }
.taste-hot { color: var(--danger); background: var(--danger-light); }
.taste-mild { color: var(--green-700); background: var(--green-100); }
.row-link, .text-link { color: var(--green-700); font-weight: 700; white-space: nowrap; }

.filter-panel { padding: 20px 24px; }
.filters { display: flex; align-items: flex-end; gap: 14px; }
.filters .field { min-width: 160px; }
.filters .button { min-height: 44px; }
.filters .text-link { padding: 12px 4px; font-size: 11px; }
.person-cell { display: flex; align-items: center; gap: 10px; min-width: 130px; }
.person-cell small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.role { display: inline-flex; padding: 5px 8px; border-radius: 8px; font-size: 10px; font-weight: 700; }
.role-admin { color: #795918; background: var(--accent-light); }
.role-user { color: var(--green-700); background: var(--green-100); }
.permission { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 11px; font-weight: 800; }
.permission.yes { color: var(--green-700); background: var(--green-100); }
.permission.no { color: #aaa; background: #eee; }
.employee-sticky,
.page-sticky,
.dashboard-sticky { position: sticky; top: 0; z-index: 22; flex-shrink: 0; padding-bottom: 16px; background: var(--paper); }
.employee-sticky { padding-bottom: 20px; }
.employee-toolbar { padding-bottom: 24px; }
.employee-table-panel { margin-top: 0; }
.heading-panel { overflow: hidden; }
.page-sticky .filter-panel { margin-bottom: 16px; }
.page-sticky + .table-panel { margin-top: 0; }
.content:has(.dashboard-page),
.content:has(.list-page) { display: flex; flex-direction: column; overflow: hidden; }
.content:has(.dashboard-page) { padding-top: 12px; }
.dashboard-page,
.list-page { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.dashboard-page .hero-card { min-height: 0; padding: 22px 32px; }
.list-page .table-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.list-page .table-wrap { flex: 1; min-height: 0; }
.list-page .pagination { flex-shrink: 0; }
.dashboard-sticky { padding-bottom: 8px; }
.dashboard-sticky .metric-grid { margin: 10px 0 0; }
.dashboard-split { flex: 1; min-height: 0; margin-top: 12px; }
.jobs-panel { min-height: 0; overflow: auto; }
.workflow-panel { align-self: start; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.employee-search { display: flex; align-items: flex-end; gap: 12px; padding: 0 28px; }
.employee-search .field { width: min(420px, 100%); }
.employee-search .text-link { padding: 13px 4px; font-size: 11px; }
.employee-number { color: var(--green-700); font-family: Consolas, "SFMono-Regular", monospace; letter-spacing: .03em; }
.employee-import-panel .dropzone { margin: 0 28px; }
.import-hints { margin: 18px 28px 0; padding: 0; color: var(--muted); font-size: 12px; line-height: 1.7; list-style: none; }
.import-hints li { position: relative; padding-left: 14px; }
.import-hints li::before { content: "·"; position: absolute; left: 0; color: var(--green-700); font-weight: 800; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.pagination .button { min-height: 38px; padding: 8px 14px; }

.form-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); align-items: start; gap: 20px; }
.form-panel { padding-bottom: 28px; }
.form-panel > .field, .form-panel > .two-fields, .form-panel > .permission-box, .form-panel > .form-actions, .reset-panel > .button { margin-right: 28px; margin-left: 28px; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.form-panel > .field { margin-bottom: 18px; }
.permission-box { margin-top: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #f8f7f2; }
.permission-box > div:first-child p { margin: 4px 0 15px; color: var(--muted); font-size: 10px; }
.permission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.toggle { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span { position: relative; width: 36px; height: 21px; border-radius: 999px; background: #c6cac8; transition: .2s; }
.toggle span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: .2s; }
.toggle input:checked + span { background: var(--green-700); }
.toggle input:checked + span::after { transform: translateX(15px); }
.toggle input:disabled + span { opacity: .55; }
.toggle b { font-size: 11px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.employee-import-actions .template-download { margin-right: auto; }
.reset-panel { position: sticky; top: 20px; }
.narrow-wrap { max-width: 650px; margin: 0 auto; }
.narrow-wrap .form-panel { padding-top: 2px; }

.login-page { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(420px, 1.08fr) minmax(440px, .92fr); }
.login-story { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 48px clamp(40px, 6vw, 88px) 42px; color: white; background:
  radial-gradient(ellipse 80% 50% at 100% -10%, rgba(219,173,80,.16), transparent 55%),
  linear-gradient(165deg, #1a4638 0%, var(--green-950) 48%, #0c241e 100%); }
.login-story::before,
.login-story::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.login-story::before { width: 520px; height: 520px; right: -240px; top: -190px; border: 1px solid rgba(219,173,80,.22); box-shadow: 0 0 0 70px rgba(219,173,80,.04), 0 0 0 140px rgba(219,173,80,.02); }
.login-story::after { width: 280px; height: 280px; left: -120px; bottom: -80px; border: 1px solid rgba(255,255,255,.08); }
.brand-light { position: relative; z-index: 1; padding: 0; }
.story-copy { position: relative; z-index: 1; margin: auto 0; padding: 28px 0; }
.story-copy .eyebrow { color: var(--accent); }
.story-copy h1 { margin: 18px 0 22px; font: 700 clamp(44px, 5.6vw, 72px)/1.16 STKaiti, KaiTi, serif; letter-spacing: .03em; text-shadow: 0 10px 30px rgba(0,0,0,.18); }
.story-copy > p:last-of-type { max-width: 540px; margin: 0; color: #c3d4cc; font-size: 16px; line-height: 1.9; }
.story-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; padding: 0; list-style: none; }
.story-pills li { padding: 8px 12px; border: 1px solid rgba(219,173,80,.35); border-radius: 999px; color: var(--accent-light); background: rgba(219,173,80,.08); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.story-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-top: 28px; }
.story-stats span { padding: 16px 18px; border: 1px solid rgba(255,255,255,.08); border-radius: 16px; background: rgba(255,255,255,.04); }
.story-stats strong, .story-stats small { display: block; }
.story-stats strong { color: var(--accent); font: 700 26px Georgia, serif; }
.story-stats small { margin-top: 6px; color: #8ca49a; font-size: 11px; }
.login-panel { display: grid; place-items: center; padding: 48px 36px; background:
  radial-gradient(circle at 80% 10%, rgba(219,173,80,.12), transparent 28%),
  var(--paper); }
.login-card { width: min(420px, 100%); padding: 36px 34px 32px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); box-shadow: 0 24px 60px rgba(31, 48, 41, .08); }
.login-heading { margin-bottom: 28px; }
.login-mark { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 16px; padding: 6px; border-radius: 14px; background: white; box-shadow: 0 8px 20px rgba(38,54,47,.08); }
.login-mark img { width: 100%; height: 100%; object-fit: contain; }
.login-heading h2 { margin: 10px 0 8px; font: 700 34px/1.2 STKaiti, KaiTi, serif; }
.login-heading > p:last-child { color: var(--muted); line-height: 1.6; }
.login-card .field { margin-bottom: 16px; }
.login-card .button { margin-top: 10px; min-height: 48px; }
.login-note { margin-top: 18px; color: var(--muted); font-size: 11px; text-align: center; line-height: 1.6; }
.error-page { min-height: 55vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.error-page > span { color: var(--accent); font: 700 90px Georgia, serif; }
.error-page h2 { margin: 0 0 8px; font: 700 28px STKaiti, KaiTi, serif; }
.error-page p { margin: 0 0 24px; color: var(--muted); }
.guest-error { min-height: 100vh; }

@media (max-width: 1150px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .file-grid { grid-template-columns: repeat(2, 1fr); }
  .job-row { grid-template-columns: 1.4fr 100px auto 16px; }
  .job-row .operator { display: none; }
  .login-page { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  body.sidebar-open { overflow: hidden; }
  body.sidebar-open::after { content: ""; position: fixed; inset: 0; z-index: 20; background: rgba(9,31,25,.45); backdrop-filter: blur(1px); }
  .app-shell { display: block; height: auto; overflow: visible; }
  .main { height: auto; overflow: visible; }
  .content { overflow: visible; }
  .topbar { position: sticky; top: 0; }
  .employee-sticky,
  .page-sticky,
  .dashboard-sticky { top: 88px; }
  .content:has(.dashboard-page),
  .content:has(.list-page) { overflow: visible; display: block; }
  .dashboard-page,
  .dashboard-split,
  .jobs-panel,
  .list-page,
  .list-page .table-panel,
  .list-page .table-wrap { min-height: 0; overflow: visible; }
  .workflow-panel { position: static; }
  .sidebar { position: fixed; left: 0; top: 0; width: min(280px, 84vw); padding-top: calc(22px + env(safe-area-inset-top)); padding-bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-105%); transition: transform .24s ease; box-shadow: 20px 0 45px rgba(0,0,0,.25); }
  .sidebar.open { transform: translateX(0); }
  .menu-button { display: block; }
  .split-grid, .order-layout, .form-grid { grid-template-columns: 1fr; }
  .reset-panel { position: static; }
  .login-page { grid-template-columns: 1fr; }
  .login-story { min-height: 46vh; padding: 35px; }
  .story-copy { margin: 70px 0; }
  .story-stats { display: none; }
  .login-panel { min-height: 54vh; padding: 36px 24px; }
  .login-card { padding: 28px 22px; }
}

@media (max-width: 650px) {
  .topbar { min-height: 82px; padding: calc(15px + env(safe-area-inset-top)) calc(18px + env(safe-area-inset-right)) 15px calc(18px + env(safe-area-inset-left)); }
  .content { padding: 20px calc(14px + env(safe-area-inset-right)) calc(45px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left)); }
  .profile-link { display: none; }
  .hero-card { align-items: flex-start; flex-direction: column; padding: 28px 24px; }
  .dashboard-page .hero-card { padding: 20px 22px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { min-height: 108px; padding: 16px; gap: 11px; }
  .metric-icon { flex-basis: 38px; height: 38px; }
  .metric-card strong { font-size: 24px; }
  .metric-card p { display: none; }
  .panel-heading { align-items: flex-start; padding: 22px 20px 17px; }
  .panel-heading .button { padding: 9px 12px; font-size: 11px; }
  .job-row { grid-template-columns: 1fr auto 14px; padding: 15px 6px; }
  .job-row .meal-pills { display: none; }
  .dropzone, .textarea-field, .divider, .checklist { margin-right: 20px; margin-left: 20px; }
  .check-panel .button-stack, .check-panel .helper, .check-panel .validation-status, .check-panel .validation-stale { width: calc(100% - 40px); margin-left: 20px; }
  .download-panel .panel-heading { flex-direction: column; }
  .download-panel .panel-heading .button { width: 100%; min-height: 48px; }
  .file-grid { grid-template-columns: 1fr; padding: 0 20px 20px; }
  .file-grid a { min-height: 74px; padding: 13px; touch-action: manipulation; }
  .file-grid strong { white-space: normal; overflow-wrap: anywhere; }
  .file-grid b { font-size: 11px; }
  .mobile-download-note { display: block; margin: -7px 20px 20px; }
  .floor-summary-wrap { padding: 0 14px 20px; }
  .floor-summary-table th, .floor-summary-table td { padding: 10px 8px; }
  .browser-guide .button { width: 100%; }
  .browser-steps, .preview-figure { margin-right: 20px; margin-left: 20px; }
  .browser-guide-panel .form-actions,
  .image-preview-panel .form-actions { margin-right: 20px; margin-left: 20px; }
  .filters { align-items: stretch; flex-direction: column; }
  .filters .field { width: 100%; }
  .two-fields, .permission-grid { grid-template-columns: 1fr; }
  .employee-toolbar .panel-heading { flex-direction: column; }
  .employee-sticky,
  .page-sticky,
  .dashboard-sticky { top: 82px; }
  .employee-toolbar .heading-actions { width: 100%; flex-direction: column; }
  .employee-toolbar .panel-heading .button { width: 100%; min-height: 46px; }
  .employee-import-panel .dropzone, .import-hints { margin-right: 20px; margin-left: 20px; }
  .employee-import-actions { flex-direction: column; }
  .employee-import-actions .template-download { margin-right: 0; }
  .employee-import-actions .button { width: 100%; min-height: 46px; }
  .employee-search { align-items: stretch; flex-direction: column; padding: 0 20px; }
  .employee-search .field { width: 100%; }
  .employee-search .button { width: 100%; }
  .mobile-table, .mobile-table tbody, .mobile-table tr, .mobile-table td { display: block; width: 100%; }
  .mobile-table thead { display: none; }
  .mobile-table tbody { padding: 0 14px 14px; }
  .mobile-table tr { margin-bottom: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 13px; background: white; }
  .mobile-table td { display: grid; grid-template-columns: 90px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 40px; padding: 9px 0; border-top: 1px solid #efede6; text-align: right; }
  .mobile-table td:first-child { border-top: 0; }
  .mobile-table td::before { content: attr(data-label); color: var(--muted); font-size: 10px; font-weight: 700; text-align: left; }
  .mobile-table td:last-child { display: block; min-height: 0; text-align: right; }
  .mobile-table td:last-child::before { content: none; }
  .mobile-table .status { margin-left: auto; }
  .pagination { flex-wrap: wrap; gap: 10px; }
  .pagination span { width: 100%; text-align: center; order: -1; }
  .form-panel > .field, .form-panel > .two-fields, .form-panel > .permission-box, .form-panel > .form-actions, .reset-panel > .button { margin-right: 20px; margin-left: 20px; }
  .login-story { min-height: 380px; padding: 28px 24px; }
  .story-copy { margin: 36px 0 20px; }
  .story-copy h1 { font-size: 40px; }
  .story-copy > p:last-of-type { font-size: 13px; }
  .login-panel { padding: 32px 18px 40px; }
  .guest-icp { position: absolute; right: 0; bottom: 12px; left: 0; text-align: center; }
  .detail-head { flex-direction: column; gap: 14px; }
  .field input, .field select, .field textarea { font-size: 16px; }
  .button { min-height: 46px; }
  th, td { padding-right: 14px; padding-left: 14px; }
}
