:root {
  --bg: #f4f5f1;
  --surface: #ffffff;
  --surface-soft: #f8f9f5;
  --sidebar: #19231c;
  --sidebar-soft: #222e25;
  --text: #202720;
  --muted: #7b837b;
  --line: #e5e9e1;
  --green: #4f7356;
  --green-dark: #36533e;
  --green-soft: #e8f0e4;
  --lime: #c6dfaa;
  --amber: #b9782c;
  --amber-soft: #fbefd9;
  --red: #b94a43;
  --red-soft: #fae9e6;
  --blue: #506d8f;
  --blue-soft: #e8eff6;
  --shadow: 0 1px 2px rgba(25, 35, 28, .04), 0 12px 32px rgba(25, 35, 28, .045);
  --radius: 18px;
  --font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: #cde3bd; color: #162019; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #ccd2c7; border-radius: 20px; border: 3px solid var(--bg); }
:focus-visible { outline: 3px solid rgba(79, 115, 86, .26); outline-offset: 2px; }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow.light { color: rgba(235, 242, 231, .58); }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #83b36d; box-shadow: 0 0 0 3px rgba(131, 179, 109, .12); }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(400px, .92fr); background: #f8f8f4; }
.login-art { min-height: 100vh; position: relative; overflow: hidden; padding: 42px 54px; color: #f2f5ed; background: var(--sidebar); display: flex; flex-direction: column; justify-content: space-between; }
.login-art::before { content: ""; position: absolute; width: 46vw; height: 46vw; right: -21vw; top: -19vw; border: 1px solid rgba(208, 230, 192, .11); border-radius: 50%; box-shadow: 0 0 0 8vw rgba(206, 226, 190, .025), 0 0 0 16vw rgba(206, 226, 190, .018); }
.login-art::after { content: ""; position: absolute; inset: 0; opacity: .14; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 62px 62px; mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 70%, transparent); }
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 700; letter-spacing: .08em; }
.brand-symbol { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--lime); color: #203025; font-family: Georgia, serif; font-size: 20px; font-weight: 700; }
.login-art-copy { position: relative; z-index: 1; max-width: 670px; }
.login-art-copy h1 { margin: 20px 0 26px; font-size: clamp(44px, 5.2vw, 80px); line-height: 1.16; letter-spacing: -.055em; font-weight: 620; }
.login-art-copy h1 em { font-family: "STSong", "SimSun", serif; font-style: normal; font-weight: 400; color: var(--lime); }
.login-art-copy > p:last-child { margin: 0; color: rgba(239, 244, 235, .62); font-size: 13px; letter-spacing: .04em; }
.login-art-footer { position: relative; z-index: 1; display: flex; justify-content: space-between; padding-top: 22px; border-top: 1px solid rgba(239,244,235,.12); color: rgba(239,244,235,.45); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.login-form-side { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 44px; }
.login-card { width: min(100%, 390px); }
.login-card-head { margin-bottom: 38px; }
.login-card-head h2 { margin: 0 0 9px; font-size: 30px; letter-spacing: -.035em; }
.login-card-head p { margin: 0; color: var(--muted); font-size: 13px; }
.login-mobile-brand { display: none; margin-bottom: 24px; color: var(--green); font-size: 13px; font-weight: 700; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field > span { color: #5f695f; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.field input, .field select, .field textarea, .line-input { width: 100%; border: 1px solid #dfe4db; border-radius: 10px; background: #fff; color: var(--text); padding: 11px 13px; outline: none; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.field input:focus, .field select:focus, .field textarea:focus, .line-input:focus { border-color: #87a18d; box-shadow: 0 0 0 3px rgba(79,115,86,.1); }
.field textarea { min-height: 78px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #adb4aa; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8c958b 50%), linear-gradient(135deg, #8c958b 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.login-card .button { margin-top: 8px; }
.login-error { min-height: 20px; margin: 12px 0 0; color: var(--red); font-size: 12px; }
.login-hint { margin: 18px 0 0; color: #939b91; font-size: 11px; text-align: center; }
.login-hint b { color: #657066; }
.login-copyright { position: absolute; bottom: 28px; color: #a1a79f; font-size: 10px; letter-spacing: .06em; }
.login-mobile-brand { display: none; }

.button { border: 1px solid transparent; border-radius: 10px; min-height: 40px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: .01em; transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button .icon { width: 16px; height: 16px; }
.button.primary { background: var(--green); color: #fff; box-shadow: 0 5px 14px rgba(54,83,62,.16); }
.button.primary:hover { background: var(--green-dark); }
.button.ghost { border-color: #dbe1d7; background: #fff; color: #485348; }
.button.ghost:hover { border-color: #b8c5b5; background: #fbfcf9; }
.button.wide { width: 100%; height: 46px; }
.button.danger { background: var(--red-soft); color: var(--red); }
.button.small { min-height: 32px; padding: 0 11px; font-size: 10px; border-radius: 8px; }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.icon-button { width: 38px; height: 38px; border: 1px solid transparent; border-radius: 10px; padding: 0; display: grid; place-items: center; background: transparent; cursor: pointer; color: #697269; transition: background .18s ease, color .18s ease, border-color .18s ease; }
.icon-button:hover { background: #eef1eb; color: var(--text); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: 252px; padding: 25px 17px 16px; display: flex; flex-direction: column; background: var(--sidebar); color: #e8eee3; overflow-y: auto; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; }
.sidebar-brand .brand-symbol { width: 38px; height: 38px; }
.sidebar-brand strong { display: block; font-size: 14px; letter-spacing: .055em; }
.sidebar-brand small { display: block; margin-top: 3px; color: rgba(232,238,227,.43); font-size: 9px; letter-spacing: .12em; }
.workspace-chip { margin: 0 3px 21px; padding: 11px 12px; border: 1px solid rgba(226,239,218,.09); border-radius: 12px; background: rgba(255,255,255,.035); display: flex; align-items: center; gap: 10px; }
.workspace-chip b, .workspace-chip small { display: block; }
.workspace-chip b { font-size: 10px; font-weight: 600; }
.workspace-chip small { margin-top: 3px; color: rgba(232,238,227,.42); font-size: 9px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label { margin: 15px 12px 7px; color: rgba(232,238,227,.32); font-size: 8px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.nav-item { width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: rgba(234,240,230,.62); display: flex; align-items: center; gap: 11px; cursor: pointer; font-size: 11px; text-align: left; transition: background .18s ease, color .18s ease; }
.nav-item .icon { width: 17px; height: 17px; opacity: .82; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #f3f7ef; }
.nav-item.active { background: #edf3e8; color: #213126; box-shadow: 0 8px 20px rgba(0,0,0,.1); }
.nav-item.active .icon { opacity: 1; }
.nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 20px; display: grid; place-items: center; background: #ba7746; color: #fff; font-size: 8px; }
.sidebar-foot { margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(233,240,229,.08); }
.user-mini { width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px; border: 0; border-radius: 11px; background: transparent; color: #e8eee3; cursor: pointer; text-align: left; }
.user-mini:hover { background: rgba(255,255,255,.04); }
.user-mini > span:nth-child(2) { min-width: 0; flex: 1; }
.user-mini b, .user-mini small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.user-mini b { font-size: 10px; }
.user-mini small { margin-top: 3px; color: rgba(232,238,227,.4); font-size: 8px; }
.user-mini > .icon { width: 13px; height: 13px; color: rgba(232,238,227,.35); }
.avatar { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: #d8e7c9; color: #324437; font-size: 11px; font-weight: 700; }
.logout-button { width: 100%; border: 0; background: transparent; color: rgba(232,238,227,.38); display: flex; align-items: center; gap: 10px; padding: 10px 12px 3px; cursor: pointer; font-size: 9px; }
.logout-button:hover { color: #f0b3ac; }
.logout-button .icon { width: 14px; height: 14px; }
.sidebar-scrim { display: none; }

.main-shell { margin-left: 252px; min-height: 100vh; }
.topbar { position: sticky; z-index: 30; top: 0; min-height: 82px; padding: 0 31px; border-bottom: 1px solid rgba(221,226,216,.8); background: rgba(244,245,241,.9); backdrop-filter: blur(18px); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.topbar-title { display: flex; align-items: center; gap: 12px; }
.topbar-title h1 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.menu-button { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.global-search { height: 38px; width: min(28vw, 295px); padding: 0 11px; border: 1px solid #e0e5dc; border-radius: 10px; background: rgba(255,255,255,.72); display: flex; align-items: center; gap: 8px; color: #8b948a; transition: border-color .18s ease, box-shadow .18s ease; }
.global-search:focus-within { border-color: #98ab9b; box-shadow: 0 0 0 3px rgba(79,115,86,.08); }
.global-search .icon { width: 15px; height: 15px; }
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 10px; }
.global-search input::placeholder { color: #9ca49a; }
.global-search kbd { padding: 2px 5px; border: 1px solid #e0e4dc; border-radius: 5px; background: #fff; color: #a0a79e; font-family: var(--font); font-size: 8px; }
.notification-button { position: relative; }
.notification-dot { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: #c98349; border: 1px solid var(--bg); }
.topbar-date { margin-left: 5px; color: #899188; font-size: 9px; letter-spacing: .03em; white-space: nowrap; }

.page-content { max-width: 1580px; margin: 0 auto; padding: 29px 31px 60px; }
.view { display: none; animation: view-in .34s ease; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.welcome-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; }
.welcome-kicker { margin: 0 0 7px; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: .03em; }
.welcome-row h2 { margin: 0; font-size: clamp(20px, 2vw, 29px); line-height: 1.3; letter-spacing: -.035em; font-weight: 620; }
.quick-actions { display: flex; gap: 9px; flex: none; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.metric-card { min-height: 135px; padding: 19px 20px 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.metric-card.accent { background: #26382a; border-color: #26382a; color: #f4f7f1; }
.metric-card.warning { background: #fcf8ee; border-color: #ede2cc; }
.metric-head { display: flex; align-items: center; justify-content: space-between; color: #7c857b; font-size: 10px; font-weight: 700; }
.metric-card.accent .metric-head { color: rgba(242,247,238,.56); }
.metric-card.warning .metric-head { color: #9a7441; }
.metric-icon { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: #f2f5ef; color: #6d786c; }
.metric-icon .icon { width: 15px; height: 15px; }
.metric-card.accent .metric-icon { background: rgba(255,255,255,.08); color: #c9dfb7; }
.metric-card.warning .metric-icon { background: #f6ead4; color: #a36d2b; }
.metric-card strong { margin-top: auto; padding-top: 14px; font-size: clamp(24px, 2.25vw, 33px); line-height: 1; letter-spacing: -.04em; font-weight: 680; }
.metric-card p { margin: 10px 0 0; color: #939b91; font-size: 9px; }
.metric-card.accent p { color: rgba(242,247,238,.4); }
.metric-card.warning p { color: #a18c6a; }
.trend { display: inline-flex; align-items: center; margin-right: 4px; padding: 2px 5px; border-radius: 5px; font-size: 8px; font-weight: 700; }
.trend.up { background: var(--green-soft); color: var(--green); }
.metric-card.accent .trend.up { background: rgba(198,223,170,.12); color: var(--lime); }
.trend.down { background: #f6e5d2; color: #ad6d2f; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); gap: 14px; margin-bottom: 14px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.chart-panel, .low-stock-panel { min-height: 340px; padding: 20px 21px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-head h3 { margin: 0 0 5px; font-size: 13px; letter-spacing: -.01em; }
.panel-head p { margin: 0; color: #91988f; font-size: 9px; }
.legend { display: flex; gap: 14px; align-items: center; color: #7f887e; font-size: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 6px; height: 6px; border-radius: 2px; }
.legend-dot.sales { background: var(--green); }
.legend-dot.purchase { background: #d6a36d; }
.bar-chart { height: 244px; margin-top: 17px; padding-top: 10px; display: flex; align-items: stretch; justify-content: space-between; gap: 9px; border-bottom: 1px solid #edf0eb; background-image: linear-gradient(to bottom, #f0f2ee 1px, transparent 1px); background-size: 100% 25%; }
.bar-group { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; }
.bar-pair { width: 100%; height: 190px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.bar { position: relative; width: min(11px, 32%); min-height: 3px; border-radius: 4px 4px 2px 2px; transition: height .5s ease, opacity .18s ease; }
.bar.sales { background: var(--green); }
.bar.purchase { background: #e0b27e; }
.bar:hover { opacity: .74; }
.bar-label { color: #9ba29a; font-size: 8px; white-space: nowrap; }
.bar-tooltip { position: absolute; left: 50%; bottom: calc(100% + 7px); display: none; padding: 6px 7px; border-radius: 6px; background: #243026; color: #fff; font-size: 8px; white-space: nowrap; transform: translateX(-50%); z-index: 2; }
.bar:hover .bar-tooltip { display: block; }
.text-button { border: 0; background: transparent; padding: 3px 0; color: var(--green); cursor: pointer; font-size: 9px; font-weight: 700; }
.text-button:hover { color: var(--green-dark); text-decoration: underline; text-underline-offset: 3px; }
.low-stock-list { margin-top: 18px; display: flex; flex-direction: column; }
.low-stock-row { padding: 11px 0; border-bottom: 1px solid #eef0ec; display: flex; align-items: center; gap: 10px; }
.low-stock-row:last-child { border-bottom: 0; }
.stock-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: #fbf0de; color: #b47c3c; }
.stock-icon .icon { width: 15px; height: 15px; }
.low-stock-info { min-width: 0; flex: 1; }
.low-stock-info b { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; }
.low-stock-info span { display: block; margin-top: 3px; color: #98a096; font-size: 8px; }
.stock-number { color: var(--red); font-size: 10px; font-weight: 700; white-space: nowrap; }
.stock-number small { color: #a9afa7; font-size: 8px; font-weight: 400; }
.activity-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; margin-top: 9px; }
.activity-row { display: flex; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid #eef0ec; }
.activity-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.activity-icon .icon { width: 14px; height: 14px; }
.activity-icon.in { background: var(--green-soft); color: var(--green); }
.activity-icon.out { background: var(--red-soft); color: var(--red); }
.activity-copy { min-width: 0; flex: 1; }
.activity-copy b { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; }
.activity-copy span { display: block; margin-top: 3px; color: #969e95; font-size: 8px; }
.activity-qty { font-size: 10px; font-weight: 700; white-space: nowrap; }
.activity-qty.in { color: var(--green); }
.activity-qty.out { color: var(--red); }
.empty-state { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: #9aa199; text-align: center; font-size: 10px; }
.empty-state .icon { width: 23px; height: 23px; opacity: .55; }

.section-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; }
.section-toolbar h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.035em; }
.section-toolbar p { margin: 0; color: var(--muted); font-size: 10px; }
.summary-strip { display: flex; gap: 26px; margin-bottom: 14px; padding: 13px 17px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.6); }
.summary-item { display: flex; align-items: baseline; gap: 7px; color: #8f978e; font-size: 9px; }
.summary-item b { color: var(--text); font-size: 13px; }
.table-panel { overflow: hidden; margin-bottom: 14px; }
.table-tools { min-height: 58px; padding: 12px 19px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #edf0eb; }
.table-tools h3 { margin: 0; font-size: 12px; }
.result-count { color: #929a91; font-size: 9px; }
.segmented { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.segmented button { border: 0; padding: 6px 10px; border-radius: 7px; background: transparent; color: #8a9289; cursor: pointer; font-size: 9px; }
.segmented button:hover { background: #f0f3ed; }
.segmented button.active { background: var(--green-soft); color: var(--green-dark); font-weight: 700; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 19px; border-bottom: 1px solid #edf0eb; color: #9aa199; font-size: 8px; font-weight: 700; letter-spacing: .04em; text-align: left; white-space: nowrap; }
td { padding: 13px 19px; border-bottom: 1px solid #eff1ed; font-size: 10px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #fafbf8; }
.align-right { text-align: right; }
.entity-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.entity-avatar { width: 34px; height: 34px; border-radius: 9px; background: #eef2ea; color: #5e715f; display: grid; place-items: center; flex: none; font-size: 10px; font-weight: 700; }
.entity-cell b { display: block; max-width: 240px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; font-weight: 600; }
.entity-cell span { display: block; margin-top: 3px; color: #9aa198; font-size: 8px; }
.mono { font-family: Consolas, "SFMono-Regular", monospace; font-size: 9px; color: #707970; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border-radius: 6px; font-size: 8px; font-weight: 700; white-space: nowrap; }
.badge.success { background: var(--green-soft); color: var(--green); }
.badge.warning { background: var(--amber-soft); color: var(--amber); }
.badge.danger { background: var(--red-soft); color: var(--red); }
.badge.neutral { background: #edf0eb; color: #747d73; }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.table-action { width: 30px; height: 30px; border: 0; border-radius: 7px; display: inline-grid; place-items: center; background: transparent; color: #929a91; cursor: pointer; }
.table-action:hover { background: #eef2ea; color: var(--green); }
.table-action.danger:hover { background: var(--red-soft); color: var(--red); }
.table-action .icon { width: 14px; height: 14px; }
.table-action.labeled-action { width: 58px; height: auto; min-height: 48px; padding: 6px 4px 5px; display: inline-flex; flex-direction: column; gap: 4px; font-size: 8px; line-height: 1; }
.table-action.labeled-action .icon { width: 16px; height: 16px; }
.table-action.labeled-action span { color: inherit; font-size: 8px; font-weight: 600; white-space: nowrap; }
#shipments-content .table-actions { gap: 5px; }
.price { font-variant-numeric: tabular-nums; font-weight: 600; }
.price.muted { color: #8d958c; font-weight: 400; }
.stock-positive { color: var(--green-dark); font-weight: 700; }
.stock-low { color: var(--red); font-weight: 700; }
.stock-normal { color: var(--text); font-weight: 600; }

.order-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; }
.order-head h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.035em; }
.order-head p { margin: 0; color: var(--muted); font-size: 10px; }
.order-filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.order-search { height: 34px; width: 210px; padding: 0 11px; border: 1px solid #e0e5dc; border-radius: 8px; background: #fff; outline: none; font-size: 9px; }
.order-type { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 7px; font-size: 8px; font-weight: 700; }
.order-type.purchase { background: #f8eedf; color: #aa742f; }
.order-type.sale { background: var(--green-soft); color: var(--green); }
.order-amount { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.order-contact-mini { color: #8f978e; font-size: 8px; margin-top: 3px; }
.clickable-row { cursor: pointer; }
.contact-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.contact-tabs button { border: 1px solid #dfe4dc; padding: 7px 13px; border-radius: 8px; background: #fff; color: #7d867c; font-size: 9px; cursor: pointer; }
.contact-tabs button.active { background: var(--sidebar); border-color: var(--sidebar); color: #f2f6ee; }
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.contact-card { padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.contact-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.contact-avatar { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: #e9f0e4; color: #516c55; font-size: 13px; font-weight: 700; }
.contact-card.supplier .contact-avatar { background: #f5ebdd; color: #946a33; }
.contact-top-actions { display: flex; }
.contact-card h3 { margin: 14px 0 5px; font-size: 12px; }
.contact-card > p { margin: 0; color: #929a90; font-size: 9px; }
.contact-meta { margin-top: 15px; padding-top: 13px; border-top: 1px solid #eef0ec; display: flex; flex-direction: column; gap: 7px; color: #778077; font-size: 9px; }
.contact-meta span { display: flex; align-items: center; gap: 6px; }
.contact-meta b { color: #515a51; font-weight: 500; }
.contact-note { margin-top: 12px; padding: 7px 9px; border-radius: 7px; background: #f6f8f3; color: #8b948a; font-size: 8px; }
.report-controls { display: flex; align-items: center; gap: 8px; }
.report-controls select { height: 34px; border: 1px solid #dfe4dc; border-radius: 8px; background: #fff; padding: 0 28px 0 11px; font-size: 9px; }
.report-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.report-kpi { padding: 18px 19px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.report-kpi span { color: #8c958b; font-size: 9px; }
.report-kpi strong { display: block; margin-top: 10px; font-size: 25px; letter-spacing: -.04em; }
.report-grid { display: grid; grid-template-columns: 1.45fr .75fr; gap: 14px; }
.report-card { padding: 20px; }
.report-chart { height: 270px; margin-top: 17px; display: flex; align-items: flex-end; gap: 8px; padding-top: 15px; background-image: linear-gradient(to bottom, #f0f2ee 1px, transparent 1px); background-size: 100% 25%; }
.report-bar-wrap { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; }
.report-bars { width: 100%; height: 220px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.report-bars .bar { width: min(9px, 30%); }
.rank-list { display: flex; flex-direction: column; margin-top: 14px; }
.rank-row { position: relative; padding: 12px 0; border-bottom: 1px solid #eef0ec; overflow: hidden; }
.rank-row:last-child { border-bottom: 0; }
.rank-main { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 12px; }
.rank-main b { font-size: 10px; font-weight: 600; }
.rank-main span { color: var(--green); font-size: 9px; font-weight: 700; }
.rank-sub { position: relative; z-index: 1; margin-top: 5px; color: #9aa199; font-size: 8px; }
.rank-track { position: absolute; left: 0; bottom: 0; height: 100%; width: var(--bar); background: linear-gradient(90deg, #f1f5ed, transparent); opacity: .7; }
.report-note { margin-top: 12px; color: #9aa199; font-size: 8px; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-card { padding: 21px; }
.settings-card .panel-head { margin-bottom: 22px; }
.settings-card .button { margin-top: 5px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 8px 0 21px; cursor: pointer; }
.switch-row > span b, .switch-row > span small { display: block; }
.switch-row > span b { font-size: 10px; }
.switch-row > span small { margin-top: 4px; color: #90988f; font-size: 8px; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i { position: relative; width: 34px; height: 19px; border-radius: 20px; background: #d8ded4; flex: none; transition: background .2s ease; }
.switch-row i::after { content: ""; position: absolute; width: 13px; height: 13px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: transform .2s ease; }
.switch-row input:checked + i { background: var(--green); }
.switch-row input:checked + i::after { transform: translateX(15px); }
.info-list { display: flex; flex-direction: column; }
.info-list div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid #eef0ec; font-size: 9px; }
.info-list span { color: #90988f; }
.info-list b { max-width: 70%; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.info-list b.success { display: inline-flex; align-items: center; gap: 7px; color: var(--green); }
.button-row { display: flex; gap: 9px; margin-top: 18px; }
.settings-note { margin: 17px 0 0; padding: 10px 12px; border-radius: 8px; background: #f5f7f2; color: #8a9388; font-size: 8px; line-height: 1.7; }

.modal-layer { position: fixed; z-index: 100; inset: 0; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal-layer.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(22,30,24,.52); backdrop-filter: blur(4px); }
.modal { position: relative; z-index: 1; width: min(680px, 100%); max-height: calc(100vh - 48px); border-radius: 18px; background: #fff; box-shadow: 0 24px 80px rgba(16,24,18,.25); display: flex; flex-direction: column; overflow: hidden; animation: modal-in .22s ease; }
.modal.wide { width: min(880px, 100%); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head { padding: 21px 23px 17px; border-bottom: 1px solid #edf0eb; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.modal-head h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.modal-body { padding: 20px 23px; overflow-y: auto; }
.modal-foot { padding: 15px 23px; border-top: 1px solid #edf0eb; display: flex; justify-content: flex-end; gap: 9px; background: #fbfcfa; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section-title { margin: 22px 0 13px; padding-top: 17px; border-top: 1px solid #edf0eb; font-size: 10px; font-weight: 700; }
.form-section-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.modal-summary { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-top: 16px; padding-top: 15px; border-top: 1px solid #edf0eb; font-size: 10px; color: #828b81; }
.modal-summary strong { color: var(--text); font-size: 21px; letter-spacing: -.03em; }
.order-lines { display: flex; flex-direction: column; gap: 8px; }
.order-line { display: grid; grid-template-columns: minmax(180px, 1fr) 88px 102px 86px 32px; gap: 7px; align-items: center; }
.order-line-head { padding: 0 3px; color: #9aa199; font-size: 8px; }
.order-line-head span:nth-child(n+2) { text-align: right; }
.order-line-subtotal { text-align: right; color: #596259; font-size: 10px; font-weight: 600; }
.order-line .line-input { padding: 9px 9px; font-size: 9px; }
.remove-line { width: 30px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: #a2aaa0; display: grid; place-items: center; cursor: pointer; }
.remove-line:hover { background: var(--red-soft); color: var(--red); }
.remove-line .icon { width: 13px; height: 13px; }
.add-line { align-self: flex-start; margin-top: 4px; }
.detail-list { display: flex; flex-direction: column; }
.detail-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid #eef0ec; font-size: 10px; }
.detail-row:last-child { border-bottom: 0; }
.detail-row span { color: #929a91; }
.detail-row b { text-align: right; }
.detail-items { margin-top: 20px; }
.detail-items h4 { margin: 0 0 8px; font-size: 10px; }
.detail-item { display: grid; grid-template-columns: 1fr 70px 90px 90px; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eef0ec; font-size: 9px; }
.detail-item span:nth-child(n+2) { text-align: right; }
.detail-item.head { color: #9aa199; font-size: 8px; }
.detail-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 15px; border-top: 1px solid #edf0eb; }
.detail-footer span { color: #8f978d; font-size: 10px; }
.detail-footer strong { font-size: 20px; letter-spacing: -.03em; }
.toast-stack { position: fixed; z-index: 200; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 240px; max-width: 360px; padding: 12px 15px; border: 1px solid #dbe5d7; border-radius: 10px; background: #f2f8ee; color: #3e5c43; box-shadow: 0 12px 32px rgba(20,35,25,.15); font-size: 10px; animation: toast-in .25s ease; }
.toast.error { border-color: #ecd2ce; background: #fdf0ee; color: #a34a43; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.confirm-copy { margin: 0; color: #667066; font-size: 11px; line-height: 1.8; }

@media (max-width: 1200px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .low-stock-panel { min-height: 0; }
  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; z-index: 35; inset: 0; display: none; background: rgba(20,28,22,.36); }
  .sidebar-scrim.open { display: block; }
  .main-shell { margin-left: 0; }
  .menu-button { display: grid; }
  .topbar { padding: 0 22px; }
  .page-content { padding: 25px 22px 50px; }
  .global-search { width: 220px; }
  .login-screen { grid-template-columns: 1fr 430px; }
  .login-art { padding: 36px; }
  .login-art-copy h1 { font-size: 46px; }
}
@media (max-width: 820px) {
  .login-screen { display: block; }
  .login-art { display: none; }
  .login-form-side { min-height: 100vh; padding: 30px; background: radial-gradient(circle at 80% 5%, #edf3e6, transparent 34%), #f8f8f4; }
  .login-mobile-brand { display: block; }
  .login-copyright { position: static; margin-top: 48px; }
  .topbar-date { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar { min-height: 72px; padding: 0 16px; }
  .topbar-title h1 { font-size: 17px; }
  .topbar-title .eyebrow { display: none; }
  .topbar-actions { gap: 5px; }
  .global-search { width: 180px; }
  .global-search kbd { display: none; }
  .page-content { padding: 20px 16px 44px; }
  .welcome-row { align-items: flex-start; flex-direction: column; }
  .welcome-row h2 { font-size: 21px; }
  .quick-actions { width: 100%; }
  .quick-actions .button { flex: 1; }
  .metric-grid { gap: 10px; }
  .metric-card { min-height: 122px; padding: 16px; }
  .metric-card strong { font-size: 24px; }
  .dashboard-grid { gap: 10px; }
  .chart-panel, .low-stock-panel { padding: 17px; }
  .activity-list { grid-template-columns: 1fr; }
  .section-toolbar { align-items: flex-start; flex-direction: column; }
  .summary-strip { flex-wrap: wrap; gap: 12px 20px; }
  .table-tools { align-items: flex-start; flex-direction: column; gap: 10px; }
  .contact-grid { grid-template-columns: 1fr; }
  .report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .report-card { padding: 17px; }
  .order-head { align-items: flex-start; flex-direction: column; }
  .order-filter-row { width: 100%; }
  .order-search { flex: 1; width: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .modal-layer { padding: 12px; }
  .modal { max-height: calc(100vh - 24px); }
  .order-line { grid-template-columns: minmax(145px, 1fr) 70px 90px 70px 30px; }
  .detail-item { grid-template-columns: 1fr 55px 80px 80px; }
}
@media (max-width: 520px) {
  .login-form-side { padding: 24px; }
  .login-card-head h2 { font-size: 27px; }
  .global-search { display: none; }
  .notification-button { width: 34px; height: 34px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 116px; }
  .metric-card strong { font-size: 21px; }
  .metric-card p { font-size: 8px; }
  .metric-icon { width: 25px; height: 25px; }
  .bar-chart { gap: 4px; }
  .bar-pair { gap: 2px; }
  .quick-actions { flex-direction: column; }
  .quick-actions .button { width: 100%; }
  .report-kpis { grid-template-columns: 1fr 1fr; }
  .report-kpi strong { font-size: 20px; }
  .report-chart { gap: 3px; }
  .settings-card { padding: 17px; }
  .button-row { flex-direction: column; }
  .modal-layer { padding: 0; align-items: flex-end; }
  .modal { width: 100%; max-height: 94vh; border-radius: 18px 18px 0 0; }
  .modal-head, .modal-body, .modal-foot { padding-left: 17px; padding-right: 17px; }
  .order-line { grid-template-columns: 1fr 1fr 30px; gap: 7px; padding-bottom: 12px; border-bottom: 1px solid #edf0eb; }
  .order-line-head { display: none; }
  .order-line .line-product { grid-column: 1 / -1; }
  .order-line-subtotal { align-self: center; }
  .detail-item { grid-template-columns: 1fr 50px 70px 75px; gap: 5px; }
  .modal-summary { justify-content: space-between; }
  .toast-stack { left: 15px; right: 15px; bottom: 15px; }
  .toast { min-width: 0; max-width: none; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.warehouse-panel { margin-bottom: 14px; padding: 20px 21px; }
.warehouse-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.warehouse-stat { position: relative; min-height: 104px; padding: 15px; border: 1px solid #e9ede6; border-radius: 12px; background: #fbfcf9; display: flex; align-items: center; gap: 12px; cursor: pointer; overflow: hidden; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.warehouse-stat:hover { transform: translateY(-2px); border-color: #cfd9ca; box-shadow: 0 10px 24px rgba(35, 54, 38, .07); }
.warehouse-stat::after { content: ""; position: absolute; right: -25px; bottom: -35px; width: 90px; height: 90px; border-radius: 50%; background: var(--accent-soft, #eef3e9); opacity: .65; }
.warehouse-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--accent-soft, #eef3e9); color: var(--accent, #5f7662); }
.warehouse-icon .icon { width: 18px; height: 18px; }
.warehouse-info { min-width: 0; flex: 1; position: relative; z-index: 1; }
.warehouse-info p { margin: 0 0 5px; color: #818a80; font-size: 8px; font-weight: 700; letter-spacing: .06em; }
.warehouse-info strong { display: block; font-size: 13px; }
.warehouse-info span { display: block; margin-top: 3px; color: #939b92; font-size: 8px; }
.warehouse-amount { position: relative; z-index: 1; text-align: right; }
.warehouse-amount b { display: block; font-size: 13px; }
.warehouse-amount small { color: #989f97; font-size: 7px; }
.warehouse-stat.finished { --accent: #4f7356; --accent-soft: #e6f0e1; }
.warehouse-stat.semi { --accent: #8a6c3f; --accent-soft: #f5ead8; }
.warehouse-stat.component { --accent: #506d8f; --accent-soft: #e8eff6; }
.warehouse-stat.accessory { --accent: #786078; --accent-soft: #f0e8f0; }
.warehouse-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.warehouse-tabs button { border: 1px solid #dfe5da; padding: 8px 12px; border-radius: 9px; background: #fff; color: #7b847a; cursor: pointer; font-size: 9px; transition: background .18s ease, border-color .18s ease, color .18s ease; }
.warehouse-tabs button b { margin-left: 5px; color: #9ba39a; font-size: 8px; }
.warehouse-tabs button:hover { border-color: #b9c7b5; }
.warehouse-tabs button.active { background: var(--sidebar); border-color: var(--sidebar); color: #f4f7f1; }
.warehouse-tabs button.active b { color: #bcd1af; }
.warehouse-badge { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 6px; font-size: 8px; font-weight: 700; white-space: nowrap; }
.warehouse-badge.finished { background: #e7f0e2; color: #4b704f; }
.warehouse-badge.semi { background: #f7ecd9; color: #8c6834; }
.warehouse-badge.component { background: #e8eff7; color: #526f91; }
.warehouse-badge.accessory { background: #f1e9f1; color: #785f78; }
.spec-cell { min-width: 150px; }
.spec-cell b { display: block; font-size: 9px; font-weight: 600; }
.spec-cell span { display: block; max-width: 230px; margin-top: 3px; color: #969e95; font-size: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.serial-flag { display: inline-block; margin-left: 6px; padding: 2px 5px; border-radius: 4px; background: #edf1ea; color: #7f8a7e; font-size: 7px; vertical-align: 1px; }
.shipment-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.shipment-summary button { padding: 15px 17px; border: 1px solid var(--line); border-radius: 13px; background: #fff; display: flex; align-items: center; justify-content: space-between; cursor: pointer; box-shadow: var(--shadow); transition: border-color .18s ease, transform .18s ease; }
.shipment-summary button:hover { transform: translateY(-1px); border-color: #c6d1c1; }
.shipment-summary button.active { border-color: var(--green); box-shadow: 0 0 0 2px rgba(79,115,86,.1); }
.shipment-summary span { color: #7d867c; font-size: 11px; }
.shipment-summary strong { font-size: 24px; letter-spacing: -.04em; }
.address-cell { max-width: 290px; color: #626c62; font-size: 11px; line-height: 1.65; }
.shipment-order-note { margin-top: 7px; padding: 6px 8px; border-radius: 7px; background: #f7f4eb; color: #675f4e; font-size: 9px; line-height: 1.55; max-width: 260px; overflow-wrap: anywhere; }
.shipment-order-note span { display: block; margin-bottom: 2px; color: #9b8c70; font-size: 8px; font-weight: 700; }
.shipment-sales-note { min-width: 170px; max-width: 260px; padding: 8px 10px; border: 1px solid #eadfc8; border-radius: 8px; background: #fffaf0; color: #5f5748; line-height: 1.55; overflow-wrap: anywhere; }
.shipment-sales-note b { display: block; font-size: 10px; font-weight: 650; }
.shipment-sales-note small { display: block; margin-top: 5px; padding-top: 5px; border-top: 1px dashed #e4d7bf; color: #8c7350; font-size: 9px; }
.tracking-number { display: inline-block; min-width: 130px; color: #4f6654; white-space: nowrap; }
#shipments-content th { font-size: 9px; }
#shipments-content td { font-size: 11px; }
#shipments-content .order-contact-mini { font-size: 9px; }
#shipments-content .mono { font-size: 10px; }
#shipments-content .badge { font-size: 9px; }
.shipping-form-grid { padding: 13px; border: 1px solid #e7ece2; border-radius: 12px; background: #fafbf8; }
#shipping-form .field > span { font-size: 10px; }
#shipping-form input, #shipping-form select, #shipping-form textarea { font-size: 11px; }
.shipping-detail-box { margin-top: 18px; padding: 15px 16px; border: 1px solid #e3e9df; border-radius: 12px; background: #f8faf6; }
.shipping-detail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.shipping-detail-head h4 { margin: 0; font-size: 13px; }
.shipping-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.shipping-detail-grid > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.shipping-detail-grid .wide { grid-column: 1 / -1; }
.shipping-detail-grid span { color: #929b91; font-size: 10px; }
.shipping-detail-grid b { font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.shipping-empty-copy { margin: 0; color: #7f897e; font-size: 9px; line-height: 1.7; }
.shipment-items-list { display: flex; flex-wrap: wrap; gap: 6px; }
.shipment-items-list > span { display: flex; flex-direction: column; gap: 2px; padding: 7px 9px; border-radius: 8px; background: #fff; border: 1px solid #e3e9df; }
.shipment-items-list b { font-size: 11px; }
.shipment-items-list small { color: #7e897d; font-size: 10px; }
.shipment-items-list code { color: #536854; font-size: 10px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; }
.shipment-items-list.compact { gap: 4px; }
.shipment-items-list.compact > span { padding: 4px 6px; border: 0; background: #f1f5ee; }
.shipment-items-list.compact b { font-size: 9px; }
.shipment-items-list.compact small { font-size: 9px; }
.shipment-items-list.compact code { font-size: 9px; }
@media (max-width: 1100px) { .warehouse-overview { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) {
  .warehouse-overview, .shipment-summary { grid-template-columns: 1fr 1fr; }
  .warehouse-stat { min-height: 96px; }
  .shipping-detail-grid { grid-template-columns: 1fr; }
  .shipping-detail-grid .wide { grid-column: auto; }
}
@media (max-width: 520px) { .warehouse-overview, .shipment-summary { grid-template-columns: 1fr; } }
.file-filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.7); }
.file-related-filter { height: 33px; min-width: 140px; padding: 0 28px 0 10px; border: 1px solid #dfe5da; border-radius: 8px; background: #fff; color: #6f786e; font-size: 9px; outline: none; }
.file-cell { display: flex; align-items: center; gap: 11px; min-width: 220px; }
.file-cell b { display: block; max-width: 300px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; }
.file-cell span { display: block; max-width: 300px; margin-top: 3px; color: #969e95; font-size: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.file-thumb { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; flex: none; overflow: hidden; background: #edf1e9; color: #6b7b6d; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb .icon { width: 17px; height: 17px; }
.file-category { display: inline-flex; padding: 4px 7px; border-radius: 6px; background: #eef1eb; color: #69756a; font-size: 8px; font-weight: 700; white-space: nowrap; }
.file-category.certificate { background: #e7f0e2; color: #4e704f; }
.file-category.drawing { background: #e8eff7; color: #526f91; }
.file-category.contract { background: #f5ead8; color: #8a6838; }
.file-category.inspection { background: #f1e9f1; color: #785f78; }
.file-category.shipping_photo { background: #e5f0ef; color: #4f7774; }
.file-category.shipping_receipt { background: #f8e9e4; color: #a35f4c; }
.relation-label { display: block; max-width: 230px; color: #697269; font-size: 9px; line-height: 1.5; overflow-wrap: anywhere; }
.drop-zone { min-height: 150px; border: 1.5px dashed #cbd5c7; border-radius: 13px; background: #f8faf6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: #7c897c; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--green); background: #f0f6eb; }
.drop-zone b { font-size: 11px; }
.drop-zone small { color: #9aa299; font-size: 8px; }
.drop-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green); }
.drop-icon .icon { width: 18px; height: 18px; }
.selected-files { display: flex; flex-direction: column; gap: 5px; }
.selected-file { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #e8ece5; border-radius: 8px; background: #fbfcfa; font-size: 9px; }
.selected-file > .icon { width: 14px; height: 14px; color: #758676; }
.selected-file b { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500; }
.selected-file small { color: #939b92; font-size: 8px; }
.selected-file button { width: 22px; height: 22px; border: 0; border-radius: 5px; display: grid; place-items: center; background: transparent; color: #989f97; cursor: pointer; }
.selected-file button:hover { background: var(--red-soft); color: var(--red); }
.selected-file button .icon { width: 11px; height: 11px; }
.shipping-photo-editor { margin-top: 2px; padding: 14px; border: 1px solid #e3e9df; border-radius: 12px; background: #fafbf8; }
.shipping-photo-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.shipping-photo-editor-head h4 { margin: 0 0 4px; font-size: 10px; }
.shipping-photo-editor-head p { margin: 0; color: #929b91; font-size: 8px; }
.shipping-photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.shipping-photo-item { position: relative; min-width: 0; }
.shipping-photo-item a { display: block; aspect-ratio: 4/3; overflow: hidden; border-radius: 8px; background: #e8ece5; }
.shipping-photo-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.shipping-photo-item a:hover img { transform: scale(1.04); }
.shipping-photo-item button { position: absolute; right: 5px; top: 5px; width: 22px; height: 22px; border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(20,28,22,.7); color: #fff; cursor: pointer; }
.shipping-photo-item button .icon { width: 11px; height: 11px; }
.shipping-photo-item small { display: block; margin-top: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #8b948a; font-size: 7px; }
.photo-empty { grid-column: 1 / -1; min-height: 78px; border: 1px dashed #d7dfd3; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #9aa299; font-size: 9px; }
.photo-empty .icon { width: 16px; height: 16px; }
.new-photo-list { display: flex; flex-direction: column; gap: 5px; margin-top: 9px; }
.shipping-photo-strip { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 13px; padding-top: 12px; border-top: 1px solid #e5ebe1; }
.shipping-photo-strip a { width: 64px; height: 52px; overflow: hidden; border-radius: 7px; background: #e8ece5; }
.shipping-photo-strip img { width: 100%; height: 100%; object-fit: cover; }
.shipment-photo-count { margin-top: 5px; color: #929b91; font-size: 9px; white-space: nowrap; }
@media (max-width: 720px) {
  .file-filter-bar { align-items: flex-start; flex-direction: column; }
  .file-related-filter { width: 100%; }
  .shipping-photo-grid { grid-template-columns: repeat(3, 1fr); }
  .shipping-photo-editor-head { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 520px) { .shipping-photo-grid { grid-template-columns: repeat(2, 1fr); } }
.product-thumb { overflow: hidden; padding: 0; background: #e8ece5; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-photo-field { display: flex; align-items: center; gap: 15px; padding: 14px; border: 1px solid #e3e9df; border-radius: 12px; background: #fafbf8; }
.product-photo-preview { width: 94px; height: 74px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; flex: none; background: #edf1e9; color: #6f7f70; }
.product-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.product-photo-preview .photo-placeholder .icon { width: 25px; height: 25px; }
.product-photo-copy { flex: 1; min-width: 0; }
.product-photo-copy > b, .product-photo-copy > span, .product-photo-copy > small { display: block; }
.product-photo-copy > b { font-size: 10px; }
.product-photo-copy > span { margin-top: 4px; color: #8f988e; font-size: 8px; }
.product-photo-copy > small { margin-top: 6px; color: #a0a79e; font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-photo-copy .button-row { margin-top: 9px; }
.role-badge { display: inline-flex; padding: 5px 8px; border-radius: 6px; font-size: 8px; font-weight: 700; }
.role-badge.superadmin { background: #e7f0e2; color: #4e704f; }
.role-badge.sales { background: #e8eff7; color: #526f91; }
.role-badge.production { background: #f5ead8; color: #8a6838; }
.permission-preview { padding: 13px; border: 1px solid #e6ebe2; border-radius: 10px; background: #f8faf6; }
.permission-preview h4 { margin: 0 0 10px; font-size: 10px; }
.permission-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.permission-grid > div { padding: 10px; border-radius: 8px; background: #fff; }
.permission-grid b { display: block; margin-bottom: 5px; font-size: 9px; }
.permission-grid span { display: block; color: #8b948a; font-size: 8px; line-height: 1.6; }
@media (max-width: 720px) { .permission-grid { grid-template-columns: 1fr; } .product-photo-field { align-items: flex-start; } }
.file-head-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.file-breadcrumb { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 13px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.72); }
.file-breadcrumb button { border: 0; background: transparent; padding: 2px 4px; color: #687568; cursor: pointer; font-size: 9px; }
.file-breadcrumb button:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.file-breadcrumb span { color: #b0b7ae; font-size: 9px; }
.folder-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.folder-card { min-width: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: flex; align-items: center; gap: 10px; cursor: pointer; text-align: left; box-shadow: var(--shadow); transition: transform .18s ease, border-color .18s ease; }
.folder-card:hover { transform: translateY(-2px); border-color: #bfcdb9; }
.folder-card-icon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; flex: none; background: #f5ead8; color: #9a7339; }
.folder-card-icon .icon { width: 18px; height: 18px; }
.folder-card-copy { min-width: 0; flex: 1; }
.folder-card-copy b, .folder-card-copy small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.folder-card-copy b { font-size: 10px; }
.folder-card-copy small { margin-top: 4px; color: #939b92; font-size: 8px; }
.folder-card > .icon { width: 13px; height: 13px; color: #abb2a9; }
.folder-path-label { display: block; max-width: 180px; color: #788278; font-size: 8px; line-height: 1.5; overflow-wrap: anywhere; }
@media (max-width: 1100px) { .folder-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .folder-grid { grid-template-columns: 1fr 1fr; } .file-head-actions { width: 100%; } .file-head-actions .button { flex: 1; } }
@media (max-width: 520px) { .folder-grid { grid-template-columns: 1fr; } }
.warning-tab.active { background: #fae9e6 !important; color: #a94840 !important; }
.warning-tab b { color: inherit; }
.inventory-alert-banner { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 13px 15px; border: 1px solid #e3e9df; border-radius: 12px; background: #f4f8f0; color: #5a6c5b; }
.inventory-alert-banner.active { border-color: #edd9bb; background: #fdf7ea; color: #8e642d; }
.inventory-alert-banner > .icon { width: 20px; height: 20px; flex: none; }
.inventory-alert-banner > div { flex: 1; min-width: 0; }
.inventory-alert-banner b, .inventory-alert-banner span { display: block; }
.inventory-alert-banner b { font-size: 10px; }
.inventory-alert-banner span { margin-top: 3px; color: #8d978b; font-size: 8px; }
.inventory-alert-banner.active span { color: #9e8055; }
.research-category { display: inline-flex; padding: 4px 8px; border-radius: 6px; background: #eef0f8; color: #5c6487; font-size: 8px; font-weight: 700; white-space: nowrap; }
.order-line.with-sales-extra { grid-template-columns: minmax(160px, 1fr) 80px 92px 80px 30px; padding-bottom: 10px; border-bottom: 1px solid #edf0eb; }
.order-line-extra { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(118px, .8fr) minmax(108px, .75fr) minmax(130px, 1fr) minmax(135px, .9fr) minmax(230px, 1.45fr) 36px auto; gap: 7px; align-items: end; }
.line-extra-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.line-extra-field > span { color: #8f988e; font-size: 7px; font-weight: 700; letter-spacing: .03em; }
.line-extra-field .line-input { width: 100%; }
.line-number-control { display: flex; gap: 5px; min-width: 0; }
.line-number-control .line-product-no { min-width: 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 8px; letter-spacing: .02em; }
.generate-nameplate { flex: none; padding: 0 9px; border: 1px solid #cbd6c6; border-radius: 8px; background: #f5f9f2; color: #516b55; cursor: pointer; font-size: 8px; font-weight: 700; }
.generate-nameplate:hover { border-color: #aabca6; background: #edf5e9; }
.nameplate-date-settings { display: grid; grid-template-columns: minmax(220px, 1fr) 120px 120px; gap: 12px; align-items: end; padding: 13px 14px; border: 1px solid #e4e9e0; border-radius: 12px; background: #f8faf6; }
.nameplate-date-settings .field { margin-bottom: 0; }
.nameplate-date-settings p { margin: 5px 0 0; color: #8b958a; font-size: 8px; line-height: 1.6; }
.line-photo-preview { width: 36px; height: 30px; border-radius: 6px; overflow: hidden; display: grid; place-items: center; background: #edf1e9; color: #8c998d; }
.line-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.line-photo-picker { min-height: 32px; padding: 0 10px; border: 1px solid #dbe1d7; border-radius: 8px; background: #fff; color: #667267; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 8px; white-space: nowrap; }
.line-photo-picker:hover { border-color: #b8c5b5; background: #fbfcf9; }
.line-photo-picker .icon { width: 13px; height: 13px; }
.detail-items { overflow-x: auto; }
.detail-item.sales-detail-item { grid-template-columns: minmax(140px, 1.3fr) 100px 100px 120px 58px 60px 85px 90px; min-width: 790px; }
.detail-photo { display: inline-block; width: 44px; height: 34px; overflow: hidden; border-radius: 6px; background: #edf1e9; }
.detail-photo img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 720px) {
  .order-line.with-sales-extra { grid-template-columns: minmax(145px, 1fr) 70px 90px 70px 30px; }
  .order-line-extra { grid-template-columns: 1fr 1fr; }
  .nameplate-date-settings { grid-template-columns: 1fr 1fr; }
  .nameplate-date-settings > div:first-child { grid-column: 1 / -1; }
  .line-photo-picker { justify-content: center; }
}
@media (max-width: 520px) {
  .order-line.with-sales-extra { grid-template-columns: 1fr 1fr 30px; }
  .order-line-extra { grid-template-columns: 1fr 1fr; }
  .nameplate-date-settings { grid-template-columns: 1fr 1fr; }
  .line-photo-preview { justify-self: start; }
}
.sales-query-panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.sales-query-panel .field { margin-bottom: 0; }
@media (max-width: 720px) { .sales-query-panel { grid-template-columns: 1fr; } }
.shipment-filter-panel { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(220px, 1.2fr); gap: 14px; margin-bottom: 14px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
.shipment-filter-panel .field { margin-bottom: 0; }
.shipment-fixed-sales { display: flex; flex-direction: column; justify-content: center; gap: 7px; padding: 0 4px; }
.shipment-fixed-sales span { color: #5f695f; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.shipment-fixed-sales b { font-size: 13px; }
.shipment-request-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; padding: 13px 14px; border: 1px solid #e3e9df; border-radius: 12px; background: #f8faf6; }
.shipment-request-summary > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.shipment-request-summary span { color: #90998f; font-size: 10px; }
.shipment-request-summary b { font-size: 12px; overflow-wrap: anywhere; }
.shipment-request-note { margin: 10px 0 16px; padding: 11px 13px; border-left: 3px solid #d4a34f; border-radius: 8px; background: #fbf7ee; display: flex; flex-direction: column; gap: 4px; }
.shipment-request-note span { color: #98815b; font-size: 9px; }
.shipment-request-note b { font-size: 11px; line-height: 1.65; }
.shipment-product-picker { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.shipment-product-choice { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 12px; align-items: center; padding: 11px 12px; border: 1px solid #e3e9df; border-radius: 10px; background: #fff; }
.shipment-product-check { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; }
.shipment-product-check input { width: 16px; height: 16px; accent-color: var(--green); flex: none; }
.shipment-product-check span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.shipment-product-check b { font-size: 12px; }
.shipment-product-check small { color: #8f988e; font-size: 10px; }
.shipment-product-qty { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.shipment-product-qty span { color: #8f988e; font-size: 10px; white-space: nowrap; }
.shipment-product-qty input { width: 70px; }
.form-hint { margin-top: 10px; color: #8c958a; font-size: 9px; line-height: 1.7; }
.nameplate-print-sheet { padding: 4px; }
.nameplate-print-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 12px; border-bottom: 2px solid #263b2b; }
.nameplate-print-head h2 { margin: 0; font-size: 18px; }
.nameplate-print-head p { margin: 4px 0 0; color: #7f8b80; font-size: 9px; }
.nameplate-print-head > span { color: #657264; font-size: 9px; }
.nameplate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.nameplate-card { min-height: 185px; padding: 16px; border: 2px solid #273c2b; border-radius: 10px; background: #fff; display: flex; flex-direction: column; break-inside: avoid; }
.nameplate-card-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 8px; border-bottom: 1px solid #9da99c; }
.nameplate-card-head span { font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.nameplate-card-head small { color: #737e72; font-size: 8px; }
.nameplate-card h3 { margin: 13px 0 10px; font-size: 15px; line-height: 1.35; }
.nameplate-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; margin: 0; }
.nameplate-card dl > div { min-width: 0; }
.nameplate-card dt { color: #7f8a7e; font-size: 7px; }
.nameplate-card dd { margin: 2px 0 0; font-size: 9px; font-weight: 700; overflow-wrap: anywhere; }
.nameplate-code { margin-top: auto; padding-top: 14px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 19px; font-weight: 800; letter-spacing: .11em; text-align: center; }
.nameplate-card > p { margin: 3px 0 0; color: #7f8a7e; font-size: 7px; text-align: center; }
.role-badge.purchaser { background: #f5ead8; color: #8a6838; }
@media (max-width: 720px) { .shipment-filter-panel { grid-template-columns: 1fr; } .shipment-request-summary { grid-template-columns: 1fr 1fr; } .shipment-product-choice { grid-template-columns: 1fr; } .shipment-product-qty { justify-content: space-between; } }
@media (max-width: 720px) { .nameplate-grid { grid-template-columns: 1fr; } }
@media print {
  @page { size: A4; margin: 10mm; }
  body { padding: 0 !important; background: #fff !important; }
  body * { visibility: hidden; }
  #modal-layer, #modal-layer *, #modal, #modal-body, .nameplate-print-sheet, .nameplate-print-sheet * { visibility: visible; }
  #modal-layer { position: absolute; inset: 0; display: block; background: #fff; }
  .modal-backdrop, .modal-head, .modal-foot { display: none !important; }
  .modal { width: 100% !important; max-width: none !important; max-height: none !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: #fff !important; }
  .modal-body { max-height: none !important; overflow: visible !important; padding: 0 !important; }
  .nameplate-print-sheet { position: absolute; left: 0; top: 0; width: 100%; padding: 0; }
  .nameplate-card { min-height: 190px; }
}
