:root {
  --ink: #15211d;
  --muted: #6b7772;
  --line: #dde4e0;
  --soft-line: #edf1ef;
  --canvas: #f4f6f4;
  --panel: #ffffff;
  --forest: #173f35;
  --forest-2: #235a4b;
  --mint: #d9f06f;
  --mint-soft: #f2f8d7;
  --amber: #e9a23b;
  --amber-soft: #fff3dc;
  --red: #c95448;
  --red-soft: #fbe9e6;
  --green: #2f8069;
  --green-soft: #e5f3ee;
  --shadow: 0 18px 50px rgba(22, 45, 37, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0%, rgba(217, 240, 111, .13), transparent 24rem),
    var(--canvas);
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 246px 1fr; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
  display: flex;
  flex-direction: column;
  padding: 25px 18px 18px;
  color: #f5faf7;
  background:
    linear-gradient(160deg, rgba(217, 240, 111, .08), transparent 35%),
    var(--forest);
}
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 12px; background: var(--mint); color: var(--forest);
  font-family: Georgia, serif; font-weight: 800; font-size: 20px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
}
.brand strong { display: block; font-size: 18px; letter-spacing: .08em; }
.brand small { display: block; margin-top: -2px; color: #afc1ba; font-size: 10px; letter-spacing: .1em; }
.nav-list { display: flex; flex-direction: column; gap: 4px; margin-top: 34px; }
.nav-list a {
  display: flex; align-items: center; gap: 11px; min-height: 43px;
  padding: 0 12px; border-radius: 11px; color: #c7d5d0;
  font-weight: 600; transition: .16s ease;
}
.nav-list a span { width: 20px; text-align: center; color: #91aaa1; font-size: 17px; }
.nav-list a:hover { color: white; background: rgba(255,255,255,.06); }
.nav-list a.active { color: var(--forest); background: var(--mint); }
.nav-list a.active span { color: var(--forest); }
.sidebar-footer {
  display: flex; align-items: center; gap: 10px; margin-top: auto;
  padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.12);
}
.user-avatar {
  flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 50%; background: #d8e4df; color: var(--forest); font-weight: 800;
}
.user-copy { min-width: 0; flex: 1; }
.user-copy strong, .user-copy small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-copy small { color: #9fb1aa; font-size: 11px; }
.icon-button {
  width: 34px; height: 34px; display: grid; place-items: center; border: 0;
  border-radius: 10px; background: transparent; color: inherit; cursor: pointer; font-size: 18px;
}
.icon-button:hover { background: rgba(255,255,255,.1); }

.main-column { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px; min-height: 76px;
  padding: 14px 34px; background: rgba(244, 246, 244, .88);
  border-bottom: 1px solid rgba(221,228,224,.9); backdrop-filter: blur(16px);
}
.menu-toggle { display: none; border: 0; background: transparent; font-size: 22px; }
.global-search {
  width: min(540px, 55vw); display: flex; align-items: center; gap: 10px;
  padding: 0 14px; min-height: 44px; background: white; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 5px 20px rgba(20,40,34,.03);
}
.global-search > span { font-size: 20px; color: var(--muted); }
.global-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.global-search kbd { padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; color: #8a9590; background: #f8faf9; font-size: 10px; }
.topbar-meta { display: flex; align-items: center; gap: 7px; margin-left: auto; color: var(--muted); font-size: 12px; }
.system-dot { width: 8px; height: 8px; border-radius: 50%; background: #58ad71; box-shadow: 0 0 0 4px rgba(88,173,113,.12); }
.content { width: 100%; max-width: 1540px; margin: 0 auto; padding: 31px 34px 48px; }

.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 25px; }
.page-heading h1 { margin: 3px 0 6px; font-family: Georgia, "Microsoft YaHei UI", serif; font-size: clamp(28px, 3vw, 40px); line-height: 1.1; letter-spacing: -.035em; }
.page-heading p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.heading-actions { display: flex; gap: 9px; }
.button {
  min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 17px; border: 1px solid transparent; border-radius: 11px; cursor: pointer;
  font-weight: 750; transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--forest); }
.button-primary:hover { background: var(--forest-2); }
.button-secondary { color: var(--forest); background: var(--mint); }
.button-secondary:hover { background: #cfeb4f; }
.button-ghost { color: var(--ink); background: white; border-color: var(--line); }
.button-small { min-height: 34px; padding: 0 11px; font-size: 12px; border-radius: 9px; }
.button-block { width: 100%; }

.alert {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px; padding: 13px 15px;
  border-radius: 12px; border: 1px solid; animation: appear .2s ease;
}
.alert > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-weight: 900; }
.alert button { margin-left: auto; border: 0; background: transparent; cursor: pointer; font-size: 19px; }
.alert-success { color: #266c59; background: var(--green-soft); border-color: #c5e4d9; }
.alert-success > span { color: white; background: var(--green); }
.alert-danger, .alert-warning { color: #93443b; background: var(--red-soft); border-color: #f0c8c2; }
.alert-danger > span, .alert-warning > span { color: white; background: var(--red); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.metric-card {
  position: relative; min-width: 0; min-height: 145px; overflow: hidden;
  padding: 20px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); box-shadow: 0 6px 25px rgba(22,45,37,.04);
}
.metric-card > div { margin-top: 14px; }
.metric-card small { display: block; color: var(--muted); font-weight: 650; }
.metric-card strong { margin-right: 5px; font-family: Georgia, serif; font-size: 34px; letter-spacing: -.03em; }
.metric-card em { color: var(--muted); font-style: normal; font-size: 12px; }
.metric-card > i { position: absolute; right: 17px; bottom: 15px; color: #9aa49f; font-style: normal; font-size: 10px; }
.metric-icon {
  position: absolute; right: 17px; top: 17px; width: 31px; height: 31px;
  display: grid; place-items: center; border-radius: 9px; color: var(--forest); background: #eef3f0;
}
.metric-primary { color: white; background: var(--forest); border-color: var(--forest); }
.metric-primary small, .metric-primary em, .metric-primary > i { color: #b7cac3; }
.metric-primary .metric-icon { color: var(--forest); background: var(--mint); }
.metric-warning { background: #fffaf0; border-color: #f0dfbd; }
.metric-warning .metric-icon { color: #925f10; background: var(--amber-soft); }

.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.panel {
  min-width: 0; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); box-shadow: 0 8px 30px rgba(22,45,37,.035);
}
.panel-span-2 { grid-column: span 2; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.panel-head h2 { margin: 2px 0 0; font-family: Georgia, "Microsoft YaHei UI", serif; font-size: 21px; letter-spacing: -.02em; }
.panel-head a { color: var(--green); font-size: 12px; font-weight: 750; }
.attention-list { display: flex; flex-direction: column; }
.attention-row { display: grid; grid-template-columns: 10px 1fr auto auto; align-items: center; gap: 13px; padding: 12px 0; border-top: 1px solid var(--soft-line); }
.attention-row:first-child { border-top: 0; }
.attention-row > div strong, .attention-row > div small { display: block; }
.attention-row > div small { color: var(--muted); font-size: 11px; }
.attention-row > b { font-size: 19px; }
.attention-row > b small { margin-left: 3px; color: var(--muted); font-size: 10px; font-weight: 500; }
.status-orb { width: 8px; height: 8px; border-radius: 50%; }
.status-orb.status-low { background: var(--amber); }
.status-orb.status-out { background: var(--red); }
.status-orb.status-normal { background: var(--green); }
.status-badge, .purchase-status {
  display: inline-flex; align-items: center; width: max-content; padding: 4px 8px;
  border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap;
}
.status-normal { color: #2b715e; background: var(--green-soft); }
.status-low { color: #976313; background: var(--amber-soft); }
.status-out { color: #a4453a; background: var(--red-soft); }
.purchase-pending { color: #8a621b; background: var(--amber-soft); }
.purchase-ordered { color: #345c82; background: #e4eff8; }
.purchase-in_transit { color: #4f4b90; background: #eceafb; }
.purchase-received { color: #2b715e; background: var(--green-soft); }
.purchase-cancelled { color: #7d8581; background: #ecefed; }
.purchase-mini-list { display: flex; flex-direction: column; gap: 3px; }
.purchase-mini-list > div { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--soft-line); }
.purchase-mini-list > div:first-child { border-top: 0; }
.purchase-index { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: var(--mint-soft); color: var(--forest); font-family: Georgia, serif; font-weight: 800; font-size: 11px; }
.purchase-mini-list strong, .purchase-mini-list small { display: block; }
.purchase-mini-list small { color: var(--muted); font-size: 11px; }
.computer-overview { display: flex; flex-direction: column; gap: 15px; }
.bar-row > div:first-child { display: flex; justify-content: space-between; margin-bottom: 6px; }
.bar-row span { color: var(--muted); font-size: 11px; }
.bar-track { height: 7px; border-radius: 99px; background: #ecf0ee; overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: inherit; background: var(--forest); }

.toolbar, .filter-bar {
  display: flex; align-items: flex-end; gap: 12px; margin-bottom: 14px; padding: 12px;
  border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.65);
}
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: #e9eeeb; }
.segmented a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 750; }
.segmented a.active { color: var(--forest); background: white; box-shadow: 0 2px 6px rgba(0,0,0,.05); }
.result-count { margin-left: auto; color: var(--muted); font-size: 11px; }
.filter-bar label { min-width: 150px; }
.filter-bar label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.filter-bar select, .filter-bar input { width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.filter-search { display: flex; flex-wrap: wrap; min-width: 250px !important; }
.filter-search span { width: 100%; }
.filter-search input { flex: 1; border-radius: 9px 0 0 9px; }
.filter-search button { padding: 0 14px; border: 0; border-radius: 0 9px 9px 0; color: white; background: var(--forest); }

.table-panel { padding: 0; overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 17px; color: #7b8782; background: #f7f9f8; border-bottom: 1px solid var(--line); text-align: left; font-size: 10px; letter-spacing: .05em; white-space: nowrap; }
td { padding: 14px 17px; border-bottom: 1px solid var(--soft-line); vertical-align: middle; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcfb; }
.actions-col { min-width: 245px; }
.item-link { display: flex; align-items: center; gap: 10px; }
.item-link strong, .item-link small { display: block; }
.item-link small, .table-sub { margin-top: 2px; color: #929c98; font-size: 9px; letter-spacing: .04em; }
.table-sub { display: block; }
.item-monogram {
  flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px; color: #f2f8f5; background: var(--forest); font-family: Georgia, serif; font-size: 11px; font-weight: 800;
}
.item-monogram.part { color: var(--forest); background: var(--mint-soft); }
.stock-number { font-family: Georgia, serif; font-size: 18px; }
.model-chip, .source-chip, .operator-chip { display: inline-flex; padding: 4px 8px; border-radius: 7px; background: #eef2f0; font-size: 10px; font-weight: 750; }
.source-chip { text-transform: uppercase; letter-spacing: .05em; }
.operator-chip { color: var(--forest); background: var(--mint-soft); }
.row-actions { display: flex; align-items: center; gap: 6px; }
.row-actions form { margin: 0; }
.row-actions select { min-height: 32px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 11px; }
.action-button, .action-link {
  min-height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px;
  background: white; cursor: pointer; font-size: 11px; font-weight: 700;
}
.action-button.inbound { color: #2a745f; border-color: #bfddd2; background: #f0f8f5; }
.action-button.outbound { color: #a64e43; border-color: #efcbc6; background: #fdf5f3; }
.action-link { display: inline-flex; align-items: center; color: var(--muted); }
.disabled-row { opacity: .5; }
.muted { color: var(--muted); }
.quantity-change { display: inline-flex; min-width: 40px; justify-content: center; padding: 3px 7px; border-radius: 7px; font-family: Consolas, monospace; font-weight: 800; }
.positive { color: #23725b !important; }
.negative { color: #ae4c41 !important; }
.quantity-change.positive { background: var(--green-soft); }
.quantity-change.negative { background: var(--red-soft); }
.notes-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

.modal {
  width: min(540px, calc(100vw - 30px)); padding: 0; border: 0; border-radius: 20px;
  color: var(--ink); background: white; box-shadow: 0 30px 100px rgba(10,30,23,.3);
}
.modal::backdrop { background: rgba(14,31,25,.55); backdrop-filter: blur(3px); }
.modal form { padding: 25px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.modal-head h2 { margin: 3px 0 0; font-family: Georgia, "Microsoft YaHei UI", serif; font-size: 24px; }
.modal-head .icon-button { color: var(--muted); background: #f0f3f1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field { display: block; }
.field.full { grid-column: 1 / -1; }
.field > span { display: block; margin-bottom: 6px; color: #56625d; font-size: 11px; font-weight: 750; }
.field em { color: #97a19d; font-style: normal; font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; outline: 0; color: var(--ink); background: #fbfcfb;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #6d9286; box-shadow: 0 0 0 3px rgba(47,128,105,.09); background: white; }
.field > small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.form-note { margin-top: 15px; padding: 10px 12px; border-radius: 9px; color: #65716c; background: #f3f6f4; font-size: 11px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }

.breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--muted); font-size: 11px; }
.breadcrumb a { color: var(--green); font-weight: 750; }
.detail-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-bottom: 16px; padding: 26px; color: white; border-radius: 20px;
  background: linear-gradient(120deg, var(--forest), #245447); box-shadow: var(--shadow);
}
.detail-identity { display: flex; align-items: center; gap: 18px; }
.detail-mark { width: 65px; height: 65px; display: grid; place-items: center; border-radius: 17px; color: var(--forest); background: var(--mint); font-family: Georgia, serif; font-size: 20px; font-weight: 900; }
.detail-identity .eyebrow { color: #c2d6ce; }
.detail-identity h1 { margin: 3px 0 1px; font-family: Georgia, "Microsoft YaHei UI", serif; font-size: 31px; }
.detail-identity p { margin: 0; color: #b3c7c0; }
.detail-actions { display: flex; gap: 8px; }
.detail-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 17px; }
.detail-stat-grid article { min-height: 105px; display: flex; flex-direction: column; justify-content: center; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.detail-stat-grid small { color: var(--muted); }
.detail-stat-grid strong { margin-top: 4px; font-family: Georgia, serif; font-size: 28px; }
.detail-stat-grid strong em { margin-left: 4px; color: var(--muted); font-family: inherit; font-size: 11px; font-style: normal; }
.detail-stat-grid .status-badge { margin-top: 9px; }
.detail-stat-grid .text-value { font-family: inherit; font-size: 16px; }
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 12px; bottom: 12px; width: 1px; background: var(--line); }
.timeline-row { position: relative; display: grid; grid-template-columns: 20px 100px 1fr auto auto; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--soft-line); }
.timeline-row:first-child { border-top: 0; }
.timeline-dot { z-index: 1; width: 17px; height: 17px; border: 5px solid white; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px var(--line); }
.timeline-dot.negative { background: var(--red); }
.timeline-row time { font-weight: 700; font-size: 11px; }
.timeline-row time small { display: block; color: var(--muted); font-weight: 400; }
.timeline-main strong, .timeline-main p { display: block; margin: 0; }
.timeline-main p { color: var(--muted); font-size: 11px; }
.timeline-qty { text-align: right; }
.timeline-qty strong, .timeline-qty small { display: block; }
.timeline-qty strong { font-family: Consolas, monospace; font-size: 17px; }
.timeline-qty small { color: var(--muted); }

.summary-strip { display: flex; align-items: center; gap: 20px; margin-bottom: 17px; padding: 16px 20px; border-radius: 15px; color: white; background: var(--forest); }
.summary-strip div { display: flex; align-items: baseline; gap: 7px; }
.summary-strip strong { color: var(--mint); font-family: Georgia, serif; font-size: 30px; }
.summary-strip p { margin: 0; color: #bdd0c9; font-size: 12px; }
.low-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.panel + .panel { margin-top: 17px; }
.low-card { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfb; }
.low-card h3 { margin: 10px 0 1px; font-size: 15px; }
.low-card p { margin: 0; color: var(--muted); font-size: 11px; }
.low-amount { display: flex; align-items: baseline; gap: 5px; margin: 15px 0; padding: 12px; border-radius: 10px; background: white; }
.low-amount strong { font-family: Georgia, serif; font-size: 28px; }
.low-amount small { color: var(--muted); }
.low-actions { display: flex; gap: 7px; }

.operation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.operation-card { position: relative; overflow: hidden; }
.operation-symbol { position: absolute; right: 15px; top: 10px; color: #dce5e1; font-family: Georgia, serif; font-size: 55px; line-height: 1; }
.operation-card h2 { margin: 6px 0; font-family: Georgia, serif; font-size: 25px; }
.operation-card p { min-height: 42px; margin: 0 0 18px; color: var(--muted); }
.inbound-card { background: linear-gradient(145deg, white, #f2faf6); }
.outbound-card { background: linear-gradient(145deg, white, #fdf5f3); }
.material-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-height: 410px; overflow-y: auto; }
.material-picker button { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; text-align: left; background: white; cursor: pointer; }
.material-picker button > span:nth-child(2) { flex: 1; min-width: 0; }
.material-picker button strong, .material-picker button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-picker button small { color: var(--muted); font-size: 10px; }
.material-picker button i { color: var(--green); font-style: normal; font-size: 10px; }
.material-picker button.ready { border-color: #a8cabf; box-shadow: 0 0 0 2px rgba(47,128,105,.05); }

.search-section { margin-bottom: 24px; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.section-title h2 { margin: 0; font-family: Georgia, serif; font-size: 21px; }
.section-title span { color: var(--muted); font-size: 11px; }
.search-result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.search-card { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.search-card > div { flex: 1; min-width: 0; }
.search-card strong, .search-card small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-card small { color: var(--muted); font-size: 10px; }
.search-card i { color: var(--green); font-style: normal; }
.search-empty { min-height: 350px; }

.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tool-card > .tool-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 12px; color: var(--forest); background: var(--mint); font-size: 19px; font-weight: 800; }
.tool-card h2 { margin: 16px 0 4px; font-family: Georgia, serif; }
.tool-card > p { min-height: 42px; margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.button-stack { display: flex; flex-direction: column; gap: 7px; }
.button-stack a { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 9px; color: var(--forest); background: #f3f6f4; font-weight: 700; font-size: 12px; }
.stack-form { display: flex; flex-direction: column; gap: 13px; }
.file-drop, .image-drop { display: grid; place-items: center; padding: 24px 15px; border: 1px dashed #afc0b9; border-radius: 12px; text-align: center; background: #f8faf9; cursor: pointer; }
.file-drop input, .image-drop input { position: absolute; opacity: 0; pointer-events: none; }
.file-drop span { font-weight: 750; }
.file-drop small { color: var(--muted); }
.permission-note { padding: 13px; border-radius: 10px; color: var(--muted); background: #f3f6f4; }
.backup-list { margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--soft-line); }
.backup-list > strong { display: block; margin-bottom: 7px; font-size: 11px; }
.backup-list > div { display: flex; justify-content: space-between; padding: 6px 0; color: var(--muted); font-size: 10px; }

.ocr-flow { display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.ocr-flow > div { display: flex; align-items: center; gap: 7px; color: #99a39f; font-size: 11px; }
.ocr-flow > div span { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: white; }
.ocr-flow > div.active, .ocr-flow > div.done { color: var(--forest); }
.ocr-flow > div.active span { color: var(--forest); background: var(--mint); border-color: var(--mint); }
.ocr-flow > div.done span { color: white; background: var(--forest); border-color: var(--forest); }
.ocr-flow > i { width: 70px; height: 1px; margin: 0 9px; background: var(--line); }
.ocr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.ocr-upload-form { display: flex; flex-direction: column; gap: 12px; }
.image-drop { min-height: 235px; }
.upload-symbol { width: 55px; height: 55px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 17px; color: var(--forest); background: var(--mint-soft); font-size: 27px; }
.image-drop p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.service-note { display: flex; gap: 10px; margin-top: 14px; padding: 11px; border-radius: 10px; color: #56635e; background: #f2f5f3; }
.service-note > span { flex: 0 0 auto; width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--green); font-family: Georgia, serif; font-weight: 800; }
.service-note p { margin: 0; font-size: 10px; }
.service-note strong { display: block; }
.recognition-result { padding: 16px; border-radius: 13px; background: #f5f8f6; }
.recognition-result small, .recognition-result strong { display: block; }
.recognition-result strong { margin: 5px 0 10px; font-family: Consolas, monospace; font-size: 20px; }
.candidate-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 16px; }
.candidate-list span { padding: 5px 9px; border-radius: 7px; color: var(--forest); background: var(--mint-soft); font-weight: 750; }
.success-state { display: grid; place-items: center; min-height: 250px; text-align: center; }
.success-state span { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--green); font-size: 24px; }
.success-state strong { margin-top: 12px; font-size: 17px; }
.success-state p { margin: 0; color: var(--muted); }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.panel-wide { grid-column: 1 / -1; }
.user-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.user-list > div { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--soft-line); border-radius: 11px; }
.user-list > div > div { flex: 1; }
.user-list strong, .user-list small { display: block; }
.user-list small { color: var(--muted); font-size: 10px; }

.empty-state { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 25px; text-align: center; color: var(--muted); }
.empty-state > span { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 10px; border-radius: 14px; color: var(--forest); background: var(--mint-soft); font-size: 20px; }
.empty-state strong { color: var(--ink); }
.empty-state p { margin: 3px 0 0; font-size: 11px; }
.empty-state.compact { min-height: 130px; }

.login-page { min-height: 100vh; background: #eef2ef; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 1.2fr) minmax(390px, .8fr); }
.login-brand {
  position: relative; display: grid; align-items: end; overflow: hidden; padding: clamp(40px, 7vw, 90px);
  color: white; background:
    linear-gradient(135deg, rgba(217,240,111,.05), transparent 45%),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(255,255,255,.025) 80px),
    repeating-linear-gradient(0deg, transparent 0 79px, rgba(255,255,255,.025) 80px),
    var(--forest);
}
.login-brand::after { content: ""; position: absolute; width: 380px; height: 380px; right: -130px; top: -110px; border: 80px solid rgba(217,240,111,.08); border-radius: 50%; }
.brand-kicker { color: var(--mint); font-size: 10px; font-weight: 800; letter-spacing: .25em; }
.login-brand h1 { margin: 18px 0; font-family: Georgia, "Microsoft YaHei UI", serif; font-size: clamp(43px, 5.4vw, 78px); line-height: 1.05; letter-spacing: -.05em; }
.login-brand h1 em { color: var(--mint); font-style: normal; }
.login-brand p { color: #bfd0c9; font-size: 16px; }
.login-signal { display: flex; align-items: center; gap: 8px; margin-top: 60px; color: #9eb4ac; font-size: 11px; }
.login-signal span { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px rgba(217,240,111,.1); }
.login-panel { display: grid; place-items: center; padding: 40px; background: white; }
.login-form-wrap { width: min(380px, 100%); }
.login-logo { color: var(--ink); margin-bottom: 70px; }
.login-logo small { color: var(--muted); }
.login-copy h2 { margin: 4px 0; font-family: Georgia, "Microsoft YaHei UI", serif; font-size: 33px; }
.login-copy p { margin: 0 0 25px; color: var(--muted); }
.login-form { display: flex; flex-direction: column; gap: 15px; }
.login-form .button { min-height: 47px; margin-top: 3px; justify-content: space-between; padding: 0 19px; }
.login-help { margin-top: 18px; color: var(--muted); font-size: 10px; }
.login-help code { color: var(--forest); background: var(--mint-soft); padding: 2px 4px; border-radius: 4px; }
.sidebar-scrim { display: none; }

@keyframes appear { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-span-2 { grid-column: span 2; }
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .tool-card:last-child { grid-column: 1 / -1; }
  .material-picker, .low-card-grid, .search-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: 246px; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 20px 0 60px rgba(0,0,0,.2); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(8,25,19,.45); }
  .sidebar-scrim.visible { display: block; }
  .menu-toggle { display: block; }
  .topbar { padding: 12px 18px; min-height: 65px; }
  .content { padding: 24px 18px 40px; }
  .global-search { width: min(600px, calc(100vw - 120px)); }
  .topbar-meta { display: none; }
  .detail-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operation-grid { grid-template-columns: 1fr 1fr; }
  .operation-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 650px) {
  .page-heading, .detail-hero { align-items: stretch; flex-direction: column; }
  .page-heading h1 { font-size: 31px; }
  .heading-actions, .detail-actions { width: 100%; }
  .heading-actions .button, .detail-actions .button { flex: 1; }
  .metric-grid, .dashboard-grid, .tool-grid, .ocr-grid, .settings-grid, .operation-grid { grid-template-columns: 1fr; }
  .panel-span-2, .panel-wide, .tool-card:last-child, .operation-card:last-child { grid-column: auto; }
  .metric-card { min-height: 125px; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar label { width: 100%; }
  .material-picker, .low-card-grid, .search-result-grid, .user-list { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .detail-identity { align-items: flex-start; }
  .detail-mark { width: 52px; height: 52px; }
  .detail-stat-grid { grid-template-columns: 1fr 1fr; }
  .timeline-row { grid-template-columns: 20px 75px 1fr auto; gap: 8px; }
  .timeline-row .operator-chip { display: none; }
  .ocr-flow > i { width: 18px; }
  .login-shell { display: block; }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; padding: 30px 22px; }
  .login-logo { margin-bottom: 60px; }
  .global-search kbd { display: none; }
}
