/* OilReserves MC — стили интерфейса */
:root {
  --bg: #f2f5fa;
  --card: #ffffff;
  --line: #e2e8f0;
  --line2: #edf1f6;
  --text: #13233a;
  --text2: #33455f;
  --muted: #64758c;
  --primary: #1e6ff1;
  --primary-d: #1559c9;
  --primary-l: #eaf2ff;
  --green: #1f9d4a;
  --green-l: #e7f6ec;
  --orange: #e8900c;
  --orange-l: #fff4e0;
  --red: #e5484d;
  --red-l: #fdecec;
  --purple: #7c4ddb;
  --purple-l: #f1ecfd;
  --gray-l: #eef1f5;
  --side: #0c2340;
  --side2: #0f2b4d;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 34, 64, .05), 0 3px 12px rgba(16, 34, 64, .04);
  --font: "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --math: "Cambria Math", Cambria, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }
.ic { flex: none; display: inline-block; vertical-align: middle; }
[hidden] { display: none !important; }

/* ---------- Заставка ---------- */
#splash { position: fixed; inset: 0; z-index: 1000; background: linear-gradient(160deg, #0c2340, #133a68); display: flex; align-items: center; justify-content: center; transition: opacity .35s; }
#splash.hide { opacity: 0; pointer-events: none; }
.splash-box { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #dbe7f7; text-align: center; }
.splash-box b { font-size: 22px; color: #fff; }
.splash-bar { width: 220px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.15); overflow: hidden; margin-top: 8px; }
.splash-bar i { display: block; width: 40%; height: 100%; background: #4d94ff; border-radius: 4px; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* ---------- Каркас ---------- */
.app { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 196px; flex: none; background: linear-gradient(180deg, var(--side) 0%, var(--side2) 100%); color: #d6e2f2; display: flex; flex-direction: column; padding: 0 0 14px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.07); margin-bottom: 8px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; }
.brand-txt b { font-size: 16px; font-weight: 700; letter-spacing: .1px; }
.brand-txt small { color: #93a9c7; font-size: 12.5px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 6px; }
.nav-bottom { margin-top: auto; border-top: 1px solid rgba(255,255,255,.07); padding-top: 10px; }
.nav-item { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 8px; color: #d6e2f2; font-size: 14px; transition: background .15s; }
.nav-item:hover { background: rgba(255,255,255,.06); }
.nav-item.on { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(30,111,241,.35); }
.nav-item .ic { opacity: .95; }

.main { flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden; position: relative; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 22px; background: rgba(242,245,250,.92); backdrop-filter: blur(8px); border-bottom: 1px solid transparent; }
.crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.crumbs b { color: var(--text); font-weight: 600; }
.crumb-sep { color: #a8b4c4; display: inline-flex; }
.crumb-back { display: inline-flex; margin-right: 8px; }
.search-wrap { position: relative; width: 340px; }
.search-wrap input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px 0 36px; background: #fff; outline: none; font-size: 13px; }
.search-wrap input:focus { border-color: #9cc0fb; box-shadow: 0 0 0 3px rgba(30,111,241,.12); }
.search-ic { position: absolute; left: 11px; top: 10px; color: #7b8aa0; }
.search-results { position: absolute; left: 0; right: 0; top: 44px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(16,34,64,.14); padding: 6px; max-height: 420px; overflow: auto; }
.sr-item { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 7px; color: var(--text); }
.sr-item:hover, .sr-item.on { background: var(--primary-l); }
.sr-item .ic { color: var(--primary); }
.sr-item span { display: flex; flex-direction: column; }
.sr-item small { color: var(--muted); font-size: 11.5px; }
.sr-empty { padding: 12px; color: var(--muted); text-align: center; font-size: 13px; }
.icon-btn { width: 38px; height: 38px; border: none; background: transparent; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: #3a4b64; cursor: pointer; position: relative; }
.icon-btn:hover { background: rgba(16,34,64,.06); }
.bell.has-dot::after { content: ""; position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; background: var(--red); border-radius: 50%; border: 2px solid var(--bg); }
.user-box { display: flex; align-items: center; gap: 10px; border: none; background: transparent; cursor: pointer; padding: 4px 6px; border-radius: 10px; }
.user-box:hover { background: rgba(16,34,64,.05); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #0f2747; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.user-txt { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.user-txt b { font-size: 13.5px; }
.user-txt small { color: var(--muted); font-size: 12px; }

#view { padding: 4px 22px 28px; }
.view { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Заголовки страниц ---------- */
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.page-head > div:first-child { flex: 1 1 auto; min-width: 260px; }
.page-head h1 { font-size: 26px; font-weight: 700; color: #0e2342; letter-spacing: -.2px; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 14px; }
.page-head .head-ic { color: var(--primary); margin-right: 8px; vertical-align: -4px; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.head-stack { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }

/* ---------- Сетка ---------- */
.g12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.c2 { grid-column: span 2; } .c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; }
.c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c9 { grid-column: span 9; }
.c12 { grid-column: span 12; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.grow { flex: 1; min-width: 0; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }

@media (max-width: 1350px) {
  .c2, .c3 { grid-column: span 4; }
  .c4, .c5 { grid-column: span 6; }
  .c7, .c8, .c9 { grid-column: span 12; }
  .c6 { grid-column: span 12; }
  .search-wrap { width: 260px; }
}
@media (max-width: 900px) {
  .g12 > * { grid-column: span 12 !important; }
  .sidebar { width: 64px; }
  .brand-txt, .nav-item span { display: none; }
  .search-wrap { display: none; }
  .user-txt { display: none; }
}

/* ---------- Карточки ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; display: flex; flex-direction: column; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 18px 0; flex-wrap: wrap; }
.card-head h3 { font-size: 15.5px; font-weight: 700; color: #11233d; display: flex; align-items: center; gap: 6px; }
.card-body { padding: 14px 18px 16px; flex: 1; min-width: 0; }
.card-body.flush { padding: 10px 0 0; }
.help-ic { color: #8a99ae; display: inline-flex; cursor: help; }
.card.tinted-blue { background: #f5f9ff; border-color: #d9e7fd; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1350px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .kpis { grid-template-columns: 1fr; } }
.kpi { display: flex; flex-direction: row; align-items: center; gap: 14px; padding: 16px 16px; color: inherit; position: relative; }
a.kpi:hover { border-color: #c7dafb; }
.kpi-ic { width: 50px; height: 50px; border-radius: 12px; background: var(--primary-l); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.kpi-ic.green { background: var(--green-l); color: var(--green); }
.kpi-main { flex: 1; min-width: 0; }
.kpi-label { font-size: 12.5px; color: #4b5c75; }
.kpi-value { font-size: 26px; font-weight: 700; color: #0e2342; line-height: 1.25; margin-top: 2px; white-space: nowrap; }
.kpi-value small { font-size: 13px; font-weight: 600; color: #4b5c75; margin-left: 4px; }
.kpi-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi .chev { color: var(--primary); }
.delta-up { color: var(--green); font-weight: 600; }
.delta-down { color: var(--red); font-weight: 600; }

.mini-kpis { display: flex; gap: 12px; flex-wrap: wrap; }
.mini-kpi { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; box-shadow: var(--shadow); }
.mini-kpi .ic { color: var(--primary); }
.mini-kpi span { display: flex; flex-direction: column; font-size: 12px; color: #4b5c75; }
.mini-kpi b { font-size: 19px; color: #0e2342; }
.mini-kpi b small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }

.stat-cards { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1350px) { .stat-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat-card { border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 8px; padding: 10px 12px; background: #fff; }
.stat-card .l { font-size: 12.5px; color: #4b5c75; font-weight: 600; }
.stat-card .v { font-size: 23px; font-weight: 700; color: #0e2342; margin-top: 2px; white-space: nowrap; }
.stat-card .u { font-size: 11.5px; color: var(--muted); }
.stat-card.p90 { border-left-color: var(--green); } .stat-card.p90 .l { color: var(--green); }
.stat-card.p50 { border-left-color: var(--orange); }
.stat-card.p10 { border-left-color: var(--red); } .stat-card.p10 .l { color: var(--red); }
.stat-card.mean { border-left-color: var(--primary); }
.stat-card.gray { border-left-color: #a3afc0; }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid #d3dce8; background: #fff; border-radius: 8px; font-weight: 600; font-size: 13px; color: #1d3150; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; text-decoration: none; }
.btn:hover { background: #f6f9fd; border-color: #bfcbdb; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); border-color: var(--primary-d); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.outline { color: var(--primary); border-color: #a9c6f7; }
.btn.outline:hover { background: var(--primary-l); }
.btn.green { color: #157a39; border-color: #a7dcb9; background: #f3fbf6; }
.btn.red { color: #c22d32; border-color: #f4b3b5; background: #fef6f6; }
.btn.blue { color: var(--primary); border-color: #b5cdf6; background: #f5f9ff; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; gap: 6px; }
.btn.lg { height: 50px; font-size: 15.5px; padding: 0 22px; }
.btn.block { width: 100%; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(16,34,64,.05); }
.btn.icon { width: 30px; padding: 0; }
.link { border: none; background: none; color: var(--primary); cursor: pointer; padding: 0; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.kebab { width: 28px; height: 28px; border: none; background: transparent; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: #4a5a72; cursor: pointer; }
.kebab:hover, .kebab.menu-open { background: #e8eef6; }

/* ---------- Поля ввода ---------- */
.input { height: 36px; width: 100%; border: 1px solid #d3dce8; border-radius: 8px; padding: 0 10px; background: #fff; outline: none; font-size: 13.5px; min-width: 0; }
textarea.input { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; }
select.input { padding-right: 28px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2333455f' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; cursor: pointer; }
.input:focus { border-color: #8db6fa; box-shadow: 0 0 0 3px rgba(30,111,241,.12); }
.input.err, .cell-in.err { border-color: var(--red) !important; background: #fff7f7; }
.input:disabled { background: #f4f6f9; color: #8a97a8; }
.input.sm { height: 30px; font-size: 12.5px; }
.fld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.fld-label { font-size: 12.5px; color: #44556e; font-weight: 600; }
.fld-hint { font-size: 11.5px; color: var(--muted); }
.fld-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fld-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 10px 14px; align-items: center; }
.form-grid > label { font-size: 13px; color: #33455f; }
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: #2b3c55; user-select: none; }
.chk input { width: 17px; height: 17px; accent-color: var(--primary); margin: 0; }
.radio-list { display: flex; flex-direction: column; gap: 8px; }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: #cbd5e1; border-radius: 22px; transition: .2s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(18px); }
.num-stepper { display: flex; }
.num-stepper .input { border-radius: 8px 0 0 8px; }
.num-stepper .sbtns { display: flex; flex-direction: column; border: 1px solid #d3dce8; border-left: none; border-radius: 0 8px 8px 0; overflow: hidden; }
.num-stepper .sbtns button { flex: 1; width: 26px; border: none; background: #f7f9fc; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; color: #44556e; }
.num-stepper .sbtns button:hover { background: #e9eef6; }

/* ---------- Сегменты, вкладки, шаги ---------- */
.seg { display: inline-flex; flex-wrap: wrap; background: #eef2f7; border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; padding: 6px 12px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: #4b5d78; cursor: pointer; white-space: nowrap; }
.seg button.on { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(16,34,64,.12); }
.seg.solid button.on { background: var(--primary); color: #fff; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button { display: inline-flex; align-items: center; gap: 7px; border: none; background: none; padding: 12px 16px 11px; color: #4b5d78; font-weight: 600; font-size: 13.5px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--primary); }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); }
.tabs-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 12px; box-shadow: var(--shadow); }
.tabs-card .tabs { border-bottom: none; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pills button { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 16px; font-weight: 600; color: #33455f; cursor: pointer; }
.pills button.on { background: var(--primary-l); border-color: #b9d1fb; color: var(--primary); }
.stepper { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 9px; padding: 4px 12px 4px 4px; border-radius: 30px; color: #44556e; font-size: 13px; }
.step b { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid #c6d1df; background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; color: #33455f; }
.step.on { background: #fff; box-shadow: var(--shadow); color: #0e2342; font-weight: 600; }
.step.on b { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.done b { border-color: var(--primary); color: var(--primary); }
.step + .step::before { content: ""; width: 28px; height: 1px; background: #cdd6e2; margin-right: 4px; margin-left: -10px; }

/* ---------- Таблицы ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th { background: #f4f7fb; color: #2f4058; font-weight: 600; text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 12.5px; vertical-align: middle; }
.tbl th small { display: block; font-weight: 500; color: var(--muted); font-size: 10.5px; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: #f8fafd; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .ctr { text-align: center; }
.tbl tr.sel td { background: #edf4ff; }
.tbl tr.total td { font-weight: 700; background: #f4f7fb; }
.tbl tr.clickable { cursor: pointer; }
.tbl.compact td, .tbl.compact th { padding: 6px 8px; }
.tbl.bordered td, .tbl.bordered th { border-right: 1px solid var(--line2); }
.tbl.bordered td:last-child, .tbl.bordered th:last-child { border-right: none; }
.tbl-box { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.fdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); font-size: 13px; }
.kv > div { padding: 8px 0; border-bottom: 1px solid var(--line2); }
.kv > div:nth-child(odd) { color: #4b5c75; }
.kv > div:nth-last-child(-n+2) { border-bottom: none; }
.comment-box { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; background: #fbfcfe; min-height: 40px; white-space: pre-wrap; }

/* ---------- Статусы ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 9px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.ok { background: var(--green-l); color: #17843d; }
.status.warn { background: var(--orange-l); color: #b56a00; }
.status.muted { background: var(--gray-l); color: #66768d; }
.status.info { background: var(--primary-l); color: var(--primary); }
.status.sm { font-size: 11.5px; padding: 2px 8px; }
.sdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.sdot.ok { background: #22a447; } .sdot.warn { background: #f59e0b; } .sdot.muted { background: #a3afc0; } .sdot.info { background: var(--primary); }
.badge { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--green-l); color: #17843d; }
.badge.blue { background: var(--primary-l); color: var(--primary); }
.spin { width: 11px; height: 11px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: rot .8s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- Графики ---------- */
.chart { width: 100%; position: relative; }
.chart-svg { display: block; overflow: visible; }
.chart-svg .bar:hover { opacity: 1 !important; filter: brightness(1.08); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; font-size: 12px; color: #44556e; margin-top: 6px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-box { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-line { width: 18px; height: 3px; border-radius: 2px; display: inline-block; }
.lg-dash { width: 18px; height: 0; border-top: 2px dashed; display: inline-block; }
.donut-row { display: flex; align-items: center; gap: 16px; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; flex: 1; min-width: 0; }
.donut-legend div { display: flex; align-items: center; gap: 8px; }
.donut-legend i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.donut-legend span { flex: 1; color: #2b3c55; }
.donut-legend b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tooltip { position: fixed; z-index: 2000; background: #0f2342; color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 6px; pointer-events: none; max-width: 320px; box-shadow: 0 6px 18px rgba(0,0,0,.2); display: none; line-height: 1.4; }

/* ---------- Карта ---------- */
.map-wrap { position: relative; border-radius: 10px; overflow: hidden; background: #3f3f30; user-select: none; cursor: grab; min-height: 200px; }
.map-wrap:active { cursor: grabbing; }
.map-svg { display: block; width: 100%; height: 100%; }
.map-block { cursor: pointer; transition: fill .15s; }
.map-block:hover { filter: brightness(1.18); }
.map-field { cursor: pointer; }
.map-ctrl { position: absolute; left: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.map-ctrl button { width: 32px; height: 32px; border: none; background: #fff; border-radius: 7px; box-shadow: 0 1px 4px rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; cursor: pointer; color: #1d3150; }
.map-ctrl button:hover { background: #f0f5ff; }
.map-ctrl button.mt { margin-top: 4px; }
.map-mode { position: absolute; right: 10px; top: 10px; }
.map-mode select { height: 32px; border: none; border-radius: 7px; padding: 0 30px 0 12px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2333455f' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; appearance: none; box-shadow: 0 1px 4px rgba(0,0,0,.25); font-size: 13px; cursor: pointer; }
.map-legend { position: absolute; left: 10px; bottom: 10px; background: rgba(255,255,255,.94); border-radius: 7px; padding: 6px 10px; display: flex; gap: 12px; font-size: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend i { width: 11px; height: 11px; border-radius: 3px; }

/* ---------- Меню, окна, уведомления ---------- */
.popmenu { position: fixed; z-index: 1500; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 36px rgba(16,34,64,.18); padding: 5px; min-width: 210px; max-width: 360px; max-height: 70vh; overflow: auto; }
.pm-item { display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: none; text-align: left; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; color: #1f3350; }
.pm-item:hover { background: #f1f5fb; }
.pm-item:disabled { opacity: .45; cursor: default; background: none; }
.pm-item.danger { color: #c62f34; }
.pm-ic { color: #50627d; display: inline-flex; }
.pm-item.danger .pm-ic { color: #c62f34; }
.pm-check { width: 16px; color: var(--primary); display: inline-flex; }
.pm-text { display: flex; flex-direction: column; }
.pm-text small { color: var(--muted); font-size: 11.5px; }
.pm-div { height: 1px; background: var(--line2); margin: 4px 6px; }
.pm-head { padding: 6px 10px 4px; font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.notif-menu { width: 360px; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 8px; border-bottom: 1px solid var(--line2); margin-bottom: 4px; }
.notif { display: flex; gap: 10px; padding: 8px; border-radius: 7px; color: var(--text); font-size: 13px; }
.notif:hover { background: #f1f5fb; }
.notif i { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: transparent; }
.notif.unread i { background: var(--primary); }
.notif span { display: flex; flex-direction: column; gap: 2px; }
.notif small { color: var(--muted); font-size: 11.5px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 1200; background: rgba(9, 22, 42, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow: auto; opacity: 0; transition: opacity .16s; }
.modal-backdrop.show { opacity: 1; }
.modal { width: 520px; max-width: 100%; background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.25); transform: translateY(8px); transition: transform .16s; }
.modal-backdrop.show .modal { transform: none; }
.modal.wide { width: 760px; }
.modal.xwide { width: 1040px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 6px; }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 10px 20px 6px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px 18px; align-items: center; }
.modal-foot .grow { flex: 1; }
.modal-err { margin: 4px 20px 0; padding: 8px 12px; background: var(--red-l); color: #b42318; border-radius: 8px; font-size: 13px; white-space: pre-line; }
.confirm-text { font-size: 14px; color: #2b3c55; line-height: 1.5; padding: 4px 0 8px; }
#toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 2100; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { display: flex; gap: 10px; align-items: flex-start; background: #0f2342; color: #fff; padding: 11px 14px; border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.25); font-size: 13.5px; max-width: 440px; opacity: 0; transform: translateY(10px); transition: .25s; }
.toast.show { opacity: 1; transform: none; }
.toast.success .ic { color: #4ade80; }
.toast.error { background: #7f1d1d; }
.toast.info .ic { color: #7cb4ff; }
.toast.warn .ic { color: #fbbf24; }

.empty { text-align: center; color: var(--muted); padding: 28px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .ic { color: #a5b3c6; }
.empty h4 { color: #2b3c55; font-size: 15px; }
.empty .btn { margin-top: 8px; }
.err-pre { white-space: pre-wrap; font-size: 12px; color: #b42318; }
.note { display: flex; gap: 10px; background: #f2f7ff; border: 1px solid #d6e5fd; border-radius: 10px; padding: 12px 14px; font-size: 12.5px; color: #284772; line-height: 1.5; }
.note .ic { color: var(--primary); margin-top: 1px; }
.note.warn { background: #fff8eb; border-color: #fbe2b2; color: #7a4b00; }
.note.warn .ic { color: var(--orange); }
.note ul { margin: 4px 0 0; padding-left: 18px; }
.note b { color: #183259; }

/* ---------- Главная ---------- */
.quick-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1350px) { .quick-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.quick { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 12px; border: 1px solid; color: inherit; transition: transform .15s, box-shadow .15s; }
.quick:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(16,34,64,.08); }
.quick .q-ic { width: 52px; height: 52px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: #fff; flex: none; }
.quick b { font-size: 16px; display: block; color: #0e2342; }
.quick span { font-size: 13px; color: #4b5c75; }
.quick .chev { margin-left: auto; }
.quick.blue { background: #f3f8ff; border-color: #d6e5fd; } .quick.blue .q-ic, .quick.blue .chev { color: var(--primary); }
.quick.purple { background: #f6f2ff; border-color: #e1d6fb; } .quick.purple .q-ic, .quick.purple .chev { color: var(--purple); }
.quick.green { background: #f1faf4; border-color: #cdebd7; } .quick.green .q-ic, .quick.green .chev { color: var(--green); }
.quick.orange { background: #fff7ec; border-color: #fbe2bd; } .quick.orange .q-ic, .quick.orange .chev { color: var(--orange); }

/* ---------- Проекты ---------- */
.tree { font-size: 13.5px; }
.tree-search { display: flex; gap: 10px; margin-bottom: 10px; }
.tree-search .input { padding-left: 32px; }
.tree-search .sw { position: relative; flex: 1; }
.tree-search .sw .ic { position: absolute; left: 10px; top: 9px; color: #7b8aa0; }
.t-node { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 4px 0 calc(var(--lvl, 0) * 20px + 6px); border-radius: 7px; cursor: pointer; color: #1d3150; position: relative; }
.t-node:hover { background: #f3f7fc; }
.t-node.on { background: #e9f1ff; color: #0e2342; font-weight: 600; }
.t-node .tw { width: 16px; display: inline-flex; color: #50627d; }
.t-node .tw.closed .ic { transform: rotate(-90deg); }
.t-node .ti { color: var(--primary); display: inline-flex; }
.t-node .tl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-node.lvl0 { font-weight: 700; }
.t-node.lvl1 { font-weight: 600; }
.t-node .kebab { opacity: .7; }
.t-node:hover .kebab { opacity: 1; }
.status-legend { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; color: #33455f; }
.status-legend div { display: flex; align-items: center; gap: 8px; }
.blk-head { display: flex; gap: 12px; align-items: center; padding: 4px 0 12px; border-bottom: 1px solid var(--line2); margin-bottom: 6px; }
.blk-head .ic-box { width: 46px; height: 46px; border-radius: 10px; background: var(--primary-l); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.blk-head b { font-size: 17px; display: block; }
.blk-head small { color: var(--muted); }
.icon-act { display: inline-flex; color: var(--primary); cursor: pointer; padding: 2px; border-radius: 5px; }
.icon-act:hover { background: var(--primary-l); }

/* ---------- Исходные данные ---------- */
.ptable td { padding: 6px 6px; }
.ptable th { padding: 8px 6px; }
.ptable .pname { font-weight: 500; min-width: 150px; }
.ptable .pname small { display: block; color: var(--muted); font-size: 11px; }
.cell-in { width: 74px; height: 32px; border: 1px solid #d3dce8; border-radius: 7px; text-align: center; font-size: 13px; outline: none; background: #fff; font-variant-numeric: tabular-nums; }
.cell-in:focus { border-color: #8db6fa; box-shadow: 0 0 0 3px rgba(30,111,241,.12); }
.cell-in:disabled { background: transparent; border-color: transparent; color: #9aa6b8; }
.dist-sel { height: 32px; font-size: 12.5px; width: 122px; }
.ptable tr.err td { background: #fff8f8; }
.ptable tr.picked td { background: #f2f7ff; }
.p-err { color: var(--red); font-size: 11px; display: block; margin-top: 2px; }
.dist-ic { cursor: pointer; display: inline-flex; }
.formula-box { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.formula { font-family: var(--math); font-style: italic; font-size: 24px; color: #14243c; white-space: nowrap; }
.formula sub { font-size: .62em; font-style: italic; }
.formula.sm { font-size: 20px; }
.legend-list { font-size: 12.5px; color: #33455f; line-height: 1.75; border-left: 1px solid var(--line); padding-left: 18px; flex: 1; min-width: 260px; }
.legend-list i { font-family: var(--math); font-size: 14px; color: #14243c; display: inline-block; min-width: 30px; }
.preview-stats { background: #f5f8fc; border-radius: 10px; padding: 10px 14px; font-family: var(--math); font-size: 15px; text-align: center; line-height: 1.7; color: #1d3150; }
.prev-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.corr-tbl { border-collapse: separate; border-spacing: 2px; font-size: 12.5px; }
.corr-tbl th { font-weight: 700; color: #1d3150; padding: 4px 6px; font-family: var(--math); font-size: 13.5px; }
.corr-tbl td { width: 52px; height: 28px; text-align: center; border-radius: 3px; font-variant-numeric: tabular-nums; }
.corr-tbl td input { width: 100%; height: 28px; border: 1px solid transparent; background: transparent; text-align: center; font-size: 12.5px; outline: none; border-radius: 3px; }
.corr-tbl td input:hover { border-color: rgba(30,111,241,.4); }
.corr-tbl td input:focus { border-color: var(--primary); background: #fff; }
.corr-wrap { display: flex; gap: 14px; align-items: stretch; }
.corr-scale { width: 14px; border-radius: 3px; background: linear-gradient(180deg, #ef4444, #fecaca 35%, #fff 50%, #bfdbfe 65%, #2563eb); position: relative; flex: none; }
.corr-scale-l { display: flex; flex-direction: column; justify-content: space-between; font-size: 11.5px; color: #4b5c75; }

/* ---------- Моделирование ---------- */
.progress { height: 12px; background: #e8edf4; border-radius: 6px; overflow: hidden; flex: 1; }
.progress i { display: block; height: 100%; background: var(--primary); border-radius: 6px; transition: width .2s; }
.prog-row { display: flex; align-items: center; gap: 12px; margin: 10px 0 12px; }
.prog-row b { font-size: 15px; min-width: 44px; text-align: right; }
.prog-grid { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; font-size: 13px; color: #33455f; }
.prog-grid span:nth-child(even) { text-align: right; }
.log { font-size: 12.5px; max-height: 190px; overflow: auto; border: 1px solid var(--line2); border-radius: 8px; padding: 4px 10px; }
.log-row { display: grid; grid-template-columns: 66px 22px minmax(0, 1fr); align-items: center; padding: 4px 0; border-bottom: 1px solid #f1f4f8; color: #2b3c55; }
.log-row:last-child { border-bottom: none; }
.log-row time { color: #4b5c75; font-variant-numeric: tabular-nums; }
.lg-ok { color: var(--green); display: inline-flex; }
.lg-warn { color: var(--orange); display: inline-flex; }
.lg-error { color: var(--red); display: inline-flex; }
.lg-run { color: var(--primary); display: inline-flex; }
.success-box { text-align: center; background: #eef9f1; border-radius: 12px; padding: 18px 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.success-box .big-ic { width: 44px; height: 44px; border-radius: 50%; background: #22a447; color: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.success-box b { color: #157a39; font-size: 15px; }
.success-box span { color: #44556e; font-size: 13px; }
.idle-box { background: #f5f8fc; }
.idle-box .big-ic { background: #a3afc0; }
.idle-box b { color: #33455f; }
.chk-list { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line2); border-radius: 10px; padding: 12px 14px; }
.collapse-head { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; padding: 8px 0; font-size: 13.5px; }
.collapse-head .ic { transition: transform .15s; }
.collapse-head.closed .ic { transform: rotate(-90deg); }

/* ---------- Сценарии ---------- */
.scn-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.scn-card { padding: 16px; position: relative; cursor: pointer; }
.scn-card.cur { border: 2px solid #6fa2f5; background: #f6faff; padding: 15px; }
.scn-card .sc-head { display: flex; align-items: center; gap: 8px; }
.scn-card .sc-head b { font-size: 15.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scn-card p { font-size: 12.5px; color: #4b5c75; margin: 8px 0 12px; line-height: 1.45; min-height: 36px; }
.scn-card .kv { grid-template-columns: 82px 1fr; font-size: 12.5px; }
.scn-card .kv > div { padding: 3px 0; border: none; }
.scn-card .cmp { position: absolute; right: 14px; bottom: 14px; }
.star { color: #f5a524; display: inline-flex; cursor: pointer; }
.star.off { color: #b8c3d2; }
.col-scn { font-weight: 700; text-align: right; }
.scn-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.mgmt-list { display: flex; flex-direction: column; gap: 2px; }
.mgmt-list button { display: flex; align-items: center; gap: 10px; border: none; background: none; padding: 7px 4px; text-align: left; cursor: pointer; font-size: 13px; color: #1f3350; border-radius: 6px; }
.mgmt-list button:hover { background: #f1f5fb; }
.mgmt-list button:disabled { opacity: .45; cursor: default; }
.mgmt-list .ic { color: var(--primary); }
.mgmt-list .danger, .mgmt-list .danger .ic { color: #d1373c; }
.mgmt-list h5 { margin: 10px 0 4px; font-size: 13.5px; color: #11233d; }

/* ---------- Отчёты ---------- */
.rep-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .rep-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rep-stat { display: flex; flex-direction: row; align-items: center; gap: 14px; padding: 14px 16px; }
.rep-stat .rs-ic { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.rep-stat b { font-size: 22px; display: block; }
.rep-stat span { font-size: 12.5px; color: #4b5c75; }
.rep-stat .spark { margin-left: auto; width: 110px; height: 46px; }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tpl-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1350px) { .tpl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tpl-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #fff; }
.tpl-thumb { height: 128px; border-radius: 8px; overflow: hidden; background: #f4f7fb; border: 1px solid var(--line2); }
.tpl-thumb svg { width: 100%; height: 100%; display: block; }
.tpl-card b { font-size: 14.5px; margin-top: 4px; }
.tpl-card p { font-size: 12.5px; color: #4b5c75; flex: 1; line-height: 1.45; }
.file-ic { display: inline-flex; width: 26px; height: 26px; border-radius: 6px; align-items: center; justify-content: center; color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .3px; flex: none; }
.file-ic.pdf { background: #ef4444; } .file-ic.xlsx { background: #1f9d4a; } .file-ic.doc { background: #2563eb; } .file-ic.csv { background: #0d9488; }
.rep-name { display: flex; align-items: center; gap: 10px; font-weight: 600; color: #1d3150; }
.act-btn { width: 34px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; color: var(--primary); cursor: pointer; }
.act-btn:hover { background: var(--primary-l); }
.rv-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) 270px; gap: 16px; align-items: start; }
@media (max-width: 1350px) { .rv-layout { grid-template-columns: 230px minmax(0, 1fr); } .rv-right { grid-column: span 2; } }
.rv-tree .t-node { height: 32px; font-size: 12.5px; }
.rv-tree .cnt { font-size: 11px; background: #eef2f7; border-radius: 10px; padding: 1px 7px; color: #4b5c75; }
.form-list { display: flex; flex-direction: column; }
.form-item { display: flex; gap: 12px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--line2); cursor: pointer; border-radius: 6px; }
.form-item:hover { background: #f6f9fd; }
.form-item:last-child { border-bottom: none; }
.form-item .fi-ic { width: 36px; height: 36px; border-radius: 8px; background: var(--primary-l); color: var(--primary); display: flex; align-items: center; justify-content: center; flex: none; }
.form-item .fi-ic.green { background: var(--green-l); color: var(--green); }
.form-item .fi-ic.red { background: var(--red-l); color: var(--red); }
.form-item b { font-size: 13px; display: block; }
.form-item small { font-size: 11.5px; color: var(--muted); line-height: 1.35; display: block; }
.form-item .chev { margin-left: auto; color: #8a99ae; }
.summary-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1350px) { .summary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sum-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.sum-card .sc-t { display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: #33455f; }
.sum-card .sc-t .ic { color: var(--green); }
.sum-card .big { font-size: 24px; font-weight: 700; margin: 6px 0 0; }
.sum-card .big small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.sum-card .rows { margin-top: 8px; font-size: 12.5px; }
.sum-card .rows div { display: flex; justify-content: space-between; padding: 3px 0; }
.sum-card .rows div span:first-child { color: #4b5c75; }

/* ---------- Справка и настройки ---------- */
.prose { font-size: 14px; line-height: 1.65; color: #23344d; max-width: 980px; }
.prose h2 { font-size: 19px; margin: 18px 0 8px; color: #0e2342; }
.prose h3 { font-size: 16px; margin: 14px 0 6px; color: #0e2342; }
.prose p { margin: 6px 0; }
.prose ul, .prose ol { margin: 6px 0; padding-left: 22px; }
.prose code { background: #eef2f7; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.prose .formula { display: block; margin: 8px 0; }
.toc { display: flex; flex-direction: column; gap: 4px; font-size: 13px; position: sticky; top: 76px; }
.toc a { padding: 6px 10px; border-radius: 6px; color: #33455f; }
.toc a:hover { background: #eef3fb; color: var(--primary); }
.picker { display: flex; flex-direction: column; gap: 14px; }
.picker-field h4 { font-size: 14px; margin-bottom: 8px; display: flex; align-items: center; }
.picker-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.picker-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); }
.picker-item:hover { border-color: #a9c6f7; background: #f8fbff; }
.picker-item .ic { color: var(--primary); }
.picker-item span { flex: 1; display: flex; flex-direction: column; }
.picker-item small { color: var(--muted); font-size: 12px; }
.store-bar { height: 8px; background: #e8edf4; border-radius: 4px; overflow: hidden; margin-top: 6px; }
.store-bar i { display: block; height: 100%; background: var(--primary); }

/* ---------- Серверный режим: вход, роли, синхронизация ---------- */
#login-screen { position: fixed; inset: 0; z-index: 1100; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 1fr); background: var(--bg); }
.login-side { background: linear-gradient(160deg, #0c2340 0%, #123a6b 60%, #1e5fc4 100%); color: #dbe7f7; padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 36px; }
.login-brand { display: flex; flex-direction: column; gap: 10px; }
.login-brand b { font-size: 34px; color: #fff; letter-spacing: -.3px; }
.login-brand span { font-size: 16px; color: #a9c1e2; max-width: 420px; line-height: 1.5; }
.login-points { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; color: #c9d9ef; }
.login-main { display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 380px; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 30px 30px 24px; box-shadow: 0 20px 60px rgba(16,34,64,.12); }
.login-card h2 { font-size: 22px; margin-bottom: 18px; color: #0e2342; }
@media (max-width: 860px) { #login-screen { grid-template-columns: 1fr; } .login-side { display: none; } }
.sync-state { font-size: 12px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.sync-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #22a447; }
.sync-state.saving::before { background: var(--primary); animation: pulse 1s infinite; }
.sync-state.err { color: #b42318; }
.sync-state.err::before { background: var(--red); }
@keyframes pulse { 50% { opacity: .3; } }
body.role-viewer [data-perm="edit"] { display: none !important; }
body.role-superadmin .search-wrap, body.role-superadmin #bell { visibility: hidden; }
body.role-viewer .view-input .card-body input, body.role-viewer .view-input .card-body textarea,
body.role-viewer .view-input .card-body select:not(#prev-sel), body.role-viewer .view-model .card-body input,
body.role-viewer .view-model .card-body select, body.role-viewer .view-scenarios textarea { pointer-events: none; background-color: #f6f8fb; }
.ro-note { margin-bottom: 0; }
code.temp-pass { font-size: 16px; background: #eef3fb; padding: 4px 10px; border-radius: 6px; letter-spacing: .5px; user-select: all; }
.crumb-back { border: none; background: none; cursor: pointer; color: var(--muted); padding: 0; display: inline-flex; }
.toc button { border: none; background: none; text-align: left; font: inherit; font-size: 13px; padding: 6px 10px; border-radius: 6px; color: #33455f; cursor: pointer; }
.toc button:hover { background: #eef3fb; color: var(--primary); }
.role-pill { display: inline-flex; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--gray-l); color: #44556e; }
.role-pill.admin { background: var(--purple-l); color: var(--purple); }
.role-pill.geologist { background: var(--primary-l); color: var(--primary); }
.role-pill.viewer { background: var(--orange-l); color: #a35f00; }

@media print {
  .sidebar, .topbar, .head-actions, #toast-root { display: none !important; }
  .main { overflow: visible; }
  .app { height: auto; }
}
