/* ГК № 7 — светлая панель: белые карточки на сером, синий акцент, мягкие тени.
   Мобильный экран первым: на телефоне нижнее меню, на компьютере боковое. */
:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #6b7280;
  --line: #eceef2;
  --line-2: #e2e5ea;
  --primary: #2563eb;
  --primary-2: #1d4ed8;
  --primary-soft: #eef3ff;
  --ok: #16a34a;
  --ok-soft: #e8f7ee;
  --debt: #e11d48;
  --debt-soft: #fdecf0;
  --warn: #ea7a12;
  --warn-soft: #fff3e6;
  --violet: #7c3aed;
  --focus: #2563eb;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 1px rgba(15, 23, 42, .02);
  --shadow-lg: 0 12px 32px -12px rgba(15, 23, 42, .18), 0 2px 6px rgba(15, 23, 42, .05);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --side-w: 248px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--font); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.1rem; font-weight: 650; margin-top: 1.8em; }
h3 { font-size: .98rem; font-weight: 650; }
p { margin: 0 0 .8em; max-width: 70ch; }
small, .muted { color: var(--muted); }
code { font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); padding: .05em .35em; border-radius: 6px; }
.ic { width: 20px; height: 20px; flex: none; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: .5rem .8rem; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ===== каркас ===== */
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 750; font-size: 1.08rem; color: var(--ink); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.logo { width: 30px; height: 30px; flex: none; }

.shell { min-height: 100vh; }
@media (min-width: 901px) { .shell { background: linear-gradient(to right, var(--surface) calc(var(--side-w) - 1px), var(--line) 0 var(--side-w), transparent 0); } }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 40;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px; overflow-y: auto;
}
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 18px; }
.side-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #9aa1ad; margin: 14px 10px 6px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  position: relative; display: flex; align-items: center; gap: .7rem;
  padding: .58rem .75rem; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.side-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.side-nav a .ic { color: #8a93a2; transition: color .18s var(--ease), transform .25s var(--ease); }
.side-nav a:hover .ic { transform: translateX(1px) scale(1.06); }
.side-nav a[aria-current] { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.side-nav a[aria-current] .ic { color: var(--primary); }
.side-nav a[aria-current]::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--primary); animation: grow-y .35s var(--ease) both;
}
.side-foot { margin-top: auto; padding-top: 18px; display: grid; gap: 12px; }
.side-card {
  position: relative; overflow: hidden; border-radius: 14px; padding: 14px; color: #fff;
  background: radial-gradient(120% 90% at 100% 0%, #3b82f6 0%, transparent 60%), linear-gradient(160deg, #1e3a8a, #172554);
}
.side-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.12) 50%, transparent 70%); transform: translateX(-100%); animation: sheen 6s ease-in-out 1.2s infinite; pointer-events: none; }
.side-card b { display: block; font-size: .95rem; margin-top: 8px; }
.side-card p { font-size: .8rem; opacity: .8; margin: 4px 0 10px; }
.side-card-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.14); }
.side-card-ic .ic { width: 17px; height: 17px; }
.me { display: flex; align-items: center; gap: .6rem; padding: 4px 4px 0; }
.me-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; margin-right: auto; }
.me-name b { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-name small { font-size: .78rem; }
.me form { margin: 0; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #dbe7ff, #c7d7fe); color: var(--primary-2); font-weight: 700; font-size: .9rem;
  box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px var(--line-2);
}
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 11px; flex: none;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: background-color .15s, transform .15s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .ic { width: 18px; height: 18px; }

.main-col { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem;
  padding: 12px 28px; background: rgba(244, 245, 248, .82); backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s, background-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); background: rgba(255, 255, 255, .85); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.hello { margin: 0; color: var(--muted); font-weight: 500; }

.page { width: 100%; max-width: 1240px; padding: 12px 28px 48px; flex: 1; }
.narrow .page { max-width: 820px; }
.mobile-only { display: none !important; }
.sm-only { display: none; }
.scrim { display: none; }
.side-close { display: none; }
.tabbar { display: none; }

/* до входа */
.pub-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: 1100px; margin: 0 auto; padding: 18px 20px; }
.pub-top nav { display: flex; gap: .5rem; }
.pub-main { max-width: 1100px; margin: 0 auto; padding: 8px 20px 48px; }
.auth-card { max-width: 440px; margin: 4vh auto 0; }
.auth-card h1 { text-align: center; }
.auth-card .lead { text-align: center; color: var(--muted); margin: -.2rem auto 1.4rem; }
.auth-card .btn[type=submit] { width: 100%; }
.auth-foot { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 1rem; }
.auth-foot p { margin: .3rem auto; }

.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: center; margin: 4vh 0 24px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); letter-spacing: -.035em; line-height: 1.08; margin: 14px 0 12px; }
.hero-text p { font-size: 1.05rem; }
.hero-points { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.hero-points li { display: flex; align-items: center; gap: .6rem; font-weight: 500; }
.hero-points .ic { width: 32px; height: 32px; padding: 7px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--primary); box-shadow: var(--shadow); }
.hero-form { box-shadow: var(--shadow-lg); padding: 24px; margin: 0; }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; gap: 20px; margin-top: 8px; } }

/* переключатель гаражей, если их несколько */
.garage-tabs { display: flex; gap: 6px; padding: 4px; margin: 6px 0 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; width: fit-content; max-width: 100%; box-shadow: var(--shadow); }
.garage-tabs a { position: relative; display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .85rem; border-radius: 10px; color: var(--ink-2); font-weight: 600; white-space: nowrap; transition: background-color .2s var(--ease), color .2s; }
.garage-tabs a:hover { text-decoration: none; background: var(--surface-2); }
.garage-tabs a .ic { width: 17px; height: 17px; color: #8a93a2; }
.garage-tabs a[aria-current] { background: var(--primary-soft); color: var(--primary); }
.garage-tabs a[aria-current] .ic { color: var(--primary); }
.debt-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--debt); animation: pulse 2s infinite; }

/* блок «Тарифы на месяц» */
.tariffs .lines td small { display: block; font-size: .8rem; }
.tariffs .lines tr.total td { border-top: 1px solid var(--line-2); border-bottom: 0; padding-top: .6rem; }
.tariff-sub { margin: 16px 0 4px; font-size: .9rem; color: var(--ink-2); }

/* ===== заголовок страницы ===== */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin: 10px 0 20px; }
.page-head h1 { margin: 0; margin-right: auto; }
.page-head .row { gap: .5rem; }
.crumb { display: inline-flex; align-items: center; gap: .35rem; font-size: .88rem; color: var(--muted); margin: 6px 0 2px; }
.crumb .ic { width: 16px; height: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem; height: 38px; padding: 0 .85rem; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--line-2); font-size: .88rem; font-weight: 500; color: var(--ink-2);
}
.chip .ic { width: 16px; height: 16px; color: var(--muted); }

/* ===== карточки ===== */
.panel, .card, .stat, details.invoice, .table-wrap, .qr {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.panel { padding: 18px 20px; margin-bottom: 16px; }
.card { padding: 18px 20px; }
a.panel, a.card { color: inherit; transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s; }
a.panel:hover, a.card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; font-size: .98rem; font-weight: 650; }
.card-head .more { color: var(--muted); font-size: .85rem; }

.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.pager { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: center; margin-top: 1rem; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 16px; }
.kpis { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.cols { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.cols > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.cols .panel, .cols .card, .cols .table-wrap { margin-bottom: 0; }

.stat { padding: 16px 18px; position: relative; overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
a.stat-link { color: inherit; text-decoration: none; display: block; }
a.stat-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat > small:first-child, .stat .stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--ink-2); font-weight: 600; font-size: .9rem; }
.stat b { display: block; font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; margin: 10px 0 6px; line-height: 1.1; }
.stat small { display: block; font-size: .8rem; }
.stat-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.stat-ic .ic { width: 17px; height: 17px; }
.stat-ic.red { background: var(--debt-soft); color: var(--debt); }
.stat-ic.green { background: var(--ok-soft); color: var(--ok); }
.stat-ic.orange { background: var(--warn-soft); color: var(--warn); }
.stat-foot { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }

.pill { display: inline-flex; align-items: center; gap: .2rem; padding: .1rem .5rem; border-radius: 99px; font-size: .78rem; font-weight: 650; white-space: nowrap; }
.pill.up { background: var(--ok-soft); color: var(--ok); }
.pill.down { background: var(--debt-soft); color: var(--debt); }
.pill.flat { background: var(--surface-2); color: var(--muted); }

/* крупная сумма */
.debt-figure { font-size: 2.5rem; font-weight: 750; line-height: 1.05; letter-spacing: -.03em; margin: .3rem 0 .4rem; }
.debt-figure.zero { color: var(--ok); }
.debt-figure.has { color: var(--debt); }
.big-num { font-size: 2.3rem; font-weight: 750; letter-spacing: -.03em; line-height: 1.05; margin: 6px 0; }

/* номер гаража */
.plate {
  display: inline-flex; align-items: center; gap: .45rem; background: var(--primary-soft); color: var(--primary-2);
  border-radius: 12px; font-weight: 750; font-size: 1.35rem; line-height: 1; padding: .45rem .75rem .45rem .55rem; letter-spacing: -.01em;
}
.plate::before {
  content: ""; width: 1.25em; height: 1.25em; border-radius: 8px; flex: none;
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 8.35V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8.35A2 2 0 0 1 3.26 6.5l8-3.2a2 2 0 0 1 1.48 0l8 3.2A2 2 0 0 1 22 8.35Z'/%3E%3Cpath d='M6 18h12'/%3E%3Cpath d='M6 14h12'/%3E%3Crect width='12' height='12' x='6' y='10'/%3E%3C/svg%3E") center/70% no-repeat;
}
.plate.small { font-size: .95rem; border-radius: 10px; padding: .32rem .6rem .32rem .4rem; }
.plate.small::before { border-radius: 6px; }

/* полоски-сегменты как «Customers» в примере */
.segs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.seg { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 0; overflow: hidden; position: relative; }
a.seg { display: block; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.seg:hover { border-color: var(--c, var(--primary)); box-shadow: 0 4px 14px rgb(0 0 0 / .06); transform: translateY(-1px); }
a.seg:focus-visible { outline: 2px solid var(--c, var(--primary)); outline-offset: 2px; }
.seg b { display: flex; align-items: center; gap: .4rem; font-size: 1.05rem; }
.seg small { display: block; margin-bottom: 10px; font-size: .78rem; }
.seg .bar { height: 5px; margin: 0 -12px; background: var(--surface-2); }
.seg .bar i { display: block; height: 100%; width: var(--w, 0%); background: var(--c, var(--primary)); border-radius: 0 3px 3px 0; transform-origin: left; animation: grow-x 1.1s var(--ease) .35s both; }
.seg .dot { width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; background: var(--c, var(--primary)); color: #fff; }
.seg .dot .ic { width: 12px; height: 12px; stroke-width: 2.4; }

/* полукруг-шкала */
.gauge { position: relative; width: 100%; max-width: 260px; margin: 6px auto 0; padding-bottom: 22px; }
.gauge svg { width: 100%; height: auto; display: block; }
.gauge .tick { stroke: #e7e9ee; stroke-width: 6; stroke-linecap: round; transition: stroke .3s; }
.gauge .tick.on { stroke: var(--gc, var(--ok)); }
.gauge-val { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; }
.gauge-val b { display: block; margin-bottom: 14px; font-size: 2rem; font-weight: 750; letter-spacing: -.03em; line-height: 1; }
.gauge-val small { font-size: .78rem; }

/* список «что сделать» */
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.todo a {
  display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border-radius: 12px; border: 1px solid var(--line);
  color: var(--ink); font-weight: 500; transition: background-color .15s, border-color .15s, transform .2s var(--ease);
}
.todo a:hover { text-decoration: none; background: var(--surface-2); border-color: var(--line-2); transform: translateX(2px); }
.todo .ic { width: 18px; height: 18px; color: var(--primary); }
.todo .arrow { margin-left: auto; color: #b3b9c4; transition: transform .2s var(--ease), color .2s; }
.todo a:hover .arrow { transform: translateX(3px); color: var(--primary); }

/* ===== кнопки и поля ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: inherit; font-weight: 600; font-size: .92rem; padding: .62rem 1.05rem; border-radius: 11px;
  border: 1px solid var(--primary); background: linear-gradient(180deg, #3b7bf6, var(--primary)); color: #fff; cursor: pointer;
  text-decoration: none !important; text-align: center; line-height: 1.2;
  box-shadow: 0 1px 2px rgba(37, 99, 235, .25), inset 0 1px 0 rgba(255, 255, 255, .18);
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background-color .15s, filter .15s;
}
.btn:hover { filter: brightness(1.06); box-shadow: 0 6px 16px -6px rgba(37, 99, 235, .55), inset 0 1px 0 rgba(255,255,255,.18); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn .ic { width: 17px; height: 17px; }
.btn.alt, .btn.ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line-2); box-shadow: var(--shadow); }
.btn.alt:hover, .btn.ghost:hover { background: var(--surface-2); filter: none; box-shadow: var(--shadow); }
.btn.ghost { box-shadow: none; border-color: transparent; background: transparent; }
.btn.mark { background: linear-gradient(180deg, #3b7bf6, var(--primary)); }
.btn.danger { background: var(--surface); color: var(--debt); border-color: #f7c6d2; box-shadow: none; }
.btn.danger:hover { background: var(--debt-soft); filter: none; }
.btn.light { background: #fff; color: var(--primary-2); border-color: #fff; box-shadow: none; }
.btn.sm { padding: .42rem .75rem; font-size: .85rem; border-radius: 10px; }
.btn[aria-current] { box-shadow: 0 0 0 3px var(--primary-soft); }
.linkbtn { background: none; border: 0; color: var(--primary); font: inherit; padding: 0; cursor: pointer; }

label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: .3rem; color: var(--ink-2); }
.field { margin-bottom: .9rem; }
.hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=month], input[type=file], input:not([type]), select, textarea {
  font: inherit; width: 100%; padding: .6rem .75rem; border: 1px solid var(--line-2); border-radius: 11px;
  background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .2s var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: #cfd4dc; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #93b4f8; box-shadow: 0 0 0 4px var(--primary-soft); }
textarea { min-height: 6rem; }
.inline { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
.inline .field { margin: 0; flex: 1 1 150px; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--primary); }
form.plain { margin: 0; display: inline; }

/* ===== сообщения ===== */
.flash {
  display: flex; align-items: flex-start; gap: .6rem; padding: .75rem 1rem; border-radius: 12px; margin: 0 0 12px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); animation: drop .45s var(--ease) both;
}
.flash .ic { width: 19px; height: 19px; margin-top: 1px; }
.flash.ok { background: var(--ok-soft); border-color: #c6ebd3; color: #14532d; }
.flash.ok .ic { color: var(--ok); }
.flash.error { background: var(--debt-soft); border-color: #f8c9d4; color: #881337; }
.flash.error .ic { color: var(--debt); }
/* Плашки после сохранения без перезагрузки страницы. */
.toasts { position: fixed; top: 72px; right: 16px; z-index: 60; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toasts .flash { margin: 0; pointer-events: auto; cursor: pointer; box-shadow: 0 10px 30px rgb(15 23 42 / .14); transition: opacity .35s, transform .35s; }
.toasts .flash.toast-out { opacity: 0; transform: translateY(-6px); }
/* Обновлённое без перезагрузки содержимое не проигрывает анимацию появления заново. */
.ajax .page * { animation: none !important; }
[aria-busy="true"] { transition: opacity .15s; }
p.flash { max-width: none; }
.news-strip {
  position: relative; background: linear-gradient(100deg, var(--primary-soft), #f5f8ff 70%); border: 1px solid #dbe5fd;
  padding: .9rem 1.1rem; border-radius: var(--radius); margin-bottom: 16px;
}
.news-strip h3 { margin-bottom: .2rem; }
.news-strip.warning { background: linear-gradient(100deg, var(--debt-soft), #fff6f8 70%); border-color: #f8c9d4; }
.news-strip.warning h3 { color: #9f1239; }
.kind-pick { border: 0; padding: 0; min-width: 0; }
.kind-pick legend { font-weight: 600; font-size: .86rem; margin-bottom: .3rem; color: var(--ink-2); padding: 0; }
.seg-toggle { display: inline-flex; padding: 3px; gap: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.seg-toggle .opt { position: relative; margin: 0; cursor: pointer; }
.seg-toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-toggle span { display: block; padding: .45rem 1rem; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--ink-2); transition: background .15s, color .15s; }
.seg-toggle .opt:hover span { color: var(--ink); }
.seg-toggle input:checked + span { color: #fff; background: var(--primary); box-shadow: 0 1px 4px rgb(15 23 42 / .15); }
.seg-toggle .warning input:checked + span { background: var(--debt); }
.seg-toggle input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ===== таблицы ===== */
th.sortable a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
th.sortable a:hover { color: var(--ink); }
th.sortable .sort-arrow { opacity: .45; font-size: .9em; }
th[aria-sort] { color: var(--primary); }
th[aria-sort] .sort-arrow { opacity: 1; }
.money-debt { color: var(--debt); }
.money-advance { color: var(--ok); font-weight: 600; }
#garage-list[aria-busy="true"] { opacity: .55; transition: opacity .15s; }
.table-wrap { overflow-x: auto; margin-bottom: 16px; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .72rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 600; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; background: transparent; }
tbody tr { transition: background-color .15s; }
tbody tr:hover { background: #fafbfd; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line); }
td a b, td > a { font-weight: 650; }
.card .table-wrap, .panel .table-wrap { border: 0; box-shadow: none; margin: 0 -20px -18px; border-radius: 0 0 var(--radius) var(--radius); }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 99px; font-size: .76rem; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.paid { background: var(--ok-soft); color: var(--ok); }
.badge.partial { background: var(--warn-soft); color: var(--warn); }
.badge.unpaid { background: var(--debt-soft); color: var(--debt); }
.badge.manual::before { display: none; }

/* ===== счета-раскрывашки ===== */
details.invoice { margin-bottom: 10px; overflow: hidden; transition: box-shadow .25s var(--ease), border-color .2s; }
details.invoice:hover { border-color: var(--line-2); }
details.invoice[open] { box-shadow: var(--shadow-lg); }
details.invoice summary { display: flex; gap: .7rem; align-items: center; padding: .85rem 1.1rem; cursor: pointer; list-style: none; font-weight: 550; }
details.invoice summary::-webkit-details-marker { display: none; }
details.invoice summary::before {
  content: ""; width: 18px; height: 18px; flex: none; transition: transform .25s var(--ease);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center/contain no-repeat;
}
details.invoice[open] summary::before { transform: rotate(90deg); }
details.invoice summary .sum { margin-left: auto; font-weight: 700; }
details.invoice .body { padding: 0 1.1rem 1rem 2.8rem; }
details.invoice[open] .body { animation: rise .35s var(--ease) both; }
.lines { width: 100%; }
.lines td { padding: .38rem 0; border: 0; border-bottom: 1px dashed var(--line); }
.lines tr:last-child td { border-bottom: 0; }
.lines tbody tr:hover { background: transparent; }
.pay-by-service td { vertical-align: middle; padding-right: .5rem; }
.pay-by-service td:first-child { width: 100%; }
.pay-by-service td:last-child { white-space: nowrap; padding-right: 0; }
.pay-by-service .badge { white-space: normal; display: inline-block; margin-top: .2rem; line-height: 1.3; }
.yearly-fee { margin: 0 0 .6rem; font-size: .92rem; }
.yearly-fee small { display: block; margin-top: .15rem; }

details > summary { cursor: pointer; }

.qr { padding: 12px; display: inline-block; animation: pop .5s var(--ease) .15s both; }
.qr img { width: min(260px, 70vw); height: auto; display: block; }
.mono-box { font-size: .8rem; color: var(--muted); word-break: break-all; }
.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: .35rem; }

.code-big { font-size: 2rem; font-weight: 800; letter-spacing: .1em; background: var(--primary-soft); color: var(--primary-2); padding: .25rem .7rem; border-radius: 12px; display: inline-block; animation: pop .5s var(--ease) both; }

.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 300px; }
.legend { display: flex; gap: 1rem; font-size: .82rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }

.empty { text-align: center; padding: 2.2rem 1rem; color: var(--muted); }
.empty .ic { width: 36px; height: 36px; color: #b6bdc9; margin-bottom: .4rem; }

.footer { color: #9aa1ad; font-size: .8rem; padding: 1.5rem 16px 2rem; text-align: center; }

/* печать кодов */
.sheet { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.slip { border: 1px dashed #888; padding: 1rem; break-inside: avoid; }

/* ===== анимации ===== */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: none; } }
@keyframes grow-y { from { transform: scaleY(0); } to { transform: none; } }
@keyframes sheen { 0%, 70% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(225, 29, 72, .35); } 70% { box-shadow: 0 0 0 8px rgba(225, 29, 72, 0); } 100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); } }
/* Карточки страницы появляются по очереди. Без JS всё видно сразу. */
.js .page > *, .js .pub-main > * { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
.js .kpis > *, .js .cols > div > *, .js .grid > * { animation: rise .55s var(--ease) both; animation-delay: calc(120ms + var(--i, 0) * 70ms); }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--debt); animation: pulse 2s infinite; }

/* ===== планшет и телефон ===== */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .mobile-only { display: inline-flex !important; }
  .desktop-only { display: none !important; }
  .side {
    width: min(300px, 86vw); transform: translateX(-102%); transition: transform .35s var(--ease); box-shadow: var(--shadow-lg);
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
  .menu-open .side { transform: none; }
  .side-close { display: inline-grid; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(15, 23, 42, .35); opacity: 0; pointer-events: none; transition: opacity .3s; }
  .menu-open .scrim { opacity: 1; pointer-events: auto; }
  .main-col { margin-left: 0; }
  .topbar { padding: 10px 16px; background: rgba(255, 255, 255, .9); border-bottom-color: var(--line); }
  .page { padding: 8px 16px calc(96px + env(safe-area-inset-bottom)); }
  .footer { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around;
    background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 4px;
    color: #8a93a2; font-size: .68rem; font-weight: 600; border-radius: 12px; transition: color .2s; min-width: 0;
  }
  .tabbar a span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a .ic { width: 22px; height: 22px; transition: transform .3s var(--ease); }
  .tabbar a[aria-current] { color: var(--primary); }
  .tabbar a[aria-current] .ic { transform: translateY(-1px); }
  .tabbar a[aria-current]::after { content: ""; position: absolute; bottom: -2px; width: 22px; height: 3px; border-radius: 3px; background: var(--primary); animation: grow-x .35s var(--ease) both; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  h1 { font-size: 1.4rem; }
  .debt-figure { font-size: 2.1rem; }
  .big-num { font-size: 1.9rem; }
  .kpis { gap: 10px; }
  .stat { padding: 14px; }
  .stat b { font-size: 1.3rem; }
  .panel, .card { padding: 16px; }
  .card .table-wrap, .panel .table-wrap { margin: 0 -16px -16px; }
  .segs { gap: 6px; }
  .seg { padding: 8px 8px 0; }
  .seg .bar { margin: 0 -8px; }
  .seg b { font-size: .9rem; }
  .row > .btn { flex: 1 1 auto; }
  .pub-top { padding: 14px 16px; }
  .pub-top .brand span { display: none; }
  .pub-main { padding: 8px 16px 40px; }
  th, td { padding: .6rem .7rem; }
  details.invoice .body { padding-left: 1.1rem; }
}

@media print {
  .side, .topbar, .tabbar, .noprint, .footer, .pub-top { display: none !important; }
  .main-col { margin: 0; }
  body { background: #fff; }
  .page, .pub-main { padding: 0; max-width: none; }
  .js .page > * { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===== обращения ===== */
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  display: inline-grid; place-items: center; background: var(--debt); color: #fff;
  font-style: normal; font-size: .72rem; font-weight: 700; line-height: 1;
}
.nav-badge[hidden] { display: none; }
.icon-btn { position: relative; }
.nav-badge.dot { position: absolute; top: 6px; right: 6px; min-width: 0; width: 9px; height: 9px; padding: 0; border: 2px solid var(--surface); box-sizing: content-box; }
.tabbar a .nav-badge { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; min-width: 17px; height: 17px; font-size: .64rem; padding: 0 4px; }
.badge.tk-new { background: var(--warn-soft); color: var(--warn); }
.badge.tk-work { background: var(--primary-soft); color: var(--primary); }
.badge.tk-done { background: var(--ok-soft); color: var(--ok); }
a.tk-item { display: block; }
a.tk-item:hover { text-decoration: none; }
a.tk-item .row { gap: .75rem; margin-bottom: .25rem; }
a.tk-item.unread { border-color: #c7d6fb; box-shadow: inset 3px 0 0 var(--primary); }
.tk-new-reply { color: var(--primary); font-weight: 600; }
tr.unread td { font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tk-star-form { display: inline; margin: 0; }
.tk-star-col, .tk-act-col { width: 44px; padding-left: 6px !important; padding-right: 6px !important; text-align: center; }
.icon-btn.tk-star, .icon-btn.tk-del { width: 34px; height: 34px; border-color: transparent; background: transparent; color: #b6bdc9; }
.icon-btn.tk-star:hover { color: var(--warn); background: var(--warn-soft); }
.icon-btn.tk-del:hover { color: var(--debt); background: var(--debt-soft); }
.tk-star.on, .icon-btn.tk-star.on { color: var(--warn); }
.tk-star.on .ic { fill: currentColor; }
.btn.tk-star.on { background: var(--warn-soft); border-color: #fbd9b4; }
tr.important td { background: #fffaf3; }
.tk-status { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0 0 16px; }
.chat { display: flex; flex-direction: column; gap: 10px; margin: 0 0 16px; }
.msg { max-width: min(82%, 560px); padding: 10px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.msg.theirs { align-self: flex-start; border-bottom-left-radius: 6px; }
.msg.mine { align-self: flex-end; background: var(--primary-soft); border-color: #dbe5fd; border-bottom-right-radius: 6px; }
.msg-head { display: flex; gap: .6rem; align-items: baseline; justify-content: space-between; margin-bottom: .2rem; font-size: .82rem; }
.msg-head small { color: var(--muted); white-space: nowrap; }
.msg p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.msg img { display: block; margin-top: .5rem; max-width: 100%; max-height: 320px; border-radius: 10px; }
.reply textarea { min-height: 4.5rem; }
.reply .row { gap: .75rem; }
.attach { position: relative; display: inline-flex; align-items: center; gap: .4rem; color: var(--ink-2); font-weight: 500; cursor: pointer; padding: .4rem .6rem; border-radius: 10px; }
.attach:hover { background: var(--surface-2); }
.attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.attach.has-file span::after { content: " ✓"; color: var(--ok); }
@media (max-width: 640px) { .msg { max-width: 92%; } }

/* Красное уведомление о просрочке, по каждой услуге. */
.overdue-box { margin: 0 0 1rem; padding: .8rem 1rem; border-radius: 12px; background: var(--debt-soft); border: 1px solid #f8c9d4; color: #881337; }
.overdue-box ul { list-style: none; margin: .45rem 0 0; padding: 0; display: grid; gap: .35rem; }
.overdue-box li { display: flex; flex-wrap: wrap; gap: .2rem .8rem; align-items: baseline; }
.overdue-box li > span:first-child { flex: 1 1 10rem; font-weight: 600; }
.overdue-box .days { color: var(--debt); font-weight: 600; white-space: nowrap; }
/* Долг по услугам в карточке «Долг на сегодня»: просроченные строки красные. */
.debt-lines { margin-top: .7rem; }
.debt-lines tr.late td:first-child b, .debt-lines tr.late td.num:nth-child(2) { color: var(--debt); }
.debt-lines .late-days { color: var(--debt); font-weight: 600; }
.age-split { display: grid; gap: .1rem; margin-top: .3rem; }
.age-split span { display: flex; justify-content: space-between; gap: .6rem; }
.age-split b { font-size: inherit; color: inherit; font-weight: 600; }
.pay-info { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0 0 .8rem; padding: .6rem .8rem; border-radius: 10px; background: var(--surface-2); }

/* ===== телефон: таблицы, суммы, поля ===== */
/* Подписи «скрытые для экрана» внутри прокручиваемой таблицы не растягивают страницу. */
.table-wrap { position: relative; }
/* Крупные суммы в карточках уменьшаются под ширину карточки и не переносят «₽» на новую строку. */
.stat { container-type: inline-size; }
@supports (font-size: 1cqi) {
  .stat > b { white-space: nowrap; font-size: clamp(1rem, 12.5cqi, 1.65rem); }
}
@media (max-width: 900px) {
  /* Поле меньше 16px — iPhone сам приближает страницу при вводе. */
  input[type=text], input[type=password], input[type=number], input[type=date], input[type=month], input:not([type]), select, textarea { font-size: 16px; }
  .crumb { padding: .35rem 0; }
  th.sortable a { padding: .45rem 0; margin: -.45rem 0; }
  th.sortable a { white-space: normal; }
}
@media (max-width: 640px) {
  td .badge { white-space: normal; line-height: 1.35; }
  /* Срок оплаты под названием услуги — просто красный текст, без плашки. */
  td small.badge { display: inline; background: none; padding: 0; border-radius: 0; font-size: .8rem; }
  td small.badge::before { display: inline-block; margin-right: .3rem; vertical-align: .1em; }
  table.compact { font-size: .85rem; }
  table.compact th, table.compact td { padding: .6rem .5rem; }
  table.compact th:first-child, table.compact td:first-child { padding-left: .9rem; }
  table.compact th:last-child, table.compact td:last-child { padding-right: .9rem; }
  .hide-sm { display: none !important; }
  td.sm-only { display: table-cell; }

  /* Таблица карточками: каждая строка — блок, слева название колонки, справа значение. */
  table.stack, table.stack tbody, table.stack tfoot { display: block; }
  table.stack thead { display: none; }
  table.stack tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; column-gap: .25rem;
    padding: .7rem 16px; border-bottom: 1px solid var(--line);
  }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack tfoot tr { background: var(--surface-2); border-top: 1px solid var(--line); }
  table.stack td {
    grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    padding: .2rem 0; border: 0; background: transparent; text-align: right; min-width: 0;
  }
  table.stack td::before { content: attr(data-label); flex: none; max-width: 45%; text-align: left; color: var(--muted); font-size: .8rem; font-weight: 500; }
  table.stack td:empty { display: none; }
  table.stack td[data-stack=title] { grid-column: 1; grid-row: 1; display: block; text-align: left; font-size: 1rem; padding-bottom: .3rem; }
  table.stack td[data-stack=icon] { grid-column: auto; grid-row: 1; display: block; width: auto; padding: 0 !important; }
  table.stack td[data-stack=act] { justify-content: flex-start; padding-top: .45rem; }
  table.stack td[data-stack]::before, table.stack td:not([data-label])::before { content: none; }
  table.stack td.num { white-space: normal; }
  table.stack td input:not([type=checkbox]) { max-width: 10rem; }
  .card table.stack tr, .panel table.stack tr { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 560px) {
  /* Долг по услугам: название слева, справа сумма и под ней кнопка. */
  .pay-by-service tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: .75rem; align-items: center; padding: .55rem 0; border-bottom: 1px dashed var(--line); }
  .pay-by-service tr:last-child { border-bottom: 0; }
  .pay-by-service td, .lines.pay-by-service td { display: block; border: 0; padding: 0; width: auto; }
  .pay-by-service td:first-child { grid-row: span 2; width: auto; }
  .pay-by-service td.num { text-align: right; }
  .pay-by-service td:nth-child(3) { padding-top: .35rem; }

  /* Счёт-раскрывашка: месяц и сумма в первой строке, статус под ними. */
  details.invoice summary { flex-wrap: wrap; row-gap: .35rem; position: relative; padding-left: 2.6rem; }
  details.invoice summary::before { position: absolute; left: 1rem; top: .95rem; }
  details.invoice summary > span:first-child { order: 1; flex: 1 1 auto; }
  details.invoice summary .sum { order: 2; }
  details.invoice summary::after { content: ""; order: 2; flex-basis: 100%; height: 0; }
  details.invoice summary .badge, details.invoice summary small { order: 3; }
  details.invoice summary small { flex-basis: 100%; }
  details.invoice .body { padding-left: 1rem; padding-right: 1rem; }

  .lines td.num { padding-left: .6rem; }
}

/* ---- Поправки дизайна (05.11) ---- */
.nowrap { white-space: nowrap; }
/* Разбивка долга по давности в карточке «Долг»: сумма в той же строке, что и подпись. */
.stat .age-split b { display: inline; margin: 0; letter-spacing: 0; line-height: inherit; }
/* Заголовок карточки и подсказка справа: если не влезают, подсказка уходит на строку ниже. */
.card-head { flex-wrap: wrap; }
/* Кнопка выбора файла — в стиле остальных кнопок. */
input[type=file] { padding: .4rem .5rem; cursor: pointer; }
input[type=file]::file-selector-button {
  font: inherit; font-weight: 600; font-size: .88rem; color: var(--ink); cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: .35rem .8rem; margin-right: .7rem;
}
input[type=file]::file-selector-button:hover { border-color: #cfd4dc; }
/* Раскрывающиеся блоки (вне счетов): стрелка как у счетов вместо системного треугольника. */
details:not(.invoice) > summary { list-style: none; display: flex; align-items: center; gap: .55rem; font-weight: 600; margin: .6rem 0; }
details:not(.invoice) > summary::-webkit-details-marker { display: none; }
details:not(.invoice) > summary::before {
  content: ""; width: 7px; height: 7px; flex: none; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform .2s var(--ease);
}
details:not(.invoice)[open] > summary::before { transform: rotate(45deg); }
details.panel > summary { margin: 0; }
details.panel[open] > summary { margin-bottom: .7rem; }
/* Итоги по услугам на странице месяца: оплачено — под суммой. */
.svc-sum td.num { white-space: nowrap; }
.svc-sum td.num small { display: block; font-size: .8rem; }
/* Кнопка «Сохранить» под длинным списком всегда видна внизу экрана. */
.sticky-save {
  position: sticky; bottom: 0; z-index: 5; margin: 1rem -4px 0; padding: 12px 4px;
  background: linear-gradient(to bottom, transparent, var(--bg) 35%);
}
@media (max-width: 900px) {
  .sticky-save { bottom: calc(64px + env(safe-area-inset-bottom)); }
}
@media (max-width: 560px) {
  /* Кнопки действий у услуги: одинаковой ширины, одна под другой. */
  .svc-actions { flex-direction: column; align-items: stretch; }
  .svc-actions form, .svc-actions .btn { width: 100%; }
}

/* Услуги (08.11): форма услуги, черновики, прошедшие разовые */
.svc-form fieldset { border: 0; border-top: 1px solid var(--line); margin: 1rem 0 0; padding: .9rem 0 0; min-width: 0; }
.svc-form fieldset:disabled { opacity: .6; }
.svc-form legend { font-weight: 650; padding: 0 .4rem 0 0; color: var(--ink-2); }
.svc-form textarea { width: 100%; }
.svc-form [hidden] { display: none !important; }
.svc-draft { border-left: 4px solid var(--warn); }
.svc-money { display: block; margin-top: .35rem; }
.svc-head { display: grid; gap: .3rem; margin: 0 0 1rem; }
.svc-preview { border-left: 4px solid var(--primary); }
.svc-danger { margin-top: 2rem; }

/* ===== Планшеты (08.11): iPad, Android-планшеты, портрет и альбом ===== */
/* Меню сбоку чуть уже, поля страницы меньше — таблицам хватает ширины без прокрутки. */
@media (min-width: 901px) and (max-width: 1199px) {
  :root { --side-w: 208px; }
  .side { padding-left: 12px; padding-right: 12px; }
  .side-nav a[aria-current]::before { left: -12px; }
  .topbar { padding-left: 20px; padding-right: 20px; }
  .page { padding-left: 20px; padding-right: 20px; }
}
/* Таблицы на планшете: ячейки поуже (на телефоне свои правила ниже 640px). */
@media (min-width: 641px) and (max-width: 1199px) {
  th, td { padding: .65rem .7rem; }
  th:first-child, td:first-child { padding-left: 1rem; }
  th:last-child, td:last-child { padding-right: 1rem; }
  /* Длинные плашки статуса в таблице переносятся, а не растягивают её. */
  td .badge { white-space: normal; line-height: 1.35; }
}
/* На сенсорном экране «подпрыгивание» карточек при касании залипает — отключаем. */
@media (hover: none) {
  .stat:hover, a.panel:hover, a.card:hover, a.seg:hover { transform: none; box-shadow: var(--shadow); }
  .todo a:hover { transform: none; }
}

.demo-login { padding: 10px 14px; margin: 0 0 14px; border-radius: 12px; border: 1px dashed var(--primary); background: var(--surface); text-align: center; }
