:root {
  --ink: #17221f;
  --muted: #68736f;
  --soft: #8d9893;
  --line: #dfe5e2;
  --line-soft: #edf1ef;
  --surface: #ffffff;
  --canvas: #f4f6f5;
  --green: #17463a;
  --green-2: #276757;
  --mint: #e4f1ec;
  --red: #b23a33;
  --red-bg: #fbecea;
  --amber: #a96514;
  --amber-bg: #fff3dc;
  --blue: #315f9a;
  --blue-bg: #eaf1fa;
  --shadow: 0 8px 24px rgba(30, 49, 43, 0.07);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
[hidden], .permission-hidden { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--canvas); font-size: 14px; letter-spacing: 0; overflow-x: hidden; }
button, input, select { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
button { touch-action: manipulation; }
a { color: var(--green-2); text-decoration: none; }

.app-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: #18362f; color: #fff; padding: 22px 14px 18px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 25px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.34); background: #f2c85b; color: #18362f; font-weight: 800; font-size: 13px; }
.brand strong, .brand small, .sidebar-foot strong, .sidebar-foot small { display: block; }
.brand strong { font-size: 15px; line-height: 1.35; }
.brand small { margin-top: 3px; color: #a9bdb7; font-size: 10px; }
.nav-list { display: grid; gap: 5px; }
.nav-item { width: 100%; height: 44px; border: 0; background: transparent; color: #c6d3cf; display: flex; align-items: center; gap: 11px; padding: 0 12px; text-align: left; border-radius: 6px; transition: .16s ease; }
.nav-item > svg { width: 18px; height: 18px; flex: 0 0 auto; stroke-width: 1.8; color: #dce6e2; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: #17362f; background: #f2c85b; font-weight: 700; }
.nav-item.active > svg { color: #17362f; }
.sidebar-close { display: none; width: 36px; height: 36px; margin-left: auto; border: 0; background: transparent; color: #dce6e2; place-items: center; }
.sidebar-close svg { width: 20px; height: 20px; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; border: 0; background: rgba(13, 27, 23, .4); opacity: 0; visibility: hidden; z-index: 29; transition: .18s; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 15px 9px 2px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-foot strong { font-size: 12px; }
.sidebar-foot small { margin-top: 2px; color: #91aaa3; font-size: 10px; }
.online-dot { width: 9px; height: 9px; border-radius: 50%; background: #69c7a7; box-shadow: 0 0 0 4px rgba(105,199,167,.14); }

.main { min-width: 0; }
.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 30px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-title { display: flex; align-items: center; gap: 12px; }
.topbar-title p, .drawer-head p { margin: 0 0 2px; color: var(--green-2); font-size: 11px; font-weight: 700; }
h1, h2, h3, p { letter-spacing: 0; }
h1 { margin: 0; font-size: 21px; line-height: 1.25; }
.menu-button { display: none; width: 38px; height: 38px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.menu-button svg { width: 19px; height: 19px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.sync-state { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.sync-state i { width: 7px; height: 7px; border-radius: 50%; background: #37a278; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 0 3px; border: 0; background: transparent; color: var(--ink); text-align: left; }
.user-chip > span { width: 32px; height: 32px; display: grid; place-items: center; color: white; background: var(--green); font-size: 11px; }
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { font-size: 12px; }.user-chip small { color: var(--soft); font-size: 10px; margin-top: 1px; }
.logout-button { height: 32px; padding: 0 8px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 11px; }
.logout-button:hover { color: var(--red); }

.content { padding: 28px 30px 48px; max-width: 1600px; margin: 0 auto; }
.page { display: none; }.page.active { display: block; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 22px; }
.section-heading h2 { margin: 0 0 5px; font-size: 23px; }.section-heading p { margin: 0; color: var(--muted); line-height: 1.55; }
.compact-heading { margin-bottom: 17px; }.compact-heading h2 { font-size: 19px; }
.primary-button, .secondary-button, .text-button { min-height: 36px; border-radius: 5px; padding: 0 14px; font-weight: 700; white-space: nowrap; }
.primary-button { border: 1px solid var(--green); background: var(--green); color: #fff; }
.primary-button:hover { background: #0f392e; }.primary-button.dark { background: #25323a; border-color: #25323a; }
.secondary-button { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.secondary-button:hover { border-color: #aebbb6; }
.text-button { border: 0; background: transparent; color: var(--green-2); padding-left: 5px; padding-right: 5px; }
.icon-text-button { display: inline-flex; align-items: center; gap: 6px; }.icon-text-button svg { width: 15px; height: 15px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 15px; }
.kpi-card { min-height: 114px; padding: 18px 19px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--green-2); border-radius: 7px; }
.kpi-card.warning { border-top-color: var(--amber); }.kpi-card.danger { border-top-color: var(--red); }.kpi-card.blue { border-top-color: var(--blue); }
.kpi-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.kpi-label i { width: 8px; height: 8px; background: var(--green-2); }.warning .kpi-label i { background: var(--amber); }.danger .kpi-label i { background: var(--red); }.blue .kpi-label i { background: var(--blue); }
.kpi-value { margin: 10px 0 4px; font-size: 29px; line-height: 1; font-weight: 760; font-variant-numeric: tabular-nums; }
.kpi-note { color: var(--soft); font-size: 11px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 15px; }
.span-2 { grid-column: 1; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 1px 1px rgba(30,49,43,.02); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 18px 13px; }.panel-head.padded { padding-bottom: 17px; border-bottom: 1px solid var(--line-soft); }
.panel-head h3 { margin: 0 0 3px; font-size: 14px; }.panel-head p { margin: 0; color: var(--soft); font-size: 11px; }
.flush { box-shadow: none; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { height: 38px; padding: 0 14px; color: #78837f; background: #fafbfa; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; font-weight: 600; }
td { height: 54px; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; } tbody tr:hover { background: #fbfcfb; }
.wide-table table { min-width: 1020px; }.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-main { display: block; color: var(--ink); font-weight: 650; white-space: nowrap; }.cell-sub { display: block; margin-top: 3px; color: var(--soft); font-size: 10px; white-space: nowrap; }
.tag { display: inline-flex; align-items: center; min-height: 23px; padding: 0 8px; border-radius: 4px; color: #4f5b57; background: #eef1ef; font-size: 10px; font-weight: 650; white-space: nowrap; }
.tag.red { color: var(--red); background: var(--red-bg); }.tag.amber { color: var(--amber); background: var(--amber-bg); }.tag.green { color: var(--green-2); background: var(--mint); }.tag.blue { color: var(--blue); background: var(--blue-bg); }
.row-action { width: 29px; height: 29px; border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 4px; font-size: 17px; line-height: 1; }.row-action:hover { color: var(--green); border-color: #93aaa3; }
.row-action svg { width: 16px; height: 16px; vertical-align: middle; }

.alert-list { padding: 2px 17px 14px; display: grid; gap: 7px; }
.alert-item { display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }.alert-item:last-child { border: 0; }
.alert-item > i { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--amber); }.alert-item.danger > i { background: var(--red); }.alert-item strong { display: block; font-size: 12px; }.alert-item p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }.alert-item b { color: var(--soft); font-size: 10px; white-space: nowrap; }
.shortage-bars { padding: 0 18px 18px; display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2.2fr 85px; gap: 13px; align-items: center; }.bar-row strong { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.bar-track { height: 8px; background: #edf1ef; overflow: hidden; }.bar-fill { height: 100%; background: var(--red); }.bar-value { text-align: right; color: var(--red); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 11px; }
.production-summary { padding: 3px 18px 18px; }.ring-block { display: flex; align-items: center; gap: 18px; padding: 7px 0 16px; }.progress-ring { --progress: 0; width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--green-2) calc(var(--progress) * 1%), #e7ece9 0); position: relative; }.progress-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #fff; }.progress-ring strong { position: relative; font-size: 17px; }.ring-copy strong { display: block; font-size: 18px; }.ring-copy small { color: var(--muted); }
.mini-progress-list { display: grid; gap: 11px; }.mini-progress-head { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 10px; }.mini-track { height: 5px; background: #e9eeeb; }.mini-track i { display: block; height: 100%; background: var(--blue); }

.filterbar { min-height: 57px; display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.search-field { flex: 1; min-width: 220px; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 11px; background: #f7f9f8; border: 1px solid #e5eae7; border-radius: 5px; }.search-field span { color: var(--soft); font-size: 10px; }.search-field input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
select, .field input { height: 36px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); padding: 0 30px 0 10px; outline: 0; }
.result-count { margin-left: auto; padding: 0 7px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.readiness { min-width: 92px; }.readiness-copy { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-size: 10px; }.readiness-track { height: 5px; background: #e9eeeb; }.readiness-track i { display: block; height: 100%; background: var(--green-2); }.readiness-track i.low { background: var(--red); }.readiness-track i.mid { background: var(--amber); }
.heading-metrics { display: flex; align-items: stretch; gap: 10px; }.heading-metrics span { min-width: 100px; padding: 8px 12px; color: var(--muted); background: #fff; border: 1px solid var(--line); font-size: 10px; }.heading-metrics strong { display: block; margin-top: 3px; color: var(--ink); font-size: 16px; }
.notice { margin-bottom: 12px; padding: 11px 14px; color: #53625d; background: #eef5f2; border-left: 3px solid var(--green-2); font-size: 11px; line-height: 1.5; }

.legend { display: flex; align-items: center; gap: 13px; padding-bottom: 4px; color: var(--muted); font-size: 10px; }.legend span { display: flex; align-items: center; gap: 5px; }.dot { width: 7px; height: 7px; border-radius: 50%; }.dot.green { background: var(--green-2); }.dot.amber { background: var(--amber); }.dot.blue { background: var(--blue); }
.production-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-bottom: 13px; }.board-item { padding: 14px 15px; background: #fff; border: 1px solid var(--line); border-radius: 7px; }.board-item p { display: flex; justify-content: space-between; margin: 0 0 10px; color: var(--muted); font-size: 10px; }.board-item strong { font-size: 20px; }.board-item small { color: var(--soft); }.production-table-panel { margin-top: 0; }
.progress-cell { min-width: 110px; }.progress-cell .mini-track { height: 6px; margin-top: 5px; }.progress-cell .mini-track i { background: var(--blue); }

.cost-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 13px; }.cost-tile { padding: 15px; background: #fff; border: 1px solid var(--line); border-radius: 7px; }.cost-tile span { display: block; color: var(--muted); font-size: 10px; }.cost-tile strong { display: block; margin-top: 7px; font-size: 17px; font-variant-numeric: tabular-nums; }
.cost-rate { display: flex; align-items: center; gap: 8px; min-width: 92px; }.cost-rate .mini-track { flex: 1; }.profit-positive { color: var(--green-2); }.profit-negative { color: var(--red); }

.import-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.import-card { min-height: 245px; display: flex; flex-direction: column; position: relative; padding: 23px; background: #fff; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }.import-sequence { position: absolute; right: 18px; top: 13px; color: #e6ebe8; font-size: 54px; line-height: 1; font-weight: 800; }.file-type { display: inline-flex; margin-bottom: 17px; padding: 4px 7px; color: var(--green-2); background: var(--mint); font-size: 10px; font-weight: 700; }.file-type.bom { color: var(--blue); background: var(--blue-bg); }.import-card h3 { margin: 0 0 8px; font-size: 18px; }.import-card p { max-width: 440px; margin: 0; color: var(--muted); line-height: 1.7; }.import-actions { display: flex; align-items: center; gap: 15px; margin-top: auto; padding-top: 24px; }.import-actions a { font-size: 11px; font-weight: 700; }
.import-help { display: grid; grid-template-columns: 130px 1fr; gap: 24px; padding: 20px 23px; margin-bottom: 14px; }.import-help span { color: var(--green-2); font-size: 10px; font-weight: 700; }.import-help h3 { margin: 4px 0 0; font-size: 15px; }.import-help ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 50px; color: var(--muted); line-height: 2; font-size: 11px; }
.empty-cell { padding: 35px 15px; text-align: center; color: var(--soft); }

.org-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 13px; }
.org-stat { padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 7px; }
.org-stat span { display: block; color: var(--muted); font-size: 10px; }
.org-stat strong { display: block; margin-top: 6px; font-size: 20px; }
.org-stat strong small { margin-left: 3px; color: var(--muted); font-size: 10px; font-weight: 600; }
.org-name { padding-left: calc(var(--depth, 0) * 14px); }
.org-tabs { display: flex; gap: 2px; margin-bottom: 12px; padding: 4px; width: fit-content; max-width: 100%; overflow-x: auto; background: #e7ece9; border-radius: 6px; }
.org-tabs button { height: 34px; padding: 0 16px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); white-space: nowrap; font-size: 11px; font-weight: 700; }
.org-tabs button.active { color: var(--green); background: #fff; box-shadow: 0 1px 3px rgba(30,49,43,.08); }
.org-tab-pane { display: none; }.org-tab-pane.active { display: block; }
.org-two-column { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 13px; }
.tree-name { display: flex; align-items: center; gap: 8px; min-width: 160px; }
.tree-name i { width: 6px; height: 6px; background: var(--green-2); }
.permission-chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 520px; }
.permission-chip { display: inline-flex; padding: 3px 6px; border-radius: 3px; color: #52605b; background: #eef2f0; font-size: 9px; }
.permission-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 3px; }
.permission-option { min-height: 48px; display: grid; grid-template-columns: 16px 1fr; align-items: start; gap: 8px; padding: 8px; border: 1px solid var(--line-soft); border-radius: 4px; }
.permission-option input { width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--green); }
.permission-option strong, .permission-option small { display: block; }.permission-option strong { font-size: 11px; }.permission-option small { margin-top: 2px; color: var(--soft); font-size: 9px; line-height: 1.4; }

.login-screen { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: #e9eeeb; z-index: 300; }
.login-screen::before { content: ""; position: fixed; left: 0; top: 0; bottom: 0; width: 34%; background: #173a31; }
.login-panel { position: relative; width: min(440px, 100%); min-height: 520px; padding: 32px 38px; background: #fff; border: 1px solid #d8e0dc; box-shadow: 0 24px 60px rgba(20,38,32,.16); z-index: 1; }
.login-brand { display: flex; align-items: center; gap: 11px; padding-bottom: 31px; border-bottom: 1px solid var(--line-soft); }
.login-brand > span { width: 38px; height: 38px; display: grid; place-items: center; background: var(--green); color: #f2c85b; font-weight: 800; font-size: 12px; }
.login-brand strong, .login-brand small { display: block; }.login-brand strong { font-size: 14px; }.login-brand small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.login-copy { padding: 35px 0 27px; }.login-copy p { margin: 0 0 6px; color: var(--green-2); font-size: 10px; font-weight: 800; }.login-copy h1 { margin: 0 0 9px; font-size: 25px; }.login-copy span { color: var(--muted); font-size: 11px; }
.login-form { display: grid; gap: 15px; }.login-form label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 650; }.login-form input { height: 41px; padding: 0 11px; border: 1px solid var(--line); border-radius: 4px; outline: 0; }.login-form input:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(39,103,87,.09); }.login-form .primary-button { height: 42px; margin-top: 3px; }
.form-error { min-height: 16px; margin: -4px 0 0; color: var(--red); font-size: 10px; }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(13, 27, 23, .3); opacity: 0; visibility: hidden; z-index: 80; transition: .18s; }.drawer-backdrop.open { opacity: 1; visibility: visible; }
.drawer { position: fixed; right: 0; top: 0; width: min(430px, 96vw); height: 100vh; display: flex; flex-direction: column; background: #fff; transform: translateX(101%); z-index: 90; box-shadow: -20px 0 45px rgba(20,38,32,.16); transition: .22s ease; }.drawer.open { transform: translateX(0); }
.drawer-head { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; border-bottom: 1px solid var(--line); }.drawer-head h2 { margin: 0; font-size: 19px; }.close-button { width: 34px; height: 34px; border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 4px; font-size: 23px; line-height: 1; }
.drawer form { display: flex; flex-direction: column; min-height: 0; flex: 1; }.drawer-body { flex: 1; overflow-y: auto; padding: 22px; }.drawer-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 22px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 12px; }.field { display: grid; gap: 6px; }.field.full { grid-column: 1 / -1; }.field label { color: var(--muted); font-size: 11px; font-weight: 650; }.field input, .field select { width: 100%; }.record-summary { margin-bottom: 20px; padding: 14px; background: #f5f8f6; border-left: 3px solid var(--green-2); }.record-summary strong { display: block; margin-bottom: 4px; }.record-summary span { color: var(--muted); font-size: 11px; }
.toast { position: fixed; left: 50%; bottom: 25px; max-width: min(500px, calc(100vw - 30px)); transform: translate(-50%, 20px); padding: 11px 17px; color: #fff; background: #20332d; border-radius: 5px; box-shadow: var(--shadow); opacity: 0; visibility: hidden; z-index: 120; transition: .2s; }.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }.toast.error { background: #9e342e; }
.loading { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 13px; background: #f4f6f5; z-index: 150; transition: .2s; }.loading.hidden { opacity: 0; visibility: hidden; }.loading-mark { width: 52px; height: 52px; display: grid; place-items: center; background: var(--green); color: #f2c85b; font-weight: 800; }.loading p { margin: 0; color: var(--muted); }
.mobile-nav { display: none; }

@media (max-width: 1120px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .production-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cost-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .org-two-column { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-101%); width: 260px; max-width: calc(100vw - 54px); transition: .2s; }
  .sidebar.open { transform: translateX(0); box-shadow: 20px 0 35px rgba(20,38,32,.2); }
  .sidebar-close { display: grid; }
  .sidebar-backdrop { display: block; }
  .sidebar-backdrop.open { opacity: 1; visibility: visible; }
  .menu-button { display: grid; place-items: center; }.topbar { height: 68px; padding: 0 20px; }.content { padding: 22px 20px 44px; }.sync-state { display: none; }
  .dashboard-grid { display: block; }.dashboard-grid .panel { margin-bottom: 13px; }.section-heading { align-items: flex-start; }.heading-metrics { display: none; }
  .import-grid { grid-template-columns: 1fr; }.import-help { grid-template-columns: 1fr; }.import-help ol { columns: 1; }
  .login-screen::before { width: 100%; height: 28%; bottom: auto; }.login-panel { min-height: 500px; }
}
@media (max-width: 640px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .topbar { height: 62px; padding: 0 12px; gap: 10px; }.top-actions { gap: 4px; }.top-actions .secondary-button, .user-chip { display: none; }.logout-button { height: 36px; padding-left: 10px; }.topbar-title p { display: none; } h1 { font-size: 17px; }
  .content { padding: 16px 12px 30px; }
  .section-heading { display: block; }.section-heading > button { margin-top: 14px; }.section-heading h2 { font-size: 20px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 9px; }.kpi-card { min-height: 102px; padding: 14px; }.kpi-value { font-size: 24px; }
  .filterbar { flex-wrap: wrap; padding: 9px; }.search-field { flex-basis: 100%; min-width: 0; }.filterbar select { flex: 1; min-width: 126px; }.result-count { display: none; }
  .production-board { grid-template-columns: 1fr 1fr; }.cost-summary { grid-template-columns: 1fr 1fr; }.import-card { min-height: 230px; padding: 19px; }
  .org-summary { grid-template-columns: 1fr 1fr; }.permission-grid { grid-template-columns: 1fr; }.login-screen { align-items: start; padding: 12px; overflow-y: auto; }.login-panel { min-height: 0; margin-top: 18px; padding: 25px 22px; }.login-copy { padding: 26px 0 22px; }
  .bar-row { grid-template-columns: minmax(90px, 1fr) 1.5fr 68px; }.form-grid { grid-template-columns: 1fr; }.field.full { grid-column: auto; }
  .panel { overflow: visible; }.panel-head { padding: 15px 14px 11px; }.panel-head.padded { padding-bottom: 14px; }
  .table-wrap, .wide-table { overflow: visible; }
  table[data-mobile-cards="true"], table[data-mobile-cards="true"] tbody { display: block; width: 100%; min-width: 0 !important; }
  table[data-mobile-cards="true"] thead { display: none; }
  table[data-mobile-cards="true"] tbody { padding: 10px; background: #f2f5f3; }
  table[data-mobile-cards="true"] tbody tr { display: grid; gap: 0; margin-bottom: 10px; padding: 7px 12px; background: #fff; border: 1px solid var(--line); border-radius: 7px; }
  table[data-mobile-cards="true"] tbody tr:last-child { margin-bottom: 0; }
  table[data-mobile-cards="true"] td { min-width: 0; width: 100%; height: auto; display: grid; grid-template-columns: minmax(72px, 32%) minmax(0, 1fr); gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-soft); text-align: left; overflow-wrap: anywhere; }
  table[data-mobile-cards="true"] td::before { content: attr(data-label); color: var(--soft); font-size: 10px; font-weight: 650; }
  table[data-mobile-cards="true"] td:last-child { border-bottom: 0; }
  table[data-mobile-cards="true"] td[data-label=""] { display: flex; justify-content: flex-end; }
  table[data-mobile-cards="true"] td[data-label=""]::before { display: none; }
  table[data-mobile-cards="true"] .cell-main, table[data-mobile-cards="true"] .cell-sub { white-space: normal; }
  table[data-mobile-cards="true"] .readiness, table[data-mobile-cards="true"] .progress-cell, table[data-mobile-cards="true"] .cost-rate { min-width: 0; }
  table[data-mobile-cards="true"] .empty-cell { display: block; padding: 28px 8px; text-align: center; }
  table[data-mobile-cards="true"] .empty-cell::before { display: none; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; height: calc(62px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); padding: 5px 6px env(safe-area-inset-bottom); background: rgba(255,255,255,.98); border-top: 1px solid var(--line); z-index: 50; box-shadow: 0 -7px 22px rgba(30,49,43,.08); }
  .mobile-nav button { min-width: 0; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; align-content: center; gap: 3px; font-size: 9px; }
  .mobile-nav button svg { width: 19px; height: 19px; stroke-width: 1.8; }
  .mobile-nav button.active { color: var(--green); font-weight: 700; }
  .drawer { width: 100%; max-width: 100%; }.drawer-head { min-height: 68px; padding: 13px 16px; }.drawer-body { padding: 17px 16px; }.drawer-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }.drawer-foot button { flex: 1; min-height: 42px; }
  .import-actions { flex-wrap: wrap; }.import-actions .primary-button { min-height: 42px; }
  .org-tabs { width: 100%; }.org-tabs button { flex: 0 0 auto; min-height: 38px; }
}

@media (max-width: 380px) {
  .kpi-grid, .production-board, .cost-summary, .org-summary { grid-template-columns: 1fr; }
  .topbar-title { gap: 8px; }.menu-button { width: 36px; height: 36px; }
}
