:root {
  --navy: #102a43;
  --navy-2: #173f5f;
  --teal: #078f87;
  --teal-dark: #087b75;
  --teal-soft: #e6f6f4;
  --orange: #e98734;
  --orange-soft: #fff2e5;
  --red: #d64d4d;
  --red-soft: #fff0f0;
  --green: #2f9b6d;
  --green-soft: #eaf8f0;
  --blue: #3f7dc0;
  --blue-soft: #eaf2fb;
  --bg: #f4f7f8;
  --card: #ffffff;
  --text: #243b53;
  --muted: #829ab1;
  --line: #e4edf1;
  --shadow: 0 10px 28px rgba(16, 42, 67, 0.07);
  --shadow-soft: 0 14px 40px rgba(15, 45, 78, .08);
  --sidebar-bg: var(--navy);
  --active-grad: var(--teal);
}

.operation-log-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.operation-records {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbfd;
}
.operation-records h4 {
  margin: 0 0 10px;
  color: var(--navy);
  font-size: 15px;
  font-weight: 600;
}
.operation-record-line {
  display: grid;
  grid-template-columns: 150px 90px 90px minmax(0,1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px dashed rgba(111, 134, 154, 0.25);
  color: var(--text);
}
.operation-record-line:first-of-type {
  border-top: 0;
}
.operation-record-line span,
.operation-record-line small {
  color: var(--muted);
}
.operation-record-line em {
  font-style: normal;
  color: var(--teal);
  font-weight: 600;
}
.operation-log-diff {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 14px;
  margin-top: 14px;
}
.operation-log-diff h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--navy);
}
.operation-log-diff pre {
  max-height: 320px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7fafc;
  color: #334155;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 768px) {
  .init-options { grid-template-columns: 1fr; }
  .operation-log-filters {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .operation-records {
    padding: 12px;
  }
  .operation-record-line {
    grid-template-columns: 1fr;
    gap: 4px;
    align-items: start;
  }
  .operation-log-diff {
    grid-template-columns: 1fr;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: 400;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  width: 236px;
  color: #d9e7ee;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
}
.brand { height: 106px; display: grid; place-items: center; padding: 8px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-logo { display: block; width: 100%; max-width: 204px; height: auto; object-fit: contain; }
.main-nav { flex: 1; display: grid; align-content: start; gap: 8px; padding: 18px 15px; overflow-y: auto; }
.nav-item { width: 100%; height: 52px; display: flex; align-items: center; gap: 14px; padding: 0 16px; border: 1px solid transparent; border-radius: 13px; background: transparent; color: #c8d8e3; text-align: left; transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease, border-color .18s ease; }
.nav-item:hover { transform: translateX(2px); background: rgba(255,255,255,.085); border-color: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--teal); color: white; box-shadow: 0 7px 18px rgba(0,0,0,.14); border-color: transparent; }
.nav-item i { width: 26px; height: 26px; display: grid; flex: 0 0 26px; place-items: center; color: inherit; font-size: 0; font-style: normal; text-align: center; }
.nav-item svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.65; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.nav-item span { font-size: 15px; font-weight: 500; letter-spacing: .1px; }
.nav-category { height: 52px; margin-top: 0; }
.nav-category i { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 0; background: transparent; font-size: 0; }
.nav-category.active i { background: transparent; }
.sidebar-footer { margin: 0; padding: 16px 20px 20px; color: #86a6b7; font-size: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.factory-state { display: flex; align-items: center; margin-bottom: 8px; color: #b9e5d5; font-weight: 500; }
.pulse { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #55d99a; box-shadow: 0 0 0 4px rgba(85,217,154,.12); }

.main-area { width: calc(100% - 236px); margin-left: 236px; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; background: rgba(255,255,255,.92); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(226,236,242,.86); box-shadow: 0 8px 30px rgba(16,42,67,.04); }
.topbar h1 { margin: 0; color: #071d3b; font-size: 23px; font-weight: 600; letter-spacing: .1px; }
.topbar p { margin: 6px 0 0; color: #6d8095; font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.search-box { position: relative; width: 360px; height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 15px; border: 1px solid #dbe8ef; border-radius: 12px; background: #fbfdff; color: #6f8397; box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 8px 18px rgba(16,42,67,.04); }
.search-box svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; }
.global-search-results, .message-panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 70; width: min(420px, calc(100vw - 24px)); max-height: 62vh; overflow-y: auto; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); display: none; }
.global-search-results.show, .message-panel.show { display: block; }
.global-search-group { padding: 6px 0; }
.global-search-group h4 { margin: 0 0 6px; color: var(--navy); font-size: 12px; }
.global-search-item, .message-item { display: grid; gap: 3px; width: 100%; padding: 9px; border: 0; border-radius: 9px; background: transparent; text-align: left; color: var(--text); cursor: pointer; }
.global-search-item:hover, .message-item:hover { background: #f5f8fa; }
.global-search-item strong, .message-item strong { color: var(--navy); font-size: 13px; }
.global-search-item span, .message-item span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.message-button { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #f8fbfd; color: #09213f; cursor: pointer; transition: .18s ease; }
.message-button:hover { background: #edf6f7; color: var(--teal-dark); transform: translateY(-1px); }
.message-button svg { width: 21px; height: 21px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.message-button b { position: absolute; right: -3px; top: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #f04444; color: white; font-size: 11px; line-height: 18px; display: none; box-shadow: 0 4px 10px rgba(240,68,68,.26); }
.message-button.has-unread b { display: inline-block; }
.message-panel { right: 74px; }
.message-drawer-mask { position: fixed; inset: 0; z-index: 2200; display: flex; justify-content: flex-end; background: rgba(7,27,44,.28); }
.message-drawer { width: min(460px, 100vw); height: 100dvh; display: flex; flex-direction: column; background: #fff; box-shadow: -18px 0 40px rgba(0,0,0,.18); }
.message-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.message-drawer-head h3 { margin: 0; color: var(--navy); font-size: 18px; }
.message-drawer-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.message-drawer-body { flex: 1; overflow-y: auto; padding: 14px; background: #f7fafb; }
.message-tabs { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-bottom: 10px; }
.message-drawer .message-item { width: 100%; margin-bottom: 8px; }
.message-tools { display: flex; gap: 8px; margin-bottom: 8px; }
.message-tools select, .message-tools input { min-width: 0; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; }
.message-item.unread { background: #fff7ed; }
.message-item.handled { opacity: .68; }
.top-notice { position: fixed; left: 50%; top: 14px; z-index: 140; width: min(460px, calc(100vw - 24px)); transform: translate(-50%, -130%); opacity: 0; padding: 14px 16px; border-radius: 14px; background: white; box-shadow: 0 18px 60px rgba(16,42,67,.24); border-left: 5px solid var(--teal); transition: transform .36s ease, opacity .36s ease; cursor: pointer; }
.top-notice.show { transform: translate(-50%, 0); opacity: 1; }
.top-notice h4 { margin: 0 0 5px; color: var(--navy); font-size: 15px; }
.top-notice p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.top-notice .notice-close { position: absolute; right: 8px; top: 6px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; }
.icon-btn { position: relative; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 18px; }
.icon-btn b { position: absolute; top: -2px; right: -1px; width: 15px; height: 15px; border-radius: 50%; background: var(--red); color: white; font-size: 9px; line-height: 15px; }
.user-profile { display: flex; align-items: center; gap: 10px; padding-left: 18px; border-left: 1px solid #e4edf1; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg,#15cfae,#07988f); color: white; font-weight: 600; box-shadow: 0 10px 20px rgba(7,143,135,.22); }
.user-profile strong, .user-profile span { display: block; }
.user-profile strong { color: var(--navy); font-size: 13px; }
.user-profile span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.logout-btn { min-height: 34px; padding: 0 11px; }
.page-content { padding: 24px 30px 35px; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.metric-card, .panel, .quick-action { background: rgba(255,255,255,.94); border: 1px solid rgba(226,238,244,.9); border-radius: 18px; box-shadow: var(--shadow-soft); }
.metric-card { min-height: 130px; padding: 22px; transition: transform .18s ease, box-shadow .18s ease; }
.metric-card:hover, .quick-action:hover, .module-nav-card:hover { transform: translateY(-3px); box-shadow: 0 18px 46px rgba(16,42,67,.1); }
.metric-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.metric-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; font-size: 0; color: white; box-shadow: 0 12px 22px rgba(16,42,67,.12); }
.metric-icon svg, .quick-action i svg, .module-nav-card i svg, .module-nav-icon svg { width: 23px; height: 23px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.metric-icon.teal { background: linear-gradient(135deg,#1fd1b0,#078f87); }
.metric-icon.blue { background: linear-gradient(135deg,#61a5ff,#2f72dd); }
.metric-icon.orange { background: linear-gradient(135deg,#ffb34a,#ff7426); }
.metric-icon.green { background: linear-gradient(135deg,#45d49a,#16a76e); }
.metric-value { margin-top: 10px; color: #081936; font-size: 28px; font-weight: 600; letter-spacing: .1px; }
.metric-value small { margin-left: 3px; color: var(--muted); font-size: 12px; font-weight: 500; }
.metric-foot { margin-top: 5px; color: var(--muted); font-size: 11px; }
.trend-up { color: var(--green); }
.trend-down { color: var(--red); }

.dashboard-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-top: 16px; }
.panel { overflow: hidden; }
.panel-head { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 22px; border-bottom: 1px solid rgba(226,238,244,.9); }
.panel-head h3 { margin: 0; color: #0b2140; font-size: 17px; font-weight: 600; }
.panel-head p { margin: 5px 0 0; color: #7a8ba0; font-size: 12px; }
.panel-body { padding: 18px; }
.panel-link { border: 0; background: transparent; color: var(--teal); font-size: 12px; }

.chart { display: flex; align-items: flex-end; gap: 12px; height: 180px; padding-top: 10px; }
.chart-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; }
.chart-bar-wrap { width: 100%; height: 142px; display: flex; align-items: flex-end; justify-content: center; gap: 5px; border-bottom: 1px solid var(--line); }
.chart-bar { width: 12px; min-height: 6px; border-radius: 4px 4px 0 0; }
.chart-bar.plan { background: #dce8ec; }
.chart-bar.done { background: var(--teal); }
.chart-col span { color: var(--muted); font-size: 11px; }
.chart-legend { display: flex; gap: 16px; margin-top: 12px; color: var(--muted); font-size: 11px; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; }

.progress-list { display: grid; gap: 16px; }
.progress-top { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 12px; }
.progress-top strong { color: var(--navy); }
.progress-top span { color: var(--muted); }
.progress-track { height: 7px; overflow: hidden; border-radius: 8px; background: #edf2f4; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.quick-action { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid rgba(226,238,244,.9); text-align: left; transition: .2s; }
.quick-action:hover { border-color: #b8e4de; }
.quick-action i { width: 48px; height: 48px; display: grid; flex: 0 0 48px; place-items: center; border-radius: 13px; background: linear-gradient(135deg,#e9fbf7,#d7f4ee); color: var(--teal-dark); font-size: 0; font-style: normal; }
.quick-action:nth-child(2) i { background: linear-gradient(135deg,#eaf3ff,#d8e9ff); color: #2f72dd; }
.quick-action:nth-child(4) i { background: linear-gradient(135deg,#fff3e4,#ffe2bd); color: #ff7426; }
.quick-action strong { display: block; color: #0b2140; font-size: 16px; font-weight: 600; }
.quick-action span { display: block; margin-top: 5px; color: #6f8397; font-size: 13px; }
.module-nav-head { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; padding: 18px 20px; border: 1px solid #dcebea; border-radius: 12px; background: linear-gradient(135deg,#f8fdfc,#eef9f7); }
.module-nav-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px; background: var(--active-grad); color: white; font-size: 0; box-shadow: 0 12px 22px rgba(7,143,135,.2); }
.module-nav-head h2 { margin: 0; color: var(--navy); font-size: 20px; }
.module-nav-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.module-nav-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(245px,1fr)); gap: 14px; }
.module-nav-card { min-height: 138px; display: flex; align-items: flex-start; gap: 14px; padding: 20px; border: 1px solid #e6eef1; border-radius: 16px; background: white; box-shadow: var(--shadow); text-align: left; transition: .2s; }
.module-nav-card:hover { border-color: #b9e2df; }
.module-nav-card i { width: 48px; height: 48px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 13px; background: linear-gradient(135deg,#e9fbf7,#d8f4ef); color: var(--teal-dark); font-size: 0; font-style: normal; }
.module-nav-card strong { display: block; color: var(--navy); font-size: 14px; }
.module-nav-card span { display: block; min-height: 32px; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.module-nav-card b { display: block; margin-top: 10px; color: var(--teal); font-size: 11px; font-weight: 500; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 10px; }
.btn { min-height: 38px; padding: 0 15px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--text); font-size: 12px; transition: .2s; }
.btn:hover { border-color: #b9d8d5; color: var(--teal-dark); }
.btn.primary { border-color: var(--teal); background: var(--teal); color: white; }
.btn.primary:hover { background: var(--teal-dark); }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn:disabled { cursor: not-allowed; opacity: .55; }
.filter-input, .filter-select { height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; outline: 0; background: white; color: var(--text); font-size: 12px; }
.filter-input { width: 210px; }
.filter-input:focus, .filter-select:focus { border-color: var(--teal); }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 13px 16px; background: #f8fafb; color: #70889a; font-size: 11px; font-weight: 500; text-align: left; }
td { padding: 14px 16px; border-top: 1px solid var(--line); color: #486581; font-size: 12px; }
td strong { color: var(--navy); }
.table-empty { padding: 45px 20px; color: var(--muted); text-align: center; }
.sku-cell { display: flex; align-items: center; gap: 9px; }
.sku-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--teal-soft); color: var(--teal-dark); font-size: 11px; font-weight: 600; }
.sku-mark.product { background: var(--blue-soft); color: var(--blue); }
.badge { display: inline-block; padding: 4px 8px; border-radius: 12px; font-size: 11px; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.gray { background: #edf2f4; color: #718596; }
.stock-bar { width: 82px; height: 6px; display: inline-block; margin-left: 8px; overflow: hidden; border-radius: 4px; background: #edf2f4; vertical-align: middle; }
.stock-bar i { display: block; height: 100%; border-radius: 4px; background: var(--teal); }
.stock-bar.low i { background: var(--red); }
.color-stocks { display: flex; flex-wrap: wrap; gap: 4px; max-width: 270px; margin-top: 7px; }
.color-stock { padding: 3px 6px; border-radius: 10px; background: #f0f5f7; color: #668195; font-size: 10px; }
.color-stocks.muted { color: var(--muted); font-size: 10px; }
.action-link { margin-right: 10px; border: 0; background: transparent; color: var(--teal); font-size: 12px; }
.action-link.danger-link { color: var(--red); }
.doc-link { border: 0; background: transparent; color: var(--teal); font-size: 12px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.user-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-soft); color: var(--teal-dark); font-size: 12px; font-weight: 600; }
.current-user-tag { display: inline-block; margin-left: 5px; padding: 2px 5px; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-size: 9px; font-weight: 500; }

.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.report-kpis { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.report-kpi { padding: 14px; border-radius: 9px; background: #f8fafb; }
.report-kpi span { color: var(--muted); font-size: 11px; }
.report-kpi strong { display: block; margin-top: 8px; color: var(--navy); font-size: 20px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(7, 27, 44, .42); }
.modal { width: min(640px, calc(100vw - 36px)); overflow: hidden; border-radius: 12px; background: white; box-shadow: 0 18px 60px rgba(0,0,0,.18); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; color: var(--navy); font-size: 16px; }
.modal-close { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #f3f6f7; color: var(--muted); }
.modal-body { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; max-height: 64vh; overflow-y: auto; padding: 20px 22px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { display: block; margin-bottom: 7px; color: #607d8b; font-size: 12px; }
.form-field input, .form-field select, .form-field textarea { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 6px; outline: 0; color: var(--text); }
.form-field textarea { min-height: 68px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--teal); }
.form-field input[readonly] { background: #f5f8fa; color: var(--muted); cursor: not-allowed; }
.searchable-select { position: relative; min-width: 0; }
.searchable-select > input { width: 100%; }
.searchable-options { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 120; display: none; max-height: 220px; overflow-y: auto; padding: 5px; border: 1px solid var(--line); border-radius: 7px; background: white; box-shadow: 0 10px 24px rgba(16,42,67,.15); }
.searchable-options.show { display: grid; }
.searchable-option { padding: 8px 9px; border: 0; border-radius: 5px; background: white; color: var(--text); text-align: left; font-size: 12px; }
.searchable-option:hover { background: var(--teal-soft); color: var(--teal-dark); }
.searchable-empty { padding: 8px 9px; color: var(--muted); font-size: 12px; }
.structure-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: #f8fbfb; color: var(--muted); font-size: 12px; }
.structure-summary strong { margin-left: 4px; color: var(--navy); }
.structure-summary .btn { margin-left: auto; }
.structure-backdrop { z-index: 12; }
.structure-modal { width: min(1080px,calc(100vw - 36px)); }
.structure-body { max-height: calc(100vh - 180px); overflow-y: auto; padding: 18px 22px; background: #f8fafb; }
.structure-top { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 14px; }
.structure-top label { color: var(--muted); font-size: 12px; }
.structure-top input, .structure-line input, .structure-line select { width: 100%; min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--text); }
.structure-section { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.structure-section-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.structure-section-head h4 { margin: 0; color: var(--navy); font-size: 13px; }
.structure-lines { padding: 7px 12px; }
.structure-line { display: grid; grid-template-columns: minmax(180px,1fr) 110px 110px 28px; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #eef2f3; color: var(--muted); font-size: 11px; }
.structure-line:has([data-line-color]) { grid-template-columns: 100px minmax(180px,1fr) 110px 110px 28px; }
.structure-line:last-child { border-bottom: 0; }
.structure-line strong { color: var(--teal-dark); text-align: right; }
.structure-line strong small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 500; }
.structure-empty { padding: 7px 0; color: var(--muted); font-size: 12px; }
.color-structure-list { display: grid; gap: 8px; padding: 10px 12px; }
.color-structure-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #f8fbfb; }
.color-structure-card strong { display: block; color: var(--navy); font-size: 13px; }
.color-structure-card span { display: block; margin-top: 4px; color: var(--teal-dark); font-size: 11px; }
.color-structure-detail { display: grid; gap: 8px; padding: 10px 12px; color: var(--muted); font-size: 12px; }
.color-structure-detail p { margin: 0; color: var(--teal-dark); }
.color-structure-detail h5 { margin: 0 0 5px; color: var(--navy); font-size: 12px; }
.color-structure-detail ul { margin: 0; padding-left: 18px; line-height: 1.8; }
.color-structure-backdrop { z-index: 14; }
.color-structure-modal { width: min(920px,calc(100vw - 36px)); }
.production-modal { width: min(980px,calc(100vw - 36px)); }
.production-info { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbfb; }
.production-info-empty { color: var(--muted); font-size: 12px; }
.production-info-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin-bottom: 10px; }
.production-info-grid span { padding: 9px; border-radius: 6px; background: white; color: var(--muted); font-size: 11px; }
.production-info-grid strong { display: block; margin-top: 4px; color: var(--navy); font-size: 13px; }
.production-info-sections { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.production-info-sections section { padding: 9px; border-radius: 6px; background: white; }
.production-info-sections h4 { margin: 0 0 6px; color: var(--navy); font-size: 12px; }
.production-info-sections ul { margin: 0; padding-left: 16px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.production-detail { display: grid; gap: 14px; max-height: calc(100vh - 190px); overflow-y: auto; padding: 18px 22px; background: #f8fafb; }
.production-detail-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.production-detail-grid span { padding: 11px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--muted); font-size: 11px; }
.production-detail-grid strong { display: block; margin-top: 5px; color: var(--navy); font-size: 12px; line-height: 1.45; }
.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(260px,1fr)); gap: 14px; }
.settings-card { display: grid; gap: 12px; align-content: start; padding: 18px; }
.settings-card h3 { margin: 0; color: var(--navy); font-size: 16px; }
.settings-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.settings-card small { color: #6f8397; font-size: 12px; line-height: 1.5; }
.data-maintenance-page { display: grid; gap: 14px; }
.data-maintenance-alert { padding: 13px 15px; border: 1px solid #f4d58c; border-radius: 12px; background: #fff8e5; color: #8a5a00; font-size: 13px; line-height: 1.6; }
.product-import-list { display: grid; gap: 12px; }
.product-import-card { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 8px 22px rgba(16,42,67,.05); }
.product-import-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.product-import-card-head strong { display: block; color: var(--navy); font-size: 15px; line-height: 1.35; word-break: break-word; }
.product-import-card-head small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.product-import-meta { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.product-import-meta span { display: grid; gap: 4px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbfb; color: var(--muted); font-size: 11px; min-width: 0; }
.product-import-meta strong { color: var(--navy); font-size: 12px; line-height: 1.45; word-break: break-word; }
.product-import-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.product-import-modal { width: min(1180px, calc(100vw - 48px)); }
.product-import-list-wide .product-import-card { grid-template-columns: minmax(220px, 1.05fr) minmax(420px, 2fr) minmax(360px, auto); align-items: center; gap: 14px; }
.product-import-list-wide .product-import-card-head { align-items: center; }
.product-import-list-wide .product-import-card-head strong { font-size: 14px; }
.product-import-list-wide .product-import-meta { grid-template-columns: repeat(5,minmax(92px,1fr)); gap: 8px; }
.product-import-list-wide .product-import-meta span { padding: 0; border: 0; background: transparent; gap: 2px; }
.product-import-list-wide .product-import-actions { flex-wrap: nowrap; justify-content: flex-end; }
.product-import-list-wide .product-import-actions .btn { white-space: nowrap; min-height: 38px; padding: 8px 12px; }
.system-upgrade-modal { width: min(1080px, calc(100vw - 36px)); max-height: calc(100vh - 36px); }
.system-upgrade-body { display: grid; gap: 14px; padding: 18px 22px; max-height: calc(100vh - 150px); overflow-y: auto; }
.system-upgrade-section { overflow: hidden; }
.system-upgrade-info { padding: 16px; }
.upgrade-check-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding: 12px 16px 16px; }
.upgrade-check-grid span { display: grid; gap: 5px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbfb; color: var(--muted); font-size: 12px; }
.upgrade-check-grid strong { color: var(--navy); font-size: 13px; word-break: break-word; }
.upgrade-errors { grid-column: 1 / -1; padding: 12px; border-radius: 10px; background: var(--red-soft); color: var(--red); }
.upgrade-errors ul { margin: 8px 0 0; padding-left: 18px; }
.ok-text { color: var(--teal-dark) !important; }
.danger-text { color: var(--red) !important; }
.upgrade-progress { padding: 16px; }
.upgrade-log-box { min-height: 180px; max-height: 320px; margin: 0; padding: 14px; overflow: auto; border-top: 1px solid var(--line); background: #0f2233; color: #d9f7ef; font-size: 12px; line-height: 1.6; white-space: pre-wrap; }
.modal-foot-inline { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 16px 16px; }
.upgrade-task-list { display: grid; gap: 12px; padding: 14px; }
.upgrade-task-card { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 8px 22px rgba(16,42,67,.05); }
.upgrade-task-main { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.upgrade-task-main strong { color: var(--navy); font-size: 15px; }
.upgrade-task-main span { color: var(--muted); font-size: 13px; word-break: break-word; }
.upgrade-task-main small { width: 100%; color: var(--muted); font-size: 12px; }
.status-pill { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px; font-size: 12px; line-height: 1.2; }
.status-pill.ok { color: var(--teal-dark); background: var(--teal-soft); }
.status-pill.deleted { color: var(--red); background: var(--red-soft); }
.upgrade-task-meta { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.upgrade-task-meta span { padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbfb; color: var(--muted); font-size: 12px; min-width: 0; }
.upgrade-task-meta strong { display: block; margin-top: 4px; color: var(--navy); font-size: 12px; line-height: 1.4; word-break: break-word; }
.upgrade-task-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.upgrade-task-actions .action-link[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.muted-link { color: var(--muted) !important; }
.backup-file-meta { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-bottom: 16px; }
.backup-file-meta span { display: grid; gap: 5px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbfb; color: var(--muted); font-size: 12px; }
.backup-file-meta strong { color: var(--navy); font-size: 14px; word-break: break-all; }
.init-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.init-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.init-option input { margin-top: 3px; accent-color: var(--teal); }
.init-option span { display: grid; gap: 4px; }
.init-option strong { color: var(--navy); font-size: 14px; }
.init-option small { color: var(--muted); line-height: 1.45; }
.danger-zone { border-color: #ffd3d3; background: #fffafa; }
.inner-panel { padding: 14px; }
.receipt-panel-head { align-items: flex-start; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.receipt-panel-head h3, .receipt-panel-head p { writing-mode: horizontal-tb; word-break: normal; overflow-wrap: anywhere; }
.receipt-worker-picker { display: grid; grid-template-columns: minmax(260px,420px) auto; align-items: start; gap: 8px; }
.receipt-worker-picker input { width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; outline: 0; color: var(--text); }
.receipt-worker-picker input:focus { border-color: var(--teal); }
.receipt-worker-search { position: relative; }
.receipt-worker-options { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 5px); display: none; max-height: 230px; overflow-y: auto; gap: 5px; padding: 7px; border: 1px solid var(--line); border-radius: 7px; background: #f8fbfb; box-shadow: 0 12px 24px rgba(22,51,72,.14); }
.receipt-worker-options.show { display: grid; }
.receipt-worker-options button { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 9px; border: 1px solid transparent; border-radius: 6px; background: white; color: var(--navy); font-size: 12px; text-align: left; cursor: pointer; }
.receipt-worker-options button:hover { border-color: #b9e2df; color: var(--teal-dark); }
.receipt-worker-options small, .receipt-worker-options span { color: var(--muted); font-size: 11px; }
.receipt-scan-grid { display: grid; grid-template-columns: minmax(360px,1fr) auto repeat(3,minmax(130px,170px)); gap: 10px; align-items: end; }
.receipt-scan-grid label { min-width: 0; color: #607d8b; font-size: 12px; }
.receipt-scan-grid input { width: 100%; height: 38px; margin-top: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; outline: 0; color: var(--text); }
.receipt-scan-grid input:focus { border-color: var(--teal); }
.receipt-scan-grid input:disabled { background: #f5f8fa; color: var(--muted); }
.receipt-trace-field { grid-column: 1 / span 1; }
.receipt-trace-add { min-width: 108px; }
.receipt-scan-grid label:nth-of-type(n+2) { grid-row: 2; }
.trace-code-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.trace-code-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; background: #edf7f6; color: var(--teal-dark); font-size: 12px; font-weight: 500; }
.trace-code-chip button { border: 0; background: transparent; color: #e15858; font-size: 16px; cursor: pointer; }
.trace-label-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-top: 14px; }
.trace-label { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.trace-label img { width: 120px; height: 120px; }
.trace-label strong { color: var(--navy); font-size: 12px; letter-spacing: 1px; }
.dispatch-modal { width: min(1120px,calc(100vw - 36px)); }
.dispatch-body { display: grid; gap: 15px; max-height: calc(100vh - 180px); overflow-y: auto; padding: 18px 22px; background: #f8fafb; }
.dispatch-top { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.dispatch-zone, .dispatch-detail-zone { padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.dispatch-zone-head, .dispatch-person-head, .dispatch-task-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dispatch-zone-head { margin-bottom: 12px; }
.dispatch-zone-head h4, .dispatch-detail-zone h4 { margin: 0; color: var(--navy); font-size: 14px; }
.dispatch-zone-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.dispatch-person { margin-top: 10px; padding: 12px; border: 1px solid #dcebea; border-radius: 8px; background: #f8fbfb; }
.dispatch-person-head > div:first-child { display: grid; grid-template-columns: 100px minmax(220px,360px); align-items: center; gap: 10px; }
.dispatch-person-head > div:last-child { display: flex; gap: 7px; }
.dispatch-person-head strong { color: var(--navy); font-size: 12px; }
.dispatch-tasks { display: grid; gap: 8px; margin-top: 10px; }
.dispatch-task { display: grid; grid-template-columns: repeat(3,minmax(150px,1fr)); gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.dispatch-task-title { grid-column: 1 / -1; padding-bottom: 7px; border-bottom: 1px solid #edf2f3; }
.dispatch-task-title strong { color: var(--teal-dark); font-size: 12px; }
.dispatch-task label { min-width: 0; color: var(--muted); font-size: 11px; }
.dispatch-task input, .dispatch-task select, .dispatch-task textarea { width: 100%; min-width: 0; margin-top: 6px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--text); }
.dispatch-task textarea { min-height: 60px; resize: vertical; }
.dispatch-task label small { display: block; margin-top: 4px; color: var(--teal-dark); }
.dispatch-task .dispatch-wide { grid-column: 1 / -1; }
.dispatch-detail-zone p { color: var(--muted); font-size: 12px; }
.dispatch-detail-person { margin-top: 10px; padding: 11px; border-radius: 7px; background: #f8fbfb; }
.dispatch-detail-person strong { color: var(--navy); font-size: 13px; }
.dispatch-detail-person ol { margin: 7px 0 0; padding-left: 20px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 18px; }
.scanner-backdrop { z-index: 1600; }
.scanner-modal { width: min(520px, calc(100vw - 28px)); }
.scanner-body { padding: 18px 22px; background: #071b2c; color: white; text-align: center; }
.scanner-video-wrap { position: relative; overflow: hidden; aspect-ratio: 1 / 1; border-radius: 14px; background: #000; }
.scanner-video-wrap video { width: 100%; height: 100%; object-fit: cover; }
.scanner-mask { position: absolute; inset: 0; background: rgba(0,0,0,.38); }
.scanner-frame { position: absolute; inset: 15%; border-radius: 16px; box-shadow: 0 0 0 999px rgba(0,0,0,.42); }
.scanner-frame span { position: absolute; width: 34px; height: 34px; border-color: #12e89d; animation: corner-pulse 1.2s ease-in-out infinite alternate; }
.scanner-frame span:nth-child(1) { left: 0; top: 0; border-left: 4px solid #12e89d; border-top: 4px solid #12e89d; border-radius: 12px 0 0 0; }
.scanner-frame span:nth-child(2) { right: 0; top: 0; border-right: 4px solid #12e89d; border-top: 4px solid #12e89d; border-radius: 0 12px 0 0; }
.scanner-frame span:nth-child(3) { right: 0; bottom: 0; border-right: 4px solid #12e89d; border-bottom: 4px solid #12e89d; border-radius: 0 0 12px 0; }
.scanner-frame span:nth-child(4) { left: 0; bottom: 0; border-left: 4px solid #12e89d; border-bottom: 4px solid #12e89d; border-radius: 0 0 0 12px; }
.scanner-frame i { position: absolute; left: 8%; right: 8%; top: 10%; height: 2px; background: #12e89d; box-shadow: 0 0 14px #12e89d; animation: scan-line 1.5s linear infinite; }
.scanner-success .scanner-frame { animation: scanner-success-flash .22s ease-in-out 2; }
.scanner-body p { margin: 14px 0 0; color: rgba(255,255,255,.82); font-size: 12px; }
.scanner-body .scanner-tip { margin-top: 8px; color: rgba(255,255,255,.62); line-height: 1.6; }
.scanner-manual { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 14px; }
.scanner-manual input { min-width: 0; height: 38px; padding: 0 11px; border: 1px solid rgba(255,255,255,.24); border-radius: 8px; background: rgba(255,255,255,.1); color: white; outline: 0; }
.scanner-manual input::placeholder { color: rgba(255,255,255,.56); }
@keyframes scan-line { from { top: 10%; } to { top: 90%; } }
@keyframes corner-pulse { from { opacity: .68; } to { opacity: 1; } }
@keyframes scanner-success-flash { 50% { box-shadow: 0 0 0 999px rgba(18,232,157,.24); } }
.logged-out .app-shell { visibility: hidden; }
.login-screen { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg,#102a43 0%,#173f5f 48%,#087b75 100%); }
.login-wrap { width: min(420px,100%); display: grid; gap: 14px; justify-items: center; }
.login-card { width: min(420px,100%); padding: 30px; border-radius: 16px; background: white; box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.login-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.login-logo { width: 112px; height: 56px; object-fit: contain; border-radius: 9px; background: white; }
.login-brand h1 { margin: 0; color: var(--navy); font-size: 21px; }
.login-brand p, .login-welcome p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.login-welcome { padding: 22px 0 16px; }
.login-welcome h2 { margin: 0; color: var(--navy); font-size: 19px; }
.login-card label { display: block; margin-bottom: 14px; color: #607d8b; font-size: 12px; }
.login-card input { width: 100%; margin-top: 7px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 7px; outline: 0; color: var(--text); }
.login-card input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.login-submit { width: 100%; min-height: 42px; margin-top: 4px; }
.login-hint { margin-top: 15px; padding: 10px; border-radius: 7px; background: #f5f8fa; color: var(--muted); font-size: 11px; text-align: center; }
.login-icp, .login-icp a { color: #ffffff !important; font-size: 12px; text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,0.45); }
.login-error { margin-bottom: 14px; padding: 10px 12px; border-radius: 7px; background: var(--red-soft); color: var(--red); font-size: 12px; }
.permission-modal { width: min(920px, calc(100vw - 36px)); }
.permission-modal .modal-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.permission-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.permission-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; max-height: 62vh; overflow-y: auto; padding: 18px 22px; background: #f8fafb; }
.permission-group { padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.permission-group h4 { margin: 0 0 9px; color: var(--navy); font-size: 13px; }
.permission-item { display: flex; align-items: flex-start; gap: 7px; padding: 5px 0; color: #55758a; font-size: 11px; line-height: 1.35; }
.permission-item input { accent-color: var(--teal); }
.sales-modal { width: min(980px, calc(100vw - 36px)); max-height: calc(100vh - 36px); overflow-y: auto; }
.preview-modal { width: min(1180px, calc(100vw - 36px)); max-height: calc(100vh - 36px); }
.print-preview { margin: 0; padding: 18px 22px; overflow: auto; max-height: calc(100vh - 180px); border-top: 1px solid #dce4e8; border-bottom: 1px solid #dce4e8; background: #eef3f6; color: #111827; font-family: Arial,"Microsoft YaHei",sans-serif; }
.print-preview-canvas { min-width: max-content; padding: 0; }
.print-page { width: 210mm; min-height: 297mm; margin: 0 auto 10mm; padding: 8mm 5mm; box-sizing: border-box; background: #fff; box-shadow: 0 6px 22px rgba(15,35,55,.12); break-after: page; page-break-after: always; }
.sales-print-inner { width: 170mm; margin: 0 auto; }
.sales-print-body { width: 170mm; margin: 0 auto; }
.sales-page-no { text-align: right; font-size: 9.5px; line-height: 1; margin: 1.5mm 0 0; color: #333; }
.print-header { display: block; width: 205mm; margin: 0 0 2.8mm 50%; padding: 0; text-align: center; transform: translateX(-50%); }
.print-header img { display: block; width: 205mm; max-width: none; height: auto; object-fit: contain; }
.print-preview h1, .print-title { margin: 0 0 2.5mm; color: #111; font-size: 20px; line-height: 1.1; text-align: center; font-weight: 500; letter-spacing: .08em; }
.print-preview .print-subtitle { text-align: center; color: #456; }
.print-preview p { margin: 6px 0; font-size: 13px; }
.print-preview .meta { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin: 18px 0; }
.print-info-grid { display: grid; grid-template-columns: 1.05fr .92fr .52fr; gap: 2mm 12mm; margin: 0 0 3.2mm; font-size: 11.5px; line-height: 1.35; }
.sales-order-right-info { transform: translateX(-10mm); white-space: nowrap; }
.print-info-grid p { margin: 0; font-size: 11.5px; }
.print-info-grid strong { font-weight: 500; }
.print-preview table { width: 100%; margin-top: 16px; border-collapse: collapse; white-space: normal; }
.print-preview th, .print-preview td { padding: 7px; border: 1px solid #c8d0d6; color: #111827; font-size: 12px; font-weight: 400; }
.print-preview th { background: #f7f9fb; font-weight: 500; }
.print-table { width: 100%; border-collapse: collapse; margin: 0 0 10mm; font-size: 11.5px; line-height: 1.25; }
.print-table th, .print-table td { border: 0; padding: 1.7mm 1.6mm; text-align: center; color: #111; font-size: 11.5px; }
.print-table th { border-top: 2px solid #111; border-bottom: 1.4px solid #111; background: #fff; font-weight: 500; }
.sale-print-template { color: #000; }
.sale-print-template .print-header { margin-bottom: 8mm; }
.sale-print-table { margin-top: 0 !important; }
.sale-print-table th { padding: 1.6mm 1.3mm; border-top: 1.8px solid #111 !important; border-bottom: 1.8px solid #111 !important; font-size: 11.5px; font-weight: 500; }
.sale-print-table td { padding: .85mm 1mm; border: 0 !important; font-size: 11px; line-height: 1.12; }
.sale-print-table tbody tr:first-child td { padding-top: 2.55mm; }
.sale-print-table th:nth-child(1), .sale-print-table td:nth-child(1) { width: 27%; }
.sale-print-table th:nth-child(2), .sale-print-table td:nth-child(2) { width: 25%; }
.sale-print-table th:nth-child(3), .sale-print-table td:nth-child(3) { width: 15%; }
.sale-print-table th:nth-child(4), .sale-print-table td:nth-child(4) { width: 15%; }
.sale-print-table th:nth-child(5), .sale-print-table td:nth-child(5) { width: 18%; }
.delivery-note-table th:nth-child(1), .delivery-note-table td:nth-child(1) { width: 30%; }
.delivery-note-table th:nth-child(2), .delivery-note-table td:nth-child(2) { width: 30%; }
.delivery-note-table th:nth-child(3), .delivery-note-table td:nth-child(3) { width: 20%; }
.delivery-note-table th:nth-child(4), .delivery-note-table td:nth-child(4) { width: 20%; }
.delivery-note-table tbody tr:last-child td { border-bottom: 1px solid #111 !important; }
.sale-color-cell { font-size: 10.8px; line-height: 1.12; }
.sale-color-cell span { display: block; white-space: nowrap; margin: 0 0 .15mm 0; }
.sale-print-separator { border-top: 1px solid #777; margin: 8mm 0 2.5mm; }
.sales-summary-row { display: grid; grid-template-columns: 1.35fr 58mm; column-gap: 14mm; align-items: start; margin-top: 0; font-size: 11.5px; line-height: 1.38; }
.sales-discount-info h3 { margin: 0 0 1mm; font-size: 12px; font-weight: 500; }
.sales-discount-info p { margin: 0 0 .45mm; font-size: 11.5px; }
.sales-discount-info strong, .sales-total-info strong { font-weight: 600; }
.sales-total-info { padding-top: 0; font-size: 11.8px; line-height: 1.42; }
.sales-total-info .row { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; margin: 0; font-size: 11.8px; }
.sales-total-info .amount { text-align: right; font-weight: 600; }
.sales-sign-row { width: 84mm; margin: 10mm 18mm 3mm auto; display: grid; grid-template-columns: 1fr 1fr; column-gap: 6mm; font-size: 10.8px; justify-items: end; }
.sales-sign-item { display: flex; align-items: center; justify-content: flex-end; gap: 5px; width: 100%; margin: 0; white-space: nowrap; font-size: 10.8px; }
.sales-sign-line { display: inline-block; width: 27mm; height: 4mm; border-bottom: 1px solid #222; }
.sales-warning { width: 78mm; margin-left: auto; margin-right: 0; font-size: 9.8px; line-height: 1.38; }
.sales-warning h3 { margin: 0 0 .3mm; font-size: 10.5px; font-weight: 600; }
.sales-warning p { margin: 0; font-size: 9.8px; line-height: 1.38; }
.envelope-print-page { width: 220mm !important; min-height: 110mm !important; height: 110mm !important; padding: 0 !important; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.envelope-print-page .sales-print-inner { width: 220mm !important; margin: 0 !important; }
.envelope-print { width: 150mm; margin: 0 auto; font-size: 17px; line-height: 1.45; text-align: left; transform: translateX(26mm); }
.envelope-print h1 { text-align: left; font-size: 22px; font-weight: 500; margin: 0 0 6mm; letter-spacing: .15em; }
.envelope-print p { display: grid; grid-template-columns: 28mm 1fr; margin: 0 0 1.8mm; }
.envelope-print span { color: #333; }
.envelope-print strong { font-weight: 500; }
.print-preview .foot { margin-top: 20px; text-align: right; }
.print-money-summary { margin-top: 16px; display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.print-money-summary p { margin: 0; padding: 8px; border: 1px solid #cbd5db; background: #fafafa; }
.print-section-line { border-top: 1px solid #8a8a8a; margin: 14mm 0 3mm; }
.print-discount-block { display: grid; grid-template-columns: 1fr .55fr; gap: 8mm; margin-bottom: 14mm; font-size: 14px; line-height: 1.85; }
.print-discount-block h3 { margin: 0 0 2mm; font-size: 15px; font-weight: 500; }
.print-discount-block p { margin: 0; font-size: 14px; }
.print-amount-box { justify-self: end; min-width: 58mm; }
.print-amount-box p { display: flex; justify-content: space-between; gap: 8mm; margin: 0 0 1.5mm; font-size: 14px; }
.print-amount-box strong { font-weight: 600; }
.print-sign-area { display: grid; grid-template-columns: 1fr 1fr; gap: 18mm; margin: 22mm 0 6mm; font-size: 15px; }
.print-sign-area p { font-size: 15px; }
.print-sign-area span { display: inline-block; min-width: 34mm; height: 7mm; border-bottom: 1px solid #222; vertical-align: bottom; }
.print-notice { margin-left: 84mm; font-size: 13px; line-height: 1.75; }
.print-notice h3 { margin: 0 0 1mm; font-size: 14px; font-weight: 600; }
.print-notice p { margin: 0; font-size: 13px; line-height: 1.75; }
.sales-form-top { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.customer-shipping { display: flex; flex-wrap: wrap; gap: 18px; padding: 10px 22px; border-bottom: 1px solid var(--line); background: #fbfcfd; color: var(--muted); font-size: 11px; }
.customer-shipping strong { margin-left: 5px; color: var(--navy); font-weight: 500; }
.sales-lines-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px 8px; color: var(--navy); }
.sales-columns { display: grid; grid-template-columns: 150px 82px minmax(320px,1fr) 138px 112px; gap: 10px; padding: 0 32px 7px; color: var(--muted); font-size: 10px; }
.sales-lines { display: grid; gap: 8px; max-height: 310px; overflow-y: auto; padding: 0 22px 14px; }
.sales-line { display: grid; grid-template-columns: 150px 82px minmax(320px,1fr) 138px 112px 28px; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; }
.sales-line select, .sales-line input { width: 100%; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 5px; background: white; color: var(--text); font-size: 12px; }
.sales-line span { color: var(--muted); font-size: 11px; }
.sales-line strong { color: var(--teal-dark); font-size: 12px; }
.piece-work-columns { grid-template-columns: 96px 220px 92px 104px; }
.piece-work-line { grid-template-columns: 96px 220px 92px 104px 26px; }
.piece-work-line [data-piece-qty] { display: none; }
.piece-work-line .piece-mode-select[style*="hidden"] { pointer-events: none; }
.piece-work-line .line-remove { align-self: start; margin-top: 5px; }
.piece-work-line [data-piece-amount] { align-self: start; margin-top: 8px; }
.sale-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.sale-color { display: flex; align-items: center; gap: 6px; padding: 5px 7px; border-radius: 6px; background: var(--teal-soft); color: var(--teal-dark); font-size: 11px; }
.sale-color span, .detail-color { color: var(--teal-dark); }
.sale-color small, .detail-color small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.sale-color input { width: 68px; padding: 5px 6px; background: white; }
.sale-color .stock-error { display: none; color: var(--red); font-size: 10px; font-style: normal; }
.sale-color.has-error { background: var(--red-soft); }
.sale-color.has-error .stock-error { display: block; }
.sale-color input.input-error { border-color: var(--red); color: var(--red); }
.line-price-input { color: var(--navy) !important; font-weight: 500; }
.line-price, .line-qty { color: var(--navy) !important; font-weight: 500; }
.no-stock { color: var(--red) !important; }
.sale-detail-line { grid-template-columns: 150px 100px minmax(320px,1fr) 155px 120px; }
.sale-detail-money-columns { grid-template-columns: 150px 120px minmax(260px,1fr) 140px 150px 140px; }
.sale-detail-money-line { grid-template-columns: 150px 120px minmax(260px,1fr) 140px 150px 140px; }
.sale-detail-money-line strong small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 400; }
.sales-money-summary { flex-wrap: wrap; justify-content: flex-start; }
.detail-color { min-width: 64px; padding: 6px 8px; border-radius: 6px; background: var(--teal-soft); font-size: 11px; }
.sales-form-top strong { display: block; margin-top: 6px; color: var(--navy); font-size: 13px; }
.sales-form-top small { color: var(--muted); font-size: 11px; }
.line-remove { width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--red-soft); color: var(--red); }
.sales-summary { display: flex; justify-content: flex-end; gap: 24px; padding: 14px 22px; background: #f8fbfb; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.sales-summary strong { display: block; margin-top: 5px; color: var(--navy); font-size: 16px; }
.customer-price-toolbar .toolbar-left,
.product-price-toolbar .toolbar-left { display: flex; gap: 10px; flex-wrap: wrap; }
.customer-price-toolbar select,
.product-price-toolbar select { min-height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: white; color: var(--text); }
.table-price-input { width: 110px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--navy); background: white; }
.table-price-input.price-changed { border-color: var(--orange); background: #fff8ec; box-shadow: 0 0 0 2px rgba(245,158,11,.12); }
.ledger-metrics { grid-template-columns: repeat(3,1fr); margin-bottom: 16px; }
.ledger-toolbar { justify-content: flex-start; }
.statement-toolbar { justify-content: flex-start; }
.statement-metrics { margin-bottom: 16px; }
.wage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.wage-full { grid-column: 1 / -1; }
.wage-grid .panel-head > div:last-child { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.wage-form-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbfb; }
.wage-form-grid input, .wage-form-grid select { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--text); }
.wage-slip-page + .wage-slip-page { margin-top: 28px; padding-top: 24px; border-top: 2px dashed #999; }
.page-back-row { margin-bottom: 14px; }
.warehouse-filter { margin-bottom: 14px; }
.warehouse-pick-table td { vertical-align: middle; }
.warehouse-pick-table td:last-child { white-space: nowrap; }
.mobile-pick-list { display: none; }
.mobile-empty { padding: 24px; border: 1px dashed var(--line); border-radius: 12px; background: white; color: var(--muted); text-align: center; }
.needs-reprint-row { background: var(--red-soft); animation: pick-alert 1.2s ease-in-out infinite alternate; }
.picker-tags { display: flex; flex-wrap: wrap; gap: 6px; max-width: 220px; }
.picker-tags span { padding: 4px 8px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-dark); font-size: 11px; font-weight: 500; }
.picker-tags em { color: var(--muted); font-size: 11px; font-style: normal; }
.warehouse-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(300px,1fr)); gap: 14px; }
.pick-card { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow); }
.pick-card.needs-reprint { border: 2px solid var(--red); background: var(--red-soft); animation: pick-alert 1.2s ease-in-out infinite alternate; }
.pick-card-head, .pick-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pick-card-head strong, .pick-card-head span { display: block; }
.pick-card-head strong { color: var(--navy); font-size: 13px; }
.pick-card-head span, .pick-card p { margin-top: 5px; color: var(--muted); font-size: 11px; }
.pick-card h3 { margin: 15px 0 5px; color: var(--navy); font-size: 15px; }
.pick-card-actions { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.pick-card-actions select { min-width: 120px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--text); font-size: 12px; }
.pick-card-actions select[multiple] { min-width: 150px; min-height: 76px; }
.picker-worker-list { display: grid; gap: 10px; }
.picker-choice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--navy); }
.picker-choice input { width: auto; margin: 0; }
.picker-choice small { margin-left: auto; color: var(--muted); }
.sales-order-board { display: grid; grid-template-columns: repeat(auto-fill,minmax(300px,1fr)); gap: 14px; }
.sales-order-card { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow); text-align: left; transition: .2s; }
.sales-order-card:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(22,51,72,.12); }
.sales-order-card h3 { margin: 15px 0 7px; color: var(--navy); font-size: 15px; }
.sales-order-card p { margin: 6px 0; color: var(--muted); font-size: 11px; }
.sales-order-card p strong, .sales-order-card p b { color: var(--navy); }
.sales-order-card.due-yellow { border: 2px solid #e7bd42; background: #fffbea; }
.sales-order-card.due-orange { border: 2px solid var(--orange); background: var(--orange-soft); }
.sales-order-card.due-red { border: 2px solid var(--red); background: var(--red-soft); animation: pick-alert 1.2s ease-in-out infinite alternate; }
.order-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--teal); font-size: 11px; }
.order-card-foot b { color: var(--muted); font-weight: 500; }
.option-master-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 16px; }
.option-list { padding: 8px 16px; }
.option-row, .inline-option-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.option-row:last-child, .inline-option-row:last-child { border-bottom: 0; }
.managed-select { display: flex; gap: 7px; }
.managed-select select, .managed-select input { min-width: 0; flex: 1; }
.managed-select .btn { flex: 0 0 auto; }
.option-manager-backdrop { z-index: 12; }
.option-manager-modal { width: min(560px,calc(100vw - 36px)); }
.inline-option-add { display: flex; gap: 8px; margin-bottom: 10px; }
.inline-option-add input, .inline-option-row input { flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--text); }
@keyframes pick-alert { from { box-shadow: 0 0 0 rgba(214,77,77,.1); } to { box-shadow: 0 0 0 4px rgba(214,77,77,.16); } }
.toast-root { position: fixed; right: 24px; bottom: 24px; z-index: 20; display: grid; gap: 10px; }
.toast { min-width: 250px; padding: 13px 16px; border-left: 4px solid var(--green); border-radius: 7px; background: white; box-shadow: 0 10px 32px rgba(16,42,67,.14); color: var(--navy); font-size: 12px; animation: toast-in .2s ease-out; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.inspection-toolbar .toolbar-left { flex-wrap: wrap; }
.inspection-mobile-card { overflow: visible; }
.inspection-form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.inspection-submit-foot { justify-content: flex-end; }
.process-print-head { display: grid; grid-template-columns: minmax(0,1fr) 150px; gap: 18px; align-items: start; }
.inspection-print-qr { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; background: #fff; text-align: center; }
.inspection-print-qr img { width: 128px; height: 128px; }
.inspection-print-qr strong { color: var(--navy); }
.inspection-print-qr small { color: var(--muted); font-size: 12px; }

@media (max-width: 1100px) {
  .sidebar { width: 76px; }
  .brand { height: 78px; padding: 5px; }
  .brand-logo { width: 66px; max-width: 100%; height: auto; }
  .brand > div:last-child, .nav-item span, .sidebar-footer { display: none; }
  .nav-item { justify-content: center; }
  .main-area { width: calc(100% - 76px); margin-left: 76px; }
  .metrics { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  :root {
    --mobile-nav-height: 68px;
    --mobile-safe-bottom: env(safe-area-inset-bottom);
  }
  html, body { width: 100%; max-width: 100vw; overflow-x: hidden; font-size: 14px; }
  body { padding-bottom: calc(88px + var(--mobile-safe-bottom)); }
  .app-shell { display: block; width: 100vw; min-height: 100vh; overflow-x: hidden; }
  .sidebar { position: fixed; left: 0; right: 0; top: auto; bottom: 0; z-index: 900; width: 100vw; height: calc(var(--mobile-nav-height) + var(--mobile-safe-bottom)); padding: 6px 8px calc(6px + var(--mobile-safe-bottom)); display: block; background: rgba(255,255,255,.97); border-top: 1px solid rgba(15,35,55,.08); box-shadow: 0 -4px 18px rgba(15,35,55,.06); backdrop-filter: blur(12px); }
  body.modal-open .sidebar { display: none !important; }
  .brand, .sidebar-footer { display: none; }
  .main-nav { height: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(44px,1fr); gap: 2px; padding: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; align-items: start; }
  .main-nav::-webkit-scrollbar { display: none; }
  .nav-item, .nav-category { height: 54px; min-width: 44px; margin: 0; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 4px 2px; border: 0; border-radius: 14px; background: transparent; color: #7f8fa3; font-size: 12px; font-weight: 400; line-height: 1.1; text-align: center; transform: none; box-shadow: none; }
  .nav-item:hover { transform: none; background: rgba(0,143,122,.05); border-color: transparent; color: #008f7a; }
  .nav-item span { display: block; max-width: none; overflow: visible; text-overflow: clip; white-space: nowrap; color: inherit; font-size: 0; font-weight: 400; line-height: 1.1; letter-spacing: 0; }
  .nav-item span::after { content: attr(data-mobile-label); font-size: 12px; font-weight: 400; }
  .nav-item i, .nav-category i { width: 22px; height: 22px; flex: 0 0 22px; background: transparent; color: inherit; font-size: 0; }
  .nav-item svg { width: 22px; height: 22px; stroke-width: 1.55; }
  .nav-item.active { background: rgba(0,143,122,.08); color: #008f7a; box-shadow: none; font-weight: 500; }
  .nav-item.active span::after { font-weight: 500; }
  .nav-item.active svg { stroke-width: 1.65; }
  .nav-category.active i { background: transparent; }
  .main-area { width: 100vw; max-width: 100vw; margin-left: 0; overflow-x: hidden; }
  .topbar { width: 100%; max-width: 100vw; height: auto; min-height: 0; display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px 10px; overflow: visible; }
  .topbar > div:first-child { order: 2; display: block; width: 100%; min-width: 0; max-width: 100%; }
  .topbar h1, #pageTitle, .page-title, .module-title, .content-title, .module-nav-head h2 {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 0;
    writing-mode: horizontal-tb !important;
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    line-height: 1.3 !important;
    font-size: 20px;
    text-align: left;
  }
  .topbar p, #pageSubtitle, .page-subtitle, .module-subtitle, .content-subtitle, .module-nav-head p {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 5px 0 0;
    writing-mode: horizontal-tb !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    line-height: 1.5 !important;
    font-size: 14px;
    text-align: left;
  }
  .topbar-actions { order: 1; width: 100%; min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) 42px 36px auto; align-items: center; gap: 9px; }
  .user-profile { width: 36px; min-width: 36px; max-width: 36px; padding-left: 0; border-left: 0; flex: 0 0 36px; justify-content: center; overflow: visible; }
  .user-profile > div:last-child { display: none; }
  .search-box { width: 100%; min-width: 0; height: 44px; display: flex; }
  .message-button { width: 42px; height: 42px; }
  .global-search-results, .message-panel { position: fixed; left: 12px; right: 12px; top: 72px; width: auto; max-height: calc(100dvh - 150px); }
  .avatar, .user-avatar, .topbar-avatar, .header-avatar {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    flex: 0 0 36px !important;
    flex-shrink: 0 !important;
    aspect-ratio: 1 / 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    line-height: 36px !important;
  }
  .logout-btn { min-height: 44px; padding: 0 12px; font-size: 14px; }
  .page-content { width: 100%; max-width: 100vw; padding: 14px 12px calc(112px + var(--mobile-safe-bottom)); overflow-x: hidden; }
  .panel, .metric-card, .quick-action, .module-nav-head, .module-nav-card { border-radius: 12px; }
  .dashboard-grid, .split-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(2,1fr); }
  .module-nav-head { width: 100%; min-width: 0; display: flex; align-items: flex-start; gap: 12px; padding: 14px; }
  .module-nav-head > div:last-child { min-width: 0; flex: 1 1 auto; }
  .module-nav-icon { flex: 0 0 48px; width: 48px; height: 48px; }
  .module-nav-card > div { min-width: 0; }
  .module-nav-card strong, .module-nav-card span, .module-nav-card b {
    writing-mode: horizontal-tb !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
  }
  .toolbar { width: 100%; align-items: stretch; flex-direction: column; gap: 10px; }
  .toolbar-left, .toolbar-right { width: 100%; display: grid; grid-template-columns: 1fr; gap: 9px; }
  .filter-input, .filter-select, .toolbar .btn { width: 100%; height: 44px; font-size: 14px; }
  .btn { min-height: 44px; padding: 0 14px; font-size: 14px; }
  .action-link { min-height: 36px; margin: 4px 6px 4px 0; padding: 0 6px; font-size: 14px; }
  .desktop-pick-panel { display: none; }
  .mobile-pick-list { display: grid; gap: 12px; }
  .mobile-pick-card { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: var(--shadow); }
  .mobile-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .mobile-card-head strong { color: var(--navy); font-size: 16px; }
  .mobile-card-main { display: grid; gap: 4px; margin-top: 10px; }
  .mobile-card-main b { color: var(--navy); font-size: 16px; }
  .mobile-card-main small, .mobile-card-meta { color: var(--muted); font-size: 14px; }
  .mobile-card-meta { display: grid; grid-template-columns: 1fr; gap: 5px; margin-top: 9px; }
  .mobile-card-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 12px; }
  .mobile-card-actions .btn { width: 100%; }
  .table-wrap { overflow-x: hidden; }
  table { white-space: normal; }
  .table-wrap table:not(.warehouse-pick-table) thead { display: none; }
  .table-wrap table:not(.warehouse-pick-table), .table-wrap table:not(.warehouse-pick-table) tbody, .table-wrap table:not(.warehouse-pick-table) tr, .table-wrap table:not(.warehouse-pick-table) td { display: block; width: 100%; }
  .table-wrap table:not(.warehouse-pick-table) tr { margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
  .table-wrap table:not(.warehouse-pick-table) td { padding: 7px 0; border-top: 0; font-size: 14px; white-space: normal; }
  .table-wrap table:not(.warehouse-pick-table) td strong { font-size: 16px; }
  .modal-backdrop { z-index: 1500; align-items: stretch; padding: 0; overflow-x: hidden; }
  .modal, .sales-modal, .production-modal, .dispatch-modal, .preview-modal, .permission-modal, .structure-modal, .color-structure-modal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .modal-head { padding: 14px 16px; }
  .modal-head h3 { font-size: 18px; }
  .modal-close { width: 44px; height: 44px; font-size: 20px; }
  .modal-body, .dispatch-body, .structure-body { grid-template-columns: 1fr; max-height: calc(100dvh - 132px); overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 14px calc(96px + var(--mobile-safe-bottom)); }
  .dispatch-body { padding-bottom: calc(104px + var(--mobile-safe-bottom)); }
  .modal-foot { position: sticky; bottom: 0; flex-wrap: wrap; padding: 12px 14px calc(14px + var(--mobile-safe-bottom)); background: white; z-index: 4; border-top: 1px solid rgba(15,35,55,.08); box-shadow: 0 -6px 18px rgba(15,35,55,.08); }
  .modal-foot .btn { flex: 1 1 auto; }
  .form-field, .form-item, .input-group { width: 100% !important; min-width: 0 !important; box-sizing: border-box !important; }
  .form-field.full { grid-column: auto !important; }
  .form-field input, .form-field select, .form-field textarea,
  .form-item input, .form-item select, .form-item textarea,
  .input-group input, .input-group select, .input-group textarea {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .modal-content, .dialog-content, .form-modal-content { width: 100% !important; max-width: 100vw !important; box-sizing: border-box !important; }
  .sales-form-top { width: 100%; display: grid !important; grid-template-columns: 1fr !important; gap: 14px !important; padding: 14px !important; box-sizing: border-box; }
  .sales-form-top > * { width: 100% !important; min-width: 0 !important; box-sizing: border-box !important; }
  .sales-form-top input, .sales-form-top select, .sales-form-top textarea { width: 100% !important; min-width: 0 !important; box-sizing: border-box !important; }
  .customer-shipping { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 10px 14px; font-size: 13px; }
  .sales-lines { max-height: none; padding: 0 14px 14px; }
  .sales-lines-head { padding: 12px 14px 8px; }
  .sales-line, .sale-detail-line, .piece-work-line { grid-template-columns: 1fr !important; gap: 9px; padding: 12px; }
  .sales-line select, .sales-line input { min-height: 44px; font-size: 14px; }
  .sales-line span, .sales-line strong { font-size: 14px; }
  .sales-columns { display: none; }
  .sale-colors { max-width: none; }
  .sale-color { min-width: 0; }
  .sales-summary { flex-direction: column; gap: 8px; }
  .inner-panel { padding: 12px; }
  .receipt-panel-head { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  .receipt-panel-head > div:first-child { min-width: 0; }
  .receipt-panel-head h3 { margin: 0 0 5px; font-size: 16px; line-height: 1.35; white-space: normal; }
  .receipt-panel-head p { margin: 0; font-size: 14px; line-height: 1.55; white-space: normal; }
  .receipt-worker-picker { grid-template-columns: 1fr; width: 100%; gap: 9px; }
  .receipt-worker-picker input { min-width: 0; height: 44px; font-size: 14px; }
  .receipt-worker-picker .btn, .receipt-trace-add { width: 100%; min-height: 44px; white-space: normal; }
  .receipt-worker-search { width: 100%; min-width: 0; }
  .receipt-worker-options { position: fixed; left: 14px; right: 14px; top: auto; bottom: calc(88px + env(safe-area-inset-bottom)); max-height: min(48dvh, 320px); z-index: 140; }
  .receipt-worker-options button { min-height: 44px; font-size: 14px; }
  .trace-code-list { padding-bottom: 12px; }
  .receipt-scan-grid { grid-template-columns: 1fr; gap: 9px; }
  .receipt-scan-grid label, .receipt-trace-field { grid-column: auto; }
  .receipt-scan-grid label:nth-of-type(n+2) { grid-row: auto; }
  .receipt-scan-grid input { height: 44px; font-size: 14px; }
  .scanner-backdrop { z-index: 1600; }
  .scanner-modal { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; background: #071b2c; }
  .scanner-body { display: grid; align-content: center; min-height: calc(100dvh - 126px); padding: 14px; }
  .scanner-video-wrap { width: min(92vw, 520px); margin: 0 auto; }
  .scanner-body p { font-size: 14px; }
  .scanner-manual { grid-template-columns: 1fr; }
.scanner-manual input { height: 44px; font-size: 14px; }
.data-maintenance-page { gap: 12px; }
.data-maintenance-alert { width: 100%; padding: 12px 13px; font-size: 13px; line-height: 1.65; }
.settings-grid, .data-maintenance-grid, .maintenance-grid, .system-maintenance-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 14px !important;
  width: 100% !important;
}
.settings-card, .data-maintenance-card, .maintenance-card, .system-card {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  padding: 16px !important;
}
.settings-card h3, .data-maintenance-card h3 { font-size: 16px; line-height: 1.35; white-space: normal !important; }
.settings-card p, .data-maintenance-card p, .maintenance-card p, .system-card p {
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  line-height: 1.6 !important;
}
.settings-card small, .data-maintenance-card small { white-space: normal !important; word-break: normal !important; overflow-wrap: break-word !important; }
.settings-card button, .data-maintenance-card button, .maintenance-card button, .system-card button {
  width: 100% !important;
  min-height: 44px !important;
}
.product-import-card-head { display: grid; grid-template-columns: 1fr; }
.product-import-meta { grid-template-columns: 1fr !important; }
.product-import-list-wide .product-import-card { grid-template-columns: 1fr !important; }
.product-import-actions { justify-content: stretch; }
.product-import-actions .btn { flex: 1 1 100%; min-height: 42px; }
.system-upgrade-modal { width: 100vw !important; max-width: 100vw !important; height: 100dvh !important; max-height: 100dvh !important; border-radius: 0 !important; }
.system-upgrade-body { grid-template-columns: 1fr !important; max-height: calc(100dvh - 132px); padding: 14px 14px calc(96px + var(--mobile-safe-bottom)); overflow-y: auto; }
.upgrade-check-grid { grid-template-columns: 1fr !important; padding: 12px; }
.modal-foot-inline { display: grid; grid-template-columns: 1fr; padding: 0 12px 12px; }
.upgrade-log-box { max-height: 260px; font-size: 11px; }
.upgrade-task-list { padding: 12px; }
.upgrade-task-card { padding: 12px; border-radius: 12px; }
.upgrade-task-main { align-items: flex-start; flex-direction: column; gap: 6px; }
.upgrade-task-meta { grid-template-columns: 1fr; }
.upgrade-task-actions { display: grid; grid-template-columns: 1fr; }
.upgrade-task-actions .action-link { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.inspection-toolbar .toolbar-left { flex-wrap: wrap; }
.inspection-mobile-card { overflow: visible; }
.inspection-form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.inspection-submit-foot { justify-content: flex-end; }
.process-print-head { display: grid; grid-template-columns: minmax(0,1fr) 150px; gap: 18px; align-items: start; }
.inspection-print-qr { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; background: #fff; text-align: center; }
.inspection-print-qr img { width: 128px; height: 128px; }
.inspection-print-qr strong { color: var(--navy); }
.inspection-print-qr small { color: var(--muted); font-size: 12px; }
  .login-screen { padding: 18px; }
  .login-card { padding: 24px 20px; }
  .login-card label, .login-brand p, .login-welcome p, .login-icp { font-size: 14px; }
  .login-card input, .login-submit { min-height: 44px; font-size: 16px; }
  .login-icp a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
  .permission-grid { grid-template-columns: 1fr; }
  .option-master-grid { grid-template-columns: 1fr; }
  .structure-top { grid-template-columns: 1fr; }
  .structure-line, .structure-line:has([data-line-color]) { grid-template-columns: 1fr; }
  .production-info-grid, .production-info-sections { grid-template-columns: 1fr; }
  .production-detail-grid { grid-template-columns: 1fr; }
  .inspection-toolbar .toolbar-left { display: grid; grid-template-columns: 1fr; }
  .inspection-form-grid { grid-template-columns: 1fr; max-height: none; }
  .inspection-mobile-card .panel-head { align-items: stretch; flex-direction: column; }
  .inspection-mobile-card .panel-head .btn { width: 100%; }
  .inspection-submit-foot { position: sticky; bottom: 0; z-index: 4; border-top: 1px solid var(--line); background: white; }
  .process-print-head { grid-template-columns: 1fr; }
  .inspection-print-qr { max-width: 180px; margin: 0 auto 12px; }
  .dispatch-top, .dispatch-task { grid-template-columns: 1fr; }
  .dispatch-person-head, .dispatch-zone-head { align-items: flex-start; flex-direction: column; }
  .dispatch-person-head > div:first-child { width: 100%; grid-template-columns: 1fr; }
  .dispatch-task .dispatch-wide { grid-column: auto; }
  .wage-grid, .wage-full, .wage-form-grid { grid-template-columns: 1fr; grid-column: auto; }
}

@media (max-width: 768px) {
  html, body, .app-shell, .main-area, .main-content, .page-content, #pageContent {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .modal-backdrop,
  .modal,
  .sales-modal,
  .production-modal,
  .dispatch-modal,
  .modal-body,
  .dispatch-body,
  .sales-form-top,
  .form-grid,
  .modal-form-grid,
  .sales-form-grid,
  .dispatch-top,
  .toolbar,
  .toolbar-left,
  .toolbar-right,
  .wage-report-filter {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .sales-form-top,
  .form-grid,
  .modal-form-grid,
  .sales-form-grid,
  .dispatch-top,
  .modal-body,
  .dispatch-body {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .form-field,
  .form-field.full,
  .sales-form-top > .form-field,
  .modal-body > .form-field,
  .dispatch-body > .form-field,
  .toolbar-left > *,
  .toolbar-right > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    grid-column: auto !important;
  }

  .form-field label {
    display: block;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  input[type="date"],
  input[type="month"],
  input[type="time"],
  .form-field input[type="date"],
  .form-field input[type="month"],
  .form-field input[type="time"],
  .sales-form-top input[type="date"],
  .modal-body input[type="date"],
  .dispatch-body input[type="date"],
  .toolbar input[type="date"],
  .toolbar input[type="month"],
  .filter-input[type="date"],
  .filter-input[type="month"] {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    border-radius: 9px !important;
    -webkit-appearance: none;
    appearance: none;
  }

  input[type="date"]::-webkit-date-and-time-value,
  input[type="month"]::-webkit-date-and-time-value,
  input[type="time"]::-webkit-date-and-time-value {
    min-width: 0;
    max-width: 100%;
    text-align: left;
  }

  input[type="date"]::-webkit-calendar-picker-indicator,
  input[type="month"]::-webkit-calendar-picker-indicator,
  input[type="time"]::-webkit-calendar-picker-indicator {
    margin-left: auto;
    flex-shrink: 0;
  }

  .customer-price-toolbar .toolbar-left,
  .product-price-toolbar .toolbar-left,
  .customer-price-toolbar .toolbar-actions,
  .product-price-toolbar .toolbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .customer-price-toolbar select,
  .product-price-toolbar select,
  .table-price-input {
    width: 100% !important;
  }

  .sale-detail-money-columns {
    display: none;
  }

  .sale-detail-money-line {
    grid-template-columns: 1fr !important;
    align-items: stretch;
  }

  .sales-money-summary,
  .print-money-summary {
    display: grid;
    grid-template-columns: 1fr;
  }

  .preview-modal {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
  }

  .print-preview {
    padding: 12px 12px calc(92px + env(safe-area-inset-bottom)) !important;
    max-height: calc(100dvh - 132px) !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .print-preview-canvas {
    min-width: max-content !important;
  }

  .print-page {
    width: 210mm !important;
    min-height: 297mm !important;
    max-width: none !important;
    transform: none !important;
  }

}

@media (max-width: 768px) {
  .init-options {
    grid-template-columns: 1fr !important;
  }
}
