/* Стиль в духе сайта ГК «Технопарк»: тёмно-синий, оранжевый, широкие заголовки.
   Шрифты: Unbounded (заголовки) и Golos Text (текст) — бесплатные аналоги. */
:root {
  --navy: #142737; --navy-2: #1d3549; --navy-3: #26425a;
  --orange: #FF5100; --orange-dark: #E04700; --orange-soft: #FFF1EA;
  --white: #fff; --gray: #E5E5E7; --gray-soft: #F3F3F4; --muted: #8a8580;
  --line: rgba(20, 39, 55, .12); --line-dark: rgba(255, 255, 255, .14);
  --green: #11865b; --green-soft: #e3f6ee; --yellow: #b7791f; --yellow-soft: #fdf3dc;
  --red: #d92d20; --red-soft: #fdecea; --blue: #2b6cb0; --blue-soft: #e8f1fb;
  --font-heading: "Unbounded", "Arial Black", sans-serif;
  --font-body: "Golos Text", "Helvetica Neue", Arial, sans-serif;
  --r-sm: 10px; --r: 16px; --r-lg: 24px;
  --shadow: 0 10px 30px rgba(20, 39, 55, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font-body); color: var(--navy); background: var(--gray-soft); font-size: 15px; line-height: 1.45; }
a { color: inherit; }
h1, h2, h3, .h { font-family: var(--font-heading); text-transform: uppercase; letter-spacing: .01em; margin: 0; }
h1 { font-size: 30px; line-height: 1.1; font-weight: 800; }
h2 { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
h3 { font-size: 14px; font-weight: 700; }
.accent { color: var(--orange); }

/* ---------- Каркас: тёмная панель слева + контент ---------- */
.app { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--navy); color: #fff; padding: 22px 20px; display: flex; flex-direction: column; gap: 20px;
        position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { display: flex; align-items: flex-start; gap: 10px; text-decoration: none; color: #fff; }
.logo .word { font-family: var(--font-heading); font-weight: 800; font-size: 19px; letter-spacing: .02em; line-height: 1; }
.logo .sub { font-size: 11px; opacity: .7; margin-top: 4px; letter-spacing: .03em; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--orange); color: #fff; border-radius: 999px;
        padding: 6px 12px; font-size: 12px; font-weight: 600; }
.pill.ghost { background: transparent; border: 1px solid var(--line-dark); }
.month-box { border: 1px solid var(--line-dark); border-radius: var(--r); padding: 12px 14px; }
.month-box .label { font-size: 12px; opacity: .6; }
.month-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.month-row .m { font-family: var(--font-heading); font-weight: 700; font-size: 15px; text-transform: uppercase; }
.month-row a { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; text-decoration: none;
               background: var(--navy-2); color: #fff; font-size: 16px; }
.month-row a:hover { background: var(--orange); }
.scopes { display: flex; flex-wrap: wrap; gap: 6px; }
.scopes a { font-size: 12px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line-dark); text-decoration: none;
            color: rgba(255,255,255,.75); }
.scopes a.on { background: #fff; color: var(--navy); border-color: #fff; font-weight: 600; }
.nav { display: flex; flex-direction: column; border-top: 1px solid var(--line-dark); }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 2px; text-decoration: none; color: rgba(255,255,255,.6);
         border-bottom: 1px solid var(--line-dark); font-weight: 500; }
.nav a .n { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-size: 12px;
            background: var(--navy-2); color: rgba(255,255,255,.7); flex: none; }
.nav a:hover { color: #fff; }
.nav a.on { color: #fff; }
.nav a.on .n { background: var(--orange); color: #fff; }
.nav .group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .45; padding: 14px 2px 4px; }
.nav .count { margin-left: auto; background: var(--orange); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.side-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.menu-toggle { display: none !important; background: var(--navy-2); }
.side-foot { margin-top: auto; font-size: 13px; opacity: .7; display: flex; justify-content: space-between; }
.side-foot a { color: #fff; }

.main { padding: 26px 32px 60px; min-width: 0; }
.topbar { display: flex; gap: 16px; align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--orange); }
.search { margin-left: auto; position: relative; }
.search input { width: 300px; max-width: 100%; padding: 10px 14px 10px 38px; border-radius: 12px; border: 1px solid var(--line);
                background: #fff; font: inherit; }
.search svg { position: absolute; left: 12px; top: 11px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .eyebrow { font-family: var(--font-heading); font-size: 11px; color: var(--orange); letter-spacing: .12em;
                      text-transform: uppercase; margin-bottom: 8px; font-weight: 600; }
.page-head p { color: var(--muted); margin: 8px 0 0; }

/* ---------- Карточки ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 18px; }
.card.dark { background: var(--navy); color: #fff; border-color: var(--navy); }
.card.dark .muted { color: rgba(255,255,255,.6); }
.card.orange { background: var(--orange-soft); border: 1px dashed var(--orange); }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-2 { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.kpi .label { font-size: 13px; color: var(--muted); }
.kpi .value { font-family: var(--font-heading); font-weight: 700; font-size: 22px; margin-top: 6px; white-space: nowrap; }
.kpi .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi.dark { background: var(--navy); color: #fff; border-color: var(--navy); }
.kpi.dark .label, .kpi.dark .hint { color: rgba(255,255,255,.6); }
.kpi.alert .value { color: var(--red); }
.big { font-family: var(--font-heading); font-size: 26px; font-weight: 700; }
.muted { color: var(--muted); font-size: 13px; }

/* Папки-города и карточки зданий */
.folders { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.folder { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; text-decoration: none;
          display: flex; flex-direction: column; gap: 14px; transition: .15s; position: relative; }
.folder:hover { border-color: var(--orange); box-shadow: var(--shadow); transform: translateY(-2px); }
.folder .ico { width: 46px; height: 46px; border-radius: 12px; background: var(--orange-soft); display: grid; place-items: center; }
.folder .title { font-family: var(--font-heading); font-weight: 700; font-size: 17px; text-transform: uppercase; line-height: 1.15; }
.folder .addr { color: var(--muted); font-size: 13px; margin-top: -8px; }
.folder .stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.folder .stats b { display: block; font-size: 16px; }
.folder .foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line);
                padding-top: 12px; font-size: 13px; color: var(--orange); font-weight: 600; }
.folder .corner { position: absolute; top: 18px; right: 18px; }

/* ---------- Значки статусов ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: 12px;
         font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.paid, .badge.ok, .badge.green { background: var(--green-soft); color: var(--green); }
.badge.sent, .badge.yellow { background: var(--yellow-soft); color: var(--yellow); }
.badge.partial { background: var(--blue-soft); color: var(--blue); }
.badge.overdue, .badge.alarm, .badge.red { background: var(--red-soft); color: var(--red); }
.badge.draft, .badge.offline, .badge.gray { background: var(--gray); color: #5c5751; }
.badge.own { background: var(--navy); color: #fff; }
.badge.managed { background: var(--orange-soft); color: var(--orange-dark); }
.badge.plain::before { display: none; }
/* старые классы пилота */
.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-weight: 600; font-size: 12px; }
.green { background: var(--green-soft); color: var(--green); }
.yellow { background: var(--yellow-soft); color: var(--yellow); }
.red { background: var(--red-soft); color: var(--red); }
.gray { background: var(--gray); color: #5c5751; }

/* ---------- Таблицы ---------- */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th:first-child, td:first-child, td.left, th.left { text-align: left; }
td.left { white-space: normal; min-width: 120px; }
th { font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--orange-soft); }
tr.vacant td { color: var(--muted); }
tr.fail td { color: var(--red); }
td a.row-link { text-decoration: none; font-weight: 600; }
td a.row-link:hover { color: var(--orange); }
tfoot td { font-weight: 700; border-bottom: 0; }

/* ---------- Кнопки и формы ---------- */
button, .btn { font: inherit; font-weight: 600; background: var(--orange); color: #fff; border: 0; border-radius: 12px;
               padding: 11px 20px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
               transition: .15s; }
button:hover, .btn:hover { background: var(--orange-dark); }
button.secondary, .btn.secondary { background: #fff; color: var(--navy); border: 1px solid var(--line); }
button.secondary:hover, .btn.secondary:hover { border-color: var(--orange); color: var(--orange); }
button.dark, .btn.dark { background: var(--navy); }
button.small, .btn.small { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
button.link { background: none; color: var(--red); padding: 0; font-weight: 500; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
input, select, textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; width: 100%;
                          background: #fff; color: var(--navy); }
input:focus, select:focus { outline: 2px solid var(--orange-soft); border-color: var(--orange); }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 12px; }
.reading-form { display: flex; gap: 8px; }
.reading-form input { width: 140px; padding: 7px 10px; }
.flash { background: var(--navy); color: #fff; padding: 14px 18px; border-radius: var(--r); margin-bottom: 18px;
         border-left: 4px solid var(--orange); }
.error { background: var(--red-soft); color: var(--red); padding: 12px 14px; border-radius: 10px; margin-bottom: 12px; }
.warn { color: var(--yellow); font-size: 12px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 8px 14px; border-radius: 10px; text-decoration: none; background: #fff; border: 1px solid var(--line); font-size: 14px; }
.tabs a.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.tabs a .c { opacity: .6; margin-left: 4px; }
.btn-group { display: flex; gap: 6px; }
.btn-group button.active { background: var(--navy); color: #fff; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 12px; }

/* На странице счёта документ широкий — панель уходит вниз раньше */
@media (max-width: 1500px) { .grid-2.doc-layout { grid-template-columns: 1fr; } }

/* Список «требует внимания» */
.att { display: flex; flex-direction: column; gap: 2px; }
.att a, .att div.item { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; text-decoration: none;
                       border-bottom: 1px solid var(--line-dark); font-size: 14px; }
.att a:hover { color: var(--orange); }
.att .sum { font-weight: 600; white-space: nowrap; }

/* Ресурсы */
.res { display: inline-flex; align-items: center; gap: 6px; }
.res.electricity svg { color: #e0a000; } .res.water svg { color: #2b8fd6; } .res.gas svg { color: var(--orange); }

/* Онлайн-блок реле на странице помещения */
.live-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.live-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-top: 16px; }
.live-grid .big { font-size: 22px; }
.phases { font-size: 13px; line-height: 1.8; color: rgba(255,255,255,.8); }
.card.dark .btn.secondary { background: transparent; color: #fff; border-color: var(--line-dark); }

/* Датчики */
.sensors { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.sensor { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; }
.sensor .k { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sensor .v { font-family: var(--font-heading); font-weight: 700; font-size: 18px; margin: 6px 0; }
.sensor.alarm { border-color: var(--red); background: var(--red-soft); }
.sensor.offline { opacity: .65; border-style: dashed; }

/* ---------- Счёт (документ) ---------- */
.doc { background: #fff; border-radius: var(--r); padding: 34px; border: 1px solid var(--line); }
.doc-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--navy); padding-bottom: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.doc .parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; font-size: 14px; }
.doc .parties .t { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.doc .total-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 20px;
                  background: var(--gray-soft); border-radius: 14px; padding: 18px 20px; flex-wrap: wrap; }
.doc .total-row .big { color: var(--orange); }
.qr svg { width: 150px; height: 150px; display: block; }
.msg { white-space: pre-wrap; background: var(--gray-soft); border-radius: 12px; padding: 14px; font-size: 13px; }
.channel-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.channel-tabs button { padding: 6px 12px; font-size: 13px; background: var(--gray-soft); color: var(--navy); }
.channel-tabs button.on { background: var(--navy); color: #fff; }

/* Коммерческое предложение */
.hero { background: var(--navy); color: #fff; border-radius: var(--r-lg); padding: 34px; margin-bottom: 26px; }
.hero h1 { font-size: 30px; margin: 10px 0 14px; }
.hero p { color: rgba(255,255,255,.75); max-width: 760px; margin: 0 0 20px; }
.hero .eyebrow { font-family: var(--font-heading); font-size: 11px; color: var(--orange); letter-spacing: .12em; text-transform: uppercase; }
.hero .btn.secondary { background: transparent; color: #fff; border-color: var(--line-dark); }
h2.sec { margin: 30px 0 14px; font-size: 20px; }
.card.feature { display: flex; flex-direction: column; gap: 8px; text-decoration: none; transition: .15s; }
.card.feature:hover { border-color: var(--orange); box-shadow: var(--shadow); }
.flow { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.flow .step { flex: 1 1 150px; background: var(--gray-soft); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.flow .step .n { width: 26px; height: 26px; border-radius: 8px; background: var(--orange); color: #fff; display: grid; place-items: center; font-weight: 700; }
.flow .arrow { align-self: center; color: var(--orange); font-size: 22px; font-weight: 700; }
.stages { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stage { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--orange); border-radius: var(--r); padding: 18px; }
.stage .t { font-size: 12px; color: var(--orange); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.calc-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-dark); }
.calc-row b { white-space: nowrap; }
.calc-row.big-row b { color: var(--orange); font-size: 20px; font-family: var(--font-heading); }
.cta { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 26px; }
@media (max-width: 900px) { .flow .arrow { display: none; } .hero { padding: 22px; } .hero h1 { font-size: 22px; } }

/* Вход */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--navy); padding: 20px; }
.login { background: #fff; border-radius: var(--r-lg); padding: 34px; width: 100%; max-width: 400px; }
.login h1 { font-size: 24px; margin: 18px 0 20px; }

/* Счётчик строкой: название, было → стало, расход */
.meter-line { padding: 10px 0; border-bottom: 1px solid var(--line); }
.meter-line:last-child { border-bottom: 0; }
.meter-line a { text-decoration: none; }
.meter-line a:hover { color: var(--orange); }
details.meter-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
details.meter-card summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
details.meter-card summary::-webkit-details-marker { display: none; }
details.meter-card[open] { border-color: var(--orange); }

/* ---------- Обход: показания с телефона ---------- */
.round-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.round-obj { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: #fff;
             border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; text-decoration: none; }
.round-obj:hover { border-color: var(--orange); }
.round-obj .bar { grid-column: 1 / -1; }
.round-progress { font-family: var(--font-heading); font-size: 18px; white-space: nowrap; }
.round-progress.full { color: var(--green); }
.bar { height: 6px; border-radius: 999px; background: var(--gray); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--orange); border-radius: 999px; }
.round-card { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--orange); border-radius: var(--r);
              padding: 16px; margin-bottom: 14px; scroll-margin-top: 12px; }
.round-card.done { border-left-color: var(--green); }
.round-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.round-head b { font-size: 16px; }
.round-done { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.round-done img { width: 86px; height: 86px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.round-form { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.round-form label { margin: 0; }
.round-form .check { display: flex; gap: 8px; align-items: center; color: var(--navy); font-size: 14px; margin-top: 8px; }
.round-form .check input { width: auto; }
.round-form .warn-box { background: var(--yellow-soft); padding: 10px 12px; border-radius: 10px; }
.round-form details input { margin-top: 8px; }
.photo-btn { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; border: 2px dashed var(--orange);
             border-radius: 12px; padding: 14px; color: var(--orange-dark) !important; font-weight: 600; cursor: pointer;
             background: var(--orange-soft); font-size: 15px !important; }
.photo-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-preview { width: 100%; max-height: 260px; object-fit: contain; border-radius: 12px; background: var(--gray-soft); }
.big-input { font-size: 26px !important; font-family: var(--font-heading); letter-spacing: .04em; padding: 12px 14px !important; }
.big-btn { padding: 15px; font-size: 16px; justify-content: center; }

/* ---------- Телефон ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .main { padding: 20px 16px 50px; }
  .side { gap: 14px; padding: 16px; }
  .menu-toggle { display: inline-flex !important; }
  body:not(.menu-open) .side .nav, body:not(.menu-open) .side .scopes,
  body:not(.menu-open) .side .side-foot { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .search { margin-left: 0; width: 100%; }
  .search input { width: 100%; }
  h1 { font-size: 22px; }
  .doc { padding: 18px; }
  .doc .parties { grid-template-columns: 1fr; }
}
@media print {
  .side, .topbar, .no-print, .flash { display: none !important; }
  .app { display: block; }
  .main { padding: 0; }
  body { background: #fff; }
  .doc { border: 0; padding: 0; }
}

.grid.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
