/* ЛайнерТек — производственный портал. Корпоративные тона linertec.com. */
@import url('https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700;800&display=swap');
:root {
  /* Палитра ЛайнерТек — адаптирована из дизайна гендира (лого-зелёный) */
  --brand: #006132;        /* фирменный зелёный */
  --brand-600: #004f28;
  --brand-700: #003d20;
  --sidebar: #003d20;      /* тёмно-зелёный под бренд */
  --sidebar-2: #00512a;
  --bg: #eef4f0;
  --card: #ffffff;
  --line: #dde5e0;
  --text: #16241c;
  --muted: #66756d;
  --ok: #2f8a52;
  --warn: #c98a1f;
  --risk: #e31f25;
  --info: #3a6ea5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,36,28,.05), 0 4px 16px rgba(16,36,28,.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Golos Text', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--text);
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Фон: мягкий зелёный градиент + «энергетическое» свечение и тень-«лужа»
     под парящим логотипом (см. body::before/::after ниже) */
  background:
    radial-gradient(ellipse 22% 5% at 82% 78%, rgba(3,18,10,.4) 0%, rgba(3,18,10,.18) 45%, rgba(3,18,10,0) 75%),
    radial-gradient(circle at 80% 62%, rgba(64,214,156,.45) 0%, rgba(64,214,156,.2) 15%, rgba(64,214,156,0) 32%),
    linear-gradient(135deg, #eef4f0 0%, #dceee2 45%, #eef4f0 100%);
  background-attachment: fixed, fixed, fixed;
  min-height: 100vh;
}
/* «Парящий» логотип: крупный, в цвете, с отрывом от фона (drop-shadow) и
   бликом стекла поверх (body::after, обрезан по силуэту через mask-image). */
body::before {
  content: ''; position: fixed; right: 2vw; bottom: 6vh; z-index: 0; pointer-events: none;
  width: min(50vw, 620px); height: min(50vw, 620px);
  background: url("/static/img/linertec-logo-c.06afb92bcc2c.png") no-repeat center / contain;
  filter: saturate(1.3) contrast(1.1)
    drop-shadow(0 0 34px rgba(70,220,160,.75))
    drop-shadow(0 0 80px rgba(70,220,160,.5))
    drop-shadow(0 8px 10px rgba(255,255,255,.6))
    drop-shadow(0 70px 50px rgba(3,14,9,.45));
  opacity: .55;
}
body::after {
  content: ''; position: fixed; right: 2vw; bottom: 6vh; z-index: 0; pointer-events: none;
  width: min(50vw, 620px); height: min(50vw, 620px);
  -webkit-mask: url("/static/img/linertec-logo-c.06afb92bcc2c.png") no-repeat center / contain;
  mask: url("/static/img/linertec-logo-c.06afb92bcc2c.png") no-repeat center / contain;
  background:
    radial-gradient(circle at 32% 24%, rgba(255,255,255,1) 0%, rgba(200,255,235,.55) 6%, rgba(200,255,235,0) 16%),
    linear-gradient(155deg, rgba(255,255,255,.3) 0%, rgba(0,0,0,.4) 100%);
  mix-blend-mode: overlay;
  opacity: .85;
}
.app { position: relative; z-index: 1; }
a { color: inherit; text-decoration: none; }
h1 { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -.02em; }
h2 { font-size: 16px; font-weight: 650; margin: 28px 0 14px; }
h3 { font-size: 14px; font-weight: 650; margin: 0 0 14px; color: var(--muted);
     text-transform: uppercase; letter-spacing: .04em; font-size: 12px; }

/* ── Каркас: сайдбар + контент ── */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: #e6efe9; display: flex; flex-direction: column; padding: 18px 14px;
  position: sticky; top: 56px; height: calc(100vh - 56px); overflow: hidden;
}
.sidebar::-webkit-scrollbar { width: 7px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 6px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; flex: none; }
.brand-img { height: 44px; width: auto; display: block; }
.login-brand .brand-img { height: 68px; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #60a5fa);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 12px rgba(37,99,235,.4);
}
.brand-name { font-weight: 750; color: #fff; letter-spacing: .02em; font-size: 15px; }
.brand-sub { font-size: 11px; color: rgba(255,255,255,.5); }
.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 8px;
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; }
.nav::-webkit-scrollbar { width: 7px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 6px; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: 10px; color: rgba(255,255,255,.8); font-weight: 500; transition: .15s;
}
.nav-link svg { width: 18px; height: 18px; flex: none; }
.nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--risk); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.nav-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-link.active { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(0,97,50,.4); }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255,255,255,.45); padding: 16px 12px 6px; }
/* Сворачиваемые «папки» меню (как в дизайне гендира) */
.nav-folder { display: flex; flex-direction: column; }
.nav-folder > summary { list-style: none; cursor: pointer; }
.nav-folder > summary::-webkit-details-marker { display: none; }
.nav-folder > summary::after { content: '\203A'; margin-left: auto; font-size: 16px;
  color: rgba(255,255,255,.45); transition: transform .15s; }
.nav-folder[open] > summary::after { transform: rotate(90deg); }
.nav-folder .nav-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 4px;
  padding-left: 15px; margin-left: 22px; border-left: 1px solid rgba(255,255,255,.1); }
.nav-folder .nav-sub .nav-link { padding: 8px 12px; font-size: 13px; }
.sidebar-foot { margin-top: auto; flex: none; padding: 12px 10px 0; border-top: 1px solid rgba(255,255,255,.08); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  color: #fff; overflow: hidden;
  display: grid; place-items: center; font-weight: 650; font-size: 13px;
}
.user-name { color: #fff; font-weight: 600; font-size: 13px; }
.user-role { color: rgba(255,255,255,.6); font-size: 11px; }
.logout { margin-top: 10px; display: block; text-align: center; padding: 8px;
  border-radius: 9px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.82); font-size: 13px; }
.logout:hover { background: rgba(227,31,37,.2); color: #ffb3b5; }

.main { padding: 26px 32px 48px; max-width: 1180px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.topbar .subtitle { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* ── Карточки ── */
.card { background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px,1fr)); gap: 16px; }

/* ── KPI-плитки ── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi-ico { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; opacity: .9; }
.kpi-val { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.kpi-lbl { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.kpi.danger .kpi-val { color: var(--risk); }

/* ── Карточка объекта ── */
.pcard { display: flex; flex-direction: column; gap: 13px; }
.pcard-head { display: flex; justify-content: space-between; align-items: flex-start; }
.pcard-title { font-weight: 650; font-size: 15px; }
.pcard-city { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.progress { height: 8px; background: var(--line); border-radius: 20px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 20px;
  background: linear-gradient(90deg, var(--brand), #60a5fa); }
.pmeta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.pfin { display: flex; justify-content: space-between; padding-top: 13px; border-top: 1px solid var(--line); }
.pfin div { display: flex; flex-direction: column; gap: 2px; }
.pfin span { color: var(--muted); font-size: 11.5px; }
.pfin b { font-size: 14px; font-weight: 650; }

/* ── Пилюли статусов ── */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px;
  border-radius: 20px; font-size: 12px; font-weight: 600; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-норма, .pill-ok { color: #0e833c; background: rgba(14,131,60,.12); }
.pill-внимание, .pill-warning { color: #b45309; background: rgba(245,158,11,.14); }
.pill-риск, .pill-risk { color: #b91c1c; background: rgba(239,68,68,.12); }

/* ── Распределение статусов (бары) ── */
.statbar { display: flex; flex-direction: column; gap: 12px; }
.statbar-row { display: grid; grid-template-columns: 92px 1fr 40px; align-items: center; gap: 12px; }
.statbar-track { height: 10px; border-radius: 20px; background: var(--line); overflow: hidden; }
.statbar-fill { height: 100%; border-radius: 20px; }

/* ── Графики ── */
.chart { width: 100%; height: auto; }
.chart-lbl { font-size: 12px; fill: var(--muted); }
.ov-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 900px) { .ov-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .ov-kpis { grid-template-columns: repeat(2, 1fr); } }
.chart-empty { color: var(--muted); padding: 40px; text-align: center; }
.dash2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Алерты ── */
.alerts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 14px; }
.alert { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--risk);
  border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow); }
.alert.warning { border-left-color: var(--warn); }
.alert-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.alert-obj { font-weight: 650; font-size: 13.5px; }
.alert-msg { font-size: 13px; color: var(--muted); margin-bottom: 10px; }

/* ── Таблицы ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; font-size: 13.5px; border-bottom: 1px solid var(--line); }
th { background: color-mix(in srgb, var(--card) 92%, var(--muted)); color: var(--muted);
  font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: color-mix(in srgb, var(--card) 90%, var(--brand)); }
.row-del-col { width: 34px; }
.row-del { border: 1px solid var(--line); background: var(--card); border-radius: 7px; cursor: pointer;
  font-size: 14px; line-height: 1; padding: 5px 9px; color: var(--muted); }
.row-del:hover { color: var(--risk); border-color: var(--risk); }

/* ── Формы ── */
label { display: block; font-size: 12.5px; color: var(--muted); margin: 14px 0 5px; font-weight: 500; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: var(--card); color: var(--text); transition: .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ── Кнопки ── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; transition: .15s; }
.btn:hover { border-color: var(--brand); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 4px 12px rgba(37,99,235,.3); }
.btn-primary:hover { background: var(--brand-600); }
.btn-danger { color: var(--risk); border-color: color-mix(in srgb, var(--risk) 40%, var(--line)); }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; box-shadow: none; }

/* ── Вкладки ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab { padding: 11px 16px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ── Переключатель Лента/Мессенджер (крупный, в одну строку с заголовком) ── */
.chat-switch { display: flex; align-items: center; gap: 4px; }
.chat-switch-item { font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--muted);
  padding: 4px 10px; border-radius: 8px; border: 1.5px solid transparent; transition: .15s; }
.chat-switch-item:hover { color: var(--text); border-color: var(--line); }
.chat-switch-item.active { color: var(--text); }
.chat-switch-item .nav-badge { margin-left: 6px; vertical-align: 3px; }

/* ── Сообщения ── */
.flash { padding: 12px 16px; border-radius: 11px; margin-bottom: 16px; font-size: 13.5px; font-weight: 500; }
.flash.success { background: rgba(34,197,94,.12); color: #15803d; }
.flash.error { background: rgba(239,68,68,.12); color: #b91c1c; }
.issues { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.issues li { padding: 8px 12px; border-radius: 9px; font-size: 13px; }
.issues .error { background: rgba(239,68,68,.1); color: #b91c1c; }
.issues .warning { background: rgba(245,158,11,.12); color: #b45309; }

/* ── Разное ── */
.muted { color: var(--muted); }
.grade { display:inline-block; min-width:22px; text-align:center; padding:2px 8px; border-radius:6px; font-weight:700; font-size:12px; }
.grade-A { background: rgba(14,131,60,.15); color: var(--ok); }
.grade-B { background: rgba(245,158,11,.15); color: var(--warn); }
.grade-C { background: rgba(239,68,68,.15); color: var(--risk); }
.pcard.risk-medium { border-left-color: var(--warn) !important; }
.pcard.risk-high { border-left-color: var(--risk) !important; }
.view-toggle { display: inline-flex; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.view-toggle a { padding: 6px 14px; font-size: 13px; color: var(--muted); background: var(--card); }
.view-toggle a.active { background: var(--brand); color: #fff; }
.mission-bar { background: color-mix(in srgb, var(--brand) 12%, var(--card));
  color: var(--brand-700); border: 1px solid var(--line); border-left: 3px solid var(--brand);
  border-radius: 10px; font-weight: 600; font-size: 13px; text-align: center;
  padding: 9px 14px; margin-bottom: 16px; }
@media (prefers-color-scheme: dark) { .mission-bar { color: var(--text); } }
.empty { color: var(--muted); text-align: center; padding: 40px; }
.raw-text { background: var(--bg); border-radius: 10px; padding: 12px; font-size: 12.5px;
  white-space: pre-wrap; font-family: ui-monospace, monospace; margin: 10px 0; }
.badge-set { color: var(--ok); font-size: 12px; font-weight: 600; }
.badge-unset { color: var(--muted); font-size: 12px; }
.settings-group { padding: 16px 0; border-top: 1px solid var(--line); }
.settings-group:first-child { border-top: none; padding-top: 0; }

/* ── Вход ── */
.login-page { min-height: 100vh; display: grid; place-items: center;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(37,99,235,.18), transparent),
              radial-gradient(1000px 500px at 100% 100%, rgba(96,165,250,.14), transparent), var(--bg); }
.login-card { width: 380px; max-width: 92vw; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-brand .brand-logo { width: 52px; height: 52px; font-size: 24px; border-radius: 14px; }
.login-title { font-weight: 750; font-size: 20px; }
.login-sub { color: var(--muted); font-size: 13px; margin-bottom: 6px; text-align: center; }
.login-hint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 14px; }
.login-alt { text-align: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.link { color: var(--brand); font-weight: 600; cursor: pointer; }
.otp-input { text-align: center; letter-spacing: .5em; font-size: 22px; font-weight: 700; }

/* QR-вход */
.qr-box { background: #fff; border-radius: 20px; padding: 16px; width: max-content;
  margin: 6px auto 4px; box-shadow: 0 8px 30px rgba(0,0,0,.18); line-height: 0; }
.qr-box img { width: 200px; height: 200px; display: block; image-rendering: pixelated; }
.qr-steps { text-align: left; font-size: 13px; color: var(--muted); margin: 14px 4px 6px;
  display: grid; gap: 6px; }
.qr-steps b { color: var(--text); }
.qr-code { display: inline-flex; gap: 6px; margin: 4px auto 2px; padding: 10px 14px;
  background: var(--bg); border: 1px dashed var(--line); border-radius: 12px; }
.qr-code span { font-family: ui-monospace, monospace; font-size: 24px; font-weight: 700;
  letter-spacing: .06em; }
.qr-status { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px;
  font-size: 13px; color: var(--muted); padding: 7px 14px; border-radius: 20px;
  background: var(--bg); }
.qr-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn);
  animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* Стартовый выбор */
.choice-wrap { width: 760px; max-width: 94vw; }
.choice-head { text-align: center; margin-bottom: 26px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.choice-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 30px 26px; box-shadow: var(--shadow); text-align: center; transition: .18s;
  display: flex; flex-direction: column; align-items: center; gap: 12px; }
.choice-card:hover { transform: translateY(-3px); border-color: var(--brand);
  box-shadow: 0 10px 30px rgba(37,99,235,.18); }
.choice-ico { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center;
  color: #fff; font-size: 26px; }
.choice-title { font-size: 17px; font-weight: 700; }
.choice-desc { color: var(--muted); font-size: 13px; }
@media (max-width: 680px) { .choice-grid { grid-template-columns: 1fr; } }

/* ── Постраничная навигация ── */
.pager { display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 18px 0 6px; flex-wrap: wrap; }
.pager-btn { padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-weight: 600; font-size: 14px; }
.pager-btn:hover:not(.disabled) { border-color: var(--brand); color: var(--brand); }
.pager-btn.disabled { opacity: .4; pointer-events: none; }
.pager-info { color: var(--muted); font-size: 13px; }

/* ── Мобильная верхняя панель + выезжающее меню (drawer) ── */
.mtopbar { display: none; }
.drawer-overlay { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  /* на мобильных fixed-фон даёт рваный скролл — отключаем */
  body { background-attachment: scroll; }
  /* парящий логотип на телефоне — мельче и тусклее, чтобы не мешал контенту */
  body::before { width: min(72vw, 340px); height: min(72vw, 340px); right: -8vw; bottom: 10vh; opacity: .3; }
  body::after { display: none; }

  /* фиксированная верхняя панель с бургером */
  .mtopbar { display: flex; align-items: center; gap: 12px; position: fixed;
    top: 0; left: 0; right: 0; height: 56px; z-index: 70; padding: 0 14px;
    background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
    border-bottom: 1px solid rgba(255,255,255,.08); box-shadow: 0 2px 12px rgba(0,0,0,.25); }
  .mburger { background: none; border: none; color: #e2e8f0; padding: 6px; cursor: pointer;
    display: grid; place-items: center; border-radius: 8px; }
  .mburger:active { background: rgba(255,255,255,.08); }
  .mburger svg { width: 24px; height: 24px; }
  .mtopbar-logo { height: 30px; width: auto; }

  /* сайдбар → выезжающая панель слева */
  /* сверху две фиксированные панели: mtopbar 56px + control-bar 50px = 106px,
     иначе первый пункт меню (ПТО) уезжает под них и «пропадает» */
  .sidebar { position: fixed; top: 0; left: 0; width: 268px; max-width: 82vw;
    z-index: 80; height: 100vh; height: 100dvh; padding: 112px 14px 16px; overflow: hidden;
    transform: translateX(-100%); transition: transform .24s ease; }
  .sidebar .brand { display: none; }  /* логотип уже есть в верхней панели — не дублируем */
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 40px rgba(0,0,0,.45); }

  .drawer-overlay { display: block; position: fixed; inset: 0; z-index: 75;
    background: rgba(0,0,0,.72); opacity: 0; visibility: hidden; transition: opacity .2s; }
  .drawer-overlay.show { opacity: 1; visibility: visible; }

  /* контент — под фиксированной панелью (бургер + строка управления), во всю ширину */
  .main { padding: 122px 16px 40px; max-width: none; }
  .mission-bar { display: none; }
  .dash2, .row2, .row3 { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .topbar h1 { font-size: 22px; }
}

@media (max-width: 560px) {
  .main { padding: 116px 12px 32px; }
  .card { padding: 15px; border-radius: 13px; }
  .kpi-big { font-size: 22px; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 10px; }
  h1 { font-size: 21px; }
  table { font-size: 13px; }
  table th, table td { padding: 8px 9px; }
  .btn { padding: 9px 12px; }
}
