:root {
  --primary: #2563eb;
  --primary-700: #1d4ed8;
  --primary-50: #eff6ff;
  --navy: #0f172a;
  --navy-2: #111c36;
  --text: #172033;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e2e8f0;
  --line-soft: #edf1f7;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --page: #f3f6fb;
  --success: #16a34a;
  --success-bg: #ecfdf3;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --purple: #7c3aed;
  --purple-bg: #f5f3ff;
  --cyan: #0891b2;
  --cyan-bg: #ecfeff;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-sm: 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-md: 0 18px 50px rgba(15, 23, 42, .14);
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --sidebar: 124px;
  --topbar: 54px;
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--page); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
.is-hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

svg.icon { width: 18px; height: 18px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(520px, 1.16fr) minmax(420px, .84fr); background: #fff; position: relative; overflow: hidden; }
.login-showcase { position: relative; min-height: 100vh; padding: 46px clamp(40px, 6vw, 92px); color: #fff; background:
  radial-gradient(circle at 12% 12%, rgba(96, 165, 250, .26), transparent 28%),
  radial-gradient(circle at 82% 70%, rgba(168, 85, 247, .24), transparent 30%),
  linear-gradient(145deg, #172554 0%, #1e3a8a 44%, #1d4ed8 100%);
  display: flex; flex-direction: column; overflow: hidden; }
.login-showcase::before { content: ""; position: absolute; inset: 0; opacity: .08; background-image: linear-gradient(rgba(255,255,255,.4) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.4) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to bottom, #000, transparent 78%); }
.login-panel { min-height: 100vh; display: grid; place-items: center; padding: 40px; background: #fff; position: relative; z-index: 2; }
.login-card { width: min(440px, 100%); }
.brand-lockup { display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }
.brand-lockup strong { display: block; font-size: 20px; line-height: 1.1; letter-spacing: .02em; }
.brand-lockup small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.brand-lockup-light small { color: rgba(255,255,255,.66); }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #3b82f6, #1d4ed8); box-shadow: 0 10px 28px rgba(37, 99, 235, .3); flex: none; }
.brand-lockup-light .brand-mark { background: rgba(255,255,255,.13); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); backdrop-filter: blur(8px); }
.brand-mark svg { width: 29px; height: 29px; fill: currentColor; }
.brand-mark .brand-cut { fill: none; stroke: #facc15; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.showcase-copy { position: relative; z-index: 2; margin-top: clamp(80px, 11vh, 130px); max-width: 650px; }
.eyebrow { display: inline-flex; align-items: center; min-height: 30px; padding: 0 13px; border: 1px solid rgba(255,255,255,.17); background: rgba(255,255,255,.08); color: #bfdbfe; border-radius: 999px; font-size: 12px; letter-spacing: .06em; backdrop-filter: blur(10px); }
.showcase-copy h1 { margin: 26px 0 20px; font-size: clamp(40px, 4.7vw, 66px); line-height: 1.12; letter-spacing: -.045em; }
.showcase-copy p { margin: 0; max-width: 560px; color: rgba(255,255,255,.72); font-size: 17px; line-height: 1.85; }
.showcase-metrics { position: relative; z-index: 2; margin-top: 46px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 720px; }
.showcase-metrics article { min-height: 106px; padding: 19px 18px; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; background: rgba(255,255,255,.08); backdrop-filter: blur(10px); }
.showcase-metrics strong { display: block; margin-bottom: 8px; font-size: 15px; }
.showcase-metrics span { color: rgba(255,255,255,.58); line-height: 1.6; font-size: 12px; }
.showcase-board { width: min(640px, 78%); height: 260px; position: absolute; right: -92px; bottom: -36px; border: 1px solid rgba(255,255,255,.17); border-radius: 22px; background: rgba(255,255,255,.10); box-shadow: 0 36px 80px rgba(3, 7, 18, .28); transform: rotate(-4deg); backdrop-filter: blur(14px); padding: 18px; opacity: .76; }
.mini-head { height: 28px; display: flex; gap: 7px; align-items: center; }
.mini-head span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.45); }
.mini-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mini-cards i { height: 54px; border-radius: 10px; background: rgba(255,255,255,.15); }
.mini-table { margin-top: 11px; display: grid; grid-template-columns: 1.1fr .9fr .7fr .7fr .85fr .65fr; gap: 7px; }
.mini-table b, .mini-table em { display: block; height: 17px; border-radius: 5px; background: rgba(255,255,255,.24); }
.mini-table em { height: 29px; background: rgba(255,255,255,.12); }
.login-orb { position: absolute; border-radius: 50%; filter: blur(0); opacity: .45; pointer-events: none; }
.login-orb-one { width: 230px; height: 230px; background: #60a5fa; left: -100px; top: -80px; }
.login-orb-two { width: 260px; height: 260px; background: #c084fc; left: 42%; bottom: -180px; }
.mobile-brand { display: none; margin-bottom: 50px; }
.login-title > span { color: var(--primary); font-weight: 700; font-size: 13px; }
.login-title h2 { margin: 10px 0 8px; font-size: 32px; letter-spacing: -.035em; }
.login-title p { margin: 0 0 34px; color: var(--muted); }
.field { display: block; margin-bottom: 18px; }
.field > span { display: block; margin: 0 0 8px; color: #334155; font-weight: 650; font-size: 13px; }
.input-shell { height: 48px; border: 1px solid var(--line); border-radius: 11px; display: flex; align-items: center; gap: 10px; padding: 0 13px; transition: .18s ease; background: #fff; }
.input-shell:focus-within { border-color: #93c5fd; box-shadow: 0 0 0 4px rgba(59, 130, 246, .1); }
.input-shell > span { color: var(--muted-2); display: grid; place-items: center; }
.input-shell input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; }
.input-shell input::placeholder { color: #a8b3c4; }
.input-action { margin-right: -7px; }
.button { min-height: 38px; border: 1px solid transparent; border-radius: 9px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 650; transition: .16s ease; background: #fff; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.button-primary { color: #fff; background: var(--primary); box-shadow: 0 8px 20px rgba(37, 99, 235, .18); }
.button-primary:hover { background: var(--primary-700); }
.button-secondary { color: #334155; border-color: var(--line); background: #fff; box-shadow: var(--shadow-xs); }
.button-secondary:hover { border-color: #cbd5e1; background: #fbfdff; }
.button-soft { color: var(--primary-700); background: var(--primary-50); }
.button-danger { color: #fff; background: var(--danger); }
.button-ghost { background: transparent; color: var(--muted); }
.button-large { width: 100%; min-height: 49px; margin-top: 4px; border-radius: 11px; }
.button-small { min-height: 32px; padding: 0 10px; font-size: 12px; }
.form-error { min-height: 20px; margin: 10px 0 0; color: var(--danger); font-size: 12px; text-align: center; }
.demo-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--muted-2); font-size: 11px; }
.demo-divider::before, .demo-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.demo-accounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.demo-accounts button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 11px 8px; cursor: pointer; text-align: left; transition: .15s ease; }
.demo-accounts button:hover { border-color: #93c5fd; background: var(--primary-50); }
.demo-accounts b, .demo-accounts span { display: block; }
.demo-accounts b { font-size: 12px; }
.demo-accounts span { color: var(--muted); font-size: 10px; margin-top: 4px; }
.login-footnote { margin: 22px 0 0; color: var(--muted-2); text-align: center; font-size: 11px; line-height: 1.6; }

/* Shell */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: var(--sidebar); background: linear-gradient(180deg, #111c36 0%, #0f172a 100%); color: #dce6f6; display: flex; flex-direction: column; box-shadow: 8px 0 30px rgba(15, 23, 42, .08); }
.sidebar-brand { height: var(--topbar); padding: 0 6px; border-bottom: 1px solid rgba(255,255,255,.07); }
.sidebar-brand.brand-lockup { gap: 6px; }
.sidebar-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.sidebar-brand .brand-mark svg { width: 25px; height: 25px; }
.sidebar-brand strong { font-size: 17px; }
.sidebar-brand small { margin-top: 4px; font-size: 11px; letter-spacing: 0; }
.sidebar-nav { padding: 12px 6px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.nav-item { width: 100%; min-height: 44px; border: 0; border-radius: 9px; padding: 0 7px; display: flex; align-items: center; gap: 7px; color: #9eacc2; background: transparent; cursor: pointer; text-align: left; transition: .15s ease; position: relative; font-size: 14px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.065); }
.nav-item.is-active { color: #fff; background: rgba(59, 130, 246, .18); box-shadow: inset 3px 0 0 #60a5fa; }
.nav-item > span:first-child { display: grid; place-items: center; }
.nav-item > span:nth-child(2) { flex: 1; font-weight: 550; }
.nav-badge { min-width: 21px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(248,113,113,.16); color: #fca5a5; display: none; place-items: center; font-size: 10px; font-style: normal; }
.nav-badge:not(:empty) { display: grid; }
.sidebar-bottom { margin-top: auto; padding: 8px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-user { margin-top: 5px; min-height: 50px; display: flex; align-items: center; gap: 7px; padding: 7px 6px; border-radius: 10px; background: rgba(255,255,255,.055); }
.sidebar-user > div { min-width: 0; flex: 1; }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: 12px; color: #fff; }
.sidebar-user small { margin-top: 4px; font-size: 10px; color: #8291a9; }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; flex: none; color: #fff; font-weight: 750; background: linear-gradient(145deg, #60a5fa, #7c3aed); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 9px; padding: 0; background: transparent; color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; transition: .15s ease; }
.icon-button:hover { color: var(--text); background: #f1f5f9; }
.sidebar .icon-button { color: #8391a8; }
.sidebar .icon-button:hover { color: #fff; background: rgba(255,255,255,.08); }
.main-shell { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { height: var(--topbar); position: sticky; z-index: 30; top: 0; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.topbar-left { min-width: 0; display: flex; align-items: center; gap: 12px; }
.breadcrumbs { display: flex; align-items: center; gap: 7px; color: var(--muted-2); font-size: 10px; }
.breadcrumbs b { font-weight: 400; }
.breadcrumbs strong { color: var(--muted); font-weight: 500; }
.topbar h1 { margin: 2px 0 0; font-size: 17px; letter-spacing: -.02em; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.global-search { width: min(320px, 28vw); height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-alt); color: var(--muted-2); }
.global-search:focus-within { border-color: #93c5fd; background: #fff; box-shadow: 0 0 0 3px rgba(59,130,246,.08); }
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 12px; color: var(--text); }
kbd { padding: 2px 6px; border: 1px solid #dbe2ec; border-bottom-width: 2px; border-radius: 5px; color: #94a3b8; background: #fff; font-family: inherit; font-size: 9px; }
.notification-button { position: relative; border: 1px solid transparent; }
.notification-button i { min-width: 16px; height: 16px; padding: 0 4px; position: absolute; right: 0; top: 0; border: 2px solid #fff; border-radius: 999px; background: var(--danger); color: #fff; display: grid; place-items: center; font-size: 8px; font-style: normal; }
.user-menu-button { height: 40px; border: 0; border-radius: 10px; padding: 3px 6px; display: flex; align-items: center; gap: 8px; background: transparent; cursor: pointer; }
.user-menu-button:hover { background: #f8fafc; }
.user-menu-button > span:nth-child(2) { min-width: 86px; text-align: left; }
.user-menu-button b, .user-menu-button small { display: block; }
.user-menu-button b { font-size: 11px; }
.user-menu-button small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.user-menu-button .avatar { width: 30px; height: 30px; }
.mobile-menu-button { display: none; }
.page-content { padding: 16px 18px 32px; }
.sidebar-backdrop { display: none; }

/* General page components */
.page-heading { margin-bottom: 11px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-heading h2 { margin: 0; font-size: 19px; letter-spacing: -.03em; }
.page-heading p { margin: 3px 0 0; color: var(--muted); line-height: 1.4; font-size: 12px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.page-actions .button { min-height: 34px; padding: 0 11px; }
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.card-header { min-height: 58px; padding: 14px 17px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title { min-width: 0; }
.card-title h3 { margin: 0; font-size: 14px; }
.card-title p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.card-body { padding: 17px; }
.link-button { border: 0; padding: 0; color: var(--primary); background: transparent; cursor: pointer; font-size: 12px; }
.empty-state { min-height: 280px; padding: 40px 20px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.empty-state > div { max-width: 320px; }
.empty-state .empty-icon { width: 58px; height: 58px; margin: 0 auto 15px; border-radius: 17px; display: grid; place-items: center; color: var(--muted); background: #f1f5f9; }
.empty-state h3 { color: var(--text); margin: 0 0 8px; }
.empty-state p { margin: 0; line-height: 1.7; font-size: 12px; }

/* Dashboard */
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(160px, 1fr)); gap: 14px; }
.metric-card { min-height: 126px; padding: 17px; position: relative; overflow: hidden; }
.metric-card::after { content: ""; width: 100px; height: 100px; position: absolute; right: -45px; bottom: -55px; border-radius: 50%; background: currentColor; opacity: .06; }
.metric-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.metric-icon { width: 39px; height: 39px; border-radius: 11px; display: grid; place-items: center; }
.metric-icon.blue { color: var(--primary); background: var(--primary-50); }
.metric-icon.orange { color: var(--warning); background: var(--warning-bg); }
.metric-icon.red { color: var(--danger); background: var(--danger-bg); }
.metric-icon.purple { color: var(--purple); background: var(--purple-bg); }
.metric-icon.green { color: var(--success); background: var(--success-bg); }
.metric-delta { min-height: 23px; padding: 0 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 3px; color: var(--muted); background: #f8fafc; font-size: 9px; }
.metric-value { margin-top: 16px; font-size: 27px; font-weight: 760; letter-spacing: -.04em; }
.metric-label { margin-top: 4px; color: var(--muted); font-size: 11px; }
.dashboard-grid { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 14px; }
.progress-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 18px; }
.progress-donut { display: flex; align-items: center; gap: 13px; min-width: 0; }
.donut { --value: 0; --donut-color: var(--primary); width: 58px; height: 58px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--donut-color) calc(var(--value) * 1%), #edf1f7 0); position: relative; }
.donut::before { content: ""; width: 42px; height: 42px; border-radius: 50%; background: #fff; }
.donut b { position: absolute; font-size: 11px; }
.progress-donut > div:last-child { min-width: 0; }
.progress-donut strong { display: block; font-size: 13px; }
.progress-donut span { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.alert-list { padding: 5px 0; }
.alert-item { width: 100%; min-height: 63px; border: 0; border-bottom: 1px solid var(--line-soft); padding: 10px 17px; background: #fff; display: flex; align-items: center; gap: 11px; cursor: pointer; text-align: left; }
.alert-item:last-child { border-bottom: 0; }
.alert-item:hover { background: #fbfdff; }
.alert-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--warning); box-shadow: 0 0 0 5px var(--warning-bg); }
.alert-dot.danger { background: var(--danger); box-shadow: 0 0 0 5px var(--danger-bg); }
.alert-item > div { min-width: 0; flex: 1; }
.alert-item strong, .alert-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-item strong { font-size: 12px; }
.alert-item span { margin-top: 5px; color: var(--muted); font-size: 10px; }
.alert-item time { color: var(--muted-2); font-size: 9px; white-space: nowrap; }
.dashboard-lower { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr); gap: 14px; }
.status-bars { padding: 13px 17px 17px; }
.status-bar-row { display: grid; grid-template-columns: 76px minmax(0,1fr) 30px; gap: 10px; align-items: center; margin-top: 13px; }
.status-bar-row:first-child { margin-top: 4px; }
.status-bar-row span { color: var(--muted); font-size: 11px; }
.status-bar-track { height: 8px; border-radius: 999px; background: #edf1f7; overflow: hidden; }
.status-bar-fill { height: 100%; min-width: 3px; border-radius: inherit; background: linear-gradient(90deg, #60a5fa, #2563eb); }
.status-bar-row b { text-align: right; font-size: 11px; }
.recent-deliveries { padding: 4px 0; }
.delivery-compact { min-height: 55px; display: grid; grid-template-columns: 40px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 8px 17px; border-bottom: 1px solid var(--line-soft); }
.delivery-compact:last-child { border-bottom: 0; }
.delivery-compact img { width: 38px; height: 38px; border-radius: 9px; object-fit: contain; background: #f8fafc; border: 1px solid var(--line-soft); }
.delivery-compact strong, .delivery-compact span { display: block; }
.delivery-compact strong { font-size: 11px; }
.delivery-compact span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.delivery-compact b { font-size: 12px; }
.delivery-compact b small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 400; text-align: right; }

/* Toolbars and filters */
.toolbar-card { margin-bottom: 10px; padding: 9px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.filter-group { min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-box { width: 240px; height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted-2); background: #fff; }
.search-box:focus-within { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(59,130,246,.08); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 12px; }
.select-control { height: 34px; min-width: 126px; border: 1px solid var(--line); border-radius: 9px; padding: 0 30px 0 10px; color: #334155; background: #fff; outline: 0; cursor: pointer; }
.select-control:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(59,130,246,.08); }
.filter-chip { min-height: 34px; border: 1px solid var(--line); border-radius: 999px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); background: #fff; cursor: pointer; font-size: 11px; }
.filter-chip.is-active { color: var(--primary-700); border-color: #bfdbfe; background: var(--primary-50); }
.date-filter { min-height:34px; display:flex; align-items:center; gap:6px; padding:3px 8px 3px 10px; border:1px solid var(--line); border-radius:9px; background:#fff; color:var(--muted); font-size:10px; }
.date-filter input { width:122px; min-height:27px; padding:0 5px; border:0; background:#f8fafc; color:var(--text); font-size:10px; }
.date-filter em { font-style:normal; }
.toolbar-meta { color: var(--muted); font-size: 11px; white-space: nowrap; }

/* Tables */
.table-card { overflow: hidden; }
.table-scroll { width: 100%; overflow: auto; }
.data-table { width: 100%; min-width: 1240px; border-collapse: separate; border-spacing: 0; }
.data-table th { height: 43px; position: sticky; z-index: 3; top: 0; padding: 0 10px; color: #64748b; background: #f8fafc; border-bottom: 1px solid var(--line); text-align: left; font-size: 10px; font-weight: 650; white-space: nowrap; }
.table-sort-button { display:inline-flex; align-items:center; gap:5px; padding:0; border:0; background:transparent; color:inherit; font:inherit; cursor:pointer; white-space:nowrap; }
.table-sort-button:hover,.table-sort-button:focus-visible { color:var(--primary); }
.table-sort-button b { color:var(--primary); font-size:15px; line-height:1; }
.data-table td { min-height: 64px; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; font-size: 11px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: .12s ease; }
.data-table tbody tr:hover { background: #fbfdff; }
.data-table tbody tr.is-risk { background: linear-gradient(90deg, rgba(254,242,242,.7), transparent 42%); }
.table-check { width: 18px; height: 18px; accent-color: var(--primary); }
.product-cell { min-width: 150px; display: flex; align-items: center; gap: 10px; }
.product-image { width: 48px; height: 54px; border-radius: 9px; object-fit: contain; flex: none; border: 1px solid var(--line-soft); background: #f8fafc; }
.image-hover-preview { width: 240px; height: 300px; position: fixed; z-index: 120; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 24px 60px rgba(15,23,42,.22); pointer-events: none; animation: pop .14s ease-out; }
.image-hover-preview img { width: 100%; height: 100%; border-radius: 9px; object-fit: contain; background: #f8fafc; }
.product-cell strong, .product-cell span { display: block; }
.product-cell strong { font-size: 12px; }
.product-cell span { margin-top: 5px; color: var(--muted); font-size: 9px; }
.batch-code { color: #475569; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.color-cell { min-width: 92px; }
.color-cell strong, .color-cell span { display: block; }
.color-cell strong { font-size: 11px; }
.color-cell span { margin-top: 5px; color: var(--muted); font-size: 9px; max-width: 115px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.size-grid { min-width: 180px; display: grid; grid-template-columns: repeat(5, minmax(29px, 1fr)); gap: 4px; }
.size-box { min-height: 36px; border-radius: 7px; display: grid; place-items: center; background: #f8fafc; border: 1px solid var(--line-soft); text-align: center; }
.size-box b, .size-box span { display: block; }
.size-box b { font-size: 9px; }
.size-box span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.size-box.is-empty { color: #b5bfce; background: #fbfcfe; }
.fabric-cell { min-width: 150px; }
.fabric-cell strong { display: block; font-size: 11px; }
.fabric-cell span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.inline-progress { min-width: 120px; }
.inline-progress-head { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; }
.inline-progress-head span { color: var(--muted); }
.progress-track { height: 6px; margin-top: 7px; border-radius: 999px; overflow: hidden; background: #e9eef5; }
.progress-track > i { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: var(--primary); }
.progress-track > i.warning { background: var(--warning); }
.progress-track > i.danger { background: var(--danger); }
.progress-track > i.success { background: var(--success); }
.progress-caption { margin-top: 5px; color: var(--muted); font-size: 9px; }
.orders-data-table td { font-size: 13px; }
.orders-data-table .product-image { width: 120px; height: 135px; }
.orders-data-table .batch-code { font-size: 12px; font-weight: 650; }
.orders-data-table .factory-label { font-size: 11px; }
.orders-data-table .product-cell strong { font-size: 14px; }
.orders-data-table .product-cell span { font-size: 11px; }
.orders-data-table .color-cell strong { font-size: 13px; }
.orders-data-table .color-cell span { font-size: 11px; }
.orders-data-table .size-box b { font-size: 10px; }
.orders-data-table .size-box span { font-size: 11px; }
.orders-data-table .inline-progress { width: 112px; min-width: 112px; }
.orders-data-table .inline-progress-head { font-size: 12px; }
.orders-data-table .progress-caption { font-size: 11px; line-height: 1.35; }
.status-badge { min-height: 24px; padding: 0 9px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-size: 9px; font-weight: 650; white-space: nowrap; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-complete { color: var(--success); background: var(--success-bg); }
.status-risk { color: var(--danger); background: var(--danger-bg); }
.status-fabric { color: var(--warning); background: var(--warning-bg); }
.status-cutting { color: var(--purple); background: var(--purple-bg); }
.status-delivery { color: var(--primary); background: var(--primary-50); }
.status-default { color: var(--muted); background: #f1f5f9; }
.assignee-cell { display: flex; align-items: center; gap: 7px; min-width: 92px; }
.assignee-cell .avatar { width: 27px; height: 27px; border-radius: 8px; font-size: 10px; }
.due-date { white-space: nowrap; }
.due-date.overdue { color: var(--danger); font-weight: 650; }
.table-actions { display: flex; align-items: center; gap: 3px; }
.table-actions .icon-button { width: 31px; height: 31px; }
.table-footer { min-height: 50px; padding: 10px 14px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; }
.warning-text { color: var(--danger); }
.success-text { color: var(--success); }
.muted { color: var(--muted); }

/* Focus pages */
.focus-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.focus-card { min-height: 112px; padding: 16px; }
.focus-card-header { display: flex; align-items: center; justify-content: space-between; }
.focus-card h3 { margin: 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.focus-card strong { display: block; margin-top: 15px; font-size: 25px; }
.focus-card p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.stage-list { padding: 6px 0; }
.stage-row { min-height: 76px; display: grid; grid-template-columns: 48px minmax(160px,1fr) minmax(180px,.85fr) 130px 100px auto; align-items: center; gap: 13px; padding: 10px 17px; border-bottom: 1px solid var(--line-soft); }
.stage-row:last-child { border-bottom: 0; }
.stage-row img { width: 44px; height: 52px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line-soft); background: #f8fafc; }
.stage-row h4 { margin: 0; font-size: 12px; }
.stage-row p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.stage-numbers { display: flex; align-items: baseline; gap: 4px; }
.stage-numbers strong { font-size: 17px; }
.stage-numbers span { color: var(--muted); font-size: 9px; }

/* Deliveries */
.delivery-table { min-width: 960px; }
.destination-badge { min-height: 25px; padding: 0 9px; border-radius: 7px; display: inline-flex; align-items: center; color: var(--primary-700); background: var(--primary-50); font-weight: 650; font-size: 10px; }
.qty-total { font-size: 13px; font-weight: 750; }
.delivery-note { max-width: 220px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Reports */
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.report-card { min-height: 320px; }
.big-number { font-size: 30px; font-weight: 760; letter-spacing: -.04em; }
.report-summary { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.report-summary p { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.bar-chart { height: 190px; padding-top: 20px; display: flex; align-items: stretch; gap: 12px; border-bottom: 1px solid var(--line); }
.bar-column { flex: 1; min-width: 30px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; }
.bar-column b { font-size: 9px; }
.bar-column i { width: min(38px, 70%); min-height: 3px; border-radius: 7px 7px 0 0; background: linear-gradient(180deg, #60a5fa, #2563eb); }
.bar-column span { height: 29px; color: var(--muted); font-size: 9px; text-align: center; }
.ranking-list { margin-top: 14px; }
.ranking-row { display: grid; grid-template-columns: 24px minmax(0,1fr) 60px; gap: 9px; align-items: center; margin-top: 13px; }
.ranking-row > b { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: #f1f5f9; font-size: 9px; }
.ranking-row strong { display: block; font-size: 11px; }
.ranking-row .progress-track { margin-top: 5px; }
.ranking-row > span { text-align: right; font-size: 10px; }

/* Team and activity */
.team-grid { display: grid; grid-template-columns: repeat(3, minmax(230px, 1fr)); gap: 14px; }
.member-card { padding: 17px; }
.member-head { display: flex; align-items: center; gap: 11px; }
.member-head .avatar { width: 42px; height: 42px; border-radius: 12px; font-size: 13px; }
.member-head > div { min-width: 0; flex: 1; }
.member-head strong, .member-head span { display: block; }
.member-head strong { font-size: 13px; }
.member-head span { margin-top: 5px; color: var(--muted); font-size: 10px; }
.member-status { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.member-status.off { background: var(--muted-2); }
.member-meta { margin: 17px 0 14px; padding: 12px; border-radius: 10px; background: #f8fafc; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.member-meta span { display: block; color: var(--muted); font-size: 9px; }
.member-meta b { display: block; margin-top: 4px; font-size: 11px; }
.member-actions { display: flex; gap: 8px; }
.activity-timeline { padding: 8px 18px 18px; }
.activity-row { min-height: 64px; position: relative; display: grid; grid-template-columns: 36px minmax(0,1fr) auto; gap: 11px; align-items: start; padding: 11px 0; }
.activity-row:not(:last-child)::after { content: ""; width: 1px; position: absolute; left: 17px; top: 48px; bottom: -10px; background: var(--line); }
.activity-icon { width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; color: var(--primary); background: var(--primary-50); position: relative; z-index: 1; }
.activity-row strong { display: block; margin-top: 1px; font-size: 11px; }
.activity-row p { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.activity-row time { color: var(--muted-2); font-size: 9px; white-space: nowrap; }

/* Popovers */
.popover { min-width: 260px; max-width: 380px; position: fixed; z-index: 90; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow-md); overflow: hidden; animation: pop .14s ease-out; }
.delivery-detail-popover,.cutting-detail-popover { width: min(520px, calc(100vw - 20px)) !important; max-width: calc(100vw - 20px); pointer-events: auto; }
.cutting-hover-target,.delivery-hover-target { border-radius:8px; }
.cutting-hover-target:hover,.cutting-hover-target:focus,.delivery-hover-target:hover,.delivery-hover-target:focus { outline:2px solid #bfdbfe; outline-offset:2px; }
.batch-cell { display:flex; align-items:flex-start; gap:6px; flex-direction:column; }
.batch-cell time { color:#64748b; font-size:9px; white-space:nowrap; }
@keyframes pop { from { opacity: 0; transform: translateY(-5px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.popover-header { min-height: 49px; padding: 10px 13px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; }
.popover-header strong { font-size: 12px; }
.popover-list { max-height: 390px; overflow: auto; }
.popover-item { width: 100%; min-height: 58px; border: 0; border-bottom: 1px solid var(--line-soft); padding: 10px 13px; display: flex; align-items: flex-start; gap: 9px; background: #fff; text-align: left; cursor: pointer; }
.popover-item:last-child { border-bottom: 0; }
.popover-item:hover { background: #f8fafc; }
.popover-item > div { min-width: 0; }
.popover-item strong, .popover-item span { display: block; }
.popover-item strong { font-size: 11px; }
.popover-item span { margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.user-popover { width: 220px; }
.user-popover .popover-item { min-height: 42px; align-items: center; }

/* Modal */
.modal-backdrop { position: fixed; z-index: 100; inset: 0; padding: 24px; background: rgba(15, 23, 42, .48); backdrop-filter: blur(3px); display: grid; place-items: center; animation: fade .14s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { width: min(760px, 100%); max-height: min(88vh, 880px); display: flex; flex-direction: column; border-radius: 17px; background: #fff; box-shadow: 0 30px 90px rgba(15,23,42,.3); overflow: hidden; animation: modal-in .18s ease-out; }
.modal.modal-wide { width: min(920px, 100%); }
.modal.modal-small { width: min(500px, 100%); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header { min-height: 67px; padding: 15px 19px; border-bottom: 1px solid var(--line); display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; }
.modal-header h2 { margin: 0; font-size: 17px; }
.modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.modal > form { min-height: 0; display: flex; flex: 1; flex-direction: column; overflow: hidden; }
.modal-body { min-height: 0; padding: 19px; overflow: auto; overscroll-behavior: contain; }
.modal > .modal-body, .modal > form > .modal-body { flex: 1; }
.modal-footer { min-height: 66px; padding: 13px 19px; border-top: 1px solid var(--line); display: flex; flex: none; align-items: center; justify-content: flex-end; gap: 9px; background: #fbfcfe; box-shadow: 0 -8px 22px rgba(15, 23, 42, .04); position: relative; z-index: 2; }
.form-section { margin-bottom: 20px; }
.form-section:last-child { margin-bottom: 0; }
.form-section-title { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; color: #334155; font-size: 12px; font-weight: 750; }
.form-section-title::before { content: ""; width: 3px; height: 14px; border-radius: 999px; background: var(--primary); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-grid.cols-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.form-control { min-width: 0; }
.form-control.full { grid-column: 1 / -1; }
.form-control label { display: block; margin-bottom: 7px; color: #475569; font-size: 10px; font-weight: 650; }
.form-control input, .form-control select, .form-control textarea { width: 100%; min-height: 39px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; outline: 0; color: var(--text); background: #fff; transition: .15s ease; }
.form-control textarea { min-height: 78px; resize: vertical; line-height: 1.6; }
.form-control input:focus, .form-control select:focus, .form-control textarea:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(59,130,246,.08); }
.form-hint { margin-top: 5px; color: var(--muted-2); font-size: 9px; }
.required { color: var(--danger); }
.image-uploader { min-height: 120px; border: 1px dashed #cbd5e1; border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px; background: #fbfdff; cursor: pointer; }
.image-uploader:hover { border-color: #93c5fd; background: var(--primary-50); }
.image-uploader img { width: 76px; height: 88px; border-radius: 9px; object-fit: contain; background: #fff; border: 1px solid var(--line-soft); }
.image-uploader strong, .image-uploader span { display: block; }
.image-uploader strong { font-size: 11px; }
.image-uploader span { margin-top: 6px; color: var(--muted); font-size: 9px; }
.checkbox-row { min-height: 39px; display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--danger); }
.checkbox-row span { font-size: 11px; }
.remaining-grid { margin-bottom: 13px; padding: 12px; border-radius: 10px; background: var(--primary-50); display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.remaining-grid span, .remaining-grid b { display: block; text-align: center; }
.remaining-grid span { color: var(--muted); font-size: 9px; }
.remaining-grid b { margin-top: 5px; color: var(--primary-700); font-size: 12px; }
.import-summary { padding: 13px; border-radius: 10px; background: #f8fafc; font-size: 11px; line-height: 1.7; }

/* Drawer */
.drawer-backdrop { position: fixed; z-index: 95; inset: 0; background: rgba(15,23,42,.35); animation: fade .14s ease; }
.drawer { width: min(620px, 96vw); height: 100%; position: absolute; right: 0; top: 0; display: flex; flex-direction: column; background: #fff; box-shadow: -24px 0 70px rgba(15,23,42,.22); animation: drawer-in .22s ease-out; }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-header { min-height: 70px; padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.drawer-header > div { min-width: 0; flex: 1; }
.drawer-header h2 { margin: 0; font-size: 16px; }
.drawer-header p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.drawer-body { flex: 1; overflow: auto; background: #f7f9fc; }
.drawer-footer { min-height: 68px; padding: 13px 17px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: #fff; }
.detail-hero { padding: 18px; display: grid; grid-template-columns: 92px minmax(0,1fr); gap: 15px; background: #fff; border-bottom: 1px solid var(--line); }
.detail-hero img { width: 92px; height: 112px; object-fit: contain; border-radius: 12px; border: 1px solid var(--line-soft); background: #f8fafc; }
.detail-hero h3 { margin: 0 0 7px; font-size: 19px; }
.detail-hero p { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.detail-tags { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.detail-tag { min-height: 25px; padding: 0 9px; border-radius: 7px; display: inline-flex; align-items: center; color: #475569; background: #f1f5f9; font-size: 9px; }
.detail-section { margin: 12px; border: 1px solid var(--line-soft); border-radius: 13px; background: #fff; overflow: hidden; }
.detail-section-head { min-height: 48px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; }
.detail-section-head h4 { margin: 0; font-size: 12px; }
.detail-section-body { padding: 14px; }
.detail-progress-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.detail-progress { padding: 11px; border-radius: 10px; background: #f8fafc; }
.detail-progress span, .detail-progress b { display: block; }
.detail-progress span { color: var(--muted); font-size: 9px; }
.detail-progress b { margin-top: 7px; font-size: 16px; }
.detail-kv { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0; }
.detail-kv > div { min-height: 57px; padding: 9px 11px; border-bottom: 1px solid var(--line-soft); }
.detail-kv > div:nth-child(odd) { border-right: 1px solid var(--line-soft); }
.detail-kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.detail-kv span, .detail-kv b { display: block; }
.detail-kv span { color: var(--muted); font-size: 9px; }
.detail-kv b { margin-top: 6px; font-size: 11px; }
.size-compare { width: 100%; border-collapse: collapse; }
.size-compare th, .size-compare td { height: 35px; border: 1px solid var(--line-soft); text-align: center; font-size: 10px; }
.size-compare th { color: var(--muted); background: #f8fafc; font-weight: 600; }
.delivery-timeline { position: relative; }
.delivery-timeline-item { position: relative; min-height: 74px; display: grid; grid-template-columns: 14px minmax(0,1fr) auto; gap: 10px; padding-bottom: 12px; }
.delivery-timeline-item:not(:last-child)::before { content: ""; width: 1px; position: absolute; left: 5px; top: 13px; bottom: -1px; background: var(--line); }
.delivery-timeline-item > i { width: 11px; height: 11px; margin-top: 4px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); position: relative; z-index: 1; }
.delivery-timeline-item strong { display: block; font-size: 11px; }
.delivery-timeline-item p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.delivery-timeline-item time { color: var(--muted-2); font-size: 9px; white-space: nowrap; }
.risk-box { padding: 11px 12px; border: 1px solid #fecaca; border-radius: 10px; color: #991b1b; background: var(--danger-bg); font-size: 10px; line-height: 1.7; }
.note-box { margin: 0; white-space: pre-wrap; color: #475569; line-height: 1.75; font-size: 10px; }

/* Toast */
.toast-root { position: fixed; z-index: 200; right: 20px; top: 20px; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { width: min(360px, calc(100vw - 40px)); min-height: 54px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-md); display: flex; align-items: flex-start; gap: 10px; pointer-events: auto; animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.toast-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; color: var(--primary); background: var(--primary-50); }
.toast.success .toast-icon { color: var(--success); background: var(--success-bg); }
.toast.error .toast-icon { color: var(--danger); background: var(--danger-bg); }
.toast strong, .toast span { display: block; }
.toast strong { font-size: 11px; }
.toast span { margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.5; }

/* Product catalog */
.product-toolbar .search-box { width:min(460px,100%); }
.product-toolbar-actions { display:flex; align-items:center; gap:12px; }
.product-table { width:100%; min-width:1180px; table-layout:fixed; }
.product-table th { padding:8px 6px; font-size:11px; white-space:normal; line-height:1.25; }
.product-table td { height:70px; padding:8px 6px; font-size:12px; line-height:1.35; overflow:hidden; }
.product-table col.product-col-identity { width:10%; }
.product-table col.product-col-name { width:4.5%; }
.product-table col.product-col-materials { width:10.5%; }
.product-table col.product-col-suppliers { width:6%; }
.product-table col.product-col-price { width:5%; }
.product-table col.product-col-metric { width:4.5%; }
.product-table col.product-col-hanging { width:4%; }
.product-table col.product-col-cost { width:4.5%; }
.product-table col.product-col-fee { width:3.5%; }
.product-table col.product-col-total { width:4.5%; }
.product-table col.product-col-factory { width:5%; }
.product-table col.product-col-development { width:8.5%; }
.product-table col.product-col-sizes { width:12%; }
.product-table col.product-col-actions { width:3.5%; }
.product-table .product-cell { min-width:0; width:100%; gap:7px; }
.product-table .product-image { width:46px; height:54px; }
.product-table .product-cell strong { font-size:14px; }
.product-table .product-cell span { font-size:11px; }
.product-material-tags { max-width:none; display:flex; gap:3px; flex-wrap:wrap; }
.product-material-tags span { max-width:100%; padding:3px 6px; border-radius:999px; color:#475569; background:#f1f5f9; font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.product-cost-value { color:#0f766e; font-size:14px; white-space:nowrap; }
.product-data-lines { min-width:0; display:grid; gap:3px; color:#334155; }
.product-data-lines strong { font-size:13px; }
.product-data-lines span { display:flex; align-items:center; gap:3px; color:#64748b; font-size:10px; overflow-wrap:anywhere; }
.product-data-lines span > b { color:#334155; font-size:11px; }
.product-empty-value { color:#94a3b8 !important; }
.product-date-stack { min-width:0; display:grid; gap:4px; color:#475569; font-size:11px; white-space:nowrap; }
.product-date-stack > span { display:grid; grid-template-columns:30px minmax(0,1fr); align-items:center; gap:3px; }
.product-date-stack > span b { color:#1e293b; }
.product-sample-warning { width:max-content; min-height:24px; padding:0 8px; border-radius:999px; display:inline-flex; align-items:center; gap:5px; color:#b91c1c; background:#fef2f2; font-size:11px; }
.product-sample-warning .icon { width:14px; height:14px; }
.product-size-summary { min-width:0; display:grid; grid-template-columns:repeat(5,minmax(26px,1fr)); gap:3px; }
.product-size-summary > span { min-height:39px; padding:4px 1px; border:1px solid #dbeafe; border-radius:7px; display:grid; place-items:center; background:#eff6ff; }
.product-size-summary b,.product-size-summary em { display:block; font-style:normal; }
.product-size-summary b { color:#1e3a8a; font-size:10px; }
.product-size-summary em { color:#0f172a; font-size:12px; font-weight:650; }
.product-size-summary .is-empty { border-color:var(--line-soft); background:#f8fafc; }
.product-size-summary .is-empty b,.product-size-summary .is-empty em { color:#94a3b8; }
.product-size-total { display:block; margin-top:4px; color:var(--muted); font-size:9px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.product-column-picker { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.checkbox-card { min-height:46px; padding:0 12px; border:1px solid var(--line); border-radius:10px; display:flex; align-items:center; gap:9px; background:#fff; cursor:pointer; }
.checkbox-card:hover { border-color:#93c5fd; background:#f8fbff; }
.checkbox-card input { width:17px; height:17px; accent-color:var(--primary); }
.checkbox-card span { font-size:12px; font-weight:600; }
.product-basic-grid { display:grid; grid-template-columns:150px minmax(0,1fr); gap:16px; align-items:start; }
.product-basic-fields { align-self:start; }
.product-size-entry { grid-column:1 / -1; }
.product-size-entry-grid { display:grid; grid-template-columns:repeat(5,minmax(80px,1fr)); gap:8px; }
.product-size-entry-grid label { display:grid; grid-template-columns:32px minmax(0,1fr); align-items:center; gap:5px; }
.product-size-entry-grid label > span { color:#475569; font-size:11px; font-weight:650; }
.product-size-entry-grid input { width:100%; height:38px; padding:0 9px; border:1px solid var(--line); border-radius:9px; }
.product-size-entry > small { display:block; margin-top:6px; color:var(--muted); font-size:10px; }
.product-image-upload { min-height:178px; padding:10px; border:1px dashed #bfdbfe; border-radius:13px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:9px; background:#f8fbff; color:var(--primary); cursor:pointer; font-size:11px; }
.product-image-upload:hover { border-color:#60a5fa; background:#eff6ff; }
.product-image-upload img { width:104px; height:124px; border-radius:10px; object-fit:contain; border:1px solid var(--line-soft); background:#fff; }
.product-image-upload span { display:flex; align-items:center; gap:6px; }
.product-section-title { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.form-hint { margin:5px 0 12px; color:var(--muted); font-size:10px; line-height:1.5; }
.product-material-list { display:grid; gap:12px; }
.product-material-card { padding:13px; border:1px solid #dbeafe; border-radius:13px; background:linear-gradient(135deg,#f8fbff,#fff); }
.product-material-head { margin-bottom:10px; display:flex; align-items:center; justify-content:space-between; gap:10px; }
.product-material-head > div { display:flex; align-items:center; gap:9px; }
.product-material-head strong { font-size:12px; }
.material-sequence { padding:4px 8px; border-radius:999px; color:#1d4ed8; background:#dbeafe; font-size:9px; }
.product-material-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:9px; }
.product-material-grid .form-control label:first-child { min-height:17px; }
.product-composite-control .checkbox-row { min-height:38px; padding:0 9px; border:1px solid var(--line); border-radius:9px; background:#fff; }
.product-material-result { margin-top:10px; padding:9px 10px; border-radius:10px; display:grid; grid-template-columns:repeat(5,1fr); gap:8px; background:#eff6ff; }
.product-material-result span { display:flex; align-items:center; justify-content:space-between; gap:6px; color:#64748b; font-size:10px; }
.product-material-result b { color:#1e3a8a; font-size:11px; white-space:nowrap; }
.product-cost-summary { position:sticky; bottom:-1px; z-index:4; margin:18px -18px -18px; padding:13px 18px; border-top:1px solid #bfdbfe; display:flex; align-items:center; justify-content:flex-end; gap:12px; background:rgba(239,246,255,.96); backdrop-filter:blur(10px); }
.product-cost-summary > div { min-width:110px; }
.product-cost-summary span,.product-cost-summary b { display:block; }
.product-cost-summary span { color:var(--muted); font-size:9px; }
.product-cost-summary b { margin-top:4px; color:#1e3a8a; font-size:14px; }
.product-cost-summary i { color:#94a3b8; font-style:normal; }
.product-cost-summary .is-total { min-width:140px; padding:9px 12px; border-radius:10px; background:#2563eb; }
.product-cost-summary .is-total span,.product-cost-summary .is-total b { color:#fff; }
.product-cost-summary .is-total b { font-size:19px; }

/* Responsive */
@media (max-width: 1320px) {
  :root { --sidebar: 124px; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .metric-card:nth-child(4), .metric-card:nth-child(5) { grid-column: span 1; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-lower { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1050px) {
  :root { --sidebar: 68px; }
  .sidebar-brand { padding: 0 18px; }
  .sidebar-brand > div, .nav-item > span:nth-child(2), .sidebar-user > div, .sidebar-user .icon-button, .sidebar-bottom > .nav-item span:nth-child(2) { display: none; }
  .sidebar-brand .brand-mark { width: 42px; height: 42px; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-badge { position: absolute; right: 5px; top: 4px; }
  .sidebar-user { justify-content: center; padding: 8px 0; background: transparent; }
  .topbar { padding: 0 20px; }
  .page-content { padding: 16px; }
  .global-search { width: 250px; }
  .user-menu-button > span:nth-child(2), .user-menu-button > span:last-child { display: none; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-showcase { display: none; }
  .login-panel { padding: 30px 22px; background: linear-gradient(180deg, #eff6ff 0, #fff 30%); }
  .mobile-brand { display: flex; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-lower, .report-grid { grid-template-columns: 1fr; }
  .focus-grid { grid-template-columns: 1fr; }
  .stage-row { grid-template-columns: 44px minmax(150px,1fr) 160px 90px auto; }
  .stage-row > :nth-child(4) { display: none; }
}

@media (max-width: 720px) {
  :root { --topbar: 68px; --sidebar: 244px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 20px 0 60px rgba(15,23,42,.25); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-brand > div, .nav-item > span:nth-child(2), .sidebar-user > div, .sidebar-user .icon-button, .sidebar-bottom > .nav-item span:nth-child(2) { display: block; }
  .nav-item { justify-content: flex-start; padding: 0 12px; }
  .sidebar-user { justify-content: flex-start; padding: 9px 8px; background: rgba(255,255,255,.055); }
  .sidebar-backdrop { position: fixed; z-index: 35; inset: 0; background: rgba(15,23,42,.42); }
  .sidebar-backdrop.is-open { display: block; }
  .main-shell { margin-left: 0; }
  .mobile-menu-button { display: inline-grid; }
  .topbar { padding: 0 12px; }
  .topbar h1 { font-size: 17px; }
  .breadcrumbs { display: none; }
  .global-search { display: none; }
  .notification-button { margin-left: auto; }
  .page-content { padding: 14px 12px 28px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .toolbar-card { align-items: stretch; flex-direction: column; }
  .filter-group { width: 100%; }
  .search-box { width: 100%; }
  .select-control { flex: 1; min-width: 120px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { min-height: 116px; padding: 14px; }
  .metric-grid .metric-card:last-child { grid-column: 1 / -1; }
  .progress-overview { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
  .modal.modal-wide, .modal.modal-small { width: 100%; }
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .form-grid.cols-5 { grid-template-columns: repeat(2, 1fr); }
  .remaining-grid { grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 10px 6px; }
  .drawer { width: 100%; }
  .detail-progress-grid { grid-template-columns: 1fr; }
  .detail-kv { grid-template-columns: 1fr; }
  .detail-kv > div { border-right: 0 !important; border-bottom: 1px solid var(--line-soft) !important; }
  .detail-kv > div:last-child { border-bottom: 0 !important; }
  .toast-root { right: 10px; top: 10px; }
  .stage-row { grid-template-columns: 42px minmax(140px,1fr) 85px auto; gap: 9px; }
  .stage-row > :nth-child(3) { display: none; }
}

@media (max-width: 440px) {
  .login-panel { padding: 24px 18px; }
  .mobile-brand { margin-bottom: 38px; }
  .login-title h2 { font-size: 28px; }
  .demo-accounts { grid-template-columns: 1fr; }
  .demo-accounts button { display: flex; align-items: center; justify-content: space-between; }
  .demo-accounts span { margin-top: 0; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-grid .metric-card:last-child { grid-column: auto; }
  .topbar-actions .user-menu-button { padding-left: 0; }
  .page-actions .button { flex: 1; }
  .form-grid.cols-5 { grid-template-columns: repeat(2, 1fr); }
  .detail-hero { grid-template-columns: 72px minmax(0,1fr); }
  .detail-hero img { width: 72px; height: 92px; }
}

.chase-banner { width:100%; display:flex; align-items:center; gap:14px; margin-bottom:16px; padding:15px 18px; border:1px solid #fecaca; border-radius:14px; background:linear-gradient(90deg,#fff1f2,#fff); color:#9f1239; text-align:left; cursor:pointer; box-shadow:var(--shadow-sm); }
.chase-banner > span:nth-child(2) { display:grid; gap:3px; flex:1; }
.chase-banner strong { font-size:15px; }
.chase-banner small { color:#be123c; }
.factory-label { display:block; margin-top:5px; max-width:130px; color:var(--muted); line-height:1.3; }
.data-table tr.row-complete td { background:#f0fdf4; }
.data-table tr.row-delivering td { background:#eff6ff; }
.data-table tr.row-chase td { background:#fff1f2; }
.data-table tr.row-chase td:first-child { box-shadow:inset 4px 0 #e11d48; }
.form-section-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:12px; }
.form-section-head p { margin:4px 0 0; color:var(--muted); font-size:12px; }
.section-step { display:inline-grid; place-items:center; width:24px; height:24px; margin-right:8px; border-radius:8px; background:#e0e7ff; color:#3730a3; font-size:12px; }
.material-form-scroll { width:100%; overflow-x:auto; padding-bottom:4px; }
.material-form-head,.material-form-row { display:grid; grid-template-columns:44px minmax(88px,1fr) minmax(96px,1.05fr) 112px 76px 112px 90px 90px 82px 30px; gap:6px; min-width:880px; align-items:center; }
.material-form-head { padding:0 4px 7px; color:var(--muted); font-size:11px; }
#materialRows { display:grid; gap:8px; }
.material-form-card { min-width:880px; padding:9px; border:1px solid var(--line); border-radius:11px; background:#f8fafc; }
.material-form-row { min-width:0; }
.material-form-row input,.material-form-row select { width:100%; min-width:0; height:36px; padding:0 8px; border:1px solid var(--line); border-radius:8px; background:#fff; }
.material-adjustment-section { margin-bottom:10px; padding:12px; border:1px solid #bfdbfe; border-radius:12px; background:#f8fbff; }
.material-adjustment-section-head { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:10px; }
.material-adjustment-section-head strong { color:#1e3a8a; font-size:13px; }
.material-adjustment-section-head span { color:#64748b; font-size:11px; }
#materialAdjustmentRows { display:grid; gap:8px; }
.material-adjustments { display:grid; grid-template-columns:minmax(105px,.75fr) 100px minmax(150px,1fr) minmax(145px,.9fr) minmax(130px,.8fr) minmax(145px,1fr); gap:10px; align-items:end; margin:0; padding:10px 11px; border:1px solid #dbeafe; border-radius:9px; background:#eef4ff; }
.material-adjustments-title { display:grid; align-self:center; gap:3px; color:#1e40af; font-size:12px; font-weight:750; }
.material-adjustments-title small { color:#64748b; font-size:10px; font-weight:550; }
.material-adjustments > label { display:grid; gap:4px; min-width:0; color:#475569; font-size:11px; }
.material-adjustments select,.material-adjustments input { width:100%; min-width:0; height:34px; padding:0 8px; border:1px solid #bfdbfe; border-radius:8px; background:#fff; }
.material-adjustment-input { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:5px; }
.material-adjustment-input em { color:#64748b; font-size:11px; font-style:normal; white-space:nowrap; }
.material-conversion input { font-weight:700; color:#1d4ed8; }
.material-conversion.is-meter { opacity:.72; }
.material-conversion.is-meter input { background:#f1f5f9; color:#475569; }
.material-quantity,.material-billing { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:4px; min-width:0; }
.material-quantity input,.material-billing input { min-width:0; }
.material-quantity em,.material-billing em { color:#64748b; font-size:11px; font-style:normal; white-space:nowrap; }
.material-effective { display:grid; gap:5px; min-width:0; padding:0 8px; }
.material-effective span { color:#475569; font-size:11px; }
.material-effective strong { color:#047857; font-size:14px; white-space:nowrap; }
.material-adjustment-formula { margin:0 0 14px; }
.main-material-radio { display:grid; justify-items:center; gap:2px; color:#475569; font-size:11px; }
.main-material-radio input { width:16px; height:16px; }
.formula-hint { margin-top:10px; padding:10px 12px; border-radius:9px; background:#eff6ff; color:#1e40af; font-size:12px; }
.cutting-size-block { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:14px; }
.cutting-size-block > div { padding:13px; border:1px solid var(--line); border-radius:11px; background:#f8fafc; }
.cutting-size-block strong { display:block; margin-bottom:10px; }
.modal-rule-note { margin-right:auto; color:#166534; font-size:12px; }
.deadline-strip { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:18px; }
.deadline-strip > div { display:grid; gap:5px; text-align:center; flex:1; }
.deadline-strip span { color:var(--muted); font-size:12px; }
.deadline-strip b { font-size:14px; }
.deadline-strip > .icon { color:#94a3b8; }
.material-detail-list { display:grid; }
.material-detail-row { display:grid; grid-template-columns:52px 1fr 1fr 1fr 1.2fr 1fr; gap:10px; align-items:center; padding:11px 16px; border-top:1px solid var(--line-soft); font-size:12px; }
.material-detail-row span { min-width:0; }
.material-detail-row span small { display:block; margin-top:3px; color:#64748b; font-size:10px; }
.main-material-tag { display:inline-flex; justify-content:center; padding:3px 6px; border-radius:999px; background:#dbeafe; color:#1d4ed8; }
.chase-groups { display:grid; gap:16px; margin-top:16px; }
.chase-list { display:grid; }
.chase-item { display:grid; grid-template-columns:46px minmax(180px,1.5fr) repeat(4,minmax(90px,1fr)) auto; gap:14px; align-items:center; padding:13px 18px; border-top:1px solid var(--line-soft); }
.chase-item img { width:42px; height:52px; object-fit:cover; border-radius:8px; background:#f1f5f9; }
.chase-item > div { display:grid; gap:4px; }
.chase-item span { color:var(--muted); font-size:11px; }
.chase-product strong { font-size:14px; }
.factory-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.factory-card { padding:18px; }
.factory-card.is-inactive { opacity:.65; }
.factory-card-top,.factory-card-footer { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.factory-card h3 { margin:14px 0 5px; }
.factory-card > p { min-height:20px; margin:0; color:var(--muted); }
.factory-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:17px 0; padding:13px 0; border-block:1px solid var(--line-soft); }
.factory-stats div { display:grid; justify-items:center; gap:3px; }
.factory-stats strong { font-size:20px; }
.factory-stats span,.factory-card-footer > span { color:var(--muted); font-size:11px; }
.delivery-hover-target { min-width:145px; padding:4px; margin:-4px; border-radius:9px; cursor:help; outline:none; }
.delivery-hover-target:hover,.delivery-hover-target:focus { background:#eff6ff; box-shadow:0 0 0 2px #bfdbfe; }
.delivery-hover-target .progress-caption { color:var(--primary-700); }
.delivery-hover-summary { display:grid; grid-template-columns:90px minmax(220px,1fr) 50px; gap:10px; align-items:center; padding:11px 13px; background:#eef6ff; border-bottom:1px solid #bfdbfe; }
.delivery-hover-summary > div:first-child { display:grid; gap:3px; }
.delivery-hover-summary > div:first-child span { color:var(--muted); font-size:10px; }
.delivery-hover-list { max-height:320px; overflow:auto; }
.delivery-hover-row { display:grid; grid-template-columns:90px minmax(220px,1fr) 50px; gap:10px; align-items:center; padding:11px 13px; border-bottom:1px solid var(--line-soft); }
.delivery-hover-row:last-child { border-bottom:0; }
.delivery-hover-row > div:first-child { display:grid; gap:4px; }
.delivery-hover-row > div:first-child span { color:var(--muted); font-size:10px; }
.delivery-hover-sizes { display:grid; grid-template-columns:repeat(5,1fr); gap:5px; }
.delivery-hover-sizes span { display:grid; justify-items:center; gap:3px; padding:5px 3px; border-radius:7px; background:#eff6ff; color:#1d4ed8; font-size:11px; }
.delivery-hover-sizes span.is-empty { background:#f8fafc; color:#94a3b8; }
.delivery-hover-sizes b { font-size:9px; }
.delivery-hover-total { text-align:right; white-space:nowrap; }
.stage-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:6px; }
.stage-actions > span { width:100%; color:var(--muted); font-size:10px; text-align:right; }
.cutting-auto-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:11px; }
.cutting-plan-only { grid-template-columns:1fr; }
.inline-cutting-editor { margin-top:16px; padding:14px; border:1px solid #bfdbfe; border-radius:12px; background:#f8fbff; }
#inlineCuttingRows { display:grid; gap:8px; margin-top:12px; }
.inline-cutting-row { display:grid; grid-template-columns:118px minmax(290px,.88fr) minmax(104px,.32fr) 108px; gap:8px; align-items:end; padding:9px; border:1px solid var(--line); border-radius:10px; background:#fff; }
.inline-cutting-sequence,.inline-cutting-note { display:grid; gap:5px; }
.inline-cutting-sequence b,.inline-cutting-note span,.inline-cutting-row-total span { color:var(--muted); font-size:10px; }
.inline-cutting-row input { min-width:0; width:100%; height:34px; padding:0 8px; border:1px solid var(--line); border-radius:8px; font-size:11px; }
.inline-cutting-sizes { display:grid; grid-template-columns:repeat(5,minmax(48px,1fr)); gap:5px; }
.inline-cutting-sizes label { display:grid; gap:4px; }
.inline-cutting-sizes span { text-align:center; color:#475569; font-size:9px; font-weight:700; }
.inline-cutting-row-total { min-height:34px; display:flex; align-items:center; justify-content:flex-end; gap:6px; }
.inline-cutting-row-total b { color:#1e3a8a; white-space:nowrap; }
.inline-cutting-delete { flex:0 0 30px; width:30px; height:30px; color:#dc2626; background:#fff5f5; border-color:#fecaca; }
.inline-cutting-delete:hover { color:#b91c1c; background:#fee2e2; }
.delivery-editor-summary { display:grid; grid-template-columns:repeat(5,minmax(90px,1fr)) auto; gap:7px; margin-bottom:16px; padding:11px; border:1px solid #bfdbfe; border-radius:11px; background:#eff6ff; }
.delivery-editor-summary > div { display:grid; justify-items:center; gap:4px; padding:7px; border-radius:8px; background:#fff; }
.delivery-editor-summary b { color:#1e3a8a; font-size:11px; }
.delivery-editor-summary span { color:#64748b; font-size:10px; white-space:nowrap; }
.delivery-editor-summary > strong { display:flex; align-items:center; color:#1d4ed8; white-space:nowrap; }
.delivery-editor-head { align-items:center; margin-top:2px; }
.delivery-editor-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
#inlineDeliveryRows { display:grid; gap:8px; }
.inline-delivery-row { display:grid; grid-template-columns:112px 96px minmax(285px,1fr) minmax(120px,.55fr) 82px 58px; gap:7px; align-items:end; padding:9px; border:1px solid var(--line); border-radius:10px; background:#fff; }
.inline-delivery-sequence,.inline-delivery-destination,.inline-delivery-note { display:grid; gap:5px; }
.inline-delivery-sequence b,.inline-delivery-destination span,.inline-delivery-note span,.inline-delivery-row-total span { color:var(--muted); font-size:10px; }
.inline-delivery-row input,.inline-delivery-row select { min-width:0; width:100%; height:34px; padding:0 8px; border:1px solid var(--line); border-radius:8px; font-size:11px; background:#fff; }
.inline-delivery-sizes { display:grid; grid-template-columns:repeat(5,minmax(46px,1fr)); gap:5px; }
.inline-delivery-sizes label { display:grid; gap:4px; }
.inline-delivery-sizes span { text-align:center; color:#475569; font-size:9px; font-weight:700; }
.inline-delivery-row-total { min-height:34px; display:flex; align-items:center; justify-content:flex-end; gap:5px; }
.inline-delivery-row-total b { color:#1e3a8a; white-space:nowrap; }
.inline-delivery-saved { min-height:30px; display:flex; align-items:center; justify-content:center; color:#166534; font-size:10px; white-space:nowrap; }
.inline-delivery-delete { width:30px; height:30px; color:#dc2626; background:#fff5f5; border-color:#fecaca; }
.inline-cutting-summary { margin-top:10px; padding:11px; border:1px solid #bbf7d0; border-radius:10px; background:#f0fdf4; }
.inline-cutting-summary-title { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.inline-cutting-summary-title > div { display:grid; gap:2px; }
.inline-cutting-summary-title span { color:#64748b; font-size:10px; }
.inline-cutting-summary-title > b { color:#047857; font-size:18px; }
.inline-cutting-summary-sizes { display:grid; grid-template-columns:repeat(5,minmax(56px,1fr)) minmax(140px,1.5fr); gap:7px; margin-top:9px; }
.inline-cutting-summary-sizes > span { display:grid; justify-items:center; gap:3px; padding:7px; border-radius:8px; background:#fff; color:#047857; }
.inline-cutting-summary-sizes > span b { font-size:9px; }
.inline-cutting-summary-sizes > span.is-empty { color:#94a3b8; }
.inline-cutting-summary-sizes .actual-use { color:#1e40af; }
.history-summary-panel { padding:14px 16px; border-top:1px solid var(--line); background:#f8fafc; }
.history-summary-heading > div { display:grid; gap:2px; }
.history-summary-heading span { color:var(--muted); font-size:10px; }
.history-summary-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:10px; }
.history-summary-card { padding:12px; border:1px solid var(--line); border-radius:11px; background:#fff; }
.history-summary-card.is-cutting { border-color:#ddd6fe; background:#faf8ff; }
.history-summary-card.is-delivery { border-color:#fed7aa; background:#fffaf5; }
.history-summary-title { display:flex; justify-content:space-between; gap:12px; align-items:center; }
.history-summary-title > div { display:grid; gap:2px; }
.history-summary-title span { color:var(--muted); font-size:10px; }
.history-summary-title > b { font-size:17px; color:#1e3a8a; }
.history-summary-sizes { display:grid; grid-template-columns:repeat(5,1fr); gap:6px; margin-top:9px; }
.history-summary-sizes span { display:flex; align-items:center; justify-content:space-between; gap:6px; padding:6px 8px; border-radius:7px; background:#fff; color:#334155; }
.history-summary-sizes span b { font-size:9px; }
.history-summary-sizes span.is-empty { color:#94a3b8; }
.cutting-summary-strip { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.cutting-summary-strip > div { display:grid; gap:5px; padding:12px; border:1px solid var(--line); border-radius:10px; background:#f8fafc; }
.cutting-summary-strip span { color:var(--muted); font-size:11px; }
.cutting-summary-strip b { font-size:15px; color:#1e3a8a; }
.cutting-history-section { margin-top:18px; }
.cutting-history-summary { display:flex; align-items:center; flex-wrap:wrap; gap:7px; padding:10px; border-radius:10px; background:#eef6ff; }
.cutting-history-summary span { min-width:54px; display:grid; justify-items:center; gap:2px; padding:5px 8px; border-radius:8px; background:white; color:#1d4ed8; }
.cutting-history-summary span b { font-size:9px; }
.cutting-history-summary strong { margin-left:auto; color:#1e3a8a; }
.cutting-history-list { margin-top:8px; display:grid; gap:6px; }
.cutting-history-row { display:grid; grid-template-columns:112px minmax(260px,1fr) 70px auto; gap:10px; align-items:center; padding:9px 10px; border:1px solid var(--line-soft); border-radius:9px; background:#fff; }
.cutting-history-row time { font-weight:700; color:#334155; }
.cutting-history-row > span { color:var(--muted); }
.cutting-history-row > b { text-align:right; }
.cutting-history-row > div { display:flex; gap:4px; }
.concurrency-warning { display:grid; gap:5px; margin-bottom:15px; padding:12px 14px; border:1px solid #f59e0b; border-radius:10px; background:#fffbeb; color:#92400e; }
.concurrency-warning span { line-height:1.55; }
.consumption-calculator { display:grid; grid-template-columns:1fr 1.25fr 1fr 1fr 1.35fr; gap:9px; margin-bottom:14px; padding:13px; border:1px solid #bfdbfe; border-radius:12px; background:linear-gradient(135deg,#eff6ff,#fff); }
.consumption-calculator > div,.consumption-calculator > label { min-width:0; min-height:72px; display:flex; flex-direction:column; justify-content:center; gap:7px; padding:10px; border:1px solid #dbeafe; border-radius:10px; background:rgba(255,255,255,.9); }
.consumption-calculator span { color:var(--muted); font-size:11px; }
.consumption-calculator b { color:#1e3a8a; font-size:17px; }
.consumption-calculator .link-button { width:max-content; font-size:10px; }
.calculator-input { display:flex; align-items:center; gap:6px; }
.calculator-input input { min-width:0; width:100%; height:34px; padding:0 8px; border:1px solid #93c5fd; border-radius:8px; color:var(--text); background:#fff; }
.calculator-input em { color:#64748b; font-size:10px; font-style:normal; white-space:nowrap; }
.consumption-calculator .actual-consumption-result { border-color:#bbf7d0; background:#f0fdf4; }
.consumption-calculator .actual-consumption-result b { color:#166534; }

@media (max-width: 1100px) { .factory-grid { grid-template-columns:repeat(2,1fr); } .chase-item { grid-template-columns:46px minmax(170px,1fr) repeat(2,90px) auto; } .chase-item > div:nth-of-type(4),.chase-item > div:nth-of-type(5) { display:none; } }
@media (max-width: 1100px) { .consumption-calculator { grid-template-columns:repeat(3,1fr); } }
@media (max-width: 1100px) { .product-material-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width: 720px) { .cutting-size-block,.factory-grid,.history-summary-grid { grid-template-columns:1fr; } .material-form-head { display:none; } .material-adjustments { grid-template-columns:repeat(2,minmax(0,1fr)); } .material-adjustments-title,.material-effective { grid-column:1/-1; } .chase-item { grid-template-columns:42px 1fr auto; } .chase-item > div:not(.chase-product) { display:none; } .deadline-strip { align-items:stretch; flex-direction:column; } .deadline-strip > .icon { transform:rotate(90deg); align-self:center; } .material-detail-row { grid-template-columns:50px 1fr 1fr; } .material-detail-row span:nth-last-child(-n+3) { display:none; } .modal-rule-note { width:100%; } .consumption-calculator,.cutting-summary-strip { grid-template-columns:1fr 1fr; } .delivery-hover-row,.delivery-hover-summary { grid-template-columns:74px 1fr; } .delivery-hover-total { display:none; } .cutting-history-row { grid-template-columns:1fr auto; } .cutting-history-row > span { grid-column:1/-1; } .date-filter { width:100%; } .date-filter input { flex:1; } .inline-cutting-row,.inline-delivery-row { grid-template-columns:1fr; } .inline-cutting-summary-sizes,.delivery-editor-summary { grid-template-columns:repeat(3,1fr); } }
@media (max-width: 720px) { .product-basic-grid { grid-template-columns:1fr; } .product-image-upload { min-height:150px; } .product-material-grid { grid-template-columns:1fr 1fr; } .product-material-result { grid-template-columns:1fr 1fr; } .product-cost-summary { flex-wrap:wrap; justify-content:flex-start; } .product-cost-summary i { display:none; } }

/* Readable page typography — keep every workspace aligned with production tracking */
#pageContent { font-size:13px; }
#pageContent .data-table th { font-size:12px; }
#pageContent .data-table td { font-size:13px; }
#pageContent .batch-code { font-size:12px; font-weight:650; }
#pageContent .product-cell strong,.stage-row h4,.activity-row strong,.ranking-row strong { font-size:13px; }
#pageContent .product-cell span,.color-cell span,.progress-caption,.table-footer,.toolbar-meta,.focus-card p,.stage-row p,.activity-row p,.activity-row time,.report-summary p,.ranking-row > span { font-size:12px; }
#pageContent .color-cell strong,.inline-progress-head,.delivery-compact strong,.member-meta b { font-size:13px; }
#pageContent .card-title p,.metric-label,.alert-item span,.status-bar-row span,.status-bar-row b,.factory-stats span,.factory-card-footer > span { font-size:12px; }
#pageContent .alert-item strong,.delivery-compact b,.detail-section-head h4,.detail-kv b,.delivery-timeline-item strong { font-size:13px; }
#pageContent .member-head strong { font-size:14px; }
#pageContent .member-head span,.member-meta span { font-size:12px; }
#pageContent .factory-card > p,.factory-card-footer > span { font-size:12px; }
#pageContent .size-compare th,#pageContent .size-compare td { font-size:12px; }
#pageContent .product-material-tags span,#pageContent .product-data-lines span,#pageContent .product-data-lines span > b,#pageContent .product-date-stack,#pageContent .product-sample-warning,#pageContent .product-size-total { font-size:12px; }
#modalRoot .modal-header p,#modalRoot .form-control label,#drawerRoot .drawer-header p,#drawerRoot .detail-hero p,#drawerRoot .detail-kv span,#drawerRoot .delivery-timeline-item p,#drawerRoot .delivery-timeline-item time { font-size:12px; }
#modalRoot input,#modalRoot select,#modalRoot textarea { font-size:13px; }

/* v2.14 readability: hierarchy stays clear even without relying on row colors. */
#pageContent .data-table th { color:#334155; font-size:13px; font-weight:750; letter-spacing:.01em; }
#pageContent .data-table td { color:#1e293b; font-size:14px; font-weight:500; }
#pageContent .data-table td small { color:#475569; font-size:12px; font-weight:500; }
#pageContent .orders-data-table .batch-cell time { color:#475569; font-size:11px; font-weight:650; }
#pageContent .orders-data-table .batch-code { color:#1e3a5f; font-size:13px; font-weight:800; }
#pageContent .orders-data-table .factory-label { color:#475569; font-size:12px; font-weight:600; }
#pageContent .orders-data-table .product-cell strong { color:#1e3a5f; font-size:15px; font-weight:800; }
#pageContent .orders-data-table .product-cell span { color:#475569; font-size:12px; font-weight:550; }
#pageContent .orders-data-table .color-cell strong { color:#0f172a; font-size:14px; font-weight:800; }
#pageContent .orders-data-table .color-cell span { color:#475569; font-size:12px; font-weight:550; }
#pageContent .orders-data-table .size-box b { color:#334155; font-size:11px; font-weight:800; }
#pageContent .orders-data-table .size-box span { color:#334155; font-size:12px; font-weight:650; }
#pageContent .orders-data-table .inline-progress-head { color:#0f172a; font-size:13px; font-weight:750; }
#pageContent .orders-data-table .inline-progress-head span { color:#475569; font-weight:600; }
#pageContent .orders-data-table .progress-caption { color:#475569; font-size:12px; font-weight:550; }
#pageContent .orders-data-table .status-badge { font-size:11px; font-weight:750; }

.member-permissions { min-height:72px; margin:-3px 0 14px; padding:11px 12px; border:1px solid var(--line-soft); border-radius:10px; background:#fff; }
.member-permissions > span { color:var(--muted); font-size:12px; }
.member-permissions p { margin:6px 0 0; color:#334155; font-size:12px; line-height:1.65; }
.permission-section { margin-top:20px; }
.permission-section .form-section-title { justify-content:flex-start; }
.permission-section .form-section-title .muted { font-size:12px; font-weight:500; }
.permission-groups { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.permission-groups fieldset { min-width:0; margin:0; padding:12px; border:1px solid #dbeafe; border-radius:12px; background:#f8fbff; }
.permission-groups legend { padding:0 7px; color:#1e3a8a; font-size:13px; font-weight:750; }
.permission-groups fieldset > div { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.permission-groups .checkbox-card { min-height:42px; }
.permission-groups input:disabled + span { color:#64748b; }
.readonly-note { margin-top:12px; padding:10px 12px; border-radius:10px; color:#166534; background:#f0fdf4; font-size:12px; line-height:1.6; }

@media (max-width: 720px) { .permission-groups,.permission-groups fieldset > div { grid-template-columns:1fr; } }

@media print {
  .sidebar, .topbar, .page-actions, .toolbar-card, .table-actions, .button { display: none !important; }
  .main-shell { margin: 0; }
  .page-content { padding: 0; }
  body, .card { background: #fff; box-shadow: none; }
  .table-scroll { overflow: visible; }
  .data-table { min-width: 0; font-size: 8px; }
}

/* Hot product follow-up */
.hot-toolbar { margin-bottom: 12px; padding: 11px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hot-filter-group { min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hot-date-field { height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fff; font-size: 12px; }
.hot-date-field input { width: 132px; border: 0; outline: 0; color: var(--text); background: #f8fafc; }
.hot-search { width: 250px; height: 36px; }
.hot-shortage-filter { min-height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; color: #475569; background: #fff; cursor: pointer; font-size: 12px; }
.hot-shortage-filter:has(input:checked) { border-color: #fdba74; color: #9a3412; background: #fff7ed; }
.hot-shortage-filter input { width: 16px; height: 16px; accent-color: var(--warning); }
.hot-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.hot-summary-card { min-height: 112px; padding: 16px 17px; display: flex; flex-direction: column; gap: 7px; position: relative; overflow: hidden; }
.hot-summary-card::after { content: ""; width: 74px; height: 74px; position: absolute; right: -30px; bottom: -34px; border-radius: 50%; background: currentColor; opacity: .06; }
.hot-summary-card > span { color: var(--muted); font-size: 13px; }
.hot-summary-card strong { color: #123154; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hot-summary-card strong small { font-size: 13px; font-weight: 600; }
.hot-summary-card em { color: var(--muted); font-size: 11px; font-style: normal; }
.hot-summary-card.is-primary strong { color: var(--primary); }
.hot-summary-card.is-warning strong { color: var(--warning); }
.hot-summary-card.is-danger strong { color: var(--danger); }
.hot-formula-note { margin-bottom: 12px; padding: 10px 13px; display: flex; align-items: flex-start; gap: 8px; border: 1px solid #bfdbfe; border-radius: 10px; color: #334155; background: #eff6ff; font-size: 12px; line-height: 1.6; }
.hot-formula-note .icon { margin-top: 1px; flex: none; color: var(--primary); }
.hot-table-card { overflow: hidden; }
.hot-table { min-width: 1660px; }
.hot-table th, .hot-table td { padding-left: 11px; padding-right: 11px; }
.hot-table th:first-child, .hot-table td:first-child { width: 190px; position: sticky; left: 0; z-index: 2; background: #fff; }
.hot-table th:first-child { z-index: 5; background: #f8fafc; }
.hot-table tbody tr.has-shortage > td { background: #fffafa; }
.hot-table tbody tr.has-shortage > td:first-child { box-shadow: inset 3px 0 0 #fb7185; }
.hot-table tbody tr:hover > td { background: #f8fbff; }
.hot-product { min-width: 165px; display: flex; align-items: center; gap: 10px; }
.hot-product img, .hot-no-image { width: 50px; height: 64px; flex: none; border: 1px solid var(--line-soft); border-radius: 8px; object-fit: contain; background: #f8fafc; }
.hot-no-image { display: grid; place-items: center; color: var(--muted-2); font-size: 11px; text-align: center; }
.hot-product strong, .hot-product span { display: block; }
.hot-product strong { color: #1e3a5f; font-size: 14px; font-weight: 800; }
.hot-product span { margin-top: 5px; color: #475569; font-size: 12px; }
.hot-quantity { color: var(--primary); font-size: 20px; font-variant-numeric: tabular-nums; }
.hot-table td > small { display: block; margin-top: 5px; color: var(--muted); }
.hot-growth-cell { min-width: 380px; }
.hot-growth-windows { min-width: 350px; margin-top: 8px; display: grid; grid-template-columns: repeat(5, minmax(64px, 1fr)); gap: 5px; }
.hot-growth-window { min-height: 42px; padding: 5px 4px; display: grid; place-items: center; align-content: center; gap: 2px; border: 1px solid transparent; border-radius: 8px; text-align: center; font-variant-numeric: tabular-nums; }
.hot-growth-window b { font-size: 10px; line-height: 1; font-weight: 750; opacity: .72; }
.hot-growth-window em { font-size: 11px; line-height: 1.15; font-style: normal; font-weight: 800; white-space: nowrap; }
.hot-growth-window.is-up { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.hot-growth-window.is-down { color: #15803d; border-color: #bbf7d0; background: #f0fdf4; }
.hot-growth-window.is-flat { color: #475569; border-color: #dbe3ee; background: #f8fafc; }
.hot-growth-window.is-insufficient { color: #64748b; border-color: #dbe3ee; border-style: dashed; background: #f8fafc; }
.hot-growth-window.is-insufficient em { font-size: 10px; font-weight: 650; }
.hot-number-field { width: 104px; min-height: 36px; padding: 0 8px; display: flex; align-items: center; gap: 5px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; }
.hot-number-field:focus-within { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.hot-number-field input { width: 64px; min-width: 0; border: 0; outline: 0; color: #172033; background: transparent; font-weight: 700; font-variant-numeric: tabular-nums; }
.hot-number-field input:disabled { color: #64748b; cursor: not-allowed; }
.hot-number-field em { margin-left: auto; color: var(--muted); font-size: 11px; font-style: normal; }
.hot-plan-number, .hot-in-production { color: #1e3a5f; font-size: 17px; font-variant-numeric: tabular-nums; }
.hot-factory-details { margin-top: 5px; }
.hot-factory-details summary { width: max-content; color: var(--primary); cursor: pointer; font-size: 11px; }
.hot-factory-details > div { min-width: 180px; margin-top: 7px; padding: 7px 9px; display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.hot-factory-details span { display: flex; justify-content: space-between; gap: 12px; }
.hot-factory-details b { color: #334155; font-size: 11px; }
.hot-factory-details em { color: #475569; font-size: 11px; font-style: normal; white-space: nowrap; }
.hot-gap { font-size: 18px; font-variant-numeric: tabular-nums; }
.hot-gap.is-shortage { color: var(--danger); }
.hot-gap.is-covered { color: var(--success); }
.hot-suggestion { min-height: 30px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 8px; color: #166534; background: #f0fdf4; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hot-suggestion.is-needed { color: #fff; background: var(--danger); box-shadow: 0 6px 14px rgba(220,38,38,.16); }

@media (max-width: 1050px) {
  .hot-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hot-toolbar { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 720px) {
  .hot-filter-group { width: 100%; }
  .hot-date-field, .hot-search { width: 100%; }
  .hot-date-field input { flex: 1; width: auto; }
  .hot-shortage-filter { flex: 1; }
  .hot-summary-grid { gap: 9px; }
  .hot-summary-card { min-height: 104px; padding: 13px; }
  .hot-summary-card strong { font-size: 24px; }
  .hot-table th:first-child, .hot-table td:first-child { position: static; }
  .hot-growth-cell { min-width: 360px; }
}

@media (max-width: 440px) {
  .hot-summary-grid { grid-template-columns: 1fr; }
}
.order-completion-control{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:8px}.order-complete-button{min-width:72px;justify-content:center}.order-completion-state{display:inline-flex;align-items:center;border-radius:999px;padding:5px 10px;font-size:12px;font-weight:700}.order-completion-state.is-auto{background:#dcfce7;color:#166534}.order-completion-state.is-manual{background:#dbeafe;color:#1d4ed8}.order-completion-hint{color:#9a3412;font-size:11px}
.order-inline-note{display:grid;gap:6px;width:150px;min-width:150px}.order-inline-note textarea{box-sizing:border-box;width:100%;min-height:54px;max-height:120px;resize:vertical;padding:7px 8px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#1e293b;font:12px/1.45 inherit}.order-inline-note textarea:focus{outline:2px solid #bfdbfe;border-color:#3b82f6}.order-inline-note .button{justify-self:end}.order-inline-note.is-readonly{min-height:42px;padding:7px 8px;border-radius:8px;background:#f8fafc;color:#475569;white-space:pre-wrap;overflow-wrap:anywhere}
