:root {
    --navy-950: #071a2f;
    --navy-900: #0b2442;
    --navy-800: #12365e;
    --teal-600: #058b87;
    --teal-500: #0aa6a0;
    --teal-100: #dff7f5;
    --bg: #f5f7fa;
    --panel: #fff;
    --soft: #f8fafc;
    --text: #182638;
    --muted: #6d7989;
    --line: #e3e9ef;
    --success: #15815f;
    --success-bg: #e8f7f1;
    --warning: #ab7109;
    --warning-bg: #fff6db;
    --danger: #c94444;
    --danger-bg: #fff0ef;
    --violet: #7355c5;
    --shadow: 0 1px 2px rgba(7, 26, 47, .04), 0 8px 24px rgba(7, 26, 47, .055);
}

[data-theme="dark"] {
    --bg: #07111f;
    --panel: #0d1b2d;
    --soft: #102238;
    --text: #e8eef6;
    --muted: #9aa8ba;
    --line: #1f354d;
    --teal-100: #113936;
    --success-bg: #12382f;
    --warning-bg: #3a2d12;
    --danger-bg: #3b1f25;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Tahoma, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
    outline: 3px solid rgba(10, 166, 160, .22);
    outline-offset: 2px;
}

.app-shell { min-height: 100vh; padding-right: 264px; }
.sidebar {
    position: fixed; z-index: 40; inset: 0 0 0 auto; width: 264px;
    display: flex; flex-direction: column;
    color: #dce7f2;
    background: radial-gradient(circle at 80% -10%, rgba(18, 99, 130, .45), transparent 27%), linear-gradient(180deg, #0b2949, #071a30);
    box-shadow: -8px 0 30px rgba(4, 20, 38, .1);
}
.side-brand {
    height: 76px; padding: 0 18px; display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-logo {
    width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center;
    border-radius: 12px; color: white; background: linear-gradient(145deg, #19b7ad, #07867f);
    box-shadow: 0 7px 18px rgba(8, 171, 162, .26); font-size: 19px; font-weight: 900;
}
.side-brand > span:last-child { display: flex; flex-direction: column; gap: 4px; }
.side-brand strong { color: white; font-size: 18px; }
.side-brand small { color: #91a9bf; font-size: 9px; }
.side-nav { flex: 1; padding: 20px 12px; overflow-y: auto; }
.nav-caption { display: block; padding: 0 13px 9px; color: #6f8aa3; font-size: 10px; font-weight: 700; }
.side-nav a, .side-bottom > a, .side-bottom form button {
    position: relative; width: 100%; height: 45px; padding: 0 13px;
    display: flex; align-items: center; gap: 12px;
    border: 0; border-radius: 10px; background: transparent; color: #aebed0;
    font-size: 12px; font-weight: 700; text-align: right;
}
.side-nav a:hover, .side-bottom > a:hover, .side-bottom form button:hover { background: rgba(255,255,255,.06); color: white; }
.side-nav a.active, .side-bottom > a.active {
    color: white; background: linear-gradient(90deg, rgba(8,153,148,.12), rgba(10,166,160,.28));
}
.side-nav a.active::after, .side-bottom > a.active::after {
    content: ""; position: absolute; top: 10px; right: 0; bottom: 10px; width: 3px;
    border-radius: 3px 0 0 3px; background: #28d4c9;
}
.side-nav a i, .side-bottom i {
    width: 22px; height: 22px; display: grid; place-items: center; color: #8ba5bd;
    font-style: normal; font-size: 18px;
}
.side-nav a.active i { color: #3cddd3; }
.side-nav a b {
    margin-right: auto; min-width: 22px; height: 20px; padding: 0 6px; display: grid;
    place-items: center; border-radius: 12px; background: rgba(24,190,181,.16);
    color: #54e0d8; font-size: 9px;
}
.side-bottom { padding: 10px 12px 14px; border-top: 1px solid rgba(255,255,255,.07); }
.side-user {
    margin: 8px 4px; padding: 12px 8px; display: flex; align-items: center; gap: 10px;
    border-top: 1px solid rgba(255,255,255,.07);
}
.avatar, .top-avatar {
    width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center;
    border-radius: 50%; background: #d7ebe9; color: #075e5b; font-size: 12px; font-weight: 900;
}
.side-user > span:last-child { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.side-user strong { color: white; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user small { color: #7790a8; font-size: 8px; }
.side-bottom form button { color: #8199af; }
.workspace { min-width: 0; }
.topbar {
    position: sticky; z-index: 30; top: 0; height: 76px; padding: 0 28px;
    display: flex; align-items: center; justify-content: space-between;
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    border-bottom: 1px solid var(--line); backdrop-filter: blur(16px);
}
.topbar-start, .topbar-end { display: flex; align-items: center; gap: 10px; }
.project-select {
    min-width: 270px; padding: 6px 10px; display: flex; align-items: center; gap: 9px;
    border: 1px solid var(--line); border-radius: 11px; background: var(--soft);
}
.project-symbol {
    width: 33px; height: 33px; display: grid; place-items: center; border-radius: 8px;
    background: var(--teal-100); color: var(--teal-600); font-weight: 900;
}
.project-select label { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.project-select small, .rate-pill small { color: var(--muted); font-size: 8px; }
.project-select select { width: 100%; padding: 1px 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 11px; font-weight: 700; }
.rate-pill {
    height: 43px; padding: 0 11px; display: grid; grid-template-columns: 25px auto; grid-template-rows: 1fr 1fr;
    align-items: center; column-gap: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft);
}
.rate-pill > span { grid-row: 1/3; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--success-bg); color: var(--success); font-weight: 900; }
.rate-pill strong { font-size: 9px; }
.icon-button {
    width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line);
    border-radius: 10px; background: var(--panel); color: var(--text);
}
.mobile-menu { display: none; }
.content { max-width: 1580px; margin: auto; padding: 25px 28px 48px; }
.page-heading { margin-bottom: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.breadcrumb { margin-bottom: 9px; color: var(--muted); font-size: 9px; }
.breadcrumb span { color: var(--teal-600); }
.page-heading h1 { margin: 0 0 7px; font-size: 24px; letter-spacing: -.7px; }
.page-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.heading-actions { display: flex; gap: 8px; }
.button {
    min-height: 39px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center;
    gap: 7px; border: 1px solid transparent; border-radius: 9px; font-size: 10px; font-weight: 800;
}
.button.primary { color: white; background: var(--teal-600); box-shadow: 0 5px 14px rgba(5,139,135,.18); }
.button.primary:hover { background: #057b77; }
.button.secondary { border-color: var(--line); background: var(--panel); color: var(--text); }
.button.secondary:hover { border-color: #8ed5d1; color: var(--teal-600); background: var(--teal-100); }
.button.full { width: 100%; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.panel { border: 1px solid var(--line); border-radius: 13px; background: var(--panel); box-shadow: var(--shadow); }
.panel-head {
    min-height: 67px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 15px;
    border-bottom: 1px solid var(--line);
}
.panel-head > span:first-child { display: flex; flex-direction: column; gap: 4px; }
.panel-head h2 { margin: 0; font-size: 12px; }
.panel-head small { color: var(--muted); font-size: 8px; }
.panel-head > a { color: var(--teal-600); font-size: 8px; font-weight: 800; }
.demo-banner {
    margin-bottom: 17px; padding: 11px 14px; display: flex; align-items: center; gap: 10px;
    border: 1px solid #b8dedb; border-radius: 10px; background: color-mix(in srgb, var(--teal-100) 62%, var(--panel));
}
.demo-banner > b { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-600); color: white; }
.demo-banner > span { flex: 1; color: var(--muted); font-size: 9px; line-height: 1.7; }
.demo-banner strong { margin-left: 5px; color: var(--text); }
.demo-banner i { padding: 4px 7px; border-radius: 5px; background: rgba(5,139,135,.12); color: var(--teal-600); font: 800 8px Arial; letter-spacing: 1px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; }
.metric { min-height: 142px; padding: 16px; display: grid; grid-template-columns: 1fr auto; align-content: start; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.metric-icon { grid-column: 2; grid-row: 1/3; width: 39px; height: 39px; display: grid; place-items: center; border-radius: 10px; font-size: 17px; font-weight: 900; }
.metric-icon.navy { color: var(--navy-800); background: #e8eff7; }
.metric-icon.teal { color: var(--teal-600); background: var(--teal-100); }
.metric-icon.violet { color: var(--violet); background: #f0ebfb; }
.metric-icon.amber { color: var(--warning); background: var(--warning-bg); }
.metric small { color: var(--muted); font-size: 9px; }
.metric strong { grid-column: 1/3; margin-top: 18px; direction: ltr; text-align: right; font-size: 20px; letter-spacing: -.4px; }
.metric em { grid-column: 1/3; margin-top: 5px; color: var(--muted); font-size: 8px; font-style: normal; }
.health-grid { margin: 13px 0; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.health { min-height: 72px; padding: 11px 13px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: 1fr 1fr; align-items: center; border: 1px solid var(--line); border-right-width: 3px; border-radius: 10px; background: var(--panel); }
.health > span { font-size: 9px; font-weight: 800; }
.health > strong { grid-column: 2; grid-row: 1/3; font-size: 19px; }
.health > small, .health > a { color: var(--muted); font-size: 8px; }
.health > a { color: var(--teal-600); }
.health.success { border-right-color: var(--success); } .health.warning { border-right-color: var(--warning); } .health.danger { border-right-color: var(--danger); } .health.neutral { border-right-color: #718096; }
.dashboard-grid { margin-bottom: 13px; display: grid; grid-template-columns: 1.65fr 1fr; gap: 13px; }
.chart-panel, .composition-panel { min-height: 345px; }
.bar-chart { height: 268px; padding: 35px 9% 20px; display: flex; align-items: flex-end; justify-content: space-around; background: repeating-linear-gradient(to top, transparent 0 53px, var(--line) 54px); }
.bar-item { height: 100%; width: 25%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; }
.bar-item > span { font-size: 8px; font-weight: 800; }
.bar-item > i { width: 46px; min-height: 5px; border-radius: 6px 6px 2px 2px; }
.bar-item > i.navy, .composition-list i.navy { background: var(--navy-800); }
.bar-item > i.teal, .composition-list i.teal { background: var(--teal-500); }
.bar-item > i.violet, .composition-list i.violet { background: var(--violet); }
.composition-list i.amber { background: #e5a52a; }
.bar-item > b { color: var(--muted); font-size: 8px; }
.composition-list { padding: 19px 20px 11px; }
.composition-list > div { min-height: 43px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px dashed var(--line); font-size: 9px; }
.composition-list span { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.composition-list i { width: 9px; height: 9px; display: block; border-radius: 50%; }
.formula-box { margin: 10px 18px 16px; padding: 12px; border-radius: 8px; background: var(--soft); color: var(--muted); font-size: 8px; line-height: 1.8; }
.status { width: fit-content; padding: 5px 8px; display: inline-flex; align-items: center; border-radius: 13px; font-size: 8px; font-weight: 800; }
.status.valid { color: var(--success); background: var(--success-bg); }
.status.review { color: var(--warning); background: var(--warning-bg); }
.status.expired, .status.missing { color: var(--danger); background: var(--danger-bg); }
.form-grid { padding: 18px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.form-grid.compact { padding-bottom: 10px; }
label { color: var(--muted); font-size: 9px; font-weight: 700; }
label > span { display: block; margin-bottom: 7px; }
input, select, textarea {
    width: 100%; min-height: 41px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px;
    outline: 0; background: var(--soft); color: var(--text); font-size: 10px;
}
textarea { min-height: 86px; padding: 10px 11px; line-height: 1.7; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #78ccc7; box-shadow: 0 0 0 3px rgba(10,166,160,.07); }
label.wide { grid-column: 1/-1; }
.coefficient-section { padding: 4px 18px 18px; }
.coefficient-section h3 { margin: 0 0 12px; font-size: 11px; }
.coefficient-section h3 small { margin-right: 7px; color: var(--muted); font-size: 8px; font-weight: 400; }
.coefficient-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.form-footer { padding: 14px 18px; display: flex; justify-content: flex-end; border-top: 1px solid var(--line); }
.stepper { min-height: 88px; padding: 16px 8%; display: flex; align-items: center; background: var(--soft); border-bottom: 1px solid var(--line); }
.stepper span { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); font-size: 8px; }
.stepper b { width: 29px; height: 29px; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 50%; background: var(--panel); }
.stepper span.active { color: var(--teal-600); font-weight: 800; }
.stepper span.active b { border-color: var(--teal-600); }
.stepper > i { flex: 1; height: 2px; margin: 0 8px 20px; background: var(--line); }
.upload-zone { min-height: 415px; margin: 24px; padding: 35px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px dashed #b6c4d1; border-radius: 14px; background: var(--soft); text-align: center; }
.upload-symbol { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 20px; background: var(--teal-100); color: var(--teal-600); font-size: 34px; font-weight: 900; }
.upload-zone h2 { margin: 18px 0 8px; font-size: 16px; }
.upload-zone p { margin: 0 0 18px; color: var(--muted); font-size: 9px; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.commit-check, .check-label { margin: 14px 0 9px; display: flex; align-items: center; gap: 7px; color: var(--text); }
.commit-check input, .check-label input { width: 15px; min-height: 15px; accent-color: var(--teal-600); }
.upload-zone > small { margin-bottom: 18px; color: var(--muted); font-size: 8px; }
.upload-result { margin: 0 24px 24px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); font-size: 9px; line-height: 1.8; }
.upload-result.success { border-color: #9dd5c5; background: var(--success-bg); }
.upload-result.warning { border-color: #e6cf8e; background: var(--warning-bg); }
.issue-list { margin-top: 10px; display: grid; gap: 5px; }
.issue-list div { padding: 7px 9px; border-radius: 6px; background: var(--panel); }
.table-panel { overflow: hidden; }
.table-toolbar { min-height: 68px; padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.table-toolbar > div { display: flex; gap: 8px; }
.search-field { min-width: 310px; height: 39px; padding: 0 11px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); color: var(--muted); }
.search-field input { min-width: 0; min-height: 0; height: 100%; padding: 0; border: 0; background: transparent; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 950px; border-collapse: collapse; }
th { height: 41px; padding: 0 10px; background: var(--soft); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 8px; text-align: right; white-space: nowrap; }
td { height: 64px; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 9px; white-space: nowrap; }
tbody tr:hover { background: color-mix(in srgb, var(--teal-100) 27%, var(--panel)); }
td > strong, td > small { display: block; }
td > strong { font-size: 9px; }
td > small { margin-top: 5px; color: var(--muted); font-size: 7px; }
.empty-cell { height: 130px; color: var(--muted); text-align: center; }
.source-link { color: var(--teal-600); font-size: 8px; font-weight: 800; }
.split-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(320px,.75fr); gap: 14px; align-items: start; }
.side-form { position: sticky; top: 91px; }
.stack-form { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.supplier-grid { padding: 15px; display: grid; grid-template-columns: repeat(2,1fr); gap: 11px; }
.supplier-card { padding: 14px; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.supplier-letter { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 9px; background: var(--teal-100); color: var(--teal-600); font-weight: 900; }
.supplier-card h3 { margin: 0 0 5px; font-size: 10px; }
.supplier-card p { margin: 0; color: var(--muted); font-size: 8px; }
.supplier-card dl { grid-column: 1/-1; margin: 8px 0 0; padding-top: 9px; display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--line); }
.supplier-card dl > div { display: flex; flex-direction: column; gap: 4px; }
.supplier-card dt { color: var(--muted); font-size: 7px; }
.supplier-card dd { margin: 0; font-size: 8px; font-weight: 800; }
.rfb-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(310px,.65fr); gap: 14px; align-items: start; }
.section-subhead { padding: 11px 18px; display: flex; align-items: center; justify-content: space-between; }
.section-subhead h3 { margin: 0; font-size: 11px; }
.section-subhead button { border: 0; background: transparent; color: var(--teal-600); font-size: 8px; font-weight: 800; }
.rfb-list { max-height: 330px; margin: 0 18px; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; }
.rfb-list label { min-height: 55px; padding: 8px 11px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); color: var(--text); }
.rfb-list label:last-child { border-bottom: 0; }
.rfb-list input { width: 15px; min-height: 15px; accent-color: var(--teal-600); }
.rfb-list label > span { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.rfb-list strong { font-size: 9px; }
.rfb-list small { color: var(--muted); font-size: 7px; }
.wide-textarea { margin: 16px 18px; display: block; }
.rfb-history article { margin: 0 16px; padding: 13px 0; display: grid; grid-template-columns: 1fr auto; gap: 8px; border-bottom: 1px solid var(--line); }
.rfb-history article > span:first-child { display: flex; flex-direction: column; gap: 4px; }
.rfb-history strong { font-size: 9px; }
.rfb-history small { color: var(--muted); font-size: 7px; }
.rfb-history article > div { grid-column: 1/-1; display: flex; gap: 7px; }
.rfb-history article a { flex: 1; padding: 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--teal-600); font-size: 8px; text-align: center; }
.report-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.report-card { min-height: 130px; padding: 16px; display: grid; grid-template-columns: 43px 1fr 34px; align-items: start; gap: 11px; }
.report-card > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; background: var(--teal-100); color: var(--teal-600); font-size: 19px; }
.report-card h2 { margin: 2px 0 7px; font-size: 11px; }
.report-card p { margin: 0 0 10px; color: var(--muted); font-size: 8px; }
.report-card small { color: var(--muted); font-size: 7px; }
.report-card > a { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--teal-600); }
.formula-report { margin-top: 13px; }
.formula-grid { padding: 16px; display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.formula-grid > div { min-height: 68px; padding: 12px; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); }
.formula-grid span { color: var(--muted); font-size: 8px; }
.formula-grid strong { direction: ltr; text-align: right; font-size: 13px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.profile-box { padding: 20px; display: flex; align-items: center; gap: 13px; }
.large-avatar { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 17px; background: var(--teal-100); color: var(--teal-600); font-size: 23px; font-weight: 900; }
.profile-box h2 { margin: 0 0 5px; font-size: 13px; }
.profile-box p { margin: 0 0 7px; color: var(--muted); font-size: 9px; }
.role-list, .system-checks { padding: 0 18px 18px; }
.role-list > div, .system-checks > div { min-height: 52px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.role-list > div { align-items: flex-start; justify-content: center; flex-direction: column; gap: 4px; }
.role-list strong, .system-checks strong { font-size: 9px; }
.role-list span, .system-checks span { color: var(--muted); font-size: 8px; }
.green { color: var(--success); } .red { color: var(--danger); }
.security-callout { margin: 0 18px 18px; padding: 12px; border-radius: 8px; background: var(--danger-bg); color: var(--danger); font-size: 8px; line-height: 1.7; }
.empty-state { min-height: 220px; padding: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.empty-state > b { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; background: var(--soft); color: var(--teal-600); font-size: 22px; }
.empty-state h2 { color: var(--text); font-size: 13px; }
.empty-state p { font-size: 9px; }
.toast { position: fixed; z-index: 100; left: 22px; bottom: 22px; max-width: 420px; min-height: 49px; padding: 12px 15px; border: 1px solid #9ed5c5; border-radius: 10px; background: var(--panel); box-shadow: 0 12px 40px rgba(7,26,47,.18); color: var(--success); font-size: 9px; font-weight: 800; }
.toast.error { border-color: #e6a7a7; color: var(--danger); }
.nav-overlay { display: none; }

/* Authentication and installer */
.auth-page { min-height: 100vh; background: #f5f7fa; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(440px, .9fr) minmax(520px, 1.1fr); direction: ltr; }
.login-visual { position: relative; padding: 42px 48px; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(circle at 15% 20%, rgba(9,157,151,.35), transparent 30%), linear-gradient(145deg, #071a2f, #0b2d50); color: white; direction: rtl; }
.blueprint-grid { position: absolute; inset: 0; opacity: .13; background-image: linear-gradient(rgba(89,207,201,.5) 1px, transparent 1px), linear-gradient(90deg, rgba(89,207,201,.5) 1px, transparent 1px); background-size: 44px 44px; }
.login-brand { position: relative; display: flex; align-items: center; gap: 11px; }
.login-brand strong { font-size: 18px; }
.visual-copy { position: relative; margin: auto 0; }
.visual-copy > span { color: #49d4cb; font-size: 11px; font-weight: 800; }
.visual-copy h1 { margin: 16px 0; font-size: clamp(27px, 3vw, 43px); line-height: 1.7; letter-spacing: -1.5px; }
.visual-copy p { max-width: 510px; color: #a7bdd0; font-size: 11px; line-height: 2; }
.visual-badges { position: relative; display: flex; gap: 8px; }
.visual-badges span { padding: 8px 11px; border: 1px solid rgba(68,219,210,.25); border-radius: 8px; background: rgba(10,166,160,.08); color: #b8dedb; font-size: 8px; }
.login-form-wrap { display: grid; place-items: center; padding: 30px; direction: rtl; }
.auth-card { width: min(470px,100%); border: 1px solid #e1e8ee; border-radius: 15px; background: white; box-shadow: 0 15px 55px rgba(7,26,47,.09); }
.login-card { padding: 36px; }
.login-card h2 { margin: 0 0 9px; font-size: 20px; }
.login-card > p { margin: 0 0 26px; color: #758191; font-size: 10px; }
.login-card label { display: block; margin-bottom: 15px; }
.login-card input { background: #f8fafc; color: #182638; }
.login-card > small { margin-top: 15px; display: block; color: #8793a1; font-size: 8px; text-align: center; }
.mobile-login-brand { display: none; }
.form-alert { margin: 0 0 16px; padding: 11px 12px; border-radius: 8px; font-size: 9px; line-height: 1.7; }
.form-alert.danger { border: 1px solid #efc4c4; background: #fff0ef; color: #b73838; }
.installer { max-width: 880px; margin: 0 auto; padding: 35px 18px 60px; }
.install-brand { margin-bottom: 22px; display: flex; align-items: center; justify-content: center; gap: 11px; }
.install-brand > div:last-child { display: flex; flex-direction: column; gap: 4px; }
.install-brand strong { color: #0b2442; font-size: 18px; }
.install-brand span { color: #758191; font-size: 9px; }
.install-card { width: 100%; }
.install-header { padding: 22px 26px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e3e9ef; }
.install-header h1 { margin: 0 0 7px; color: #182638; font-size: 19px; }
.install-header p { margin: 0; color: #758191; font-size: 9px; }
.install-header > span { padding: 5px 8px; border-radius: 6px; background: #dff7f5; color: #058b87; font-size: 8px; font-weight: 800; }
.requirements { padding: 14px 26px; display: flex; flex-wrap: wrap; gap: 7px; border-bottom: 1px solid #e3e9ef; }
.requirements > div { padding: 6px 9px; display: flex; align-items: center; gap: 5px; border-radius: 7px; font-size: 8px; }
.requirements .passed { background: #e8f7f1; color: #15815f; }
.requirements .failed { background: #fff0ef; color: #c94444; }
.install-form { padding: 22px 26px 27px; }
.install-form h2 { margin: 0 0 2px; color: #182638; font-size: 12px; }
.install-form .form-grid { padding: 13px 0 22px; }
.install-form input { color: #182638; background: #f8fafc; }
.install-success { margin: auto; padding: 40px; text-align: center; }
.success-icon { width: 76px; height: 76px; margin: 0 auto; display: grid; place-items: center; border: 8px solid #e8f7f1; border-radius: 50%; background: #cceee2; color: #15815f; font-size: 30px; font-weight: 900; }
.install-success h1 { margin: 20px 0 8px; color: #182638; }
.install-success p { color: #758191; font-size: 10px; }
.install-success .button { margin-top: 10px; }
.security-warning { margin-top: 22px; padding: 11px; border-radius: 8px; background: #fff6db; color: #936105; font-size: 8px; }

@media (max-width: 1150px) {
    .metric-grid, .health-grid { grid-template-columns: repeat(2,1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .coefficient-grid { grid-template-columns: repeat(3,1fr); }
    .supplier-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .app-shell { padding-right: 0; }
    .sidebar { transform: translateX(105%); transition: transform .22s ease; }
    .sidebar.open { transform: translateX(0); }
    .nav-overlay { position: fixed; z-index: 35; inset: 0; border: 0; background: rgba(2,12,24,.5); backdrop-filter: blur(2px); }
    .nav-overlay.open { display: block; }
    .mobile-menu { display: grid; }
    .topbar { padding: 0 16px; }
    .content { padding: 21px 16px 42px; }
    .split-grid, .rfb-grid, .settings-grid { grid-template-columns: 1fr; }
    .side-form { position: static; }
    .login-layout { grid-template-columns: 1fr; }
    .login-visual { display: none; }
    .mobile-login-brand { margin-bottom: 25px; display: flex; align-items: center; gap: 9px; color: #0b2442; }
}
@media (max-width: 650px) {
    .topbar { height: 66px; }
    .project-select { width: 210px; min-width: 0; }
    .rate-pill, .top-avatar { display: none; }
    .content { padding: 17px 11px 34px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .page-heading h1 { font-size: 20px; }
    .heading-actions { width: 100%; }
    .heading-actions .button { flex: 1; }
    .demo-banner { align-items: flex-start; }
    .demo-banner i { display: none; }
    .metric-grid, .health-grid, .report-grid, .formula-grid { grid-template-columns: 1fr; }
    .metric { min-height: 126px; }
    .table-toolbar { align-items: stretch; flex-direction: column; }
    .table-toolbar > div { overflow-x: auto; }
    .search-field { min-width: 0; width: 100%; }
    .form-grid, .coefficient-grid, .two-cols { grid-template-columns: 1fr; }
    .stepper { padding: 14px 3%; }
    .stepper span { font-size: 7px; }
    .upload-zone { margin: 14px; }
    .login-form-wrap { padding: 18px; }
    .login-card { padding: 27px 22px; }
    .installer { padding: 22px 10px; }
    .install-header { align-items: flex-start; flex-direction: column; gap: 10px; }
    .install-form { padding: 18px; }
}
@media print {
    .sidebar, .topbar, .page-heading, .demo-banner, .heading-actions { display: none !important; }
    .app-shell { padding: 0; }
    .content { max-width: none; padding: 0; }
    .panel { border: 0; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
