/* ═══════════════════════════════════════════════════════════
   ТЕКАР ГРУПП — дашборд (стили)
   Основан на прототипе, расширен для полного приложения
════════════════════════════════════════════════════════════ */

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

:root {
  --bg:          #f0f4f8;
  --card:        #fff;
  --header:      #1a2744;
  --accent:      #2563eb;
  --green:       #16a34a;
  --green-light: #dcfce7;
  --red:         #dc2626;
  --red-light:   #fee2e2;
  --blue:        #0ea5e9;
  --blue-light:  #dbeafe;
  --yellow:      #f59e0b;
  --text:        #1e293b;
  --muted:       #64748b;
  --border:      #e2e8f0;
  --subtle:      #f8fafc;
}

/* ──────────────────────────────────────────────────────────────
   IAM (users & access) — in-app styles
   ────────────────────────────────────────────────────────────── */
.iam-wrap{display:flex; flex-direction:column; gap:12px;}
.iam-toolbar{
  display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap;
  background:var(--card); border:1px solid var(--border); border-radius:16px;
  padding:12px;
}
.iam-field label{display:block; font-size:12px; font-weight:800; color:#334155; margin-bottom:6px;}
.iam-actions{display:flex; gap:10px; align-items:center; flex-wrap:wrap;}
.iam-pill{
  display:inline-flex; align-items:center;
  background:var(--subtle); border:1px solid var(--border);
  padding:8px 10px; border-radius:999px; font-size:12px; font-weight:800; color:#334155;
}
.iam-cb{display:flex; gap:8px; align-items:center; font-size:13px; font-weight:700; color:#334155; user-select:none;}
.iam-cb input{width:16px; height:16px;}

.iam-users{display:flex; flex-direction:column; gap:10px;}
.iam-user{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  overflow:hidden;
  box-shadow:0 10px 24px rgba(15,23,42,.06);
}
.iam-user.collapsed .iam-user-body{display:none;}
.iam-user-head{
  width:100%;
  border:none;
  cursor:pointer;
  text-align:left;
  padding:12px 14px;
  display:flex; justify-content:space-between; align-items:flex-start; gap:10px;
  color:#fff;
  background:linear-gradient(135deg,#0f1f3d 0%,#1a2744 40%,#2563eb 100%);
}
.iam-user-title{font-size:15px; font-weight:900; margin:0;}
.iam-user-meta{margin-top:4px; font-size:12px; opacity:.9; font-weight:700;}
.iam-user-right{display:flex; gap:10px; align-items:flex-start;}
.iam-chev{font-size:14px; opacity:.92; transform:rotate(0deg); transition:transform .15s ease; margin-top:2px;}
.iam-user.collapsed .iam-chev{transform:rotate(-90deg);}
.iam-user-body{padding:12px 14px;}
.iam-row{display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:10px;}
.iam-badges{display:flex; flex-direction:column; gap:8px; align-items:flex-end;}
.iam-badge{
  display:inline-flex; align-items:center; justify-content:center;
  padding:4px 10px; border-radius:999px;
  background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.22);
  font-size:12px; font-weight:900; white-space:nowrap;
}
.iam-badge.ok{background:rgba(34,197,94,.22); border-color:rgba(34,197,94,.35);}
.iam-badge.bad{background:rgba(239,68,68,.20); border-color:rgba(239,68,68,.30);}
.iam-badge.warn{background:rgba(245,158,11,.22); border-color:rgba(245,158,11,.30);}

.iam-table{width:100%; border-collapse:collapse; font-size:12px; margin-top:10px;}
.iam-table th,.iam-table td{border:1px solid var(--border); padding:8px 8px; text-align:left;}
.iam-table thead th{background:#f8fafc; font-weight:900; color:#334155;}
.iam-perm{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:26px; padding:4px 8px; border-radius:999px; font-weight:900;
}
.iam-perm.y{background:var(--green-light); color:#166534;}
.iam-perm.n{background:var(--red-light); color:#991b1b;}

/* IAM modal */
.iam-modal{
  width:min(980px,96vw);
  background:#fff;
  border-radius:16px;
  overflow:hidden;
  border:1px solid var(--border);
  box-shadow:0 25px 50px rgba(0,0,0,.22);
}
.iam-modal-h{
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  padding:12px 14px;
  border-bottom:1px solid var(--border);
  background:linear-gradient(90deg,#f8fafc,#fff);
}
.iam-modal-title{font-size:15px; font-weight:900;}
.iam-modal-b{padding:14px;}
.iam-modal-f{
  padding:12px 14px;
  border-top:1px solid var(--border);
  display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap;
}
.iam-cols{display:grid; grid-template-columns:1fr 1fr; gap:14px;}
@media (max-width: 980px){ .iam-cols{grid-template-columns:1fr;} }
.iam-card{border:1px solid var(--border); border-radius:16px; overflow:hidden;}
.iam-card-h{padding:10px 12px; background:#f8fafc; border-bottom:1px solid var(--border); font-weight:900; color:#334155;}
.iam-card-b{padding:12px;}
.iam-grid2{display:grid; grid-template-columns:1fr 1fr; gap:10px 12px;}
@media (max-width: 720px){ .iam-grid2{grid-template-columns:1fr;} }
.iam-perms{display:flex; flex-direction:column; gap:10px; margin-top:10px;}
.iam-perm-row{
  display:grid;
  grid-template-columns: 1fr auto auto;
  gap:10px 12px;
  align-items:center;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  background:#fff;
}
.iam-perm-left strong{font-weight:900;}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ─── СТРАНИЦЫ ─── */
.page { display: none; }
.page.active { display: block; }

/* ─── ЛОГИН ─── */
#pg-login {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f1f3d 0%, #1a2744 40%, #2563eb 100%);
}
#pg-login.active { display: flex; }

.login-wrap {
  background: #fff;
  border-radius: 24px;
  padding: 52px 44px;
  width: 420px;
  max-width: 95vw;
  box-shadow: 0 32px 64px rgba(0,0,0,.35);
  animation: fadeUp .4s ease;
}
.login-brand { text-align: center; margin-bottom: 36px; }
.brand-logo-img { height: auto; object-fit: contain; }
/* Логотип крупно: встроенный текст «ТЕКАР ГРУПП» визуально не меньше подписи под ним */
.login-brand-logo {
  display: block;
  margin: 0 auto 18px;
  width: min(100%, 380px);
  height: auto;
  max-height: 200px;
  object-fit: contain;
}
.login-brand p {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  margin-top: 8px;
  letter-spacing: .45px;
  line-height: 1.45;
}

.login-err {
  background: #fee2e2; color: #dc2626;
  padding: 12px 16px; border-radius: 10px;
  font-size: 13px; margin-bottom: 16px;
  border-left: 4px solid #dc2626; display: none;
}
.login-err.show { display: block; }

.fg { margin-bottom: 20px; }
.fg label { display: block; font-size: 13px; font-weight: 600; color: #475569; margin-bottom: 7px; }
.fg input {
  width: 100%; padding: 13px 16px;
  border: 2px solid #e2e8f0; border-radius: 12px;
  font-size: 15px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.fg input:focus { border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37,99,235,.1); }

.fg .login-show-pass-lbl {
  display: flex; align-items: center; gap: 8px; margin-top: 10px; margin-bottom: 0;
  font-size: 13px; font-weight: 500; color: #64748b; cursor: pointer;
  user-select: none;
}
.fg .login-show-pass-lbl input[type=checkbox] {
  width: 16px; height: 16px; min-width: 16px; accent-color: #2563eb; cursor: pointer; margin: 0;
  padding: 0; border: none; box-shadow: none;
}
.fg .login-show-pass-lbl input[type=checkbox]:focus { box-shadow: none; outline: 2px solid #93c5fd; outline-offset: 2px; }
.fg .login-show-pass-lbl span { cursor: pointer; }

.btn-login {
  width: 100%; padding: 14px;
  background: #2563eb; color: #fff;
  border: none; border-radius: 12px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: all .2s; margin-top: 4px;
}
.btn-login:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(37,99,235,.35); }

.btn-super {
  width: 100%; margin-top: 12px; padding: 11px;
  background: transparent; color: #94a3b8;
  border: 2px solid #e2e8f0; border-radius: 12px;
  font-size: 13px; cursor: pointer; transition: all .2s;
}
.btn-super:hover { border-color: #2563eb; color: #2563eb; background: rgba(37,99,235,.04); }

/* ─── ШАПКА ─── */
#pg-app { display: none; flex-direction: column; min-height: 100vh; }
#pg-app.active { display: flex; }

.app-header {
  background: #1a2744;
  height: 66px;
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 4px 24px rgba(0,0,0,.25);
}
.hdr-left  { display: flex; align-items: center; gap: 24px; }
.hdr-logo {
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.1em;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
}
.hdr-logo span {
  color: #60a5fa;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.hdr-nav   { display: flex; gap: 2px; flex-wrap: nowrap; }
.nav-btn {
  padding: 8px 14px; background: transparent; border: none;
  color: #94a3b8; font-size: 13px; font-weight: 600;
  cursor: pointer; border-radius: 8px; transition: all .2s; white-space: nowrap;
}
.nav-btn:hover  { background: rgba(255,255,255,.1); color: #fff; }
.nav-btn.active { background: #2563eb; color: #fff; }
.hdr-right { display: flex; align-items: center; gap: 10px; }
.date-pill { background: rgba(255,255,255,.08); color: #94a3b8; padding: 5px 12px; border-radius: 20px; font-size: 12px; }
.user-pill { background: #2563eb; color: #fff; padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.btn-out {
  background: transparent; border: 1px solid #374151;
  color: #94a3b8; padding: 6px 12px; border-radius: 8px;
  font-size: 12px; cursor: pointer; transition: all .2s;
}
.btn-out:hover { border-color: #dc2626; color: #ef4444; }

/* ─── БУРГЕР МЕНЮ (мобильный) ─── */
.burger-btn {
  display: none;
  position: fixed; top: 14px; right: 16px; z-index: 300;
  background: #2563eb; color: #fff; border: none;
  width: 40px; height: 40px; border-radius: 10px;
  font-size: 18px; cursor: pointer;
}
.mobile-nav {
  display: none;
  position: fixed; top: 66px; left: 0; right: 0;
  background: #1a2744; z-index: 199;
  padding: 12px; flex-direction: column; gap: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.mobile-nav.open  { display: flex; }
.mobile-nav .nav-btn { text-align: left; color: #cbd5e1; }

/* ─── КОНТЕНТ ─── */
.app-content {
  flex: 1; padding: 28px 32px;
  max-width: 1600px; width: 100%; margin: 0 auto;
}
.dash-page { display: none; }
.dash-page.active { display: block; animation: fadeUp .25s ease; }

/* ─── ЗАГОЛОВОК СТРАНИЦЫ ─── */
.pg-title-row {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.pg-title h2 { font-size: 24px; font-weight: 800; color: #1a2744; }
.pg-title p  { color: #64748b; font-size: 14px; margin-top: 4px; }
.btns-row    { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.data-info-bar {
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 10px; padding: 10px 16px;
  font-size: 13px; color: #92400e;
  margin-bottom: 20px;
}

/* ─── ВЫБОР ПЕРИОДА ─── */
.period-bar {
  display: flex; align-items: center; gap: 10px;
  background: #fff; padding: 10px 16px;
  border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.period-bar label { font-size: 13px; color: #64748b; font-weight: 600; }
.period-bar select, .period-bar input[type=number] {
  padding: 6px 10px; border: 2px solid #e2e8f0; border-radius: 8px;
  font-size: 13px; outline: none; background: #fff; color: #1e293b;
  transition: border-color .2s;
}
.period-bar select:focus, .period-bar input:focus { border-color: #2563eb; }

/* ─── КНОПКИ ─── */
.btn-action {
  padding: 10px 20px; border: none; border-radius: 10px;
  font-size: 13px; font-weight: 700; cursor: pointer; transition: all .2s;
}
.btn-blue    { background: #2563eb; color: #fff; }
.btn-blue:hover  { background: #1d4ed8; transform: translateY(-1px); }
.btn-green   { background: #16a34a; color: #fff; }
.btn-green:hover { background: #15803d; transform: translateY(-1px); }
.btn-red     { background: #dc2626; color: #fff; }
.btn-red:hover   { background: #b91c1c; }
.btn-outline { background: #fff; color: #475569; border: 2px solid #e2e8f0; }
.btn-outline:hover { border-color: #2563eb; color: #2563eb; }
.btn-sm      { padding: 6px 14px; font-size: 12px; }

/* ─── УРОВНИ МЕТРИК ─── */
.level-block  { margin-bottom: 32px; }
.level-hdr {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.level-hdr .l-num {
  width: 28px; height: 28px; background: #1a2744; color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.level-hdr h3 {
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px; color: #475569;
}
.level-hdr .l-hint { font-size: 11px; color: #94a3b8; margin-left: 4px; }

.metrics-grid { display: grid; gap: 16px; }
.g2  { grid-template-columns: repeat(2, 1fr); }
.g3  { grid-template-columns: repeat(3, 1fr); }
.g4  { grid-template-columns: repeat(4, 1fr); }
.g5  { grid-template-columns: repeat(5, 1fr); }

/* ─── КАРТОЧКА МЕТРИКИ ─── */
.mc {
  background: #fff; border-radius: 16px; padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  border: 1px solid #f1f5f9;
  transition: transform .2s, box-shadow .2s;
  position: relative; overflow: hidden;
}
.mc:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.1); }
.mc::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
}
.mc.good::before    { background: linear-gradient(90deg, #16a34a, #4ade80); }
.mc.bad::before     { background: linear-gradient(90deg, #dc2626, #f87171); }
.mc.neutral::before { background: linear-gradient(90deg, #0284c7, #38bdf8); }

.mc-name {
  font-size: 12px; color: #64748b; font-weight: 600;
  margin-bottom: 10px; line-height: 1.35; min-height: 28px;
}
.mc-vals {
  display: flex; justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.mc-plan {
  text-align: right;
  flex-shrink: 0;
  padding-top: 2px;
}
.mc-fact      { font-size: 24px; font-weight: 800; line-height: 1; }
.mc-fact sub  { font-size: 12px; font-weight: 500; color: #94a3b8; }
.c-green { color: #16a34a; }
.c-red   { color: #dc2626; }
.c-blue  { color: #0ea5e9; }
.c-gray  { color: #64748b; }

.mc-plan .lbl { font-size: 10px; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; }
.mc-plan .val { font-size: 14px; font-weight: 700; color: #475569; }

.status-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 10px; font-weight: 800; letter-spacing: .3px; margin-bottom: 8px;
}
.chip-g { background: #dcfce7; color: #16a34a; }
.chip-r { background: #fee2e2; color: #dc2626; }
.chip-b { background: #dbeafe; color: #2563eb; }
.chip-y { background: #fef3c7; color: #92400e; }

/* ─── НАКОПИТЕЛЬНАЯ ДИАГРАММА (progress bar) ─── */
.prog-wrap   { position: relative; margin-top: 4px; clear: both; }
.prog-track  {
  height: 22px; background: #f1f5f9; border-radius: 11px;
  overflow: visible; position: relative; border: 1px solid #e2e8f0;
}
.prog-fill {
  height: 100%; border-radius: 11px; position: relative;
  transition: width 1s ease; min-width: 0;
}
.pf-green { background: linear-gradient(90deg, #15803d, #22c55e); }
.pf-red   { background: linear-gradient(90deg, #b91c1c, #ef4444); }
.pf-blue  { background: linear-gradient(90deg, #0369a1, #38bdf8); }

/* Маркер ожидаемого — внутри полосы, подпись вынесена в .prog-labels (script.js) */
.prog-expected {
  position: absolute; top: 0; bottom: 0;
  width: 3px; margin-top: 2px; margin-bottom: 2px;
  background: #f59e0b; border-radius: 2px;
  z-index: 3; pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,.85);
}
.prog-labels {
  display: flex; justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px; font-size: 10px; color: #94a3b8;
}
.prog-labels span:nth-child(2) {
  text-align: center; flex: 1; line-height: 1.35;
  color: #64748b; font-weight: 600;
}
.bar-v-pct {
  width: 100%; text-align: center; font-size: 10px; font-weight: 700;
  color: #64748b; margin-top: 4px;
}
.hbar-pct {
  font-size: 10px; font-weight: 700; color: #64748b;
  text-align: center; margin-top: 6px;
}

/* ─── СТОЛБЧАТЫЕ ДИАГРАММЫ (вертикальные) ─── */
.bar-v-outer { width: 100%; margin-top: 10px; }
.bar-v-wrap {
  display: flex; align-items: flex-end; gap: 8px;
  height: 90px; padding: 0 4px;
}
.bar-v-col {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 4px;
}
.bar-v-rect {
  width: 100%; max-width: 50px; border-radius: 6px 6px 0 0;
  position: relative; min-height: 4px;
  transition: height .8s ease;
}
.bar-v-rect .bar-top-lbl {
  position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%); padding-bottom: 2px;
  font-size: 9px; font-weight: 700; white-space: nowrap;
}
.bv-plan     { background: #cbd5e1; }
.bv-green    { background: linear-gradient(180deg, #22c55e, #15803d); }
.bv-red      { background: linear-gradient(180deg, #f87171, #b91c1c); }
.bar-v-lbl   { font-size: 10px; color: #94a3b8; }

/* ─── ГОРИЗОНТАЛЬНЫЕ ДИАГРАММЫ ─── */
.hbar-wrap  { margin-top: 8px; }
.hbar-row   { margin-bottom: 6px; }
.hbar-row:last-child { margin-bottom: 0; }
.hbar-row-lbl {
  font-size: 10px; color: #94a3b8;
  margin-bottom: 3px; display: flex; justify-content: space-between;
}
.hbar-track {
  height: 18px; background: #f1f5f9;
  border-radius: 9px; overflow: hidden; border: 1px solid #e2e8f0;
}
.hbar-fill {
  height: 100%; border-radius: 9px;
  transition: width 1s ease;
  display: flex; align-items: center; padding-left: 8px;
}
.hbar-fill span { font-size: 10px; font-weight: 800; color: #fff; white-space: nowrap; }
.hbf-gray  { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }
.hbf-green { background: linear-gradient(90deg, #16a34a, #4ade80); }
.hbf-red   { background: linear-gradient(90deg, #dc2626, #f87171); }
.hbf-blue  { background: linear-gradient(90deg, #0284c7, #38bdf8); }

/* ─── БОЛЬШИЕ ЧИСЛА ─── */
.bn-card {
  text-align: center; display: flex; flex-direction: column;
  align-items: center; justify-content: center; min-height: 120px;
}
.bn      { font-size: 38px; font-weight: 900; margin: 6px 0 4px; line-height: 1; }
.bn-unit { font-size: 12px; color: #94a3b8; margin-bottom: 2px; }
.bn-sub  { font-size: 11px; color: #94a3b8; }

/* ─── СПИДОМЕТР SVG (HR) ─── */
.gauge-wrap {
  display: flex; flex-direction: column; align-items: center;
  margin-top: 8px;
}
.gauge-wrap svg { overflow: visible; }
.gauge-value {
  font-size: 22px; font-weight: 900; margin-top: 4px;
}
.gauge-plan-lbl { font-size: 10px; color: #94a3b8; }

/* ─── ПРОТОКОЛ ─── */
.protocol-wrap { margin-top: 36px; border-top: 2px solid #e2e8f0; padding-top: 4px; }
.proto-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 4px; cursor: pointer; user-select: none; transition: color .2s;
}
.proto-toggle:hover { color: #2563eb; }
.proto-toggle .pt-icon {
  width: 28px; height: 28px; background: #f1f5f9; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: background .2s;
}
.proto-toggle:hover .pt-icon { background: #dbeafe; }
.proto-toggle .pt-label   { font-size: 14px; font-weight: 700; }
.proto-toggle .pt-count   { background: #2563eb; color: #fff; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 10px; margin-left: 6px; }
.proto-toggle .pt-arrow   { margin-left: auto; color: #94a3b8; font-size: 12px; transition: transform .2s; }
.proto-toggle.open .pt-arrow { transform: rotate(90deg); }

.proto-body {
  display: none; background: #fff; border-radius: 16px;
  padding: 22px; box-shadow: 0 2px 8px rgba(0,0,0,.06);
  margin-top: 4px; margin-bottom: 24px;
}
.proto-body.show { display: block; animation: fadeUp .2s ease; }
.proto-input-row { display: flex; gap: 12px; margin-bottom: 18px; }
.proto-ta {
  flex: 1; padding: 12px; border: 2px solid #e2e8f0; border-radius: 10px;
  font-size: 14px; resize: vertical; min-height: 70px;
  outline: none; font-family: inherit; transition: border-color .2s;
}
.proto-ta:focus { border-color: #2563eb; }
.btn-fix {
  padding: 12px 18px; background: #2563eb; color: #fff; border: none;
  border-radius: 10px; font-size: 13px; font-weight: 700;
  cursor: pointer; align-self: flex-end; transition: all .2s; white-space: nowrap;
}
.btn-fix:hover { background: #1d4ed8; transform: translateY(-1px); }
.proto-list    { list-style: none; }
.proto-item {
  background: #f8fafc; border-radius: 10px; padding: 12px 14px;
  margin-bottom: 8px; border-left: 3px solid #2563eb;
  animation: fadeUp .2s ease;
}
.proto-item-top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.proto-badge {
  font-size: 10px; font-weight: 800; letter-spacing: .3px;
  padding: 4px 10px; border-radius: 20px; text-transform: uppercase;
}
.proto-badge.st-done      { background: #dcfce7; color: #15803d; }
.proto-badge.st-cancelled { background: #f1f5f9; color: #64748b; }
.proto-badge.st-in_progress { background: #dbeafe; color: #1d4ed8; }
.proto-badge.st-not_done { background: #fee2e2; color: #b91c1c; }
.proto-status-select {
  padding: 6px 10px; border: 2px solid #e2e8f0; border-radius: 8px;
  font-size: 12px; font-weight: 600; color: #1e293b;
  background: #fff; cursor: pointer; max-width: 100%;
}
.proto-status-select:disabled {
  opacity: 0.65; cursor: not-allowed; background: #f8fafc;
}
.btn-proto-del {
  margin-left: auto;
  padding: 5px 10px; font-size: 11px; font-weight: 700;
  border: 2px solid #fecaca; background: #fff; color: #dc2626;
  border-radius: 8px; cursor: pointer; transition: all .2s;
}
.btn-proto-del:hover { background: #fef2f2; border-color: #dc2626; }
.proto-item .pi-date { font-size: 11px; color: #94a3b8; margin-bottom: 4px; }
.proto-item .pi-text { font-size: 13px; color: #1e293b; line-height: 1.5; }
.proto-empty { text-align: center; color: #94a3b8; font-size: 13px; padding: 20px; font-style: italic; }
.proto-clear-row { margin-top: 12px; text-align: right; }
.btn-clear-proto {
  padding: 7px 16px; background: transparent; border: 2px solid #e2e8f0;
  color: #94a3b8; border-radius: 8px; font-size: 12px; cursor: pointer; transition: all .2s;
}
.btn-clear-proto:hover { border-color: #dc2626; color: #dc2626; }

/* ─── ВВОД ДАННЫХ ─── */
.tabs-bar { display: flex; border-bottom: 2px solid #e2e8f0; margin-bottom: 24px; }
.tab-btn {
  padding: 13px 28px; background: none; border: none;
  font-size: 14px; font-weight: 700; color: #94a3b8;
  cursor: pointer; border-bottom: 3px solid transparent;
  margin-bottom: -2px; transition: all .2s;
}
.tab-btn.active { color: #2563eb; border-bottom-color: #2563eb; }
.tab-btn:hover  { color: #2563eb; }
.tab-content         { display: none; }
.tab-content.active  { display: block; animation: fadeUp .2s ease; }

.de-card {
  background: #fff; border-radius: 16px; padding: 28px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06); margin-bottom: 20px;
}
.de-card h3    { font-size: 16px; font-weight: 800; color: #1a2744; margin-bottom: 6px; }
.de-card .de-desc { font-size: 13px; color: #64748b; margin-bottom: 20px; }
.form-row      { display: flex; gap: 16px; margin-bottom: 20px; align-items: flex-end; flex-wrap: wrap; }
.form-field label {
  display: block; font-size: 12px; font-weight: 700;
  color: #64748b; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 7px;
}
.form-select, .form-input-s {
  padding: 10px 14px; border: 2px solid #e2e8f0; border-radius: 10px;
  font-size: 14px; outline: none; background: #fff;
  color: #1e293b; transition: border-color .2s; min-width: 140px;
}
.form-select:focus, .form-input-s:focus { border-color: #2563eb; }

.de-msg {
  background: #fef3c7; color: #92400e;
  padding: 12px 16px; border-radius: 10px;
  font-size: 13px; margin-bottom: 16px;
  border-left: 4px solid #f59e0b; display: none;
}
.de-msg.show { display: block; }

.metrics-tbl { width: 100%; border-collapse: collapse; }
.metrics-tbl thead tr { background: #f8fafc; }
.metrics-tbl th {
  padding: 10px 12px; font-size: 11px; font-weight: 800;
  color: #64748b; text-transform: uppercase; letter-spacing: .5px;
  text-align: left; border-bottom: 2px solid #e2e8f0;
}
.metrics-tbl td {
  padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle;
}
.metrics-tbl tr:last-child td { border-bottom: none; }
.metrics-tbl tr:hover td { background: #fafcff; }
.mt-name-wrap { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.hr-metric-ctx {
  font-size: 11px; font-weight: 700; color: #475569;
  line-height: 1.35; max-width: 420px;
}
.de-hr-note {
  background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 10px; padding: 12px 14px; margin-bottom: 6px;
}
.mt-name { font-size: 13px; font-weight: 600; color: #1e293b; }
.mt-unit { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.mt-input {
  padding: 8px 12px; border: 2px solid #e2e8f0; border-radius: 8px;
  font-size: 14px; width: 130px; outline: none;
  transition: border-color .2s; font-family: inherit;
}
.mt-input:focus    { border-color: #2563eb; }
.mt-input:disabled { background: #f8fafc; color: #94a3b8; cursor: not-allowed; }
.mt-input.editable-name {
  width: 180px; border-color: #bfdbfe; background: #eff6ff;
}
.no-plan-lbl {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #94a3b8; cursor: pointer;
}
.no-plan-lbl input[type=checkbox] { accent-color: #2563eb; width: 15px; height: 15px; cursor: pointer; }
.np-badge { background: #f1f5f9; color: #94a3b8; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.save-row { margin-top: 24px; display: flex; justify-content: space-between; align-items: center; }
.export-btn { font-size: 11px; color: #94a3b8; background: none; border: 1px solid #e2e8f0; border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.export-btn:hover { border-color: #94a3b8; }

/* ─── ВКЛАДКИ АДМИНКИ (отдельно от .tab-content страницы ввода данных) ─── */
.users-admin-tabs { margin-top: 4px; }
.users-tab-content { display: none; }
.users-tab-content.active { display: block; animation: fadeUp .2s ease; }

.usage-report-panel { max-width: 1100px; }
.usage-report-intro {
  font-size: 13px; color: #475569; line-height: 1.55; margin-bottom: 18px;
  padding: 14px 16px; background: #f8fafc; border-radius: 12px; border: 1px solid #e2e8f0;
}
.usage-report-filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 20px;
  margin-bottom: 20px; padding: 12px 0; border-bottom: 1px solid #e2e8f0;
}
.usage-filter-group {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
}
.usage-filter-group > label { font-size: 12px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .4px; }
.usage-range-wrap { align-items: center; }
.usage-filter-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.usage-report-filters > .usage-cb-lbl { margin-left: 0; }
.usage-report-filters label { font-size: 12px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .4px; }
.usage-cb-lbl {
  display: flex; align-items: center; gap: 8px; font-size: 13px !important;
  font-weight: 600 !important; color: #334155 !important; text-transform: none !important;
  letter-spacing: normal !important; cursor: pointer;
}
.usage-cb-lbl input { accent-color: #2563eb; width: 16px; height: 16px; cursor: pointer; }

.usage-summary-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px;
  margin-bottom: 20px;
}
.usage-summary-wide { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.usage-charts-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px;
}
@media (max-width: 960px) {
  .usage-charts-grid { grid-template-columns: 1fr; }
}
.usage-chart-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
  padding: 14px 16px 18px; box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.usage-chart-card.usage-chart-wide { grid-column: 1 / -1; }
.usage-chart-title { margin: 0 0 8px; font-size: 13px; font-weight: 800; color: #1e293b; }
.usage-chart-hint { margin: -4px 0 10px; font-size: 11px; color: #94a3b8; line-height: 1.4; }
.usage-chart-canvas-wrap { position: relative; height: 220px; width: 100%; }
.usage-chart-canvas-wrap.usage-chart-tall { height: 280px; }
.usage-chart-wide .usage-chart-canvas-wrap:first-of-type,
.usage-chart-wide > .usage-chart-canvas-wrap { height: 260px; }
.usage-sc {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 14px 16px; text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.usage-sc-n { display: block; font-size: 22px; font-weight: 800; color: #1d4ed8; }
.usage-sc-l { font-size: 11px; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }

.usage-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid #e2e8f0; }
.usage-report-table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.usage-report-table thead tr { background: #f1f5f9; }
.usage-report-table th {
  padding: 10px 12px; text-align: left; font-size: 10px; font-weight: 800;
  color: #64748b; text-transform: uppercase; letter-spacing: .45px;
  border-bottom: 2px solid #e2e8f0; white-space: nowrap;
}
.usage-report-table td {
  padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: top;
}
.usage-report-table tbody tr:hover td { background: #fafcff; }
.usage-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: #1e293b; }
.usage-tiny { font-size: 12px; color: #64748b; white-space: nowrap; }
.usage-breakdown { font-size: 12px; line-height: 1.5; }
.usage-dash-pill {
  display: inline-block; margin: 2px 6px 2px 0; padding: 3px 8px;
  background: #eff6ff; color: #1d4ed8; border-radius: 8px; font-weight: 600; font-size: 11px;
}
.usage-role-super { color: #b45309; font-weight: 700; }
.usage-empty-row { text-align: center; color: #94a3b8; padding: 24px !important; }
.usage-footnote { font-size: 12px; color: #94a3b8; margin-top: 16px; line-height: 1.45; }

/* ─── IAM управляет пользователями (legacy users-grid removed) ─── */

/* ─── СЕКЦИЯ HR (заголовок направления) ─── */
.hr-section-title {
  background: #1a2744; color: #fff;
  padding: 12px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 800;
  margin-bottom: 20px; margin-top: 8px;
  letter-spacing: .5px;
}

/* ─── ПУСТОЕ СОСТОЯНИЕ ─── */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: #94a3b8; font-size: 14px;
}
.empty-state .es-icon { font-size: 48px; margin-bottom: 12px; }

/* ─── МОДАЛЬНЫЕ ОКНА ─── */
.modal-ov {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 1000;
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-ov.show { display: flex; }
.modal-box {
  background: #fff; border-radius: 20px; padding: 36px;
  width: 440px; max-width: 95vw;
  box-shadow: 0 32px 64px rgba(0,0,0,.3);
  animation: fadeUp .2s ease; max-height: 90vh; overflow-y: auto;
}
.modal-box .mi  { font-size: 40px; margin-bottom: 12px; }
.modal-box h3   { font-size: 20px; font-weight: 800; color: #1a2744; margin-bottom: 10px; }
.modal-box p    { font-size: 14px; color: #64748b; line-height: 1.6; margin-bottom: 16px; }
.modal-actions  { display: flex; gap: 12px; justify-content: flex-end; }
.btn-mok {
  padding: 11px 28px; background: #2563eb; color: #fff; border: none;
  border-radius: 10px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: background .2s;
}
.btn-mok:hover    { background: #1d4ed8; }
.btn-mcancel {
  padding: 11px 22px; background: #f1f5f9; color: #475569; border: none;
  border-radius: 10px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .2s;
}
.btn-mcancel:hover { background: #e2e8f0; }

/* legacy perm-form-row removed (IAM has its own) */

/* ─── TOAST ─── */
.toast {
  position: fixed; bottom: 32px; right: 32px;
  background: #1a2744; color: #fff;
  padding: 14px 24px; border-radius: 12px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,.3); z-index: 9999;
  transform: translateY(20px); opacity: 0;
  transition: all .3s; display: flex; align-items: center; gap: 10px;
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast .t-icon { font-size: 18px; }

/* ─── МОДУЛЬ ТАБЕЛЬ ─── */
.tabely-root { max-width: 1400px; margin: 0 auto; }
.tabely-toolbar {
  display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end;
  margin-bottom: 12px; padding: 14px 16px; background: #fff; border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 24px rgba(15,23,42,.06);
}
.tabely-toolbar label { font-size: 12px; font-weight: 600; color: #64748b; display: flex; flex-direction: column; gap: 4px; }
.tabely-toolbar select, .tabely-toolbar input[type="month"], .tabely-toolbar input[type="date"] {
  padding: 8px 10px; border-radius: 8px; border: 1px solid #cbd5e1; font-size: 14px; min-width: 160px;
}
.tabely-toolbar select:focus, .tabely-toolbar input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
.tabely-hint { font-size: 13px; color: #64748b; margin: 0 0 14px; line-height: 1.45; }
.tabely-warn { font-size: 13px; color: #b45309; margin: 0 0 10px; }
.tabely-subnav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tabely-subtab {
  padding: 8px 16px; border-radius: 999px; border: 1px solid #e2e8f0; background: #fff;
  font-size: 13px; font-weight: 700; color: #475569; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.tabely-subtab:hover { background: #f8fafc; transform: translateY(-1px); box-shadow: 0 10px 18px rgba(15,23,42,.06); }
.tabely-subtab.active { background: #2563eb; color: #fff; border-color: #2563eb; box-shadow: 0 10px 22px rgba(37,99,235,.22); }
.tabely-pane { display: none; }
.tabely-pane.active { display: block; }
.tabely-occ-bar {
  padding: 12px 16px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px;
  font-size: 14px; margin-bottom: 14px; color: #1e3a5f;
}
.tabely-summary-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px;
}
@media (max-width: 720px) { .tabely-summary-cards { grid-template-columns: repeat(2, 1fr); } }
.tabely-summary-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 14px 18px; box-shadow: 0 2px 6px rgba(15,23,42,.05); text-align: center;
}
.tabely-summary-label { font-size: 12px; font-weight: 600; color: #64748b; margin-bottom: 6px; }
.tabely-summary-value { font-size: 28px; font-weight: 800; color: #1e293b; }
.tabely-grid-scroll { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 12px; }
.tabely-grid { border-collapse: collapse; font-size: 12px; min-width: 720px; }
.tabely-grid th, .tabely-grid td { border: 1px solid #e2e8f0; padding: 6px 8px; text-align: right; }
.tabely-grid th.tabely-sticky, .tabely-grid th.tabely-sticky2 {
  position: sticky; left: 0; background: #f8fafc; text-align: left; z-index: 2; min-width: 140px;
}
.tabely-grid th.tabely-sticky2 { left: 140px; min-width: 56px; }
.tabely-sub { display: block; font-size: 10px; font-weight: 500; color: #64748b; margin-top: 2px; }
.tabely-dn { font-weight: 800; display: block; }
.tabely-dw { font-size: 10px; color: #94a3b8; }
.tabely-cell-paid { background: #ecfdf5; }
.tabely-cell-hold { background: #fef3c7; }
.tabely-cell-unpaid { color: #94a3b8; }
.tabely-cards { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }
@media (max-width: 960px) { .tabely-cards { grid-template-columns: 1fr; } }
.tabely-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 18px;
  box-shadow: 0 2px 8px rgba(15,23,42,.06);
}
.tabely-card h3 { margin: 0 0 12px; font-size: 16px; color: #1e293b; }
.tabely-form-row { margin-bottom: 10px; display: flex; flex-direction: column; gap: 4px; }
.tabely-form-row label { font-size: 12px; font-weight: 600; color: #64748b; }
.tabely-form-row input, .tabely-form-row select { padding: 8px 10px; border-radius: 8px; border: 1px solid #cbd5e1; }
.tabely-mini-table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 12px 0; }
.tabely-mini-table th, .tabely-mini-table td { border: 1px solid #e2e8f0; padding: 6px; }
.btn-icon-del {
  border: none; background: #fee2e2; color: #b91c1c; width: 28px; height: 28px;
  border-radius: 6px; cursor: pointer; font-size: 16px; line-height: 1;
}
.tabely-dir-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabely-dir-table th, .tabely-dir-table td { border: 1px solid #e2e8f0; padding: 8px; text-align: left; }
.tabely-dir-table thead th { background: #f8fafc; font-weight: 800; color: #334155; }
.tabely-dir-table tbody tr:hover { background: #f8fafc; }
.tabely-inline { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tabely-inline input[type="number"], .tabely-inline input[type="date"] {
  padding: 8px 10px; border-radius: 10px; border: 1px solid #cbd5e1; font-size: 13px;
}
.tabely-inline input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.tabely-plan-floor { margin-bottom: 18px; border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; }
.tabely-plan-head { padding: 10px 16px; background: linear-gradient(90deg,#f8fafc,#fff); font-weight: 800; font-size: 15px; }
.tabely-plan-body { padding: 12px 14px 16px; }
.tabely-plan-wing { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.tabely-corridor {
  margin: 10px 0; padding: 8px; text-align: center; font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: #64748b;
  background: repeating-linear-gradient(90deg,#f1f5f9,#f1f5f9 8px,#e2e8f0 8px,#e2e8f0 16px);
  border-radius: 8px; border: 1px dashed #cbd5e1;
}
.tabely-room {
  min-width: 72px; padding: 8px 6px; border-radius: 10px; text-align: center; border: 2px solid;
  font-size: 12px;
}
.tabely-room.free { background: linear-gradient(180deg,#ecfdf5,#dcfce7); border-color: #4ade80; color: #14532d; }
.tabely-room.busy { background: linear-gradient(180deg,#eff6ff,#dbeafe); border-color: #60a5fa; color: #1e3a5f; }
.tabely-room-num { font-weight: 800; font-size: 13px; }
.tabely-room-meta { font-size: 10px; opacity: 0.85; }
.tabely-room-occ { font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tabely-plan-toolbar { margin-bottom: 12px; }
.tabely-plan-modes { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; }
.tabely-plan-modes label { font-weight: 600; color: #475569; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tabely-room-guest { font-size: 10px; line-height: 1.35; text-align: left; margin-top: 4px; color: #334155; max-width: 120px; }
.tabely-guest-co { display: block; font-size: 9px; color: #64748b; margin-top: 2px; }
.tabely-checkin-grid {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 260px);
  grid-template-areas:
    "main aside"
    "guest aside";
  gap: 20px;
  align-items: start;
}
.tabely-checkin-main { grid-area: main; }
.tabely-checkin-guest { grid-area: guest; }
.tabely-freebeds-card { grid-area: aside; }
.tabely-freebeds-summary { cursor: pointer; font-weight: 700; color: #1e293b; }
.tabely-freebeds-details:not([open]) .tabely-freebeds-body { display: none; }
.tabely-freebeds-list { margin: 10px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.tabely-muted { font-size: 13px; color: #64748b; }
.tabely-cmp-input { width: 100%; max-width: 420px; }
.tabely-checkout-filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 14px; font-size: 13px; }
.tabely-checkout-search { min-width: 200px; padding: 8px 10px; border-radius: 8px; border: 1px solid #cbd5e1; }
.tabely-checkout-search.form-input-s { padding: 10px 14px; border-width: 2px; border-radius: 10px; }
.tabely-checkout-bulk { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 14px; }
.tabely-checkout-table td { vertical-align: middle; }
@media (max-width: 960px) {
  .tabely-checkin-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "main" "guest" "aside";
  }
}

/* ─── Заселение: новая форма ─── */
.ci-card { padding: 20px; }
.ci-header-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.ci-header-field { display: flex; flex-direction: column; gap: 4px; }
.ci-field-company { flex: 2; min-width: 220px; }
.ci-header-field:not(.ci-field-company) { flex: 1; min-width: 160px; }
.ci-label { font-size: 12px; font-weight: 600; color: #64748b; }
.ci-table { border-collapse: collapse; width: 100%; font-size: 13px; min-width: 700px; }
.ci-table thead th { background: #f8fafc; padding: 8px 10px; text-align: left; border-bottom: 2px solid #e2e8f0; white-space: nowrap; font-size: 12px; color: #475569; }
.ci-table tbody td { padding: 5px 7px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.ci-th-num, .ci-num-cell { width: 36px; text-align: center; color: #94a3b8; font-size: 12px; font-weight: 700; }
.ci-th-fio { min-width: 180px; }
.ci-th-del { width: 36px; }
.ci-sel { font-size: 12px; padding: 4px 6px; }
.ci-fio-inp { min-width: 170px; }
.ci-paid-hint { color: #2563eb !important; font-style: italic; }
.ci-footer { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.ci-counter { font-size: 13px; color: #64748b; flex: 1; }

/* ─── Выселение: новая форма ─── */
.co-card { padding: 20px; }
.co-section { margin-bottom: 22px; }
.co-section-title { font-size: 14px; font-weight: 700; color: #1e293b; margin-bottom: 12px; }
.co-today-title { color: #b45309; }
.co-group { margin-bottom: 16px; }
.co-group-today { border-left: 3px solid #f59e0b; padding-left: 12px; }
.co-group-head { font-size: 13px; font-weight: 700; color: #475569; padding: 6px 10px; background: #f8fafc; border-radius: 8px; margin-bottom: 8px; }
.co-group-today .co-group-head { background: #fef3c7; }
.co-table { width: 100%; font-size: 13px; }
.co-table td { vertical-align: middle; }
.co-type-badge { font-size: 11px; background: #f1f5f9; border-radius: 4px; padding: 2px 7px; color: #475569; font-weight: 600; }

/* ─── Табель: "Жилой фонд" (как в прототипе) ─── */
.form-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(15,23,42,.06);
}
.form-card h3 { margin: 0 0 10px; font-size: 16px; color: #0f172a; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
@media (max-width: 960px) { .grid-2 { grid-template-columns: 1fr; } }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 12px; font-weight: 700; color: #475569; }
.form-row input, .form-row select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  background: #fff;
}
.form-row input:focus, .form-row select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
.fund-floor-names-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin-top: 10px; }
@media (max-width: 960px) { .fund-floor-names-grid { grid-template-columns: 1fr; } }
.fund-floor-name-row { display: flex; flex-direction: column; gap: 6px; }
.fund-floor-name-row label { font-size: 12px; font-weight: 700; color: #475569; }
.fund-floor-name-row input { padding: 10px 12px; border-radius: 12px; border: 1px solid #cbd5e1; }
.fund-room-editor { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
.fund-room-editor th, .fund-room-editor td { border: 1px solid #e2e8f0; padding: 10px; text-align: left; }
.fund-room-editor thead th { background: #f8fafc; font-weight: 800; color: #334155; }
.fund-room-editor input { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid #cbd5e1; }
.table-actions { display: flex; justify-content: flex-start; margin-top: 10px; }
.row { display: flex; flex-wrap: wrap; align-items: center; }
.btn-primary {
  border: none;
  background: #2563eb;
  color: #fff;
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 14px 26px rgba(37,99,235,.25); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease, transform .15s ease;
}
.btn-ghost:hover { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; transform: translateY(-1px); }

/* ─── Табель: Компании → комнаты → дневная сетка (как в прототипе) ─── */
.customer-block {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15,23,42,.06);
  overflow: hidden;
  margin-bottom: 14px;
}
.customer-head {
  width: 100%;
  border: none;
  background: linear-gradient(135deg, #0f1f3d 0%, #1a2744 40%, #2563eb 100%);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  text-align: left;
}
.customer-title { margin: 0; font-size: 18px; font-weight: 900; letter-spacing: .2px; }
.customer-meta { margin-top: 4px; font-size: 12px; color: rgba(255,255,255,.78); font-weight: 600; }
.tariff-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  font-size: 12px;
  font-weight: 800;
}
.chevron {
  font-size: 14px;
  opacity: .9;
  transform: rotate(0deg);
  transition: transform .15s ease;
  margin-top: 4px;
}
.customer-block.collapsed .chevron { transform: rotate(-90deg); }
.customer-body { padding: 16px 18px; }
.customer-block.collapsed .customer-body { display: none; }

.room-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15,23,42,.05);
  overflow: hidden;
  margin-bottom: 14px;
}
.room-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
  padding: 12px 16px;
  background: linear-gradient(90deg, #f8fafc, #ffffff);
  border-bottom: 1px solid #e2e8f0;
}
.room-head strong { font-size: 14px; }
.muted { color: #64748b; font-size: 12px; font-weight: 600; }

.grid-wrap { overflow-x: auto; }
.day-grid { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 820px; }
.day-grid th, .day-grid td { border: 1px solid #e2e8f0; padding: 7px 8px; text-align: right; }
.day-grid thead th { background: #f8fafc; font-weight: 900; color: #334155; }
.day-grid .sticky-col, .day-grid .sticky-col-2 {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
  text-align: left;
  min-width: 220px;
}
.day-grid .sticky-col-2 {
  left: 220px;
  min-width: 54px;
  text-align: center;
  z-index: 3;
  background: #fff;
}
.slot-label { display: inline-flex; flex-direction: column; gap: 2px; }
.slot-label .small { font-size: 10px; font-weight: 700; color: #64748b; }
.d-num { font-weight: 900; display: block; }
.d-wd { font-size: 10px; color: #94a3b8; display: block; }
.cell-paid { background: #EAF3DE; }
.cell-hold { background: #E6F1FB; }
.cell-expiring { background: #FAEEDA; }
.cell-unpaid { color: #94a3b8; }
.row-total td, .row-total th { background: #eff6ff; font-weight: 900; }

/* ─── Табель: свободные койко-места (details) ─── */
.free-collapsible {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15,23,42,.06);
  padding: 0;
  margin: 14px 0;
  overflow: hidden;
}
.free-collapsible > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 900;
  color: #0f172a;
  background: linear-gradient(90deg, #f8fafc, #ffffff);
  border-bottom: 1px solid #e2e8f0;
}
.free-collapsible > summary::-webkit-details-marker { display: none; }
.free-table-wrap { padding: 12px 16px 16px; }
.free-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.free-table th, .free-table td { border: 1px solid #e2e8f0; padding: 10px; text-align: left; }
.free-table thead th { background: #f8fafc; font-weight: 900; color: #334155; }
.free-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-weight: 900;
}
.free-summary { margin: 12px 0 0; font-size: 12px; color: #64748b; font-weight: 700; }

/* ─── АНИМАЦИИ ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── АДАПТИВ ─── */
@media (max-width: 1200px) {
  .g4, .g5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .g3, .g4, .g5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .app-content { padding: 16px; }
  .hdr-nav { display: none; }
  .burger-btn { display: flex; align-items: center; justify-content: center; }
  .g2, .g3, .g4, .g5 { grid-template-columns: 1fr; }
  .pg-title-row { flex-direction: column; }
  .btns-row { flex-wrap: wrap; }
  .period-bar { flex-wrap: wrap; }
  .app-header { padding: 0 16px; }
  .hdr-logo { font-size: 14px; letter-spacing: 0.06em; }
  .login-brand-logo { max-width: 100%; max-height: 180px; }
  .mc-fact { font-size: 20px; }
  .bn { font-size: 28px; }
}
