:root {
  color-scheme: light;
  --ink: #18211e;
  --muted: #66736e;
  --line: #d9e0dc;
  --surface: #ffffff;
  --canvas: #f3f6f4;
  --primary: #174f43;
  --primary-2: #237562;
  --primary-soft: #e8f3ef;
  --blue: #2563a5;
  --blue-soft: #eaf2fb;
  --amber: #a85f0d;
  --amber-soft: #fff2db;
  --red: #a63b36;
  --red-soft: #fbeceb;
  --green: #20734e;
  --green-soft: #e6f4eb;
  --shadow: 0 8px 24px rgba(28, 47, 40, 0.08);
  --sidebar: 232px;
  --topbar: 78px;
  --bottom-nav: 70px;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: var(--canvas); letter-spacing: 0; }
button, input, textarea { font: inherit; letter-spacing: 0; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(37, 99, 165, 0.2); outline-offset: 2px; }
svg { width: 20px; height: 20px; stroke-width: 2; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar); padding: 24px 16px; background: #143f36; color: #fff; display: flex; flex-direction: column; }
.brand { height: 54px; display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand-logo { width: 50px; height: 50px; flex: 0 0 50px; object-fit: contain; background: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 6px; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 16px; }
.brand span { margin-top: 2px; color: rgba(255,255,255,.68); font-size: 12px; }
.side-nav { display: grid; gap: 6px; margin-top: 38px; }
.nav-item { position: relative; width: 100%; height: 48px; border: 0; background: transparent; color: rgba(255,255,255,.72); border-radius: 6px; display: flex; align-items: center; gap: 12px; padding: 0 14px; cursor: pointer; text-align: left; }
.nav-item:hover, .nav-item.is-active { background: rgba(255,255,255,.11); color: #fff; }
.nav-item.is-active::before { content: ""; position: absolute; left: -16px; width: 4px; height: 28px; background: #f1b84b; border-radius: 0 3px 3px 0; }
.nav-item b { margin-left: auto; min-width: 24px; height: 22px; border-radius: 11px; background: rgba(255,255,255,.14); display: grid; place-items: center; font-size: 11px; }
.source-panel { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding: 18px 8px 0; display: flex; align-items: center; gap: 10px; }
.source-dot { width: 9px; height: 9px; border-radius: 50%; background: #64d39a; box-shadow: 0 0 0 4px rgba(100,211,154,.12); }
.source-panel strong, .source-panel span { display: block; }
.source-panel strong { font-size: 12px; }
.source-panel span { margin-top: 3px; color: rgba(255,255,255,.58); font-size: 11px; }

.workspace { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 15; height: var(--topbar); padding: 0 32px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 12px; }
.topbar h1 { margin: 0; font-size: 22px; line-height: 1.15; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.shift-switch { height: 36px; padding: 3px; background: #edf2ef; border: 1px solid var(--line); border-radius: 6px; display: grid; grid-template-columns: repeat(2, 54px); gap: 2px; }
.shift-switch button { border: 0; background: transparent; border-radius: 4px; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 700; }
.shift-switch button.is-active { background: var(--surface); color: var(--primary); box-shadow: 0 1px 4px rgba(21,43,35,.12); }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; display: grid; place-items: center; cursor: pointer; }
.icon-button:hover { border-color: #9eb3aa; background: #f8faf9; }
.icon-button.small { width: 34px; height: 34px; border: 0; background: transparent; }
.inspector-button { height: 44px; padding: 0 11px 0 5px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; display: flex; align-items: center; gap: 8px; cursor: default; user-select: none; }
.inspector-button svg { width: 16px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); border-radius: 5px; font-weight: 800; }

main { padding: 28px 32px 48px; }
.screen { display: none; max-width: 1440px; margin: 0 auto; }
.screen.is-active { display: block; }
.sync-notice { min-height: 42px; margin-bottom: 18px; padding: 9px 12px; background: var(--blue-soft); color: #194d78; border: 1px solid #cfe0f3; border-radius: 6px; display: flex; align-items: center; gap: 9px; font-size: 13px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric { min-height: 98px; padding: 18px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; display: flex; align-items: center; gap: 14px; cursor: pointer; text-align: left; }
.metric:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.metric-icon { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; border-radius: 6px; }
.metric-icon svg { width: 24px; height: 24px; }
.metric b, .metric small { display: block; }
.metric b { font-size: 27px; line-height: 1; }
.metric small { margin-top: 7px; color: var(--muted); font-size: 12px; }
.metric-amber .metric-icon { background: var(--amber-soft); color: var(--amber); }
.metric-blue .metric-icon { background: var(--blue-soft); color: var(--blue); }
.metric-red .metric-icon { background: var(--red-soft); color: var(--red); }
.metric-green .metric-icon { background: var(--green-soft); color: var(--green); }

.quick-section, .task-section, .recent-section { margin-top: 30px; }
.section-heading { margin-bottom: 14px; }
.section-heading span { color: var(--muted); font-size: 11px; }
.section-heading h2 { margin: 3px 0 0; font-size: 17px; }
.row-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.text-button { border: 0; background: transparent; color: var(--primary); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 13px; }
.text-button svg { width: 16px; }
.quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.quick-action { height: 74px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 0 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 700; }
.quick-action svg { color: var(--primary); }
.quick-action:hover { border-color: #8fa89e; box-shadow: var(--shadow); }
.quick-action.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.quick-action.primary svg { color: #fff; }

.task-list, .order-list, .record-list { display: grid; gap: 10px; }
.task-card, .order-card, .record-card { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; }
.task-card { min-height: 96px; padding: 15px 16px; display: grid; grid-template-columns: 1.4fr .8fr .7fr auto; gap: 18px; align-items: center; }
.task-card:hover, .order-card:hover { border-color: #9eb3aa; box-shadow: var(--shadow); }
.task-main { min-width: 0; }
.task-main strong, .task-main span { display: block; }
.task-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.task-main span { margin-top: 6px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-data { min-width: 0; }
.task-data small, .task-data b { display: block; }
.task-data small { color: var(--muted); font-size: 11px; }
.task-data b { margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.task-actions { display: flex; gap: 8px; }

.button { min-height: 42px; padding: 0 16px; border: 1px solid transparent; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; font-weight: 700; }
.button svg { width: 18px; }
.button.primary { background: var(--primary); color: #fff; }
.button.primary:hover { background: #103e34; }
.button.secondary { border-color: var(--line); background: var(--surface); color: var(--ink); }
.button:disabled, .button[disabled] { border-color: #cbd3cf; background: #dfe5e2; color: #7b8782; cursor: not-allowed; box-shadow: none; opacity: 1; }
.button.small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.status { display: inline-flex; align-items: center; width: fit-content; min-height: 24px; padding: 0 8px; border-radius: 4px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-待首件 { background: var(--amber-soft); color: var(--amber); }
.status-巡检到期 { background: var(--blue-soft); color: var(--blue); }
.status-异常冻结, .status-不合格 { background: var(--red-soft); color: var(--red); }
.status-已完成, .status-合格, .status-生产中 { background: var(--green-soft); color: var(--green); }
.status-待完善 { background: #eef0ef; color: #5b6561; }

.record-card { padding: 12px 14px; display: grid; grid-template-columns: minmax(160px, 1.4fr) .8fr .8fr .8fr auto; gap: 14px; align-items: center; }
.record-card strong, .record-card span, .record-card small { display: block; }
.record-card span, .record-card small { color: var(--muted); font-size: 11px; }
.record-card strong { margin-top: 4px; font-size: 13px; }
.empty-state { min-height: 220px; color: var(--muted); display: grid; place-content: center; justify-items: center; gap: 9px; text-align: center; }
.empty-state svg { width: 34px; height: 34px; color: #9dafaa; }
.empty-state strong { color: #4c5d56; }
.empty-state span { font-size: 12px; }

.mobile-search { height: 44px; max-width: 520px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 0 8px 0 13px; display: flex; align-items: center; gap: 9px; }
.mobile-search > svg { width: 18px; color: var(--muted); }
.mobile-search input, .picker-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; }
.order-toolbar { display: flex; align-items: center; gap: 9px; }
.order-toolbar .mobile-search { flex: 1; }
.order-date-filter { height: 44px; padding: 0 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; display: flex; align-items: center; gap: 7px; }
.order-date-filter svg { width: 17px; color: var(--muted); }
.order-date-filter span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.order-date-filter input { min-width: 120px; border: 0; background: transparent; color: var(--ink); font-size: 11px; }
.filter-tabs { margin: 16px 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tabs button { height: 34px; padding: 0 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 5px; white-space: nowrap; cursor: pointer; font-size: 12px; }
.filter-tabs button.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.order-layout { display: grid; grid-template-columns: minmax(340px, .8fr) minmax(420px, 1.2fr); gap: 16px; align-items: start; }
.order-list { max-height: calc(100vh - 190px); overflow-y: auto; padding-right: 3px; }
.order-card { padding: 15px; cursor: pointer; }
.order-card.is-selected { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.order-card-top, .order-card-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.order-card h3 { margin: 12px 0 5px; font-size: 14px; }
.order-card p { margin: 0; color: var(--muted); font-size: 12px; }
.order-card-bottom { margin-top: 14px; color: var(--muted); font-size: 11px; }
.order-card-bottom span { display: inline-flex; align-items: center; gap: 5px; }
.order-card-bottom svg { width: 14px; }
.order-detail { position: sticky; top: calc(var(--topbar) + 18px); min-height: 420px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; overflow: hidden; }
.detail-header { padding: 20px; border-bottom: 1px solid var(--line); }
.detail-header-row { display: flex; justify-content: space-between; gap: 14px; }
.detail-header h2 { margin: 8px 0 5px; font-size: 18px; }
.detail-header p { margin: 0; color: var(--muted); font-size: 12px; }
.detail-meta { margin-top: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.detail-meta div { padding: 10px; background: var(--canvas); border-radius: 5px; }
.detail-meta span, .detail-meta strong { display: block; }
.detail-meta span { color: var(--muted); font-size: 10px; }
.detail-meta strong { margin-top: 5px; font-size: 12px; }
.node-flow { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.node-flow h3, .detail-records h3 { margin: 0 0 13px; font-size: 13px; }
.node-list { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.node-item { position: relative; text-align: center; color: var(--muted); font-size: 10px; }
.node-item::after { content: ""; position: absolute; left: 58%; right: -42%; top: 10px; height: 2px; background: var(--line); }
.node-item:last-child::after { display: none; }
.node-dot { position: relative; z-index: 1; width: 22px; height: 22px; margin: 0 auto 6px; border: 2px solid var(--line); background: var(--surface); border-radius: 50%; display: grid; place-items: center; }
.node-item.is-done .node-dot { background: var(--green); border-color: var(--green); color: #fff; }
.node-item.is-na .node-dot { background: #ecefed; border-color: #d3d9d5; }
.node-item.is-done::after { background: #83b99d; }
.node-dot svg { width: 12px; height: 12px; }
.detail-actions { padding: 16px 20px; display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--line); }
.detail-records { padding: 18px 20px; }

.toolbar { margin-bottom: 16px; display: flex; justify-content: space-between; gap: 12px; }
.record-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.record-table { width: 100%; border-collapse: collapse; min-width: 980px; }
.record-table th { height: 42px; padding: 0 12px; background: #eef2f0; color: #52615c; text-align: left; font-size: 11px; white-space: nowrap; }
.record-table td { height: 54px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12px; }
.record-table td small { color: var(--muted); }
.mobile-only { display: none; }

.tool-summary { display: flex; gap: 12px; margin-bottom: 18px; }
.tool-summary > div { min-width: 160px; min-height: 74px; padding: 12px 16px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; }
.tool-summary span, .tool-summary small { display: block; color: var(--muted); font-size: 10px; }
.tool-summary strong { display: inline-block; margin: 5px 7px 0 0; font-size: 24px; }
.tool-summary small { display: inline; }
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tool-card { min-height: 148px; padding: 15px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; }
.tool-card-top { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.tool-card-icon { width: 36px; height: 36px; background: var(--primary-soft); color: var(--primary); border-radius: 5px; display: grid; place-items: center; }
.tool-card h3 { margin: 12px 0 4px; font-size: 13px; }
.tool-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.tool-card footer { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }

.report-toolbar { margin-bottom: 14px; display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.date-filter, .toolbar-actions { display: flex; gap: 10px; }
.date-filter label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.date-filter input, .report-panel select, .analytics-screen select, .analysis-form select { height: 38px; min-width: 142px; padding: 0 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 5px; color: var(--ink); }
.report-kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.report-kpis > div { min-height: 84px; padding: 15px 17px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; }
.report-kpis span, .report-kpis small { display: block; color: var(--muted); font-size: 10px; }
.report-kpis strong { display: inline-block; margin: 8px 6px 0 0; font-size: 25px; line-height: 1; }
.report-kpis small { display: inline; }
.analytics-tabs, .special-report-tabs { margin: 18px 0 12px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.analytics-tabs button, .special-report-tabs button { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 5px; color: var(--muted); cursor: pointer; white-space: nowrap; font-size: 11px; }
.analytics-tabs button.is-active, .special-report-tabs button.is-active { border-color: var(--primary); background: var(--primary); color: #fff; }
.analytics-panel { display: none; }
.analytics-panel.is-active { display: block; }
.chart-grid, .qc-tool-grid { display: grid; gap: 12px; }
.chart-grid.two, .qc-tool-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.report-panel { min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; overflow: hidden; }
.report-panel > header { min-height: 58px; padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.report-panel header span, .report-panel header h2 { display: block; }
.report-panel header span { color: var(--muted); font-size: 9px; }
.report-panel header h2 { margin: 3px 0 0; font-size: 14px; }
.report-panel.wide, .fishbone-panel { grid-column: 1 / -1; }
.chart-frame { position: relative; height: 300px; padding: 12px; }
.chart-frame canvas { width: 100% !important; height: 100% !important; }
.chart-note { margin: -4px 14px 12px; color: var(--muted); font-size: 10px; }
.report-table-panel { margin-top: 12px; }
.report-table-wrap { overflow: auto; }
.report-table-wrap table, .mini-table table { width: 100%; border-collapse: collapse; min-width: 720px; }
.report-table-wrap th, .mini-table th { height: 38px; padding: 0 11px; background: #eef2f0; color: #52615c; text-align: left; font-size: 10px; white-space: nowrap; }
.report-table-wrap td, .mini-table td { min-height: 44px; padding: 9px 11px; border-top: 1px solid var(--line); font-size: 11px; }
.report-table-wrap td small { color: var(--muted); }
.empty-cell { height: 90px; color: var(--muted); text-align: center; }
.mini-table { max-height: 300px; overflow: auto; }
.mini-table table { min-width: 440px; }
.inline-selects { display: flex; gap: 6px; }
.inline-selects select { min-width: 108px; max-width: 140px; }
.chart-empty { min-height: 260px; padding: 20px; color: var(--muted); display: grid; place-content: center; justify-items: center; gap: 7px; text-align: center; font-size: 11px; }
.chart-empty strong, .chart-empty span { display: block; }

.fishbone { min-height: 330px; padding: 18px; display: grid; grid-template-columns: minmax(160px,.7fr) minmax(420px,1.6fr) minmax(160px,.7fr); align-items: center; gap: 16px; }
.fishbone-problem, .fishbone-root { padding: 14px; border-left: 4px solid var(--red); background: var(--red-soft); border-radius: 0 6px 6px 0; }
.fishbone-root { border-color: var(--green); background: var(--green-soft); }
.fishbone-problem span, .fishbone-root span { display: block; color: var(--muted); font-size: 9px; }
.fishbone-problem strong, .fishbone-root strong { display: block; margin-top: 6px; font-size: 12px; line-height: 1.6; }
.fishbone-spine { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px 14px; }
.fishbone-spine::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; background: var(--primary); }
.bone { position: relative; z-index: 1; min-height: 112px; padding: 10px; background: var(--canvas); border: 1px solid var(--line); border-radius: 6px; }
.bone b { width: 25px; height: 25px; background: var(--primary); color: #fff; border-radius: 4px; display: grid; place-items: center; font-size: 11px; }
.bone ul { margin: 7px 0 0; padding-left: 14px; color: #44554e; font-size: 9px; line-height: 1.65; }

.cause-analysis-list { display: grid; gap: 10px; }
.cause-card { padding: 15px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; }
.cause-card header { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.cause-card header span { color: var(--muted); font-size: 9px; }
.cause-card h3 { margin: 4px 0 0; font-size: 14px; }
.cause-card > p { margin: 12px 0; color: #43534d; font-size: 11px; line-height: 1.6; }
.cause-card dl { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cause-card dl div { min-width: 0; padding: 9px; background: var(--canvas); border-radius: 5px; }
.cause-card dt { color: var(--muted); font-size: 9px; }
.cause-card dd { margin: 5px 0 0; font-size: 10px; line-height: 1.5; }

.form-section-heading { min-height: 30px; display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.legend-text { color: #53635d; font-size: 11px; font-weight: 700; }
.field-help { margin: 7px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.dynamic-entry-list { display: grid; gap: 8px; }
.dynamic-entry { position: relative; padding: 10px 42px 4px 10px; border: 1px solid var(--line); background: var(--canvas); border-radius: 6px; display: grid; gap: 8px; }
.defect-entry { grid-template-columns: 1.5fr .75fr .65fr 1fr; }
.measurement-entry { grid-template-columns: 1fr 2fr .7fr repeat(3,.7fr); }
.dynamic-entry label { min-width: 0; }
.dynamic-entry label span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.dynamic-entry input, .dynamic-entry select { width: 100%; height: 36px; padding: 0 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 5px; font-size: 10px; }
.dynamic-entry .remove-entry { position: absolute; top: 21px; right: 7px; color: var(--red); }
.analysis-form { padding: 18px; }
.analysis-form .field select { width: 100%; min-width: 0; height: 44px; }
.fishbone-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 10px; }
.wide-button { width: 100%; }

.bottom-nav { display: none; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(16, 28, 24, .46); }
.bottom-sheet { position: fixed; z-index: 55; top: 0; right: 0; bottom: 0; width: min(620px, 100%); background: var(--surface); box-shadow: -14px 0 40px rgba(21,43,35,.16); overflow-y: auto; }
.sheet-header { position: sticky; top: 0; z-index: 2; min-height: 76px; padding: 12px 18px; background: rgba(255,255,255,.98); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; }
.sheet-header span, .sheet-header h2 { display: block; }
.sheet-header > div > span { color: var(--muted); font-size: 10px; }
.sheet-header h2 { margin: 3px 0 0; font-size: 17px; }
.readonly-badge { height: 28px; padding: 0 8px; background: var(--primary-soft); color: var(--primary); border-radius: 4px; display: inline-flex !important; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; }
.readonly-badge svg { width: 14px; }
#inspection-form { padding: 18px; }
.bound-order { margin-bottom: 18px; padding: 14px; background: #edf3f0; border-left: 4px solid var(--primary); border-radius: 0 6px 6px 0; }
.bound-order strong, .bound-order span { display: block; }
.bound-order strong { font-size: 14px; }
.bound-order span { margin-top: 6px; color: var(--muted); font-size: 11px; }
.form-section { min-width: 0; margin: 0 0 18px; padding: 0; border: 0; }
.form-section legend { width: 100%; margin-bottom: 9px; color: #53635d; font-size: 11px; font-weight: 700; }
.segmented { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.segmented label { min-width: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { min-height: 40px; padding: 0 5px; background: var(--surface); border-right: 1px solid var(--line); display: grid; place-items: center; cursor: pointer; font-size: 11px; white-space: nowrap; }
.segmented label:last-child span { border-right: 0; }
.segmented input:checked + span { background: var(--primary); color: #fff; }
.form-grid { display: grid; gap: 10px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 6px; color: #53635d; font-size: 11px; font-weight: 700; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 0 12px; color: var(--ink); }
.field input { height: 44px; }
.field textarea { min-height: 82px; padding-top: 10px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--blue); }
.test-panel { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.test-heading { min-height: 58px; padding: 9px 12px; display: flex; align-items: center; gap: 10px; }
.water-panel .test-heading { background: var(--blue-soft); }
.oil-panel .test-heading { background: var(--amber-soft); }
.test-icon { width: 36px; height: 36px; border-radius: 5px; display: grid; place-items: center; }
.water-panel .test-icon { background: #d7e8fa; color: var(--blue); }
.oil-panel .test-icon { background: #f9dfb4; color: var(--amber); }
.test-heading > div { flex: 1; }
.test-heading strong, .test-heading small { display: block; }
.test-heading strong { font-size: 13px; }
.test-heading small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.switch { position: relative; width: 42px; height: 24px; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 12px; background: #b8c1bd; cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform .15s ease; }
.switch input:checked + span { background: var(--primary-2); }
.switch input:checked + span::after { transform: translateX(18px); }
.test-fields { padding: 13px; }
.test-panel:not(.is-required) .test-fields { display: none; }
.test-meta { min-height: 58px; margin-bottom: 10px; padding: 10px 12px; background: var(--canvas); border-radius: 6px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5px 12px; }
.test-meta span { color: var(--muted); font-size: 10px; }
.test-meta strong { font-size: 13px; text-align: right; }
.test-controls { margin-bottom: 10px; display: grid; grid-template-columns: 1fr; gap: 8px; }
.test-controls .button { justify-content: center; }
.result-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.result-selector.two { grid-template-columns: repeat(2, 1fr); }
.result-selector button { min-height: 38px; border: 1px solid var(--line); background: var(--surface); border-radius: 5px; display: flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer; font-size: 11px; }
.result-selector button svg { width: 15px; }
.result-selector button.is-selected[data-value="合格"] { background: var(--green-soft); border-color: #85bea0; color: var(--green); }
.result-selector button.is-selected[data-value="不合格"] { background: var(--red-soft); border-color: #d69b96; color: var(--red); }
.result-selector button.is-selected[data-value="未完成"] { background: #eef0ef; border-color: #bfc8c4; }
.result-selector button.is-selected[data-value="无异味"] { background: var(--green-soft); border-color: #85bea0; color: var(--green); }
.result-selector button.is-selected[data-value="有异味"] { background: var(--red-soft); border-color: #d69b96; color: var(--red); }
.test-result-group + .test-result-group { margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--line); }
.test-result-group > span { display: block; margin-bottom: 7px; color: #53635d; font-size: 10px; font-weight: 700; }
.tool-picker { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; max-height: 220px; overflow-y: auto; }
.tool-option { min-height: 48px; padding: 7px 9px; border: 1px solid var(--line); background: var(--surface); border-radius: 5px; display: flex; align-items: center; gap: 8px; cursor: pointer; text-align: left; }
.tool-option.is-selected { border-color: var(--primary); background: var(--primary-soft); }
.tool-option input { width: 17px; height: 17px; accent-color: var(--primary); }
.tool-option span, .tool-option small { display: block; min-width: 0; }
.tool-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; }
.tool-option small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.inline-status { min-height: 38px; margin-top: 8px; padding: 0 10px; background: var(--canvas); border-radius: 5px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; }
.inline-status strong { color: var(--muted); }
.inline-status strong.is-valid { color: var(--green); }
.inline-status strong.is-invalid { color: var(--red); }
.inspection-checklist { display: grid; gap: 7px; }
.checklist-item { min-height: 44px; padding: 8px 11px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.checklist-item input { width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--primary); }
.checklist-item span { font-size: 11px; line-height: 1.45; }
.checklist-item:has(input:checked) { border-color: #8eb9aa; background: var(--primary-soft); }
.counter-field span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; text-align: center; }
.counter-field input { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 6px; text-align: center; font-weight: 800; }
.photo-field { margin-bottom: 18px; }
.photo-field > label { min-height: 62px; padding: 10px 13px; border: 1px dashed #a8b5b0; border-radius: 6px; display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; cursor: pointer; }
.photo-field label svg { grid-row: 1 / 3; color: var(--primary); }
.photo-field label span { font-size: 12px; font-weight: 700; }
.photo-field label small { color: var(--muted); font-size: 10px; }
.photo-field input { display: none; }
#photo-preview { height: 120px; margin-top: 8px; border-radius: 6px; background-size: cover; background-position: center; }
.qr-photo-button { width: 100%; margin-top: 8px; justify-content: center; }
.qr-photo-status { margin-top: 8px; padding: 9px 11px; background: var(--green-soft); color: var(--green); border-radius: 6px; font-size: 10px; font-weight: 700; }
.qr-content { padding: 28px 18px 34px; display: grid; place-items: center; text-align: center; }
#qr-code { width: 244px; min-height: 244px; padding: 12px; border: 1px solid var(--line); background: #fff; border-radius: 8px; display: grid; place-items: center; }
.qr-content strong { margin-top: 16px; font-size: 14px; }
.qr-content small { margin-top: 6px; color: var(--muted); font-size: 10px; }
.qr-sheet { top: auto; left: 50%; right: auto; bottom: 0; width: min(420px, 100%); max-height: 82vh; transform: translateX(-50%); border-radius: 8px 8px 0 0; }
.sheet-footer { position: sticky; bottom: -18px; margin: 0 -18px -18px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.98); border-top: 1px solid var(--line); }
.form-gate { min-height: 28px; margin-bottom: 8px; color: var(--muted); display: flex; align-items: center; gap: 7px; font-size: 10px; }
.form-gate svg { width: 15px; }
.form-gate.is-pass { color: var(--green); }
.form-gate.is-fail { color: var(--red); }
.submit-button { width: 100%; height: 48px; }
.picker-sheet { top: auto; left: 50%; right: auto; bottom: 0; width: min(620px, 100%); max-height: 86vh; transform: translateX(-50%); border-radius: 8px 8px 0 0; }
.picker-search { height: 44px; margin: 14px 18px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; display: flex; align-items: center; gap: 8px; }
.picker-orders { padding: 0 18px 24px; display: grid; gap: 8px; }
.picker-orders.is-multi { padding-bottom: 88px; }
.picker-order { width: 100%; padding: 13px; border: 1px solid var(--line); background: var(--surface); border-radius: 7px; cursor: pointer; text-align: left; }
.picker-order strong, .picker-order span { display: block; }
.picker-order strong { font-size: 13px; }
.picker-order span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.picker-order-select { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 10px; }
.picker-order-select input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--primary); }
.picker-order-select > span { margin-top: 0; min-width: 0; }
.picker-order-select > span small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.picker-order-select.is-selected { border-color: var(--primary); background: var(--primary-soft); }
.picker-test-types { margin: 0 18px 12px; display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.picker-test-types button { height: 38px; border: 0; border-right: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13px; }
.picker-test-types button:last-child { border-right: 0; }
.picker-test-types button.is-active { background: var(--primary); color: #fff; }
.picker-footer { position: sticky; bottom: 0; z-index: 2; min-height: 66px; padding: 12px 18px; border-top: 1px solid var(--line); background: rgba(255,255,255,.98); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.picker-footer span { color: var(--muted); font-size: 12px; }
.picker-footer .button { min-width: 154px; }
.simple-form { padding: 18px; }
.simple-form .button { width: 100%; }
.toast-region { position: fixed; z-index: 80; top: 16px; right: 16px; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 380px; min-height: 48px; padding: 11px 13px; background: #182d26; color: #fff; border-radius: 6px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 9px; font-size: 12px; }
.toast.is-error { background: #7c2f2b; }
.toast svg { width: 17px; }

@media (max-width: 1080px) {
  .metrics, .quick-actions { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .report-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tool-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .task-card { grid-template-columns: 1.3fr .7fr auto; }
  .task-card .task-data:nth-of-type(3) { display: none; }
}

@media (max-width: 820px) {
  :root { --topbar: 68px; }
  body { padding-bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .workspace { margin-left: 0; }
  .topbar { height: var(--topbar); padding: 0 16px; }
  .topbar h1 { font-size: 18px; }
  .eyebrow { font-size: 10px; }
  .inspector-button { max-width: 150px; }
  .inspector-button > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main { padding: 16px 14px 28px; }
  .bottom-nav { position: fixed; inset: auto 0 0; z-index: 40; height: calc(var(--bottom-nav) + env(safe-area-inset-bottom)); padding: 5px 8px env(safe-area-inset-bottom); background: rgba(255,255,255,.98); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); }
  .bottom-nav button { min-width: 0; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; align-content: center; gap: 2px; font-size: 9px; }
  .bottom-nav button.is-active { color: var(--primary); }
  .bottom-nav svg { width: 21px; height: 21px; }
  .bottom-nav .bottom-create { width: 48px; height: 48px; place-self: center; margin-top: -23px; background: var(--primary); color: #fff; border: 5px solid var(--surface); border-radius: 50%; box-shadow: 0 5px 14px rgba(23,79,67,.28); }
  .bottom-nav .bottom-create svg { width: 23px; height: 23px; }
  .metrics { gap: 8px; }
  .metric { min-height: 78px; padding: 11px; gap: 10px; }
  .metric-icon { width: 38px; height: 38px; flex-basis: 38px; }
  .metric-icon svg { width: 20px; }
  .metric b { font-size: 21px; }
  .metric small { margin-top: 5px; font-size: 10px; }
  .quick-section, .task-section, .recent-section { margin-top: 22px; }
  .quick-actions { gap: 8px; }
  .quick-action { height: 58px; padding: 0 10px; gap: 8px; font-size: 11px; }
  .quick-action svg { width: 18px; }
  .task-card { min-height: 0; padding: 13px; grid-template-columns: 1fr auto; gap: 10px; }
  .task-card .task-data { display: none; }
  .task-actions { grid-column: 1 / -1; }
  .task-actions .button { flex: 1; }
  .record-card { grid-template-columns: 1fr auto; gap: 8px; }
  .record-card > div:nth-child(2), .record-card > div:nth-child(3), .record-card > div:nth-child(4) { display: none; }
  .order-layout { display: block; }
  .order-list { max-height: none; overflow: visible; }
  .order-detail { display: none; }
  .order-card { padding: 14px; }
  .toolbar { align-items: stretch; }
  .toolbar .mobile-search { flex: 1; }
  .toolbar .button { padding: 0 11px; font-size: 0; }
  .toolbar .button svg { margin: 0; }
  .record-table-wrap { display: none; }
  .mobile-only { display: grid; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-summary > div { min-width: 0; flex: 1; }
  .report-toolbar { align-items: stretch; flex-direction: column; }
  .date-filter { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .date-filter input { width: 100%; min-width: 0; }
  .toolbar-actions .button { flex: 1; }
  .chart-grid.two, .qc-tool-grid { grid-template-columns: 1fr; }
  .report-panel.wide, .fishbone-panel { grid-column: auto; }
  .chart-frame { height: 280px; }
  .fishbone { grid-template-columns: 1fr; }
  .fishbone-spine { grid-template-columns: repeat(2, 1fr); }
  .cause-card dl { grid-template-columns: 1fr; }
  .defect-entry, .measurement-entry { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .measurement-values { grid-column: 1 / -1; }
  .fishbone-form-grid { grid-template-columns: 1fr; }
  .bottom-sheet { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 94vh; border-radius: 8px 8px 0 0; box-shadow: 0 -12px 35px rgba(21,43,35,.18); }
  .picker-sheet, .qr-sheet { transform: none; }
  .sheet-header { min-height: 66px; padding: 10px 12px; grid-template-columns: 38px 1fr auto; }
  .sheet-header .icon-button { width: 38px; height: 38px; }
  #inspection-form { padding: 14px; }
  .segmented { grid-template-columns: repeat(5, minmax(64px, 1fr)); overflow-x: auto; }
  .segmented label { min-width: 64px; }
  .tool-picker { grid-template-columns: 1fr; }
  .qr-photo-button { display: none; }
  .sheet-footer { bottom: -14px; margin: 0 -14px -14px; padding-left: 14px; padding-right: 14px; }
  .toast-region { top: 10px; left: 10px; right: 10px; }
  .toast { min-width: 0; max-width: none; }
  .order-toolbar { display: grid; grid-template-columns: 1fr auto; }
  .order-toolbar .mobile-search { max-width: none; grid-column: 1 / -1; }
  .order-date-filter { min-width: 0; }
  .order-date-filter input { min-width: 0; width: 100%; }
}

@media (max-width: 420px) {
  .topbar-actions .icon-button { display: none; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .shift-switch { grid-template-columns: repeat(2, 48px); }
  .inspector-button { width: 42px; padding: 0; justify-content: center; }
  .inspector-button > span:nth-child(2), .inspector-button > svg { display: none; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .quick-actions { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid.two { grid-template-columns: 1fr 1fr; }
  .detail-meta { grid-template-columns: repeat(2, 1fr); }
  .readonly-badge { font-size: 0; width: 30px; padding: 0; justify-content: center; }
  .report-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .report-kpis > div { min-height: 72px; padding: 12px; }
  .report-kpis strong { font-size: 21px; }
  .chart-frame { height: 250px; }
  .fishbone-spine { grid-template-columns: 1fr; }
  .defect-entry, .measurement-entry { grid-template-columns: 1fr; }
  .inline-selects { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .inline-selects select { min-width: 0; width: 100%; }
}

@media print {
  .sidebar, .topbar, .bottom-nav, .report-toolbar, .analytics-tabs, .special-report-tabs, .button, .toast-region { display: none !important; }
  .workspace { margin: 0; }
  main { padding: 0; }
  .screen { display: none !important; max-width: none; }
  .screen[data-screen="analytics"] { display: block !important; }
  .analytics-panel { display: block !important; break-before: page; }
  .analytics-panel:first-of-type { break-before: auto; }
  .report-panel, .cause-card { break-inside: avoid; box-shadow: none; }
  .chart-frame { height: 260px; }
}

.login-screen { min-height: 100vh; min-height: 100dvh; max-height: 100dvh; padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom)); background: #edf3f0; display: grid; place-items: center; overflow-y: auto; }
.login-panel { width: min(440px, 100%); padding: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand .brand-logo { width: 70px; height: 70px; flex-basis: 70px; border-color: var(--line); }
.login-brand strong, .login-brand span { display: block; }
.login-brand strong { font-size: 16px; }
.login-brand span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.login-heading { margin: 44px 0 24px; }
.login-heading span { color: var(--primary-2); font-size: 11px; font-weight: 700; }
.login-heading h1 { margin: 8px 0 10px; font-size: 25px; }
.login-heading p, .login-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.login-form .field { margin-bottom: 16px; }
.remember-row { display: flex; align-items: center; gap: 8px; margin: 4px 0 16px; color: var(--muted); font-size: 12px; }
.remember-row input { width: 16px; height: 16px; accent-color: var(--primary); }
.login-error { margin: 0 0 14px; padding: 9px 11px; border: 1px solid #e4b8b4; background: var(--red-soft); color: var(--red); border-radius: 5px; font-size: 11px; }
.login-hint { margin-top: 20px; text-align: center; font-size: 10px; }
.admin-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 18px; }
.admin-heading h2 { margin: 4px 0 5px; font-size: 22px; }
.admin-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.admin-heading > div:first-child > span { color: var(--muted); font-size: 11px; }
.admin-heading-actions { display: flex; gap: 8px; }
.admin-tabs { display: flex; gap: 7px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.admin-tabs button { min-height: 40px; padding: 0 15px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 700; }
.admin-tabs button.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.admin-panel { display: none; }
.admin-panel.is-active { display: block; }
.admin-toolbar { min-height: 44px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-summary { color: var(--muted); font-size: 11px; }
.admin-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.admin-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.admin-table th { height: 42px; padding: 0 13px; background: #eef2f0; color: #52615c; text-align: left; font-size: 11px; white-space: nowrap; }
.admin-table td { height: 62px; padding: 8px 13px; border-top: 1px solid var(--line); font-size: 12px; }
.employee-cell { display: flex; align-items: center; gap: 9px; min-width: 170px; }
.employee-cell strong, .employee-cell small { display: block; }
.employee-cell small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.employee-avatar { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.role-chip { display: inline-flex; min-height: 24px; padding: 0 8px; align-items: center; border-radius: 4px; background: var(--blue-soft); color: var(--blue); font-size: 10px; white-space: nowrap; }
.status-active, .status-disabled { display: inline-flex; min-height: 24px; padding: 0 8px; align-items: center; border-radius: 4px; font-size: 10px; font-weight: 700; }
.status-active { background: var(--green-soft); color: var(--green); }
.status-disabled { background: #eef0ef; color: var(--muted); }
.employee-cards { display: none; }
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.role-card { padding: 17px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.role-card header { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.role-card h3 { margin: 4px 0 0; font-size: 16px; }
.role-card p { min-height: 32px; margin: 12px 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.role-id { color: var(--muted); font-size: 9px; }
.permission-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.permission-chips span { min-height: 23px; padding: 0 7px; border: 1px solid #cfe0d8; border-radius: 4px; display: inline-flex; align-items: center; background: #f2f8f5; color: var(--primary); font-size: 10px; }
.permission-fieldset { margin: 0 0 18px; padding: 0; border: 0; }
.permission-fieldset legend { margin-bottom: 9px; color: #53635d; font-size: 11px; font-weight: 700; }
.permission-list { display: grid; gap: 7px; }
.permission-option { min-height: 48px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; display: flex; align-items: center; gap: 9px; cursor: pointer; }
.permission-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.permission-option input { width: 16px; height: 16px; accent-color: var(--primary); }
.permission-option strong, .permission-option small { display: block; }
.permission-option strong { font-size: 11px; }
.permission-option small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.admin-sheet { width: min(500px, 100%); }

@media (max-width: 820px) {
  .login-screen { place-items: start stretch; }
  .login-panel { margin: auto; padding: 25px 20px; }
  .login-heading { margin: 28px 0 20px; }
  .admin-heading { display: block; }
  .admin-heading-actions { margin-top: 14px; }
  .admin-heading-actions .button { flex: 1; }
  .admin-toolbar { display: block; }
  .admin-summary { display: block; margin-top: 8px; }
  .admin-table-wrap { display: none; }
  .employee-cards { display: grid; gap: 8px; }
  .employee-card { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: center; }
  .employee-card .employee-cell { grid-column: 1 / -1; }
  .employee-card .button { justify-self: end; }
  .role-grid { grid-template-columns: 1fr; }
}

@media (max-height: 620px) {
  .login-screen { align-items: start; padding-top: 10px; padding-bottom: 10px; }
  .login-panel { padding-top: 18px; padding-bottom: 18px; }
  .login-heading { margin: 18px 0 14px; }
  .login-heading p, .login-hint { display: none; }
  .login-form .field { margin-bottom: 11px; }
}
