/* Кабинет D-Electro — токены как в бонус-приложении / сайте: Oswald, #f5c400, тёмный фон */
:root {
  color-scheme: dark;
  --bg: #121212; --bg-elevated: #1c1c1c; --bg-sunken: #262626;
  --bg-hover: rgba(255,255,255,.05); --bg-active: #2c2818; --bg-sidebar: #161616;
  --text: #f4f2ea; --text-secondary: #c4c0b4; --text-tertiary: #9a968b;
  --border: #2d2d2d; --border-strong: #3c3c3c;
  --brand: #f5c400; --brand-hover: #ffd22a; --brand-ink: #161616; --brand-soft: #3a320c;
  --danger: #ff9b8e; --ok: #7dcea0; --warn: #e6c36a;
  --font: "Roboto", "Segoe UI", Arial, sans-serif;
  --head: "Oswald", "Arial Narrow", "Roboto", sans-serif;
  --fs: 14px; --lh: 1.4;
  --r-btn: 7px; --r-card: 12px; --r-chip: 999px; --h-tap: 44px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: #0a0a0a; color: var(--text); height: 100%; }
body { font: 400 var(--fs)/var(--lh) var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { touch-action: manipulation; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
#app { min-height: 100%; display: flex; flex-direction: column; background: var(--bg); }
.head { position: relative; display: flex; align-items: center; gap: 12px;
  padding: calc(8px + var(--safe-top)) 16px 8px; min-height: 56px;
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  border-bottom: 1px solid var(--border); overflow: visible; }
.head::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--brand); }
.hbrand { display: flex; align-items: center; text-decoration: none; flex: none; min-width: 0; color: inherit; overflow: visible; }
/* как на d-electro.pro: D слева, «-electro» и подпись плотно справа столбиком */
.brand-lockup { display: inline-flex; align-items: center; gap: .14em; overflow: visible;
  font-family: "Segoe UI", "Helvetica Neue", Arial, Roboto, sans-serif; color: #fff; line-height: 1; }
.brand-lockup .hd { display: block; height: 36px; width: auto; aspect-ratio: 553 / 713; overflow: visible; flex: none; }
.brand-text { display: flex; flex-direction: column; justify-content: center; text-align: left; }
.brand-name { display: block; font-size: 22px; font-weight: 700; letter-spacing: .5px; line-height: 1; font-style: normal; padding: 0; margin: 0; }
.brand-text small { display: block; font-size: 10px; font-weight: 400; color: #b9b9b9; letter-spacing: .4px; margin-top: 3px; padding: 0; }
/* шапка — одна строка, без подписи (подпись только в центральном блоке входа) */
.head .brand-text small { display: none; }
.head .brand-lockup .hd { height: 34px; }
.head .brand-name { font-size: 22px; }
@media (max-width: 419px) {
  .head { min-height: 52px; }
  .head .brand-lockup .hd { height: 30px; }
  .head .brand-name { font-size: 20px; }
}
.htitles { flex: 1; min-width: 0; text-align: left; }
/* кабинет: логотип в шапке убираем, двухстрочный заголовок раздела — слева; на экранах входа логотипы не трогаем */
#app:not(.gate) .hbrand { display: none; }
#app:not(.gate) .head { justify-content: flex-start; }
#app:not(.gate) .hsub,
#app:not(.gate) .htitle { text-align: left; }
.hsub { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-tertiary); }
.htitle { font-family: var(--head); font-weight: 600; font-size: 18px; letter-spacing: .02em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; }
.hlogout { border: 1px solid var(--border-strong); background: transparent; color: var(--text-secondary);
  height: 32px; padding: 0 12px; border-radius: var(--r-btn); cursor: pointer; }
.hlogout:hover { border-color: var(--brand); color: var(--text); }
main { flex: 1; padding: 14px 14px 80px; }
.tabs { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 1fr 1fr; background: var(--bg-elevated);
  border-top: 1px solid var(--border); padding: 6px 8px calc(6px + var(--safe-bottom)); }
.tabs button { background: none; border: 0; color: var(--text-tertiary); padding: 8px; border-radius: 8px; cursor: pointer; }
.tabs button.on { color: var(--brand-ink); background: var(--brand); font-weight: 500; }
.hero { background: radial-gradient(120% 90% at 100% 0%, rgba(245,196,0,.16) 0%, transparent 60%),
  linear-gradient(180deg, #1d1d1d 0%, #0c0c0c 100%); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px 16px; margin-bottom: 14px; }
.hero .k { color: var(--text-tertiary); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.hero .amount { font-family: var(--head); font-weight: 700; font-size: 48px; line-height: 1.05; margin-top: 4px; color: var(--brand); }
.kpis { display: grid; gap: 8px; margin: 12px 0; }
.kpi { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.kpi .k { color: var(--text-tertiary); font-size: 11px; text-transform: uppercase; }
.kpi .v { font-weight: 700; font-size: 20px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 12px 14px; margin: 0 0 8px; cursor: pointer; }
.card .name { font-weight: 500; }
.card .meta { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }
.chip { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: var(--r-chip); background: var(--bg-sunken); color: var(--text-secondary); }
.chip.warn { background: #2a2416; color: var(--warn); }
.chip.ok { background: #1a2e24; color: var(--ok); }
.chip.bad { background: #3d201c; color: var(--danger); }
.btn { background: var(--brand); color: var(--brand-ink); border: 0; height: 44px; padding: 0 16px;
  border-radius: var(--r-btn); font-weight: 700; cursor: pointer; }
.btn:hover { background: var(--brand-hover); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border-strong); font-weight: 500; }
.btn.wide { width: 100%; }
.btn-row { display: flex; gap: 8px; margin: 12px 0; }
.field { margin: 0 0 12px; }
.field label { display: block; font-size: 12px; color: var(--text-tertiary); margin-bottom: 4px; }
.ctl input, .ctl select { width: 100%; height: 48px; background: var(--bg-sunken); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 0 12px; }
.hint { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.login-lead { color: var(--text-secondary); margin: 0 0 14px; }
#toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: #2a2a2a;
  border: 1px solid var(--border-strong); padding: 10px 14px; border-radius: 8px; z-index: 20; max-width: 90%; }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 30; }
.modal { background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: 14px; padding: 18px; width: min(360px, 92vw); }
.modal p { margin: 0 0 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.profile-card { cursor: pointer; }

/* ---------- экран входа (ворота) ---------- */
#app.gate { flex-direction: column; }
#app.gate .hbrand,
#app.gate .htitles,
#app.gate .hlogout { display: none; }
/* шапка на входе пустая — оставляем только жёлтую полоску, тёмную плашку убираем */
#app.gate .head {
  position: sticky; top: 0; left: auto; right: auto; z-index: 10;
  min-height: 0; height: 3px; padding: 0; gap: 0;
  background: transparent; border: 0; overflow: hidden;
}
#app.gate .desk-nav, #app.gate .tabs { display: none !important; }
#app.gate main { margin: 0 auto; width: 100%; max-width: 760px; padding: 28px 16px 48px; }
.loginscr { max-width: 560px; margin: 0 auto; }
.login-hero { text-align: center; margin: 12px 0 20px; }
.login-hero .brand-lockup { display: inline-flex; align-items: center; gap: .16em; margin: 0 auto 20px; overflow: visible; }
.login-hero .brand-lockup .hd { height: 64px; } /* видимая D ≈ 55px */
.login-hero .brand-name { font-size: 40px; }
.login-hero .brand-text small { display: block; font-size: 13px; letter-spacing: .5px; margin-top: 4px; }
@media (max-width: 419px) {
  .login-hero .brand-lockup .hd { height: 56px; } /* видимая D ≈ 48px */
  .login-hero .brand-name { font-size: 34px; }
  .login-hero .brand-text small { font-size: 12px; }
}
.login-hero-sub { margin: 4px 0 18px; }
.login-hero-sub .brand-lockup { margin: 0 auto; }
.login-hero h1 { font-family: var(--head); font-weight: 700; font-size: 32px; letter-spacing: .04em; text-transform: uppercase; margin: 0; }
.login-hero p { margin: 0; color: var(--text-secondary); font-size: 15px; }

.login-cards { display: grid; gap: 14px; }
.login-choice { display: flex; align-items: center; gap: 16px; text-align: left; width: 100%;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px 18px; min-height: 112px; cursor: pointer; color: inherit; text-decoration: none;
  transition: border-color .15s var(--ease), transform .12s var(--ease), background .12s var(--ease); }
.login-choice:hover, .login-choice:focus-visible { border-color: var(--brand); background: var(--bg-active); }
.login-choice:active { transform: scale(.985); }
.login-ico { width: 56px; height: 56px; border-radius: 14px; flex: none; display: grid; place-items: center;
  background: var(--brand); color: var(--brand-ink); }
.login-ico svg { width: 28px; height: 28px; }
.login-choice .t, .login-choice .s { display: block; }
.login-choice .t { font-family: var(--head); font-weight: 700; font-size: 22px; letter-spacing: .03em; text-transform: uppercase; line-height: 1.15; }
.login-choice .s { color: var(--text-secondary); font-size: 13px; margin-top: 6px; line-height: 1.35; }
.login-choice .chev { margin-left: auto; color: var(--text-tertiary); flex: none; }

.login-staff { text-align: center; margin: 22px 0 0; }
.login-staff a { color: var(--text-tertiary); font-size: 13px; text-decoration: none; border-bottom: 1px solid var(--border-strong); }
.login-staff a:hover { color: var(--brand); border-color: var(--brand); }

.login-back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); text-decoration: none;
  font-size: 13px; margin: 0 0 12px; min-height: var(--h-tap); }
.login-back:hover { color: var(--brand); }
.login-panel { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px; padding: 22px 20px 20px; }
.login-panel h2 { font-family: var(--head); font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  font-size: 22px; margin: 0 0 8px; }
.login-panel .login-lead { margin-bottom: 18px; }
.login-panel .codein { font-size: 26px; font-weight: 700; letter-spacing: .28em; text-align: center;
  font-variant-numeric: tabular-nums; height: 56px; }
.login-panel .codein.pin4 { letter-spacing: .4em; }
.login-alt { margin: 16px 0 0; text-align: center; }
.login-alt a { color: var(--brand); text-decoration: none; font-size: 14px; }
.login-alt a:hover { text-decoration: underline; }
.login-steps { margin-top: 16px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg-elevated); }
.login-steps .row { display: flex; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border); }
.login-steps .row:first-child { border-top: 0; }
.login-steps .lead { width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 13px; }
.login-steps .t { font-weight: 500; }
.login-steps .s { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }

@media (min-width: 720px) {
  .loginscr { max-width: 720px; }
  .login-cards { grid-template-columns: 1fr 1fr; }
  .login-choice { flex-direction: column; align-items: flex-start; min-height: 200px; padding: 26px 24px; }
  .login-choice .chev { display: none; }
  .login-hero h1 { font-size: 40px; }
  #app.gate main { padding: 36px 28px 64px; max-width: 880px; }
}

@media (min-width: 1000px) {
  #app:not(.gate) { flex-direction: row; }
  #app:not(.gate) .head { position: fixed; left: 220px; right: 0; top: 0; padding-left: 28px; padding-right: 28px; }
  #app:not(.gate) .tabs { display: none; }
  #app:not(.gate) main { margin: 64px 0 0 220px; padding: 24px 28px; max-width: 960px; }
  .desk-nav { display: flex; flex-direction: column; width: 220px; position: fixed; top: 0; bottom: 0; left: 0;
    background: var(--bg-sidebar); border-right: 1px solid var(--border); padding: 16px 10px; gap: 4px; }
  .desk-nav .brand { display: flex; justify-content: center; align-items: center; margin: 0; padding: 8px 8px 16px; overflow: visible; box-sizing: border-box; }
  .desk-nav .brand .brand-lockup { display: inline-flex; align-items: center; gap: .14em; overflow: visible; font-size: 16px; }
  .desk-nav .brand .brand-lockup .hd { display: block; height: 2em; width: auto; aspect-ratio: 553 / 713; overflow: visible; flex: none; }
  .desk-nav .brand .brand-name { display: block; font-size: 1.125em; font-weight: 700; letter-spacing: .028em; line-height: 1; margin: 0; }
  .desk-nav .brand .brand-text small { display: block; font-size: .5625em; font-weight: 400; color: #b9b9b9; letter-spacing: .044em; margin-top: .12em; }
  .desk-nav button { text-align: left; background: none; border: 0; color: var(--text-secondary); padding: 10px 12px; border-radius: 8px; cursor: pointer; }
  .desk-nav button.on { background: var(--bg-active); color: var(--text); box-shadow: inset 3px 0 0 var(--brand); }
  /* десктоп: «Выйти» только внизу колонки, в шапке справа скрываем */
  #app:not(.gate) .hlogout { display: none; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 999px) { .desk-nav { display: none; } }

/* D-коины — как в бонус-приложении: значок-логотип в крупных суммах и KPI */
.camt { white-space: nowrap; display: inline-flex; align-items: baseline; }
.coin { width: .82em; height: .82em; margin-left: .2em; flex: none; align-self: center; transform: translateY(-.02em); }
.coin.coin-img { display: inline-block; width: .64em; height: .84em; margin-left: .16em; background: var(--cd) center / contain no-repeat;
  transform: translateY(.02em); }
.hero .amount .coin.coin-img { width: .56em; height: .74em; margin-left: .12em; }
.kpi .v .coin.coin-img { width: .72em; height: .95em; }

/* строки заказов / разморозки / выдач у монтажника: слева текст, справа D-коины */
.card.orow { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: default; }
.card.orow .num { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.card.orow .num s { color: var(--text-tertiary); }
main h3 { margin: 18px 0 10px; }

.req-badge { display: inline-flex; min-width: 1.2rem; height: 1.2rem; padding: 0 5px; margin-left: 6px;
  border-radius: 999px; background: #f5c400; color: #161616; font-size: 11px; font-weight: 800;
  align-items: center; justify-content: center; line-height: 1; vertical-align: middle; }
.sec-switch a.on .req-badge { background: #161616; color: #f5c400; }

/* NIC-26 mobile:begin */
/* NIC-26 mobile: телефон. Внешний вид не меняем — только удобная область нажатия у мелких ссылок и кнопок
   (невидимое расширение до ~44 px). Отступы под вырез/панель Telegram уже берутся из --safe-top / --safe-bottom. */
@media (pointer: coarse) {
  .login-alt a, .login-staff a, .login-back, .hlogout, .linkbtn { position: relative; }
  .login-alt a::after, .login-staff a::after, .login-back::after, .linkbtn::after { content: ""; position: absolute; inset: -14px -6px; }
  .hlogout::after { content: ""; position: absolute; inset: -6px; }
}
.sp-out { display: block; text-align: center; margin-top: 14px; padding: 12px 0; color: var(--text-secondary); font-size: 14px; text-decoration: none; }
.sp-out:hover { color: var(--brand); }
/* NIC-26 mobile:end */
