/* Макеты NiceDevice · Дейтон / D-Electro. Тёмная тема, акцент #F7D300. */
:root {
  --bg: #121212;
  --bg-elevated: #1c1c1c;
  --bg-sunken: #262626;
  --bg-hover: rgba(255, 255, 255, 0.05);
  --bg-active: #2c2818;
  --bg-sidebar: #161616;
  --text: #f4f2ea;
  --text-secondary: #c4c0b4;
  --text-tertiary: #9a968b;
  --border: #2d2d2d;
  --border-strong: #3c3c3c;
  --brand: #F7D300;
  --brand-hover: #ffe45c;
  --brand-ink: #161616;
  --brand-soft: #3a320c;
  --danger: #ff9b8e;
  --danger-soft: #3d201c;
  --ok: #7dcea0;
  --ok-soft: #1a2e24;
  --warn: #e6c36a;
  --warn-bg: #2a2416;
  --warn-border: #4d4124;
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  --hero-bg: linear-gradient(180deg, #1d1d1d 0%, #0c0c0c 100%);
  --hero-glow: rgba(247, 211, 0, 0.16);
  --font: "Roboto", "Segoe UI", Arial, sans-serif;
  --head: "Oswald", "Arial Narrow", "Roboto", sans-serif;
  --fs: 14px;
  --lh: 1.4;
  --r-btn: 7px;
  --r-field: 8px;
  --r-card: 12px;
  --r-chip: 999px;
  --h-btn: 36px;
  --h-big: 48px;
  --h-tap: 44px;
  --h-tab: 56px;
  --gap: 10px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: #0a0a0a; color: var(--text); }
body { font: 400 var(--fs)/var(--lh) var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; }
:focus { outline: none; }

.app {
  width: 390px;
  height: 844px;
  background: var(--bg);
  color: var(--text);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.shell {
  width: 1440px;
  height: 900px;
  background: var(--bg);
  color: var(--text);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 8px;
  min-height: 56px;
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.head::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: var(--brand);
}
.mark { width: 22px; height: 28px; flex: none; display: block; }
.head-text { flex: 1; min-width: 0; }
.eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-tertiary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.title {
  font-family: var(--head); font-weight: 600; font-size: 18px;
  line-height: 1.15; letter-spacing: .02em; text-transform: uppercase;
  margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hback {
  width: var(--h-tap); height: var(--h-tap); margin: -6px -6px -6px -10px;
  border: 0; background: none; color: var(--text);
  display: grid; place-items: center; border-radius: 50%; padding: 0; flex: none;
}
.hback svg { width: 24px; height: 24px; }
.nd-logo {
  height: 24px; width: auto; flex: none;
  border-radius: 4px; display: block;
}
.nd-wordmark {
  height: 28px; width: auto; flex: none;
  border-radius: 5px; display: block;
}
.role {
  flex: none;
  font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: lowercase;
  background: var(--brand-soft); color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  border-radius: var(--r-chip);
  padding: 4px 9px; line-height: 1.2;
}

.example {
  flex: none;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 5px 14px;
  background: var(--warn-bg);
  border-bottom: 1px solid var(--warn-border);
  color: var(--warn);
  font-size: 11px; font-weight: 500; letter-spacing: .02em;
}
.example b { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

main {
  flex: 1;
  overflow: hidden;
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
main.tight { gap: 8px; padding-top: 10px; }

.tabs {
  flex: none;
  height: var(--h-tab);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 0 4px;
  position: relative;
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--text-tertiary); text-decoration: none;
  font-size: 10.5px; font-weight: 500; border: 0; background: none; padding: 0;
}
.tab svg { width: 22px; height: 22px; }
.tab.on { color: var(--text); font-weight: 700; }
.tab.on svg { color: var(--brand); }
.tab .plus {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-sunken); color: var(--text);
  display: grid; place-items: center; margin-bottom: 1px;
}
.tab.on .plus, .tab.plus-on .plus { background: var(--brand); color: var(--brand-ink); }
.tab.plus-on { color: var(--text); font-weight: 700; }
.tab .plus svg { width: 20px; height: 20px; color: inherit; }

.hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-bg);
  border-radius: var(--r-card);
  padding: 14px 16px 16px;
  box-shadow: inset 0 0 0 1px var(--border);
  flex: none;
}
.hero .glow {
  position: absolute; right: -8px; top: -10px;
  width: 130px; height: 170px; pointer-events: none; opacity: .28;
}
.hero .kicker {
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-tertiary);
  position: relative;
}
.hero .amount {
  font-family: var(--head); font-weight: 700; font-size: 40px;
  line-height: 1.05; color: var(--brand);
  letter-spacing: .01em; margin: 4px 0 6px;
  font-variant-numeric: tabular-nums;
  position: relative; white-space: nowrap;
}
.hero .sub { color: var(--text-secondary); font-size: 13px; position: relative; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: none; }
.stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 10px 12px;
}
.stat .k {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-tertiary);
}
.stat .v {
  font-family: var(--head); font-weight: 600; font-size: 18px;
  letter-spacing: .02em; margin-top: 3px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.stat .hint { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }
.stat.warn .v { color: var(--warn); }
.stat.ok .v { color: var(--ok); }
.stat.danger .v { color: var(--danger); }

.section {
  font-family: var(--head); font-weight: 600; font-size: 13px;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px;
  margin: 2px 0 0;
  flex: none;
}
.section .bolt { color: var(--brand); width: 12px; height: 16px; flex: none; }
.section .more {
  margin-left: auto; font-family: var(--font); text-transform: none;
  letter-spacing: 0; font-size: 12.5px; font-weight: 500; color: var(--text-tertiary);
}

.list { display: flex; flex-direction: column; gap: 8px; }
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 11px 12px;
  display: flex; align-items: flex-start; gap: 10px;
  min-width: 0;
}
.card.alert { border-left: 3px solid var(--danger); padding-left: 11px; }
.card.okline { border-left: 3px solid var(--ok); padding-left: 11px; }
.card.warnline { border-left: 3px solid var(--warn); padding-left: 11px; }
.card.sys { border-left: 3px solid var(--brand); padding-left: 11px; }
.ico {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
}
.ico svg { width: 18px; height: 18px; }
.ico.danger { background: var(--danger-soft); color: var(--danger); }
.ico.ok { background: var(--ok-soft); color: var(--ok); }
.ico.warn { background: var(--warn-bg); color: var(--warn); }
.card .body { flex: 1; min-width: 0; }
.card .row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.card .name {
  font-weight: 700; font-size: 14px; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card .sum {
  font-family: var(--head); font-weight: 600; font-size: 16px;
  letter-spacing: .02em; flex: none;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.card .sum.danger { color: var(--danger); }
.card .sum.ok { color: var(--ok); }
.card .meta {
  margin-top: 2px;
  font-size: 12px; color: var(--text-tertiary);
  white-space: normal; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.card .meta b { color: var(--text-secondary); font-weight: 500; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; border-radius: var(--r-chip);
  padding: 2px 7px; line-height: 1.3; white-space: nowrap;
}
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.brand { background: var(--brand-soft); color: var(--brand); }
.chip.muted { background: var(--bg-sunken); color: var(--text-tertiary); }
.chev { color: var(--text-tertiary); flex: none; width: 16px; height: 16px; margin-top: 8px; opacity: .7; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-chip); height: 40px; padding: 0 14px;
  color: var(--text-tertiary); flex: none;
}
.search svg { width: 18px; height: 18px; flex: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--h-btn); padding: 0 14px; border: 0; border-radius: var(--r-btn);
  background: var(--brand); color: var(--brand-ink);
  font-weight: 700; font-size: 13.5px; cursor: default; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn.ghost {
  background: var(--bg-sunken); color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn.danger-btn {
  background: var(--danger-soft); color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
}
.btn.wide { width: 100%; height: var(--h-big); font-size: 15px; font-family: var(--head); letter-spacing: .04em; text-transform: uppercase; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 12.5px; }
.btn.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }

.field { display: flex; flex-direction: column; gap: 4px; }
.field label {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-tertiary);
}
.field .ctl {
  height: 40px; border-radius: var(--r-field);
  background: var(--bg-sunken); border: 1px solid var(--border-strong);
  padding: 0 12px; display: flex; align-items: center;
  color: var(--text); white-space: nowrap; overflow: hidden;
}
.field .hint { font-size: 11.5px; color: var(--text-tertiary); }
.form { display: flex; flex-direction: column; gap: 9px; }
.form-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 4px; }

.addr { font-size: 13px; color: var(--text-secondary); margin-top: -2px; flex: none; }

.dl {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: 4px 14px;
  flex: none;
}
.dl .row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.dl .row:last-child { border-bottom: 0; }
.dl .k { color: var(--text-tertiary); flex: none; }
.dl .v { font-weight: 500; text-align: right; min-width: 0; }
.dl .v.big { font-family: var(--head); font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.dl .v.danger { color: var(--danger); }
.dl .v.ok { color: var(--ok); }

.comments { display: flex; flex-direction: column; gap: 8px; }
.comment {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: 10px 12px;
}
.comment .who { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.comment .who b { font-size: 13px; }
.comment .who span { font-size: 11.5px; color: var(--text-tertiary); flex: none; }
.comment p { margin: 0; font-size: 13.5px; color: var(--text); line-height: 1.4; }
.composer {
  display: flex; gap: 8px; align-items: center;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: 6px 6px 6px 12px;
  color: var(--text-tertiary); flex: none;
}
.composer span { flex: 1; font-size: 13px; }
.composer .btn { height: 32px; }

.hintbox {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: 11px 12px;
  font-size: 13px; color: var(--text-secondary); line-height: 1.45;
  flex: none;
}
.hintbox .bot {
  font-weight: 700; color: var(--brand);
  background: var(--brand-soft); border-radius: 4px; padding: 1px 6px;
}
.user-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

.dhead {
  flex: none;
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; height: 64px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.dhead::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--brand);
}
.dhead .mark { width: 24px; height: 32px; }
.dhead .title { font-size: 22px; }
.dhead .nd-logo { height: 28px; }
.dhead .sp { flex: 1; }
.dhead .domain { font-size: 12.5px; color: var(--text-tertiary); }
.dbody { flex: 1; display: flex; min-height: 0; }
.side {
  width: 360px; flex: none;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 16px 14px;
  gap: 8px;
}
.side .section { margin-bottom: 4px; }
.side .card.on {
  background: var(--bg-active);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  box-shadow: inset 3px 0 0 var(--brand);
}
.dmain {
  flex: 1; min-width: 0;
  padding: 18px 22px 40px;
  display: flex; flex-direction: column; gap: 14px;
}
.dmain-head { display: flex; align-items: flex-start; gap: 16px; }
.dmain-head .head-text { flex: 1; }
.dmain-head .title { font-size: 26px; }
.table-wrap {
  flex: 1; min-height: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  overflow: hidden;
  display: flex; flex-direction: column;
}
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left; padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px; white-space: nowrap;
}
th {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-tertiary);
  background: var(--bg-sunken);
}
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { font-family: var(--head); font-weight: 600; font-size: 15px; letter-spacing: .02em; }
tr:last-child td { border-bottom: 0; }
tr.overdue td { background: color-mix(in srgb, var(--danger-soft) 55%, transparent); }
tr.paid td { color: var(--text-secondary); }
.dexample {
  position: absolute; right: 22px; bottom: 14px;
  font-size: 11.5px; color: var(--warn);
  background: var(--warn-bg); border: 1px solid var(--warn-border);
  border-radius: var(--r-chip); padding: 4px 10px;
}

[hidden] { display: none !important; }
/* --- живое приложение: на весь экран, не фиксированная рамка макета --- */
html, body { height: 100%; background: var(--bg); }
body { min-height: 100%; display: flex; flex-direction: column; }
.app, .shell { width: 100%; height: auto; min-height: 100%; flex: 1; overflow: visible; }
.app { max-width: 100%; }
main { overflow: auto; flex: 1; }
.tabs { position: sticky; bottom: 0; z-index: 20; }
.head { position: sticky; top: 0; z-index: 20; }
.example { display: none; } /* в рабочей версии плашку «пример» не показываем */

/* поля ввода */
.field .ctl input, .field .ctl select, .field textarea.ctl {
  border: 0; background: transparent; width: 100%; height: 100%;
  padding: 0; color: var(--text); font: inherit;
}
.field textarea.ctl { height: auto; min-height: 72px; padding: 10px 12px; resize: vertical; display: block; }
.field .ctl input::placeholder { color: var(--text-tertiary); }

/* вход */
.login {
  max-width: 400px; margin: 40px auto 0; padding: 0 14px;
  display: flex; flex-direction: column; gap: 14px;
}
.login .hero { text-align: left; }
.login .codes {
  display: flex; gap: 8px; justify-content: space-between;
}
.login .codes input {
  width: 100%; height: 52px; text-align: center; font-family: var(--head);
  font-size: 28px; letter-spacing: .2em; font-weight: 700;
  background: var(--bg-sunken); border: 1px solid var(--border-strong);
  border-radius: var(--r-field); color: var(--text);
}
.toast {
  position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%);
  background: #1a1a1a; color: var(--text); border: 1px solid var(--border-strong);
  border-radius: var(--r-card); padding: 10px 16px; z-index: 50;
  box-shadow: var(--shadow); max-width: 90%; font-size: 13.5px;
}
.empty {
  text-align: center; color: var(--text-tertiary); padding: 28px 16px;
  background: var(--bg-elevated); border: 1px dashed var(--border-strong);
  border-radius: var(--r-card); font-size: 13.5px;
}
.card { cursor: pointer; }
.card:active { background: var(--bg-hover); }
button.card { width: 100%; text-align: left; font: inherit; color: inherit; }
a.tab, a { color: inherit; text-decoration: none; }
.pending-box { margin-top: auto; }

/* широкий кабинет */
@media (min-width: 1000px) {
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .tabs { display: none; }
  body { flex-direction: column; }
  .desk { display: flex; flex: 1; min-height: 0; }
  .desk-nav {
    display: flex; flex-direction: column; gap: 4px;
    width: 220px; flex: none; background: var(--bg-sidebar);
    border-right: 1px solid var(--border); padding: 16px 10px;
  }
  .desk-nav .navitem {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px; color: var(--text-secondary);
    font-weight: 500;
  }
  .desk-nav .navitem svg { width: 20px; height: 20px; }
  .desk-nav .navitem.on { background: var(--bg-active); color: var(--text); box-shadow: inset 3px 0 0 var(--brand); }
  .desk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .dbody { flex: 1; display: flex; min-height: 0; }
  .side { width: 360px; }
  main.split { flex-direction: row; padding: 0; gap: 0; overflow: hidden; }
  main.split .col-objects {
    width: 360px; flex: none; background: var(--bg-sidebar);
    border-right: 1px solid var(--border); padding: 16px 14px; overflow: auto;
    display: flex; flex-direction: column; gap: 8px;
  }
  main.split .col-main { flex: 1; min-width: 0; padding: 18px 22px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
  .dhead-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
  .nd-wordmark { display: block; }
  .head .nd-logo { display: none; }
  .head .nd-wordmark { height: 26px; }
}
@media (max-width: 999px) {
  .desk-nav { display: none !important; }
  .nd-wordmark { display: none; }
  .dbody, main.split { display: flex; flex-direction: column; }
  main.split .col-objects { display: none; }
  main.split .col-main { padding: 0; }
}
.head .nd-wordmark { height: 26px; border-radius: 5px; }

.muted { color: var(--text-tertiary); }
.clickable { cursor: pointer; }
.linkish { color: var(--brand); font-weight: 700; }
