:root {
  --ink: #14161a;
  --muted: #68707d;
  --line: #e5e7eb;
  --soft: #f5f6f8;
  --white: #fff;
  --red: #e31e24;
  --red-dark: #bb1118;
  --green: #147d54;
  --amber: #ad6b00;
  --shadow: 0 14px 40px rgba(20, 22, 26, .07);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--soft); font-size: 14px; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 18px; background: #111318; color: #fff; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--red); color: #fff; font-size: 20px; font-weight: 900; box-shadow: 0 8px 20px rgba(227, 30, 36, .3); }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: -.02em; }
.brand small { margin-top: 3px; color: #9299a7; font-size: 11px; }
.nav { display: grid; gap: 6px; margin-top: 42px; }
.nav a { padding: 12px 14px; border-radius: 10px; color: #aeb4c0; transition: .15s ease; }
.nav a:hover, .nav a.active { color: #fff; background: #262a32; }
.nav a.active { box-shadow: inset 3px 0 var(--red); }
.sidebar-footer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: auto; padding: 15px 10px 0; border-top: 1px solid #2a2e36; color: #969daa; font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #43d39e; box-shadow: 0 0 0 4px rgba(67, 211, 158, .12); }
.sidebar-footer form { margin-left: auto; }
.link-button { border: 0; padding: 0; background: none; color: #fff; cursor: pointer; }
.main { min-width: 0; }
.topbar { min-height: 104px; display: flex; align-items: center; justify-content: space-between; padding: 24px 34px 18px; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 27px; letter-spacing: -.035em; }
h2 { margin-bottom: 7px; font-size: 20px; letter-spacing: -.025em; }
.user-pill { padding: 9px 13px; border-radius: 99px; background: var(--soft); border: 1px solid var(--line); color: #383e48; font-size: 12px; font-weight: 650; }
.content { padding: 28px 34px 56px; }
.messages { padding: 18px 34px 0; }
.message { padding: 12px 15px; border-radius: 10px; background: #e9f7f1; color: #116442; border: 1px solid #bce8d5; }
.message.error { background: #fff0f0; color: #9d1c21; border-color: #ffc9cb; }
.message.warning { background: #fff7e7; color: #805100; border-color: #f4dcac; }
.hero-panel { display: flex; align-items: center; justify-content: space-between; gap: 30px; min-height: 176px; padding: 30px 32px; border-radius: 18px; color: #fff; background: radial-gradient(circle at 80% 0, rgba(227,30,36,.65), transparent 38%), linear-gradient(135deg, #171a21, #292e37); box-shadow: var(--shadow); }
.hero-panel h2 { margin: 14px 0 7px; font-size: 27px; }
.hero-panel p { max-width: 680px; margin-bottom: 0; color: #c2c7d0; line-height: 1.55; }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 99px; background: #eceef2; color: #555d69; font-size: 11px; font-weight: 750; }
.badge.red { color: #fff; background: rgba(227,30,36,.82); }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 40px; padding: 10px 16px; border: 1px solid transparent; border-radius: 9px; font-weight: 750; cursor: pointer; transition: .15s ease; }
.button.primary { color: #fff; background: var(--red); box-shadow: 0 7px 18px rgba(227, 30, 36, .22); }
.button.primary:hover { background: var(--red-dark); transform: translateY(-1px); }
.button.secondary { background: #181b21; color: #fff; }
.button.ghost { background: #fff; border-color: var(--line); color: #363c45; }
.button.wide { width: 100%; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.stat-card { padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.stat-card span, .stat-card strong { display: block; }
.stat-card span { margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.stat-card strong { font-size: 27px; letter-spacing: -.04em; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 7px 25px rgba(20,22,26,.035); }
.panel + .panel { margin-top: 18px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.panel-heading h2 { margin-bottom: 0; }
.text-link, .row-link { color: #b8141a; font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 12px; background: #f7f8fa; color: var(--muted); font-size: 11px; text-align: left; text-transform: uppercase; letter-spacing: .05em; }
td { padding: 13px 12px; border-bottom: 1px solid #eceef1; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
td small { display: block; margin-top: 4px; color: var(--muted); }
.status { display: inline-flex; white-space: nowrap; padding: 5px 8px; border-radius: 99px; background: #eef0f3; color: #5a626e; font-size: 11px; font-weight: 750; }
.status-done, .status-ready { background: #e8f7f1; color: var(--green); }
.status-partial, .status-warning { background: #fff4d9; color: var(--amber); }
.status-failed, .status-error { background: #ffebec; color: #aa1b21; }
.status-running { background: #eaf1ff; color: #245cb8; }
.empty-state { padding: 35px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; margin-bottom: 8px; color: var(--ink); }
.two-column { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 18px; }
.two-column .panel + .panel { margin-top: 0; }
.compact-columns { max-width: 1050px; }
.muted-panel { background: #f0f2f5; box-shadow: none; }
.stack-form { display: grid; gap: 16px; }
.stack-form label { display: grid; gap: 7px; color: #343a43; font-size: 12px; font-weight: 700; }
.stack-form input:not([type=checkbox]), .stack-form select, .warehouse-row input:not([type=checkbox]) { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #d8dce2; border-radius: 8px; background: #fff; outline: none; }
.stack-form input:focus, .stack-form select:focus, .warehouse-row input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(227,30,36,.09); }
.stack-form small { color: var(--muted); font-weight: 400; line-height: 1.4; }
.checkbox-label { grid-template-columns: auto 1fr; align-items: center; }
.checkbox-label small, .checkbox-label .errorlist { grid-column: 2; }
.field-error, .errorlist { margin: 0; padding: 0; color: #b51b21; font-size: 11px; font-style: normal; list-style: none; }
.steps { display: grid; gap: 18px; margin: 21px 0 0; padding: 0; list-style: none; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps li > span { display: grid; flex: 0 0 28px; height: 28px; place-items: center; border-radius: 8px; background: #fff; font-size: 11px; font-weight: 800; }
.steps strong, .steps small { display: block; }
.steps small { margin-top: 3px; color: var(--muted); line-height: 1.45; }
.job-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.job-header h2 { margin: 10px 0 5px; }
.job-header p { margin-bottom: 0; color: var(--muted); }
.progress-copy { display: flex; justify-content: space-between; margin-bottom: 10px; }
.progress { height: 9px; overflow: hidden; border-radius: 99px; background: #e7e9ed; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--red), #fb5e63); }
.progress-panel p { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.error-panel { margin: 18px 0; padding: 18px; border: 1px solid #ffc7c9; border-radius: 12px; background: #fff0f0; color: #92191e; }
.error-panel p { margin: 7px 0 0; word-break: break-word; }
.downloads { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.download-card { min-height: 105px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; transition: .15s ease; }
.download-card:hover { border-color: var(--red); transform: translateY(-2px); box-shadow: var(--shadow); }
.download-card strong, .download-card small { display: block; }
.download-card small { margin-top: 7px; color: var(--muted); line-height: 1.4; }
.upload-box { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 16px; padding: 16px; border-radius: 11px; background: #f5f6f8; }
.upload-box strong, .upload-box small { display: block; }
.upload-box small { margin-top: 4px; color: var(--muted); }
.filters { display: flex; gap: 7px; }
.filters a { padding: 6px 9px; border-radius: 7px; background: #f2f3f5; color: #555d68; font-size: 11px; }
.products-table { min-width: 1060px; }
.issue { padding-left: 10px; border-left: 2px solid #f2c057; }
.pagination { display: flex; justify-content: flex-end; gap: 14px; align-items: center; padding-top: 16px; color: var(--muted); }
.pagination a { color: var(--red-dark); font-weight: 700; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.settings-grid .panel + .panel { margin-top: 0; }
.warehouses-panel { grid-column: 1 / -1; }
.inline-form { margin-top: 12px; }
.inline-error { margin: 10px 0 0; color: #a91c21; font-size: 12px; }
.help-box { margin: 15px 0 0; padding: 11px; border-radius: 8px; background: #f5f6f8; color: var(--muted); font-size: 12px; line-height: 1.45; }
.warehouse-row { display: flex; gap: 10px; align-items: end; padding: 12px 0; border-top: 1px solid var(--line); }
.warehouse-row label { display: grid; gap: 5px; min-width: 105px; color: var(--muted); font-size: 11px; }
.warehouse-row .grow { flex: 1; }
.warehouse-row .switch { display: flex; align-items: center; gap: 7px; min-height: 42px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 85% 20%, rgba(227,30,36,.12), transparent 28%), #111318; }
.login-card { width: min(440px, 100%); padding: 32px; border-radius: 18px; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.login-brand { color: #111318; }
.login-copy { margin: 34px 0 24px; }
.login-copy h1 { margin-bottom: 9px; }
.login-copy p { color: var(--muted); line-height: 1.5; }
.form-errors { padding: 10px; border-radius: 8px; background: #fff0f0; color: #a31c21; }
@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; height: auto; flex-direction: row; align-items: center; gap: 20px; padding: 14px 18px; }
  .nav { display: flex; margin: 0; overflow-x: auto; }
  .sidebar-footer { display: none; }
  .stats-grid, .downloads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .topbar, .content, .messages { padding-left: 18px; padding-right: 18px; }
  .topbar { min-height: 88px; }
  .user-pill { display: none; }
  .sidebar .brand small { display: none; }
  .nav a { white-space: nowrap; padding: 9px 10px; }
  .hero-panel, .job-header, .upload-box { align-items: flex-start; flex-direction: column; }
  .two-column, .settings-grid { grid-template-columns: 1fr; }
  .warehouses-panel { grid-column: auto; }
  .stats-grid, .downloads { grid-template-columns: 1fr 1fr; }
  .warehouse-row { align-items: stretch; flex-direction: column; }
  .panel { padding: 18px; }
}
