/* WindowFlow — оформление интерфейса.
   Плотная аналитическая сетка, тёмный сайдбар, светлое рабочее поле. */

[hidden] { display: none !important; }


:root {
  --ink: #101828;
  --ink-2: #475467;
  --muted: #667085;
  --line: #E4E7EC;
  --line-2: #EEF1F5;
  --bg: #F5F7FA;
  --card: #FFFFFF;
  --brand: #0B2740;
  --brand-2: #0F3352;
  --accent: #2563EB;
  --accent-soft: #EAF0FE;
  --teal: #0E9384;
  --amber: #C77A0A;
  --red: #D92D20;
  --green: #12805C;
  --purple: #6941C6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Segoe UI", Inter, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

.layout { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }

/* ------------------------------------------------------------- сайдбар */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px 18px;
  color: #C6D2DF;
  background: linear-gradient(180deg, #0C2438 0%, #0A1D2E 60%, #091A29 100%);
  border-right: 1px solid #0A1F31;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: #fff;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .35);
}
.brand-logo { width: 26px; height: 26px; object-fit: contain; display: block; }
.login-logo-img { width: 72px; height: 72px; object-fit: contain; display: block; margin: 0 auto 10px; }
.brand-name { font-size: 15px; font-weight: 650; color: #fff; letter-spacing: .01em; }
.brand-sub { font-size: 11px; color: #7E93A8; letter-spacing: .04em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: #9DB0C4; font-size: 13.5px; font-weight: 500;
  border: 0; background: none; cursor: pointer; text-align: left; width: 100%;
  transition: background .12s, color .12s;
}
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .05); color: #DCE6F1; }
.nav-item.active { background: rgba(46, 107, 230, .18); color: #FFFFFF; box-shadow: inset 3px 0 0 #4F8DF7; }
.nav-item.active svg { opacity: 1; }
.nav-sep { height: 1px; background: rgba(255,255,255,.07); margin: 8px 6px; }
.nav-caption { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #5F7387; padding: 8px 12px 2px; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.model-card {
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 12px;
  color: #93A7BB;
}
.model-card b { color: #E7EEF6; font-weight: 600; }
.model-card .row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.demo-flag {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: #F5C97A;
  background: rgba(199, 122, 10, .14);
  border: 1px solid rgba(199, 122, 10, .3);
  border-radius: 8px; padding: 7px 9px;
}

/* ------------------------------------------------------------ рабочая зона */

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
  background: rgba(245, 247, 250, .88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
.topbar .sub { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.view { padding: 20px 28px 56px; max-width: 1580px; width: 100%; }

/* ------------------------------------------------------------------ сетка */

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-12 { grid-column: span 12; }
.stack { display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 1240px) {
  .col-3 { grid-column: span 6; }
  .col-4 { grid-column: span 6; }
  .col-5, .col-7, .col-8, .col-9 { grid-column: span 12; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-caption, .nav-sep, .side-foot { display: none; }
  .view, .topbar { padding-left: 16px; padding-right: 16px; }
  .col-3, .col-4, .col-6 { grid-column: span 12; }
}

/* ------------------------------------------------------------------ карточки */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 18px 0;
}
.card-title { font-size: 14px; font-weight: 650; letter-spacing: -.005em; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 14px 18px 18px; }
.card-body.tight { padding: 8px 8px 8px; }
.card-body.flush { padding: 0; }

.kpi { padding: 15px 16px 14px; }
.kpi-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .075em;
  color: var(--muted); font-weight: 600;
}
.kpi-value { font-size: 27px; font-weight: 650; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi-foot { font-size: 12px; color: var(--muted); margin-top: 5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* --------------------------------------------------------------- типографика */

.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.mono { font-variant-numeric: tabular-nums; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
h2.section { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 4px 0 0; font-weight: 600; }

/* ------------------------------------------------------------------- пилюли */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: #F2F4F7; color: var(--ink-2);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: #E7F6EF; color: #0B6B4B; }
.pill.warn { background: #FDF3E2; color: #9A5B00; }
.pill.danger { background: #FDECEA; color: #B42318; }
.pill.info { background: var(--accent-soft); color: #1D4ED8; }
.pill.demo { background: #F4F0FF; color: #5B3AA8; }
.pill.muted { background: #F2F4F7; color: #667085; }
.pill.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-2); }

/* -------------------------------------------------------------------- кнопки */

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 13px; font-weight: 550; cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s;
  white-space: nowrap;
}
.btn:hover { background: #F9FAFB; border-color: #D0D5DD; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(37, 99, 235, .3); }
.btn-primary:hover { background: #1D4ED8; border-color: #1D4ED8; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: #EEF1F5; }
.btn-danger { color: #B42318; border-color: #F3C7C2; }
.btn-danger:hover { background: #FEF3F2; }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* -------------------------------------------------------------------- таблицы */

.table-wrap { overflow: auto; border-radius: 0 0 var(--radius) var(--radius); }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.data th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 600;
  background: #FBFCFD; border-bottom: 1px solid var(--line);
  padding: 9px 12px; white-space: nowrap;
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tbody tr:hover { background: #FAFBFD; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.right, table.data th.right { text-align: right; }
table.data tr.clickable { cursor: pointer; }
table.data .num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------- разное */

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.period-dates { display: flex; align-items: center; gap: 6px; }
.period-dates input {
  border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px;
  font: inherit; font-size: 12.5px; background: #fff; color: var(--ink);
}
.period-dates input:focus { outline: 2px solid rgba(37, 99, 235, .18); border-color: #84ADFF; }
.map-input {
  border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px;
  font: inherit; font-size: 12.5px; width: 100%; background: #fff; color: var(--ink);
}
.map-input:focus { outline: 2px solid rgba(37, 99, 235, .18); border-color: #84ADFF; }
.req-date {
  border: 1px solid var(--line); border-radius: 7px; padding: 4px 6px;
  font: inherit; font-size: 12.5px; background: #fff; color: var(--ink); min-width: 128px;
}
.req-date:focus { outline: 2px solid rgba(37, 99, 235, .18); border-color: #84ADFF; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 999px; padding: 4px 11px; font-size: 12px; cursor: pointer; font-weight: 550;
}
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px;
  min-width: 240px;
}
.search input { border: 0; outline: none; font: inherit; width: 100%; background: transparent; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px;
  font: inherit; font-size: 13px; background: #fff; color: var(--ink); width: 100%;
}
.field input:focus, .field select:focus { outline: 2px solid rgba(37, 99, 235, .18); border-color: #84ADFF; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: span 2; }

/* --------------------------------------------------------------- графики */

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis-label { font-size: 10.5px; fill: #98A2B3; }
.chart .grid-line { stroke: #EEF1F5; stroke-width: 1; }
.chart .value-label { font-size: 10.5px; fill: #667085; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }

.barlist { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 172px 1fr 92px; gap: 10px; align-items: center; }
.bar-row .bar-label { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; background: #F0F2F5; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--accent); }
.bar-row .bar-val { text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink); }

.progress { height: 7px; background: #F0F2F5; border-radius: 999px; overflow: hidden; position: relative; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.progress .marker { position: absolute; top: -2px; width: 2px; height: 11px; background: #98A2B3; }

/* --------------------------------------------------------------- заказы */

.order-row-grid { display: grid; grid-template-columns: 96px minmax(0, 1fr) 92px 120px 110px 130px; gap: 12px; align-items: center; }

.status-line { display: flex; gap: 4px; }
.status-seg { height: 4px; flex: 1; border-radius: 999px; background: #EDF0F4; }
.status-seg.done { background: var(--teal); }
.status-seg.current { background: var(--accent); }

.timeline { display: flex; flex-direction: column; gap: 14px; }
.tl-item { display: grid; grid-template-columns: 14px 1fr; gap: 10px; position: relative; }
.tl-item::before { content: ""; position: absolute; left: 6px; top: 18px; bottom: -16px; width: 1px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 13px; height: 13px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); background: #fff; margin-top: 4px; }
.tl-item.done .tl-dot { background: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.tl-item.current .tl-dot { background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tl-title { font-size: 12.5px; font-weight: 600; }
.tl-body { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.tl-body input { max-width: 160px; }

.forecast-hero { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.forecast-days { font-size: 40px; font-weight: 650; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.forecast-days small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.forecast-range { font-size: 12.5px; color: var(--muted); }

.contrib { display: flex; flex-direction: column; gap: 7px; }
.contrib-row { display: grid; grid-template-columns: minmax(0, 1fr) 132px 62px; gap: 10px; align-items: center; font-size: 12.5px; }
.contrib-row > div:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contrib-row .bar-track { height: 6px; }
.contrib-row .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.contrib-row .val.pos { color: #B42318; }
.contrib-row .val.neg { color: #0B6B4B; }

.alert { display: flex; gap: 9px; padding: 9px 12px; border-radius: 9px; font-size: 12.5px; border: 1px solid; }
.alert.info { background: #F5F8FF; border-color: #D7E3FB; color: #1D4ED8; }
.alert.warning { background: #FFFBF2; border-color: #F7E2BC; color: #9A5B00; }
.alert.danger { background: #FEF4F3; border-color: #F7D2CE; color: #B42318; }

/* --------------------------------------------------------------- загрузка */

.dropzone {
  border: 1.5px dashed #C9D2DE; border-radius: var(--radius);
  background: #FBFCFE; padding: 22px;
  display: flex; align-items: center; gap: 16px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: #F5F8FF; }
.dropzone .dz-icon {
  width: 42px; height: 42px; border-radius: 10px; background: var(--accent-soft);
  display: grid; place-items: center; color: var(--accent); flex: 0 0 42px;
}
.dropzone .dz-title { font-weight: 600; font-size: 13.5px; }
.dropzone .dz-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.preview-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; }
.preview-card.selected { border-color: #84ADFF; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.preview-card h4 { margin: 0 0 2px; font-size: 13.5px; }
.preview-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.preview-reason { font-size: 11.5px; color: var(--ink-2); margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--line); }

.empty { text-align: center; padding: 34px 20px; color: var(--muted); font-size: 13px; }

.toast-wrap { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  background: #101828; color: #fff; padding: 10px 14px; border-radius: 9px;
  font-size: 12.5px; box-shadow: 0 8px 24px rgba(16, 24, 40, .22);
  animation: toast-in .18s ease-out;
  max-width: 360px;
}
.toast.error { background: #B42318; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.skeleton { background: linear-gradient(90deg, #EEF1F5 25%, #F6F8FA 37%, #EEF1F5 63%); background-size: 400% 100%; animation: sk 1.2s ease infinite; border-radius: 6px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.hr { height: 1px; background: var(--line-2); margin: 4px 0; }

.split { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line-2); font-size: 12.5px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; font-variant-numeric: tabular-nums; }

.badge-count {
  display: inline-flex; min-width: 18px; height: 18px; align-items: center; justify-content: center;
  padding: 0 5px; border-radius: 9px; background: #EEF1F5; color: var(--ink-2);
  font-size: 11px; font-weight: 600;
}

details.bom summary { cursor: pointer; color: var(--accent); font-size: 12px; }
details.bom summary::-webkit-details-marker { display: none; }
details.bom table { margin-top: 8px; }

.note {
  background: #FBFCFE; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; font-size: 12px; color: var(--ink-2); line-height: 1.5;
}
.note b { color: var(--ink); }
code.inline { background: #F2F4F7; border-radius: 4px; padding: 1px 5px; font-size: 11.5px; word-break: break-all; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; color: var(--ink-2); }
.switch input {
  appearance: none; -webkit-appearance: none;
  width: 38px; height: 21px; border-radius: 999px; background: #D0D5DD;
  position: relative; cursor: pointer; transition: background .15s; border: 0; margin: 0;
}
.switch input::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
  border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(16,24,40,.25);
}
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(17px); }

/* --------------------------------------------------------------- персонал */

.calendar { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.calendar th, .calendar td { border-bottom: 1px solid var(--line-2); padding: 0; }
.calendar thead th {
  position: sticky; top: 0; z-index: 2; background: #FBFCFD;
  font-size: 10px; color: var(--muted); font-weight: 600; text-align: center;
  padding: 6px 0; border-bottom: 1px solid var(--line);
}
.calendar thead th.name-col { text-align: left; padding-left: 14px; min-width: 190px; }
.calendar tbody th {
  text-align: left; padding: 6px 14px; font-weight: 600; font-size: 12.5px;
  background: #fff; position: sticky; left: 0; z-index: 1; border-right: 1px solid var(--line-2);
}
.calendar tbody th .role { display: block; font-size: 10.5px; color: var(--muted); font-weight: 500; }
.cal-day { text-align: center; cursor: pointer; user-select: none; }
.cal-day:hover { background: #F5F8FF; }
.cal-day.weekend { background: #FAFBFC; }
.cal-cell {
  display: block; width: 26px; height: 26px; line-height: 26px; margin: 1px auto;
  border-radius: 6px; font-size: 10.5px; font-weight: 700; color: transparent;
}
.cal-cell.has { color: #fff; }
.cal-cell.vac { background: #2563EB; }
.cal-cell.sick { background: #D92D20; }
.cal-cell.abs { background: #C77A0A; }
.cal-cell.study { background: #6941C6; }
.cal-cell.off { background: #98A2B3; }
.cal-cell.other { background: #0E9384; }
.cal-total { text-align: right; padding-right: 14px; font-variant-numeric: tabular-nums; color: var(--muted); }

.day-menu {
  position: absolute; z-index: 200; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(16, 24, 40, .18); padding: 8px; width: 190px;
}
.day-menu-title { font-size: 11px; color: var(--muted); padding: 2px 4px 7px; font-weight: 600; }
.day-menu button {
  display: block; width: 100%; text-align: left; border: 0; background: none; cursor: pointer;
  padding: 6px 8px; border-radius: 7px; font-size: 12.5px; color: var(--ink);
}
.day-menu button:hover { background: #F2F4F7; }
.day-menu button.active { background: var(--accent-soft); color: #1D4ED8; font-weight: 600; }

.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }

/* Ламинация: компактные поля, чтобы реестр влезал в таблицу */
.lam-table td:first-child { white-space: nowrap; }
.lam-table .pill { white-space: nowrap; }
.lam-field { padding: 5px 6px; font-size: 12px; }
.lam-field[type="date"] { width: 138px; }
.lam-num { width: 74px; text-align: right; }
.lam-text { width: 118px; }

/* Вход и роли */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: radial-gradient(900px 500px at 20% 0%, #E8F0FF 0%, #F5F7FA 55%, #EEF2F7 100%);
}
.login-card {
  width: 100%; max-width: 390px; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 28px; box-shadow: 0 18px 50px rgba(16, 24, 40, .14);
}
.login-logo { font-size: 24px; font-weight: 750; color: #1D4ED8; letter-spacing: -.02em; }
.login-sub { color: var(--muted); margin: 4px 0 18px; font-size: 13px; }
.login-card .field { margin-bottom: 12px; }
.login-submit { width: 100%; justify-content: center; margin-top: 6px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-right .topbar-actions { margin-left: 0; }
.user-chip { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.user-card {
  display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 10px;
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.07);
}
.user-card-info { min-width: 0; flex: 1; }
.user-name { color: #fff; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { color: #9DB0C4; font-size: 11px; }
.user-card .btn { padding: 4px 8px; }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.perm-group { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.perm-group-title { font-weight: 650; font-size: 13px; margin-bottom: 2px; }
.perm-group-sub { color: var(--muted); font-size: 11.5px; margin-bottom: 8px; }
.perm-item { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-top: 1px dashed #EEF1F5; }
.perm-item input { margin-top: 2px; }
.perm-item b { display: block; font-size: 12.5px; font-weight: 600; }
.perm-item small { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; }
.role-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.role-head { display: flex; gap: 10px; align-items: flex-start; }
.role-head h3 { margin: 0; font-size: 15px; }
.role-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

@media (max-width: 820px) {
  .layout { display: block; }
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: 64px; width: auto;
    z-index: 100; flex-direction: row; align-items: center; padding: 0 6px;
  }
  .brand, .side-foot, .nav-sep, .nav-caption { display: none !important; }
  .nav { flex-direction: row; overflow-x: auto; width: 100%; gap: 2px; padding: 6px 2px; }
  .nav-item {
    flex: 0 0 auto; flex-direction: column; gap: 2px; font-size: 10px;
    padding: 6px 9px; width: auto; text-align: center;
  }
  .nav-item svg { width: 20px; height: 20px; }
  .main { padding-bottom: 76px; }
  .topbar { padding: 12px 14px; gap: 8px; }
  .topbar h1 { font-size: 17px; }
  .topbar .sub { font-size: 11.5px; }
  .topbar-right { gap: 6px; }
  .user-chip { display: none; }
  .view { padding: 14px 12px 32px; }
  .grid { gap: 12px; }
  .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-12 { grid-column: 1 / -1; }
  .card-head { padding: 12px 14px; }
  .card-body { padding: 14px; }
  .form-grid { grid-template-columns: 1fr !important; }
  .form-grid .full { grid-column: 1 / -1; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.data { font-size: 11.5px; }
  table.data th, table.data td { padding: 7px 8px; }
  .login-card { padding: 22px; border-radius: 14px; }
  .perm-grid { grid-template-columns: 1fr; }
  .chips { flex-wrap: wrap; }
}


