:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --navy: #14213d;
  --navy-soft: #213153;
  --blue: #2f6fed;
  --blue-dark: #245bd0;
  --blue-soft: #eaf1ff;
  --ink: #18243a;
  --muted: #6f7d93;
  --line: #e3e8f1;
  --panel: #ffffff;
  --canvas: #f4f6fa;
  --success: #16835b;
  --success-soft: #e7f7f0;
  --warning: #b96b12;
  --warning-soft: #fff4df;
  --danger: #c84242;
  --danger-soft: #fff0f0;
  --shadow: 0 10px 32px rgba(31, 50, 85, .08);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgba(47, 111, 237, .24); outline-offset: 2px; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(360px, .85fr);
  background:
    radial-gradient(circle at 22% 26%, rgba(82, 135, 255, .22), transparent 32%),
    linear-gradient(145deg, #10203d 0%, #18345e 54%, #f4f6fa 54%, #f4f6fa 100%);
  padding: 48px clamp(32px, 7vw, 110px);
  gap: 80px;
  align-items: center;
}

.login-brand { align-self: start; display: flex; align-items: center; gap: 16px; color: white; }
.login-brand strong { display: block; font-size: 20px; }
.login-brand span { display: block; margin-top: 4px; color: #b9c9e5; font-size: 13px; }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; background: linear-gradient(145deg, #fff, #eaf2ff); color: white; font-size: 24px; font-weight: 800; box-shadow: 0 12px 26px rgba(25, 82, 197, .28); }
.brand-mark img { width: 88%; height: 88%; object-fit: contain; display: block; }
.brand-mark-small { width: 38px; height: 38px; border-radius: 11px; font-size: 18px; }
.login-card { width: min(430px, 100%); justify-self: end; padding: 40px; border-radius: 22px; background: rgba(255, 255, 255, .98); box-shadow: 0 28px 70px rgba(16, 32, 61, .18); }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: 1.5px; }
.login-card h1, .page-heading h1 { margin: 0; color: var(--ink); font-size: 28px; line-height: 1.25; }
.login-copy { margin: 10px 0 28px; color: var(--muted); line-height: 1.7; }
.login-card label { display: block; margin-top: 18px; }
.login-card label span, .field > span { display: block; margin-bottom: 7px; color: #536178; font-size: 12px; font-weight: 650; }
.login-card input, .field input, .field select { width: 100%; height: 42px; border: 1px solid #d8deea; border-radius: 9px; background: #fff; color: var(--ink); padding: 0 12px; outline: 0; transition: border .18s, box-shadow .18s; }
.login-card input { height: 46px; }
input:focus, select:focus { border-color: var(--blue) !important; box-shadow: 0 0 0 3px rgba(47, 111, 237, .12); }
.login-tip { margin: 16px 0 0; color: #8894a7; font-size: 12px; text-align: center; }
.form-error { min-height: 18px; margin: 10px 0 0; color: var(--danger); font-size: 12px; }

.button { min-height: 38px; border: 1px solid transparent; border-radius: 9px; padding: 0 16px; cursor: pointer; font-weight: 700; transition: .18s ease; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.button-primary { background: var(--blue); color: #fff; box-shadow: 0 5px 14px rgba(47, 111, 237, .2); }
.button-primary:hover { background: var(--blue-dark); }
.button-secondary { border-color: #d8dfeb; background: #fff; color: #43516a; }
.button-secondary:hover { border-color: #b8c4d8; background: #f9fbfe; }
.button-danger { background: var(--danger); color: #fff; box-shadow: 0 5px 14px rgba(200, 66, 66, .2); }
.button-danger:hover { background: #b73737; }
.button-block { width: 100%; height: 46px; margin-top: 24px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 224px; z-index: 10; display: flex; flex-direction: column; padding: 20px 14px; background: var(--navy); color: #fff; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 6px 22px; border-bottom: 1px solid rgba(255, 255, 255, .09); }
.sidebar-brand strong { display: block; font-size: 15px; }
.sidebar-brand span { display: block; margin-top: 3px; color: #91a3c2; font-size: 11px; }
.main-nav { display: grid; gap: 5px; margin-top: 18px; }
.nav-item { width: 100%; height: 43px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 9px; background: transparent; color: #aebbd1; padding: 0 12px; cursor: pointer; text-align: left; font-size: 13px; transition: color .18s, background .18s, transform .18s; }
.nav-item > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-icon { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: #8395b5; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: stroke .18s; }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .065); }
.nav-item.active { color: #fff; background: var(--blue); box-shadow: 0 8px 18px rgba(15, 54, 130, .34); }
.nav-item:hover .nav-icon, .nav-item.active .nav-icon { stroke: #fff; }
.sidebar-foot { margin-top: auto; display: grid; grid-template-columns: 9px 1fr; gap: 10px; align-items: start; padding: 14px 10px 2px; border-top: 1px solid rgba(255, 255, 255, .09); }
.online-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #45d39a; box-shadow: 0 0 0 4px rgba(69, 211, 154, .13); }
.online-dot.offline { background: #ef6b6b; box-shadow: 0 0 0 4px rgba(239, 107, 107, .13); }
.sidebar-foot strong, .sidebar-foot small { display: block; }
.sidebar-foot strong { color: #c7d2e4; font-size: 11px; }
.sidebar-foot small { margin-top: 4px; color: #7486a5; font-size: 9px; line-height: 1.4; }

.main-content { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 8; height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 26px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); }
.breadcrumb { margin: 0; color: #8a96a9; font-size: 12px; }
.breadcrumb span { color: #415069; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-button { width: 35px; height: 35px; border: 1px solid #dbe2ed; border-radius: 9px; background: #fff; color: #526078; cursor: pointer; font-size: 18px; transition: border-color .18s, background .18s, color .18s, transform .18s; }
.icon-button:hover { border-color: #bdc9dc; background: #f7f9fc; }
.icon-button:active { transform: scale(.96); }
.user-chip { display: flex; align-items: center; gap: 9px; margin-left: 4px; padding-left: 12px; border-left: 1px solid var(--line); }
.user-chip > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-weight: 800; }
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { font-size: 12px; }
.user-chip small { margin-top: 2px; color: #96a0b0; font-size: 9px; }
.text-button { border: 0; background: transparent; color: #758198; padding: 8px; cursor: pointer; font-size: 12px; }
.text-button:hover { color: var(--blue); }

.page { display: none; width: min(1600px, 100%); margin: 0 auto; padding: 26px 28px 44px; }
.page.active { display: block; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-heading > div > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.compact-heading { align-items: center; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric-card { position: relative; overflow: hidden; min-height: 112px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); box-shadow: 0 4px 14px rgba(31, 50, 85, .03); }
.metric-card::after { content: ""; position: absolute; width: 62px; height: 62px; right: -18px; top: -18px; border-radius: 50%; background: var(--blue-soft); }
.metric-card > span { display: block; color: var(--muted); font-size: 11px; }
.metric-card strong { display: block; margin: 7px 0 2px; font-size: 27px; line-height: 1; }
.metric-card small { color: #9aa4b4; font-size: 10px; }
.metric-card-warn::after { background: var(--warning-soft); }
.metric-card-warn strong { color: var(--warning); }

.filter-card { margin-bottom: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.filter-row { display: grid; grid-template-columns: 1.35fr repeat(4, minmax(120px, 1fr)); gap: 11px; align-items: end; }
.filter-row-secondary { grid-template-columns: repeat(3, minmax(140px, 180px)) 1fr; margin-top: 11px; }
.field { min-width: 0; }
.field-search input { padding-left: 13px; }
.filter-actions { display: flex; justify-content: flex-end; gap: 8px; }

.table-card, .simple-table-card { border: 1px solid var(--line); border-radius: 13px; background: var(--panel); box-shadow: 0 5px 18px rgba(31, 50, 85, .035); overflow: hidden; }
.table-toolbar { height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--line); }
.table-toolbar strong { font-size: 13px; }
.table-toolbar span { margin-left: 9px; color: #909bae; font-size: 11px; }
.page-size { color: #7f8a9e; font-size: 11px; }
.page-size select { height: 30px; margin: 0 4px; border: 1px solid #d9e0eb; border-radius: 7px; background: white; color: #4f5c72; }
.table-wrap { width: 100%; overflow: auto; max-height: calc(100vh - 410px); min-height: 260px; scrollbar-color: #c5cfdf transparent; scrollbar-width: thin; }
table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11px; }
th { position: sticky; top: 0; z-index: 3; height: 42px; padding: 0 11px; border-bottom: 1px solid #dce3ee; background: #f7f9fc; color: #5c687c; font-weight: 750; text-align: left; white-space: nowrap; }
td { height: 51px; max-width: 210px; padding: 8px 11px; border-bottom: 1px solid #edf0f5; color: #344157; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tbody tr:hover td { background: #f9fbff; }
.sticky-col { position: sticky; z-index: 2; }
th.sticky-col { z-index: 5; }
.sticky-col-status { left: 0; min-width: 88px; background: #fff; }
.sticky-col-shop { left: 88px; min-width: 125px; background: #fff; }
.sticky-col-order { left: 213px; min-width: 158px; background: #fff; box-shadow: 7px 0 12px rgba(31, 50, 85, .04); }
th.sticky-col-status, th.sticky-col-shop, th.sticky-col-order { background: #f7f9fc; }
tbody tr:hover .sticky-col { background: #f9fbff; }
.number-cell { text-align: right; font-variant-numeric: tabular-nums; }
.order-id { font-family: Consolas, monospace; font-size: 11px; color: #244f9f; }
.muted-value { color: #a7afbd; }
.status-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.status-chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-completed { color: var(--success); background: var(--success-soft); }
.status-pending { color: var(--warning); background: var(--warning-soft); }
.status-processing { color: var(--blue); background: var(--blue-soft); }
.status-skipped { color: #6f7b90; background: #eef1f6; }
.evidence-cell { display: flex; align-items: center; gap: 5px; }
.evidence-thumb { width: 34px; height: 34px; padding: 0; overflow: hidden; border: 1px solid #dce3ee; border-radius: 7px; background: #eef3fb; cursor: pointer; }
.evidence-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.evidence-thumb-placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: var(--blue); font-size: 11px; font-weight: 800; }
.evidence-more { color: var(--blue); font-size: 10px; cursor: pointer; }
.table-state { min-height: 290px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #8d98aa; gap: 7px; padding: 28px; font-size: 12px; text-align: center; }
.table-state strong { color: #59667b; font-size: 14px; }
.table-state-error { color: var(--danger); background: var(--danger-soft); }
.pagination { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-top: 1px solid var(--line); color: #7d899d; font-size: 11px; }
.pagination > div { display: flex; gap: 6px; }

.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.module-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 20px; box-shadow: var(--shadow); }
.module-card span { color: var(--muted); font-size: 12px; }
.module-card strong { display: block; margin: 10px 0; font-size: 30px; }
.module-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.issue-stats-card { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.section-card-head { min-height: 62px; display: flex; align-items: center; padding: 0 20px; border-bottom: 1px solid var(--line); }
.section-card-head strong, .section-card-head span { display: block; }
.section-card-head strong { font-size: 14px; }
.section-card-head span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.compact-state { min-height: 120px; display: grid; place-items: center; padding: 22px; color: var(--muted); font-size: 12px; text-align: center; }
.empty-illustrated { align-content: center; gap: 7px; min-height: 180px; }
.empty-illustrated::before { content: ""; width: 42px; height: 42px; border-radius: 13px; background: radial-gradient(circle at 50% 38%, #b4c9f6 0 4px, transparent 5px), linear-gradient(145deg, #edf3ff, #f8faff); box-shadow: inset 0 0 0 1px #dce7fb; }
.empty-illustrated strong, .empty-illustrated span { display: block; }
.empty-illustrated strong { color: #4b5970; font-size: 13px; }
.empty-illustrated span { max-width: 460px; color: #8b96a8; line-height: 1.6; }
.issue-stat-list { display: grid; gap: 13px; padding: 20px; }
.issue-stat-row { display: grid; grid-template-columns: minmax(90px, 150px) minmax(160px, 1fr) 70px; gap: 14px; align-items: center; }
.issue-stat-row > strong { overflow: hidden; color: #344157; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.issue-stat-track { height: 9px; overflow: hidden; border-radius: 999px; background: #edf1f7; }
.issue-stat-track > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2f6fed, #6c9bff); }
.issue-stat-value { color: #657389; font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; }

.import-workspace { display: grid; gap: 14px; }
.import-upload-card, .import-result, .import-history-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.import-upload-card { min-height: 200px; padding: 18px 20px 16px; }
.import-upload-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 13px; margin-bottom: 13px; border-bottom: 1px solid var(--line); }
.import-upload-head strong, .import-upload-head span { display: block; }
.import-upload-head strong { font-size: 14px; }
.import-upload-head > div > span { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.import-limit { flex: 0 0 auto; padding: 6px 9px; border-radius: 7px; background: #f3f6fb; color: #758298; font-size: 10px; font-weight: 700; }
.import-upload-controls { display: grid; grid-template-columns: minmax(220px, 300px) minmax(300px, 1fr) minmax(145px, 180px); gap: 12px; align-items: end; }
.import-batch-field { display: block; }
.file-drop { min-height: 176px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 1px dashed #b9c8df; border-radius: 12px; background: #f8faff; color: #52617a; cursor: pointer; text-align: center; transition: border .18s, background .18s; }
.file-drop:hover, .file-drop:focus-within { border-color: var(--blue); background: var(--blue-soft); }
.file-drop.is-dragging { border-color: var(--blue); background: #e5eeff; box-shadow: 0 0 0 4px rgba(47, 111, 237, .1); }
.file-drop.has-file { border-style: solid; border-color: #a8c0ef; background: #f4f8ff; }
.file-drop input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.file-drop-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--blue-soft); color: var(--blue); font-size: 22px; font-weight: 800; }
.file-drop strong { max-width: 90%; overflow: hidden; color: #31415c; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.file-drop small { color: #8995a8; font-size: 11px; }
.file-drop-compact { min-height: 62px; flex-direction: row; justify-content: flex-start; gap: 11px; padding: 8px 13px; text-align: left; }
.file-drop-compact .file-drop-icon { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px; font-size: 19px; }
.file-drop-copy { min-width: 0; }
.file-drop-copy strong, .file-drop-copy small { display: block; max-width: 100%; }
.file-drop-copy small { margin-top: 4px; }
.import-submit-button { min-height: 42px; }
.import-rule-line { display: flex; align-items: center; gap: 9px; min-width: 0; margin-top: 12px; color: #8490a3; font-size: 10px; line-height: 1.45; white-space: nowrap; }
.import-rule-line i { width: 3px; height: 3px; flex: 0 0 auto; border-radius: 50%; background: #bcc6d5; }
.button-wide { width: 100%; min-height: 44px; }
.import-result { padding: 16px 18px; }
.import-result-idle { border-style: dashed; box-shadow: none; }
.import-result-idle .import-result-head > span { background: #eef2f8; color: #6e7d94; }
.import-result-success { border-color: #b8e5d2; }
.import-result-error { border-color: #efc4c4; }
.import-result-head { display: grid; grid-template-columns: 36px 1fr; gap: 11px; align-items: start; }
.import-result-head > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--success-soft); color: var(--success); font-size: 18px; font-weight: 800; }
.import-result-error .import-result-head > span { background: var(--danger-soft); color: var(--danger); }
.import-result-head strong { display: block; margin-top: 1px; font-size: 14px; }
.import-result-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.import-result-metrics { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.import-result-metrics > div { min-width: 125px; padding: 9px 11px; border-radius: 8px; background: #f6f8fc; }
.import-result-metrics span, .import-result-metrics strong { display: block; }
.import-result-metrics span { color: var(--muted); font-size: 10px; }
.import-result-metrics strong { margin-top: 4px; overflow: hidden; color: #344157; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.import-error-list { max-height: 220px; overflow: auto; margin: 12px 0 0; padding: 12px 12px 12px 30px; border-radius: 9px; background: var(--danger-soft); color: #9c3434; }
.import-error-list li { margin: 5px 0; font-size: 11px; line-height: 1.55; }
.import-history-card { overflow: hidden; }
.import-history-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 17px; border-bottom: 1px solid var(--line); }
.import-history-head strong, .import-history-head span { display: block; }
.import-history-head strong { color: #26344d; font-size: 13px; }
.import-history-head span { margin-top: 4px; color: #8b96a8; font-size: 10px; }
.button-compact { min-height: 32px; padding: 0 12px; font-size: 10px; }
.import-history-state { min-height: 230px; }
.import-history-wrap { min-height: 230px; max-height: calc(100vh - 430px); }
.import-history-table th:first-child, .import-history-table td:first-child { min-width: 150px; }
.import-history-table th:nth-child(2), .import-history-table td:nth-child(2) { min-width: 150px; }
.import-history-table th:nth-child(3), .import-history-table td:nth-child(3) { min-width: 190px; }
.import-history-table th:last-child, .import-history-table td:last-child { min-width: 245px; }
.import-source-format { display: inline-flex; min-width: 42px; justify-content: center; padding: 4px 7px; border-radius: 6px; background: #edf3ff; color: #2b63ce; font-size: 9px; font-weight: 800; letter-spacing: .3px; }
.import-batch-id { color: #6d7890; font-family: Consolas, monospace; font-size: 10px; }
.simple-table { width: 100%; }
.simple-table th, .simple-table td { position: static; width: auto; max-width: none; }
.employee-toolbar { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 10px; padding: 0 4px; color: #748198; font-size: 11px; }
.avatar-stack { display: flex; min-width: 24px; padding-left: 7px; }
.avatar-stack > span { width: 30px; height: 30px; display: grid; place-items: center; margin-left: -7px; border: 2px solid var(--canvas); border-radius: 50%; background: #e8efff; color: var(--blue); font-size: 10px; font-weight: 800; }
.employee-identity { display: flex; align-items: center; gap: 10px; }
.employee-avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: #fff; font-size: 11px; font-weight: 800; }
.employee-identity strong { display: block; color: #31405a; font-size: 11px; }
.action-group { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.action-link { min-height: 30px; padding: 5px 9px; border: 1px solid #dce4f0; border-radius: 7px; background: #fff; color: var(--blue); transition: border-color .18s, background .18s; }
.action-link:hover { border-color: #b8c9e5; background: #f4f8ff; }
.action-danger { color: var(--danger); }
.action-danger:hover { border-color: #edc6c6; background: var(--danger-soft); color: var(--danger); }
.action-link:disabled { opacity: .55; cursor: wait; }

.performance-filter-card { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(150px, 190px)) auto; gap: 14px; align-items: end; margin-bottom: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(31, 50, 85, .035); }
.performance-filter-copy { align-self: center; }
.performance-filter-copy strong, .performance-filter-copy span { display: block; }
.performance-filter-copy strong { color: #32415b; font-size: 13px; }
.performance-filter-copy span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.performance-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.performance-summary-card { min-width: 0; padding: 17px 18px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 4px 14px rgba(31, 50, 85, .03); }
.performance-summary-card > span, .performance-summary-card > strong, .performance-summary-card > small { display: block; }
.performance-summary-card > span { color: var(--muted); font-size: 11px; }
.performance-summary-card > strong { margin: 7px 0 5px; color: #253653; font-size: 25px; font-variant-numeric: tabular-nums; }
.performance-summary-card > small { color: #96a0b0; font-size: 10px; }
.performance-summary-primary { border-color: #cbdcff; background: linear-gradient(145deg, #fff, #f3f7ff); }
.performance-summary-primary > strong { color: var(--blue); }
.performance-chart-card, .performance-table-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.performance-chart-card { margin-bottom: 14px; }
.performance-card-head { justify-content: space-between; gap: 12px; }
.definition-chip { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: var(--blue-soft); color: var(--blue) !important; font-size: 10px !important; font-weight: 750; }
.performance-chart-wrap { position: relative; height: 320px; padding: 18px 20px 14px; }
.performance-table-wrap { max-height: 460px; min-height: 180px; }
.performance-table { width: 100%; }
.performance-table th, .performance-table td { max-width: none; }
.performance-table td:last-child { color: var(--blue-dark); font-weight: 800; font-variant-numeric: tabular-nums; }

.version-alert { margin-bottom: 14px; padding: 12px 15px; border: 1px solid #efc4c4; border-radius: 11px; background: var(--danger-soft); color: #a13737; font-size: 12px; line-height: 1.65; }
.version-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.version-summary-card { min-width: 0; padding: 17px 18px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 4px 14px rgba(31, 50, 85, .03); }
.version-summary-card > span, .version-summary-card > strong, .version-summary-card > small { display: block; }
.version-summary-card > span { color: var(--muted); font-size: 11px; }
.version-summary-card > strong { margin: 7px 0 5px; overflow: hidden; color: #253653; font-size: 22px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.version-summary-card > small { overflow: hidden; color: #96a0b0; font-size: 10px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.version-summary-primary { border-color: #cbdcff; background: linear-gradient(145deg, #fff, #f3f7ff); }
.version-summary-primary > strong { color: var(--blue); }
.version-layout { display: grid; grid-template-columns: minmax(500px, 1.45fr) minmax(300px, .72fr); gap: 14px; align-items: start; }
.version-form-card, .version-guide-card, .version-critical-card, .version-check-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.version-card-head { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.version-card-head strong, .version-card-head span { display: block; }
.version-card-head strong { font-size: 14px; }
.version-card-head div > span { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.version-state-chip { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: #eef1f6; color: #657389; font-size: 10px; font-weight: 700; }
.version-state-ready { background: var(--success-soft); color: var(--success); }
.version-state-error { background: var(--danger-soft); color: var(--danger); }
.version-form-fields { min-width: 0; margin: 0; padding: 20px; border: 0; }
.version-form-fields:disabled { opacity: .62; }
.version-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 16px; }
.version-form-grid .field { min-width: 0; display: grid; align-content: start; gap: 7px; margin: 0; }
.version-form-grid .field-wide { grid-column: 1 / -1; }
.version-form-grid .field > span { margin: 0; }
.version-form-grid .field input, .version-form-grid .field textarea { width: 100%; border: 1px solid #d5ddea; border-radius: 9px; background: #fbfcfe; color: var(--ink); padding: 0 12px; outline: 0; transition: border .18s, box-shadow .18s, background .18s; }
.version-form-grid .field input { height: 42px; }
.version-form-grid .field textarea { min-height: 118px; padding-top: 10px; resize: vertical; font: inherit; line-height: 1.6; }
.version-form-grid .field input:hover, .version-form-grid .field textarea:hover { border-color: #bac6d9; background: #fff; }
.version-form-grid .field input:focus, .version-form-grid .field textarea:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(47, 111, 237, .12); }
.version-form-grid .field input::placeholder, .version-form-grid .field textarea::placeholder { color: #a5afbf; }
.code-input { font-family: Consolas, "Courier New", monospace !important; font-size: 11px !important; letter-spacing: .15px; }
.unit-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.unit-input input { border-radius: 9px 0 0 9px !important; }
.unit-input > span { min-width: 48px; display: grid; place-items: center; border: 1px solid #d5ddea; border-left: 0; border-radius: 0 9px 9px 0; background: #f1f4f8; color: #7b8799; font-size: 10px; }
.version-upload { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 14px; border: 1px dashed #b8c7dd; border-radius: 11px; background: #f8faff; }
.version-upload-copy { min-width: 0; display: flex; align-items: center; gap: 11px; }
.version-upload-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-size: 10px; font-weight: 850; }
.version-upload-copy strong, .version-upload-copy small { display: block; }
.version-upload-copy strong { color: #344157; font-size: 12px; }
.version-upload-copy small { max-width: 390px; margin-top: 4px; overflow: hidden; color: #8793a6; font-size: 10px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.version-upload-button { min-height: 34px; flex: 0 0 auto; padding: 0 13px; font-size: 11px; }
.version-upload-progress { height: 34px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: #edf2fb; color: #52627c; font-size: 10px; }
.version-upload-progress > span { position: absolute; inset: 0; width: 35%; background: rgba(47, 111, 237, .12); animation: upload-progress 1.2s ease-in-out infinite alternate; }
.version-upload-progress > strong { position: relative; font-weight: 700; }
@keyframes upload-progress { from { transform: translateX(-80%); } to { transform: translateX(260%); } }
.version-form-error { min-height: 0; margin: 16px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--danger-soft); line-height: 1.55; }
.version-form-error:empty { display: none; }
.version-form-actions { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 20px -20px -20px; padding: 12px 20px; border-top: 1px solid var(--line); background: #f9fbfe; }
.version-form-actions > span { color: #8b96a8; font-size: 10px; }
.version-form-actions .button { min-width: 120px; }
.version-guide-stack { display: grid; gap: 14px; }
.version-rule-list { display: grid; gap: 0; padding: 8px 18px; }
.version-rule-list article { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 11px; padding: 13px 0; border-bottom: 1px solid #edf0f5; }
.version-rule-list article:last-child { border-bottom: 0; }
.version-rule-list strong { display: block; margin: 1px 0 4px; color: #344157; font-size: 11px; }
.version-rule-list p { margin: 0; color: #8490a3; font-size: 10px; line-height: 1.55; }
.version-rule-badge { align-self: start; display: inline-flex; justify-content: center; padding: 4px 6px; border-radius: 999px; font-size: 9px; font-weight: 750; }
.version-rule-danger { color: var(--danger); background: var(--danger-soft); }
.version-rule-warning { color: var(--warning); background: var(--warning-soft); }
.version-rule-success { color: var(--success); background: var(--success-soft); }
.version-critical-card { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 16px; border-color: #f0d3a8; background: #fffaf1; }
.version-critical-card > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--warning-soft); color: var(--warning); font-weight: 850; }
.version-critical-card strong { display: block; margin: 1px 0 5px; color: #7f4c13; font-size: 11px; }
.version-critical-card p { margin: 0; color: #956a38; font-size: 10px; line-height: 1.65; }
.version-check-card { padding: 18px; }
.version-check-card > strong { display: block; font-size: 12px; }
.version-check-card ul { margin: 12px 0 0; padding-left: 18px; color: #6f7c91; }
.version-check-card li { margin-top: 7px; font-size: 10px; line-height: 1.5; }
.version-package-link { display: inline-flex; margin-top: 14px; color: var(--blue); font-size: 10px; font-weight: 700; text-decoration: none; }
.version-package-link:hover { text-decoration: underline; }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; overflow: auto; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10, 19, 36, .68); backdrop-filter: blur(5px); }
.image-dialog, .form-dialog { position: relative; width: min(1020px, 92vw); border-radius: 16px; background: #fff; box-shadow: 0 30px 80px rgba(4, 11, 25, .35); overflow: hidden; }
.form-dialog { width: min(560px, calc(100vw - 48px)); max-height: calc(100dvh - 48px); display: flex; flex-direction: column; }
.modal-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 17px; border-bottom: 1px solid var(--line); }
.modal-head strong, .modal-head span { display: block; }
.modal-head span { margin-top: 3px; color: #8b96a8; font-size: 10px; }
.form-dialog-head { min-height: 72px; flex: 0 0 auto; padding: 0 24px; }
.form-dialog-head strong { color: #17243a; font-size: 18px; line-height: 1.3; }
.form-dialog-head span { margin-top: 5px; color: #7e8ba0; font-size: 11px; line-height: 1.45; }
.form-dialog-head .icon-button { flex: 0 0 auto; margin-left: 18px; }
.image-stage { position: relative; min-height: 540px; display: grid; place-items: center; background: #101827; }
.image-stage img { max-width: 100%; max-height: 72vh; object-fit: contain; }
.image-loading-state, .image-error-state { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 30px; background: #101827; color: #c6d1e4; text-align: center; }
.image-error-state strong { color: #fff; font-size: 14px; }
.image-error-state span { color: #a8b4c9; font-size: 11px; }
.image-error-state .button { margin-top: 4px; }
.spinner { width: 28px; height: 28px; border: 3px solid rgba(255, 255, 255, .18); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gallery-button { position: absolute; z-index: 2; top: 50%; width: 42px; height: 56px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 30px; cursor: pointer; transform: translateY(-50%); }
.gallery-button:hover { background: rgba(255, 255, 255, .22); }
.gallery-button-left { left: 16px; }
.gallery-button-right { right: 16px; }
.modal-foot { min-height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 17px; color: #78859a; font-size: 11px; }
.form-dialog-body { min-height: 0; padding: 24px; overflow-y: auto; }
.employee-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
.employee-form-grid .field { display: grid; align-content: start; gap: 8px; margin: 0; }
.employee-form-grid .field-wide { grid-column: 1 / -1; }
.employee-form-grid .field > span { margin: 0; color: #45536b; font-size: 12px; font-weight: 700; line-height: 1.4; }
.employee-form-grid .field input,
.employee-form-grid .field select { height: 44px; border-color: #d5ddea; border-radius: 10px; background: #fbfcfe; padding: 0 13px; }
.employee-form-grid .field input::placeholder { color: #a5afbf; }
.employee-form-grid .field input:hover,
.employee-form-grid .field select:hover { border-color: #bac6d9; background: #fff; }
.field-help { display: block; margin: 0; color: #8793a6; font-size: 10px; line-height: 1.55; }
.form-dialog .form-error { min-height: 0; margin: 16px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--danger-soft); line-height: 1.5; }
.form-dialog .form-error:empty { display: none; }
.dialog-actions { min-height: 70px; flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin: 0; padding: 14px 24px; border-top: 1px solid var(--line); background: #f9fbfe; }
.dialog-actions .button { min-width: 84px; }
.dialog-actions .button-primary { min-width: 98px; }
.modal:not([hidden]) .form-dialog { animation: dialog-enter .18s ease-out; }
body.modal-open { overflow: hidden; }
.confirm-dialog { width: min(460px, calc(100vw - 48px)); }
.confirm-dialog-body { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 14px; align-items: center; }
.confirm-dialog-body p { margin: 0; color: #516078; font-size: 12px; line-height: 1.7; }
.confirm-dialog-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--warning-soft); color: var(--warning); font-weight: 850; }
.confirm-dialog-icon.is-danger { background: var(--danger-soft); color: var(--danger); }

@keyframes dialog-enter {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 80; max-width: 360px; padding: 12px 16px; border-radius: 10px; background: #18243a; color: white; box-shadow: 0 14px 38px rgba(20, 33, 61, .26); font-size: 12px; }

@media (max-width: 1160px) {
  .metric-grid, .module-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-row { grid-template-columns: repeat(3, 1fr); }
  .filter-row-secondary { grid-template-columns: repeat(3, 1fr); }
  .filter-actions { grid-column: 1 / -1; }
  .import-layout { grid-template-columns: 1fr; }
  .version-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .version-layout { grid-template-columns: 1fr; }
  .performance-filter-card { grid-template-columns: 1fr repeat(2, minmax(150px, 1fr)) auto; }
}

@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; background: linear-gradient(160deg, #10203d 0 34%, #f4f6fa 34%); padding: 28px 18px; gap: 40px; }
  .login-card { justify-self: center; }
  .app-shell { grid-template-columns: 74px minmax(0, 1fr); }
  .sidebar { width: 74px; padding: 16px 10px; }
  .sidebar-brand > div:last-child { display: none; }
  .sidebar-brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item > span { display: none; }
  .nav-icon { width: 20px; height: 20px; }
  .sidebar-foot { display: none; }
  .main-content { grid-column: 2; }
  .topbar { padding: 0 14px; }
  .page { padding: 18px 14px 30px; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 23px; }
  .filter-row, .filter-row-secondary { grid-template-columns: repeat(2, 1fr); }
  .user-chip div { display: none; }
  .performance-filter-card { grid-template-columns: repeat(2, 1fr); }
  .performance-filter-copy, .performance-filter-card .button { grid-column: 1 / -1; }
  .import-upload-controls { grid-template-columns: minmax(190px, .8fr) minmax(260px, 1.2fr); }
  .import-submit-button { grid-column: 1 / -1; }
  .import-rule-line { flex-wrap: wrap; white-space: normal; }
}

@media (max-width: 640px) {
  .app-shell { display: block; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .sidebar { inset: auto 0 0; width: 100%; height: calc(68px + env(safe-area-inset-bottom)); padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 -8px 24px rgba(15, 29, 54, .16); }
  .sidebar-brand, .sidebar-foot { display: none; }
  .main-nav { display: flex; gap: 4px; margin: 0; overflow-x: auto; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .nav-item { min-width: 52px; height: 53px; flex: 1 1 60px; flex-direction: column; justify-content: center; gap: 3px; padding: 3px 4px; border-radius: 9px; color: #aebbd1; font-size: 9px; }
  .nav-item > span { display: block; max-width: 100%; font-size: 9px; line-height: 1.25; }
  .nav-icon { width: 19px; height: 19px; }
  .nav-item.active { box-shadow: none; }
  .main-content { grid-column: auto; }
  .topbar { height: 58px; padding: 0 12px; }
  .topbar-actions { gap: 6px; }
  .user-chip { padding-left: 8px; }
  .page { padding: 18px 12px 28px; }
  .page-heading { margin-bottom: 16px; }
  .metric-grid, .module-grid, .filter-row, .filter-row-secondary { grid-template-columns: 1fr; }
  .page-heading { flex-direction: column; }
  .page-heading > .button { width: 100%; }
  .filter-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .topbar .breadcrumb { display: none; }
  .topbar { justify-content: flex-end; }
  .issue-stat-row { grid-template-columns: 90px minmax(90px, 1fr) 54px; gap: 8px; }
  .import-upload-card { padding: 16px; }
  .import-upload-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .import-upload-controls { grid-template-columns: 1fr; }
  .import-submit-button { grid-column: auto; }
  .import-rule-line { align-items: flex-start; flex-direction: column; gap: 5px; }
  .import-rule-line i { display: none; }
  .import-history-head { align-items: flex-start; flex-direction: column; padding: 13px 14px; }
  .import-history-head .button { width: 100%; }
  .import-result-metrics { grid-template-columns: 1fr; }
  .modal { align-items: end; padding: 12px; }
  .form-dialog { width: 100%; max-height: calc(100dvh - 24px); border-radius: 16px; }
  .form-dialog-head { min-height: 68px; padding: 0 18px; }
  .form-dialog-body { padding: 20px 18px; }
  .employee-form-grid { grid-template-columns: 1fr; gap: 16px; }
  .employee-form-grid .field-wide { grid-column: auto; }
  .dialog-actions { min-height: 66px; padding: 12px 18px; }
  .dialog-actions .button { flex: 1; }
  .version-summary-grid, .version-form-grid { grid-template-columns: 1fr; }
  .version-form-grid .field-wide { grid-column: auto; }
  .version-upload { align-items: flex-start; flex-direction: column; }
  .version-upload-button { width: 100%; }
  .version-form-actions { align-items: stretch; flex-direction: column; }
  .version-form-actions .button { width: 100%; }
  .performance-filter-card { grid-template-columns: 1fr; }
  .performance-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .performance-summary-card { padding: 13px 10px; }
  .performance-summary-card > strong { font-size: 20px; }
  .performance-summary-card > small { font-size: 9px; line-height: 1.4; }
  .performance-filter-copy, .performance-filter-card .button { grid-column: auto; }
  .performance-chart-wrap { height: 280px; padding: 14px 8px 10px; }
  .performance-card-head { align-items: flex-start; }
  .table-card, .simple-table-card, .performance-table-card { overflow: hidden; }
  .simple-table-card { overflow-x: auto; }
  .simple-table { min-width: 680px; }
  .sticky-col { position: static; left: auto; }
  .sticky-col-order { box-shadow: none; }
  th.sticky-col { position: sticky; left: auto; z-index: 3; }
  .employee-toolbar { align-items: flex-start; flex-direction: column; }
  .toast { right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); left: 12px; max-width: none; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
