:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #6d7687;
  --line: #e5e9f2;
  --blue: #246bfe;
  --blue-dark: #1454d8;
  --green: #15875f;
  --orange: #d97a16;
  --red: #c53d4a;
  --shadow: 0 14px 40px rgba(31, 47, 78, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 15% -10%, #e7efff 0, transparent 32%), var(--bg); }
a { color: var(--blue); text-decoration: none; }
button, input, select { font: inherit; }
.topbar { height: 72px; padding: 0 28px; display: flex; align-items: center; gap: 30px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); min-width: 205px; }
.brand span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 4px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: white; font-weight: 800; font-size: 12px; border-radius: 12px; background: linear-gradient(145deg, #246bfe, #7c4dff); box-shadow: 0 8px 20px rgba(36,107,254,.25); }
.brand-mark.large { width: 56px; height: 56px; border-radius: 17px; font-size: 16px; }
nav { display: flex; align-items: stretch; gap: 3px; height: 100%; overflow-x: auto; }
nav a { padding: 0 12px; display: grid; place-items: center; color: #566074; font-size: 14px; font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
nav a:hover, nav a.active { color: var(--blue); border-color: var(--blue); }
.logout-form { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.user-chip { background: #f1f4fa; border: 1px solid var(--line); padding: 7px 11px; border-radius: 20px; font-size: 13px; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-button:hover { background: #eef2f8; color: var(--red); }
.page-shell { max-width: 1440px; margin: 0 auto; padding: 34px 32px 70px; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(430px, 100%); background: var(--surface); padding: 42px; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.auth-brand { margin-bottom: 28px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(28px, 3vw, 42px); letter-spacing: -.035em; margin-bottom: 10px; }
h2 { font-size: 20px; letter-spacing: -.02em; margin-bottom: 18px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 800; color: var(--blue); margin-bottom: 8px; }
.muted, .page-heading p { color: var(--muted); line-height: 1.6; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading > div:first-child { max-width: 760px; }
.page-heading h1 { margin-bottom: 6px; }
.page-heading p { margin-bottom: 0; }
.stack-form { display: flex; flex-direction: column; gap: 17px; }
label { color: #3d4657; font-size: 13px; font-weight: 700; display: flex; flex-direction: column; gap: 7px; }
label small, td small, .list-card small { color: var(--muted); font-weight: 400; line-height: 1.4; }
input, select { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #d9deea; border-radius: 10px; color: var(--ink); background: white; outline: none; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,107,254,.10); }
.check-row { flex-direction: row; align-items: center; gap: 10px; font-weight: 600; }
.check-row input { width: 18px; min-height: 18px; accent-color: var(--blue); }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; padding: 9px 15px; border: 1px solid transparent; font-weight: 750; font-size: 13px; cursor: pointer; transition: .18s ease; white-space: nowrap; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--blue); color: white; box-shadow: 0 8px 18px rgba(36,107,254,.2); }
.button.primary:hover { background: var(--blue-dark); }
.button.success { background: var(--green); color: white; }
.button.ghost { border-color: var(--line); color: #455067; background: white; }
.button.ghost:hover { border-color: #bcc6d8; background: #f9fafc; }
.button.danger-ghost { border-color: #f0ccd1; color: var(--red); background: #fff8f9; }
.button.success-ghost { border-color: #c8e7dc; color: var(--green); background: #f5fcf9; }
.button.small { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.button.wide { width: 100%; margin-top: 4px; }
.button-row, .row-actions, .inline-form { display: flex; align-items: center; gap: 8px; }
.user-card details { position: relative; }
.user-card summary { list-style: none; }
.user-card summary::-webkit-details-marker { display: none; }
.mini-form { position: absolute; right: 0; top: 42px; z-index: 5; width: 280px; padding: 16px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 24px; }
.stat-card { min-height: 145px; padding: 22px; border-radius: 17px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 22px rgba(30,48,83,.04); display: flex; flex-direction: column; }
.stat-card span { font-size: 13px; font-weight: 700; color: var(--muted); }
.stat-card strong { font-size: 38px; letter-spacing: -.04em; margin: 12px 0 4px; }
.stat-card small { color: var(--muted); }
.stat-card.accent { border-top: 3px solid var(--blue); }
.stat-card.warning { border-top: 3px solid var(--orange); }
.stat-card.danger { border-top: 3px solid var(--red); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 17px; padding: 22px; box-shadow: 0 6px 22px rgba(30,48,83,.035); margin-bottom: 20px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.panel-heading h2 { margin-bottom: 0; }
.panel-heading .eyebrow + h2 { margin-bottom: 0; }
.panel-heading > div { margin-bottom: 18px; }
.attention-panel { border-color: #f1d7b8; background: linear-gradient(135deg, #fffdfa, white); }
.badge { background: #eef3ff; color: var(--blue); border-radius: 20px; padding: 5px 10px; font-weight: 800; font-size: 12px; }
.badge-warning { background: #fff1dc; color: #a45b0b; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.form-layout { grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr); }
.sticky-panel { position: sticky; top: 92px; }
.narrow-panel { max-width: 850px; }
.approval-list, .card-list { display: flex; flex-direction: column; }
.approval-row, .list-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.approval-row:first-child, .list-card:first-child { border-top: 0; padding-top: 5px; }
.approval-row > div:first-child, .list-card > div:first-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.approval-row span, .list-card span { color: var(--muted); font-size: 13px; }
.approval-values { display: flex; gap: 18px; }
.approval-values span { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.approval-values b { color: var(--ink); font-size: 14px; margin-top: 3px; }
.store-health > div, .event-mini-list > div { display: grid; grid-template-columns: 14px 1fr; column-gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.store-health > div:first-child, .event-mini-list > div:first-child { border-top: 0; }
.store-health strong { font-size: 14px; }
.store-health small { grid-column: 2; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.health-dot, .event-icon { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: #bac3d1; }
.health-dot.good, .event-icon.info { background: var(--green); box-shadow: 0 0 0 4px #e5f6ef; }
.health-dot.bad, .event-icon.critical { background: var(--red); box-shadow: 0 0 0 4px #fbeaed; }
.health-dot.idle, .event-icon.important { background: var(--orange); box-shadow: 0 0 0 4px #fff2e3; }
.event-mini-list p { margin: 0; font-size: 13px; line-height: 1.45; }
.event-mini-list small { display: block; color: var(--muted); margin-top: 3px; }
.filter-panel { padding: 14px; }
.filters { display: grid; grid-template-columns: minmax(230px, 1fr) repeat(4, minmax(155px, 190px)) auto; gap: 10px; }
.table-panel { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; background: #fafbfc; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: #fbfcff; }
td > strong, td > span { display: block; }
td small { display: block; margin-top: 5px; }
.stock-value { font-size: 19px; font-weight: 800; }
.stock-value.zero { color: var(--orange); }
.ozon-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 750; white-space: nowrap; }
.status { display: inline-flex; width: fit-content; border-radius: 18px; padding: 5px 9px; font-size: 11px; font-weight: 800; background: #eef1f6; color: #596276; }
.status-monitoring, .status-completed, .status-info { background: #e7f7f0; color: var(--green); }
.status-pending_approval, .status-switching, .status-important { background: #fff1dd; color: #a45b0b; }
.status-error, .status-critical { background: #fbe8eb; color: var(--red); }
.status-draft, .status-paused { background: #eef1f6; color: #687185; }
.error-detail { max-width: 260px; color: var(--red); }
.restore-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; font-size: 13px; }
.restore-preview { max-height: 500px; }
.status-restoring { background: #fff1dd; color: #a45b0b; }
.status-ready { background: #eaf0ff; color: #245eff; }
.status-launching { background: #fff1dd; color: #a45b0b; }
.status-launch_error { background: #fbe8eb; color: var(--red); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.span-2 { grid-column: span 2; }
.notice { padding: 14px 16px; border-radius: 11px; background: #eef4ff; border: 1px solid #d7e4ff; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.notice span { color: var(--muted); }
.success-notice { background: #effaf6; border-color: #cdece0; margin-bottom: 20px; }
.upload-form { display: flex; flex-direction: column; gap: 16px; }
.file-drop { border: 1.5px dashed #b9c5da; background: #f9fbff; padding: 30px; border-radius: 14px; text-align: center; cursor: pointer; }
.file-drop input { border: 0; padding: 0; min-height: auto; margin-bottom: 14px; }
.file-drop span, .file-drop small { display: block; }
.schema-list > div { display: flex; flex-direction: column; gap: 4px; padding: 13px 0; border-top: 1px solid var(--line); }
.schema-list > div:first-child { border-top: 0; }
.schema-list span { color: var(--muted); font-size: 13px; }
.schema-list em { font-style: normal; color: var(--red); font-size: 10px; text-transform: uppercase; margin-left: 5px; }
.error-list { margin-top: 20px; padding: 15px; border-radius: 11px; background: #fff5f6; color: var(--red); font-size: 13px; }
.error-list div { padding-top: 6px; }
.steps { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.steps > div { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; font-size: 13px; }
.steps b { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: #edf3ff; color: var(--blue); }
.empty-state { padding: 34px; text-align: center; color: var(--muted); }
.flash { max-width: 100%; padding: 13px 16px; border-radius: 11px; margin-bottom: 18px; font-size: 13px; font-weight: 650; border: 1px solid; }
.flash-success { color: #116b4d; background: #eefaf5; border-color: #c8e8dc; }
.flash-warning { color: #99570e; background: #fff7eb; border-color: #f1d9b8; }
.flash-error { color: #a62f3b; background: #fff1f3; border-color: #f0cbd0; }
.nowrap { white-space: nowrap; }
code { background: #f1f3f7; padding: 2px 5px; border-radius: 5px; font-size: .9em; }
@media (max-width: 1100px) { .stat-grid { grid-template-columns: 1fr 1fr; } .topbar { padding: 0 16px; gap: 15px; } .brand { min-width: auto; } .brand span:last-child { display: none; } .filters { grid-template-columns: 1fr 1fr; } }
@media (max-width: 780px) { .page-shell { padding: 24px 15px 60px; } .topbar { height: auto; padding: 12px 14px; flex-wrap: wrap; } nav { width: 100%; height: 40px; order: 3; } .logout-form { margin-left: auto; } .two-column, .form-layout, .form-grid { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } .sticky-panel { position: static; } .page-heading { align-items: flex-start; flex-direction: column; } .approval-row, .list-card { align-items: flex-start; flex-wrap: wrap; } .filters { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .stat-grid { grid-template-columns: 1fr; } .auth-card { padding: 28px 22px; } .steps { grid-template-columns: 1fr; } }
