/* 369 CRM — общая дизайн-система.
   Палитра и пластика унаследованы от Production Panel: тёмная поверхность,
   стеклянные карточки, неон cyan→violet. Цвета состояний — те же якоря,
   проверенные на тёмном фоне. Один файл на обе стороны (админка и портал
   партнёра): расходиться темам нельзя, партнёр должен видеть «тот же продукт». */
/* Roboto — self-hosted (CSP не пускает внешние шрифты; работает офлайн). */
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/static/fonts/roboto-400-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/static/fonts/roboto-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/static/fonts/roboto-500-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/static/fonts/roboto-500-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/static/fonts/roboto-700-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/static/fonts/roboto-700-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 900; font-display: swap;
  src: url('/static/fonts/roboto-900-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 900; font-display: swap;
  src: url('/static/fonts/roboto-900-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #060913;
  --card: rgba(14, 19, 35, .72);
  --card2: rgba(24, 31, 54, .8);
  --border: rgba(125, 160, 255, .13);
  --border-glow: rgba(34, 211, 238, .35);
  --text: #e8edff; --muted: #8089ad;
  --neon1: #22d3ee; --neon2: #8b5cf6;
  --accent-grad: linear-gradient(100deg, #22d3ee, #8b5cf6);
  --st-good: #3ba244; --st-warn: #c18717; --st-crit: #f0526e;
  --st-review: #488ee0; --st-gray: #8c92a0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 400px at 12% -8%, rgba(34,211,238,.09), transparent 70%),
    radial-gradient(700px 500px at 95% 8%, rgba(139,92,246,.10), transparent 70%),
    radial-gradient(800px 600px at 50% 110%, rgba(34,211,238,.05), transparent 70%);
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 26px 18px 70px; }
a { color: var(--neon1); text-decoration: none; }

/* ---- шапка ---- */
header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
h1 { font-size: 21px; font-weight: 800; letter-spacing: .01em; white-space: nowrap; }
h1 .grad {
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text;
  color: transparent; filter: drop-shadow(0 0 14px rgba(34,211,238,.45));
}
.sub { color: var(--muted); font-size: 12px; }
.spacer { flex: 1; }
.chip { font-size: 11px; color: var(--muted); border: 1px solid var(--border);
        border-radius: 20px; padding: 3px 10px; background: var(--card); white-space: nowrap; }
.chip b { color: var(--text); font-variant-numeric: tabular-nums; }
.chip.on { color: var(--neon1); border-color: rgba(34,211,238,.35); }
.chip.bad { color: #e08f8f; border-color: rgba(208,59,59,.45); }
.chip.bad b { color: var(--st-crit); }

/* ---- кнопки ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--card2);
       color: var(--text); border: 1px solid var(--border); border-radius: 9px;
       padding: 7px 14px; cursor: pointer; font-size: 13px; text-decoration: none;
       font-family: inherit; transition: border-color .15s, box-shadow .15s; }
.btn:hover { border-color: var(--border-glow); box-shadow: 0 0 14px rgba(34,211,238,.18); }
.btn.primary { background: var(--accent-grad); border: none; color: #fff; font-weight: 600;
               box-shadow: 0 0 18px rgba(99,142,255,.35); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.danger:hover { border-color: rgba(208,59,59,.6); color: #e06060;
                    box-shadow: 0 0 12px rgba(208,59,59,.2); }
.btn.tgon { border-color: rgba(34,211,238,.45); box-shadow: 0 0 12px rgba(34,211,238,.25); }
.btn.keyon { border-color: rgba(139,92,246,.55); box-shadow: 0 0 12px rgba(139,92,246,.3); }

/* ---- вкладки клиентов ---- */
.tabs { display: flex; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--border);
        overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 15px 26px 16px; color: var(--muted); text-decoration: none; font-weight: 800;
       font-size: 16px; letter-spacing: .04em; position: relative; white-space: nowrap;
       border-radius: 12px 12px 0 0; transition: color .15s, background .15s; }
.tab b { color: inherit; font-weight: 700; margin-left: 8px; font-size: 13px;
         font-variant-numeric: tabular-nums; background: rgba(125,160,255,.12);
         border-radius: 20px; padding: 2px 9px; vertical-align: 2px; }
.tab.active { color: var(--text); background: linear-gradient(180deg, rgba(34,211,238,.10), transparent); }
.tab.active b { background: rgba(34,211,238,.2); color: var(--neon1); }
.tab.active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px;
  background: var(--accent-grad); border-radius: 3px; box-shadow: 0 0 14px rgba(34,211,238,.7);
}
.tab:hover { color: var(--text); }
.tab .alert-dot { position: absolute; top: 12px; right: 10px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--st-crit); box-shadow: 0 0 8px rgba(240,82,110,.8); }
.tab.newtab { color: var(--neon1); font-weight: 700; font-size: 14px; padding-top: 17px; }

/* ---- KPI ---- */
.stats { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto;
         padding-bottom: 2px; scrollbar-width: thin; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px;
        padding: 10px 12px; position: relative; overflow: hidden; backdrop-filter: blur(10px);
        flex: 1 1 0; min-width: 116px; }
.stat::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
                background: linear-gradient(90deg, transparent, rgba(34,211,238,.5), transparent); }
.stat b { font-size: 23px; display: block; font-weight: 700; line-height: 1.1;
          font-variant-numeric: tabular-nums; }
.stat .label { color: var(--muted); font-size: 9.5px; text-transform: uppercase;
               letter-spacing: .05em; display: flex; align-items: center; gap: 5px;
               margin-top: 2px; line-height: 1.3; }
.stat .label i { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.stat.crit b { color: var(--st-crit); }

/* ---- карточки ---- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px;
        padding: 16px 18px; backdrop-filter: blur(10px); }
.card h2 { font-size: 13px; font-weight: 700; text-transform: uppercase;
           letter-spacing: .07em; margin-bottom: 12px; }
.card h2 .n { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ---- панель клиента (тулбар под вкладками) ---- */
.clientbar { display: flex; gap: 10px; align-items: center; margin: -6px 0 16px; flex-wrap: wrap; }
.portal-link { display: flex; align-items: center; gap: 8px; background: var(--card);
  border: 1px solid rgba(139,92,246,.4); border-radius: 10px; padding: 6px 12px;
  font-size: 12px; box-shadow: 0 0 14px rgba(139,92,246,.12); }
.portal-link code { color: #c4b5fd; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }

/* ---- состав портфеля ---- */
.compbar { display: flex; gap: 2px; height: 16px; border-radius: 5px; overflow: hidden;
           margin-bottom: 14px; }
.compbar div { min-width: 6px; }
.legend { display: flex; flex-direction: column; gap: 8px; }
.legend .item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend .item i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend .item b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---- консоль ---- */
.console-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  backdrop-filter: blur(10px); margin-bottom: 14px; overflow: hidden; }
.console-card.alarm { border-color: rgba(240,82,110,.4); box-shadow: 0 0 22px rgba(240,82,110,.10); }
.console-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.console-head .ico { font-size: 20px; }
.console-title b { font-size: 14.5px; font-weight: 700; display: block; }
.console-title .pkgline { color: var(--muted); font-size: 11.5px;
  font-family: ui-monospace, Menlo, monospace; }
.keychip { font-size: 11px; border-radius: 20px; padding: 3px 10px; white-space: nowrap;
  border: 1px solid rgba(139,92,246,.5); color: #c4b5fd; background: rgba(139,92,246,.08); }
.keychip.off { border-color: rgba(193,135,23,.5); color: var(--st-warn);
  background: rgba(193,135,23,.07); }
.netchips { display: flex; gap: 6px; flex-wrap: wrap; }
.netchip { font-size: 11px; border: 1px solid var(--border); border-radius: 7px;
  padding: 2px 8px; background: var(--card2); white-space: nowrap; }
.netchip.held { border-color: rgba(240,82,110,.4); color: var(--st-crit); }
.armed { font-size: 11px; border-radius: 20px; padding: 3px 10px; white-space: nowrap;
  border: 1px solid rgba(34,211,238,.4); color: var(--neon1); background: rgba(34,211,238,.06); }
.armed.off { border-color: rgba(193,135,23,.5); color: var(--st-warn);
  background: rgba(193,135,23,.07); }

/* ---- таблица приложений ---- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border);
         vertical-align: middle; }
th { color: var(--muted); font-size: 10.5px; text-transform: uppercase;
     letter-spacing: .08em; font-weight: 700; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(34,211,238,.025); }
.tablebox { overflow-x: auto; }
.appcell { display: flex; align-items: center; gap: 12px; min-width: 210px; }
.appcell img, .appcell .noicon { width: 38px; height: 38px; border-radius: 10px;
  background: var(--card2); flex-shrink: 0; }
.appcell .noicon { display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 15px; }
.appname { font-weight: 600; }
.appname a { color: var(--text); }
.appname a:hover { color: var(--neon1); }
.pkg { color: var(--muted); font-size: 12px; font-family: ui-monospace, Menlo, monospace; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px;
         font-weight: 700; background: var(--cbg, rgba(140,146,160,.16));
         color: var(--c, var(--st-gray)); white-space: nowrap; }
.srcline { font-size: 10.5px; margin-top: 3px; color: var(--muted); }
.srcline.exact { color: #35c435; }
.muted { color: var(--muted); font-size: 12px; }
.actions { display: flex; gap: 6px; }
.campcell { display: flex; gap: 5px; flex-wrap: wrap; max-width: 210px; }

/* ---- SDK-тумблеры карточки ---- */
.sdkrow { display: flex; gap: 10px; flex-wrap: wrap; }
.sdktoggle { display: flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 13px;
  font-size: 13px; background: var(--card2); transition: border-color .15s; }
.sdktoggle .sdk-ic { font-size: 16px; }
.sdktoggle b { font-size: 11px; color: var(--muted); font-weight: 700;
  text-transform: uppercase; }
.sdktoggle.on { border-color: rgba(59,162,68,.5); box-shadow: 0 0 12px rgba(59,162,68,.14); }
.sdktoggle.on b { color: #7ee07e; }

/* Плитка статусов «что в сборке» — SDK, языки, WebView */
.tilegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px; margin: 4px 0 14px; }
.tile { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  background: var(--card2); position: relative; overflow: hidden; }
.tile .tl-ic { font-size: 20px; display: block; margin-bottom: 6px; }
.tile .tl-name { font-size: 12.5px; font-weight: 700; }
.tile .tl-val { font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin-top: 2px; font-weight: 700; }
.tile.on { border-color: rgba(59,162,68,.45); box-shadow: 0 0 14px rgba(59,162,68,.1); }
.tile.on .tl-val { color: #7ee07e; }
.tile.off { opacity: .6; }
.tile.off .tl-val { color: var(--st-crit); }
.tile::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--st-crit); opacity: .5; }
.tile.on::after { background: var(--st-good); }
.tile.lang { grid-column: span 2; }
.tile.lang .langflag { display: inline-block; font-size: 11px; border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 7px; text-transform: uppercase; margin: 2px 4px 0 0; }
.tile.lang .langflag.primary { border-color: rgba(34,211,238,.45); color: var(--neon1); }
.tile.web { grid-column: 1 / -1; }
.tile.web code { color: var(--neon1); font-size: 11.5px; word-break: break-all; }

/* ---- раскрытие приложения: скриншоты и тексты листинга ---- */
.expbtn { background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 12px; padding: 4px 6px; transition: transform .15s, color .15s; }
.expbtn.open { transform: rotate(90deg); color: var(--neon1); }
.exprow > td { background: rgba(8, 11, 21, .55); padding: 16px 18px; }
.exphead { font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .08em; font-weight: 700; margin-bottom: 10px; }
.shots { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px;
  margin-bottom: 12px; }
.shots a { flex-shrink: 0; }
.shots img { height: 150px; border-radius: 10px; border: 1px solid var(--border);
  display: block; transition: border-color .15s, box-shadow .15s; }
.shots img:hover { border-color: var(--border-glow);
  box-shadow: 0 0 16px rgba(34,211,238,.25); }
.shortdesc { font-size: 13.5px; line-height: 1.6; margin-bottom: 10px; }
.fulldesc summary { cursor: pointer; color: var(--neon1); font-size: 12.5px; }
.fulldesc pre { white-space: pre-wrap; font: 12.5px/1.65 inherit; color: var(--text);
  margin-top: 10px; max-height: 320px; overflow-y: auto; }

/* ---- алерты ---- */
.events .ev { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 12.5px; align-items: baseline; }
.events .ev:last-child { border-bottom: none; }
.events .ev time { color: var(--muted); font-size: 11px; white-space: nowrap; width: 96px;
  flex-shrink: 0; font-variant-numeric: tabular-nums; }
.events .ev .k { flex-shrink: 0; }
.events .ev b { font-weight: 600; }
.events .ev .d { color: var(--muted); }
.events .ev .badge { font-size: 10.5px; padding: 2px 8px; }

/* ---- сетки ---- */
.grid2 { display: grid; grid-template-columns: 5fr 7fr; gap: 12px; margin-bottom: 20px; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } }

/* ---- предупреждения ---- */
.warnbar { background: rgba(250,178,25,.07); border: 1px solid rgba(250,178,25,.3);
  color: var(--st-warn); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px;
  font-size: 13px; }
.warnbar.crit { background: rgba(208,59,59,.09); border-color: rgba(208,59,59,.45);
  color: var(--st-crit); }
.warnbar a { color: inherit; text-decoration: underline; }
.okbar { background: rgba(12,163,12,.07); border: 1px solid rgba(12,163,12,.32);
  color: #6fd06f; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---- формы ---- */
input[type=text], input[type=password], input[type=email], select {
  background: var(--card2); border: 1px solid var(--border); border-radius: 9px;
  color: var(--text); padding: 9px 13px; font-size: 13.5px; font-family: inherit; }
input:focus, select:focus { outline: none; border-color: var(--border-glow);
  box-shadow: 0 0 14px rgba(34,211,238,.15); }

/* ---- Sign in (admin, partner, 2FA) — Apple-like: quiet, large, no chrome ---- */
.login-box { max-width: 420px; margin: 12vh auto 0; padding: 0 18px; }
.login-box .card { position: relative; padding: 52px 40px 40px; display: flex; flex-direction: column; gap: 0;
  border-radius: 26px; border: 1px solid transparent; overflow: visible;
  background: linear-gradient(180deg, rgba(20,26,46,.78), rgba(12,16,30,.82)) padding-box;
  backdrop-filter: blur(28px) saturate(140%); -webkit-backdrop-filter: blur(28px) saturate(140%);
  box-shadow: 0 40px 100px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.07);
  animation: loginGlow 4.2s ease-in-out infinite; }
/* Цветная стеклянная обводка: градиент cyan→violet по кромке, мягко пульсирует. */
.login-box .card::before { content: ""; position: absolute; inset: -1px; border-radius: 27px; padding: 1.5px;
  background: linear-gradient(135deg, rgba(34,211,238,.95), rgba(139,92,246,.55) 45%, rgba(34,211,238,.35) 70%, rgba(139,92,246,.95));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
  animation: loginBorder 4.2s ease-in-out infinite; }
@keyframes loginGlow {
  0%, 100% { box-shadow: 0 40px 100px rgba(0,0,0,.6), 0 0 34px rgba(34,211,238,.12), 0 0 70px rgba(139,92,246,.10), inset 0 1px 0 rgba(255,255,255,.07); }
  50%      { box-shadow: 0 40px 100px rgba(0,0,0,.6), 0 0 54px rgba(34,211,238,.28), 0 0 110px rgba(139,92,246,.22), inset 0 1px 0 rgba(255,255,255,.07); }
}
@keyframes loginBorder { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .login-box .card, .login-box .card::before { animation: none; } }
.login-box .logo { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 4px; }
.login-box .badge { width: 64px; height: 64px; border-radius: 19px; display: grid; place-items: center;
  font-size: 30px; background: var(--accent-grad); color: #fff;
  box-shadow: 0 12px 34px rgba(139,92,246,.45), 0 0 0 1px rgba(255,255,255,.08) inset,
              0 0 40px rgba(34,211,238,.25); }
.login-box .word { font-size: 40px; font-weight: 800; letter-spacing: -.02em; line-height: 1; color: var(--text); }
.login-box .word .grad { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text;
  color: transparent; filter: drop-shadow(0 0 16px rgba(34,211,238,.45)); }
.login-box .role { font-size: 11px; font-weight: 700; letter-spacing: .34em; color: var(--muted);
  text-transform: uppercase; margin-top: -6px; }
.login-box .logo { margin-bottom: 30px; }
.login-box form { display: flex; flex-direction: column; gap: 12px; }
.fl { position: relative; }
.fl input { width: 100%; box-sizing: border-box; height: 62px; padding: 26px 18px 8px 18px;
  font-size: 17px; border-radius: 14px; background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1); color: var(--text); font-family: inherit;
  transition: border-color .18s, background .18s, box-shadow .18s; }
.fl input::placeholder { color: transparent; }
.fl label { position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  font-size: 16px; color: rgba(128,137,173,.9); pointer-events: none;
  transition: top .16s ease, transform .16s ease, font-size .16s ease, color .16s; }
.fl input:focus + label, .fl input:not(:placeholder-shown) + label {
  top: 12px; transform: none; font-size: 11.5px; letter-spacing: .05em; color: var(--muted); }
.fl input:focus { background: rgba(255,255,255,.07); border-color: rgba(34,211,238,.8);
  box-shadow: 0 0 0 4px rgba(34,211,238,.14); outline: none; }
.fl input:-webkit-autofill { -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #171d33 inset; caret-color: var(--text); }
.fl input.code { padding: 8px 18px; text-align: center; font-size: 34px; font-weight: 600;
  letter-spacing: .42em; font-variant-numeric: tabular-nums; }
.fl input.code::placeholder { color: rgba(128,137,173,.35); letter-spacing: .42em; }
.fl input.code + label { display: none; }
.login-box .btn.primary { justify-content: center; height: 54px; font-size: 17px; font-weight: 600;
  border-radius: 14px; margin-top: 10px; letter-spacing: -.01em;
  box-shadow: 0 10px 30px rgba(139,92,246,.35); transition: transform .12s, box-shadow .18s, filter .18s; }
.login-box .btn.primary:hover { filter: brightness(1.07); box-shadow: 0 12px 36px rgba(34,211,238,.32); }
.login-box .btn.primary:active { transform: scale(.985); }
.login-box .err { color: var(--st-crit); font-size: 13.5px; text-align: center; margin: -2px 0 2px; }
.login-box .note { color: var(--st-warn); font-size: 13px; text-align: center; margin-bottom: 14px; }
.login-box .link { text-align: center; margin-top: 22px; font-size: 13.5px; }
.login-box .link a { color: var(--muted); text-decoration: none; }
.login-box .link a:hover { color: var(--text); }
@media (max-width: 480px) { .login-box .card { padding: 36px 24px 30px; } .login-box .mark { font-size: 38px; } }

.chip.warn { color: var(--st-warn); border-color: rgba(193,135,23,.5); }
button.armed { cursor: pointer; font-family: inherit; }
textarea { background: var(--card2); border: 1px solid var(--border); border-radius: 9px;
  color: var(--text); padding: 9px 13px; font-size: 12.5px; font-family: ui-monospace,
  Menlo, monospace; resize: vertical; width: 100%; }
textarea:focus { outline: none; border-color: var(--border-glow);
  box-shadow: 0 0 14px rgba(34,211,238,.15); }

/* ---- форма «добавить консоль» ---- */
details.newtab { margin: -4px 0 16px; }
details.newtab > summary { cursor: pointer; display: inline-block; color: var(--neon1);
  font-weight: 700; font-size: 13px; padding: 6px 12px; border: 1px dashed var(--border);
  border-radius: 9px; list-style: none; }
details.newtab > summary::-webkit-details-marker { display: none; }
details.newtab[open] > summary { margin-bottom: 12px; border-color: var(--border-glow); }
details.newtab form { display: flex; gap: 8px; flex-wrap: wrap; }
details.newtab input { flex: 1; min-width: 240px; }
details.newtab textarea { flex-basis: 100%; }
details.newtab .hint { color: var(--muted); font-size: 12px; margin-top: 8px; line-height: 1.6; }

.alarmcard { border-color: rgba(240,82,110,.45); box-shadow: 0 0 22px rgba(240,82,110,.12); }
input[type=date] { background: var(--card2); border: 1px solid var(--border);
  border-radius: 9px; color: var(--text); padding: 8px 10px; font-family: inherit;
  color-scheme: dark; }

/* ---- мастер подключения ---- */
.steps { display: flex; flex-direction: column; }
.steprow { display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.steprow:last-child { border-bottom: none; }
.steprow .st-ico { width: 22px; text-align: center; flex-shrink: 0; }
.steprow .st-name { font-size: 13px; font-weight: 600; min-width: 240px; }
.steprow .st-msg { font-size: 11.5px; flex: 1; min-width: 160px; }
.steprow.bad .st-msg { color: var(--st-crit); }

/* ---- выбор файла ---- */
.filepick { display: flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px dashed var(--border); border-radius: 10px; padding: 11px 14px;
  font-size: 13px; color: var(--neon1); transition: border-color .15s, box-shadow .15s; }
.filepick:hover { border-color: var(--border-glow); box-shadow: 0 0 14px rgba(34,211,238,.12); }
.filepick.picked { border-style: solid; border-color: rgba(59,162,68,.5); color: #7ee07e; }

/* ---- деплой ---- */
.actionbar { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .actionbar { grid-template-columns: 1fr; } }
.actionbar form { display: contents; }
.bigbtn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 12px 16px; border-radius: 12px; cursor: pointer; color: var(--text);
  border: 1px solid var(--border); background: var(--card); font: inherit;
  transition: border-color .15s, box-shadow .15s; }
.bigbtn:hover { border-color: var(--border-glow); box-shadow: 0 0 18px rgba(34,211,238,.16); }
.bigbtn .ico { font-size: 18px; }
.bigbtn b { display: block; font-size: 14px; font-weight: 700; }
.bigbtn i { display: block; font-style: normal; color: var(--muted); font-size: 11.5px; }
.bigbtn.go { background: linear-gradient(100deg, rgba(34,211,238,.16), rgba(139,92,246,.16));
  border-color: rgba(34,211,238,.45); }
.deploylog { font: 12px/1.6 ui-monospace, Menlo, monospace; background: rgba(4,6,14,.6);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
  overflow-x: auto; white-space: pre-wrap; color: #a8ffbf; }

/* ---- рекламные сети (страница консоли) ---- */
.netgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.netcard { background: var(--card2); border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 15px; }
.netcard.connected { border-color: rgba(34,211,238,.35); }
.nethead { display: flex; align-items: center; gap: 8px; justify-content: space-between;
  flex-wrap: wrap; }
.nethead b { font-size: 13.5px; }
.heldrow td { background: rgba(240,82,110,.05); }

/* ---- инструкция «Как подключить» ---- */
details.howto { background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; margin-bottom: 16px; backdrop-filter: blur(10px); }
details.howto summary { cursor: pointer; padding: 13px 18px; font-size: 13.5px;
  font-weight: 700; list-style: none; display: flex; align-items: center; gap: 9px;
  flex-wrap: wrap; }
details.howto summary::-webkit-details-marker { display: none; }
details.howto summary .arr { color: var(--muted); transition: transform .15s; font-size: 11px; }
details.howto[open] summary .arr { transform: rotate(90deg); }
details.howto summary .n { color: var(--muted); font-weight: 400; font-size: 12px; }
.howto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 13px; padding: 0 18px 16px; }
.hcol { background: var(--card2); border: 1px solid var(--border); border-radius: 11px;
  padding: 13px 15px; font-size: 12.5px; }
.hcol b.t { display: block; font-size: 13.5px; margin-bottom: 8px; }
.hcol b.t .n { color: var(--muted); font-weight: 400; font-size: 12px; }
.hcol ol { margin: 0 0 9px 17px; display: flex; flex-direction: column; gap: 6px;
  color: var(--text); line-height: 1.45; }
.hcol li span { color: var(--muted); }
.hcol code { background: rgba(125,160,255,.1); border-radius: 5px; padding: 1px 5px;
  font-size: 11px; font-family: ui-monospace, Menlo, monospace; }
.hcol .doc { font-size: 11.5px; color: var(--muted); }
.howto-note { padding: 0 18px 15px; color: var(--muted); font-size: 11.5px; line-height: 1.5; }

/* ---- настройки клиента ---- */
.setgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 820px) { .setgrid { grid-template-columns: 1fr; } }
.optrow { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0;
  border-bottom: 1px solid var(--border); cursor: pointer; }
.optrow:last-child { border-bottom: none; }
.optrow input { margin-top: 3px; accent-color: var(--neon1); }
.optrow b { display: block; font-size: 13px; font-weight: 600; }
.optrow i { display: block; font-style: normal; color: var(--muted); font-size: 11.5px;
  margin-top: 1px; }
.optrow.locked { opacity: .6; cursor: default; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .06em; font-weight: 700; }
.savebar { display: flex; gap: 10px; align-items: center; margin-top: 6px; }

/* ---- Gmail: glass-окно быстрого просмотра ----
   Только чтение: решения по ответам принимаются в самой почте, поэтому
   в окне нет ни одной кнопки действия, кроме «Открыть в Gmail». */
.mailbtn { position: relative; }
.mailbtn .unread-count { position: absolute; top: -6px; right: -6px; min-width: 17px;
  height: 17px; border-radius: 9px; background: var(--st-crit); color: #fff;
  font-size: 10px; font-weight: 800; display: flex; align-items: center;
  justify-content: center; padding: 0 4px; box-shadow: 0 0 10px rgba(240,82,110,.7); }

.veil { position: fixed; inset: 0; z-index: 50; background: rgba(4, 6, 14, .45);
  backdrop-filter: blur(3px); display: flex; align-items: flex-start;
  justify-content: center; padding: 7vh 18px 18px; }
.veil[hidden] { display: none; }
.glass { width: 100%; max-width: 640px; max-height: 82vh; display: flex;
  flex-direction: column; border-radius: 18px; overflow: hidden;
  background: rgba(16, 22, 42, .58);
  backdrop-filter: blur(26px) saturate(150%); -webkit-backdrop-filter: blur(26px) saturate(150%);
  border: 1px solid rgba(125, 160, 255, .22);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55), 0 0 40px rgba(34, 211, 238, .08); }
.glass::before { content: ""; display: block; height: 1px; flex-shrink: 0;
  background: linear-gradient(90deg, transparent, rgba(34,211,238,.55), rgba(139,92,246,.55), transparent); }

.gm-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px;
  border-bottom: 1px solid var(--border); flex-shrink: 0; }
.gm-head b { font-size: 14px; }
.gm-head .n { color: var(--muted); font-size: 12px; }
.gm-filters { display: flex; gap: 4px; margin-left: 8px; }
.gm-filter { background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 20px; padding: 3px 11px; font-size: 11.5px; cursor: pointer;
  font-family: inherit; transition: color .15s, border-color .15s; }
.gm-filter:hover { color: var(--text); }
.gm-filter.on { color: var(--neon1); border-color: rgba(34,211,238,.45);
  background: rgba(34,211,238,.07); }
.gm-close { margin-left: auto; background: none; border: none; color: var(--muted);
  font-size: 17px; cursor: pointer; padding: 4px 8px; border-radius: 8px;
  transition: color .15s, background .15s; }
.gm-close:hover { color: var(--text); background: rgba(125,160,255,.1); }

.gm-scroll { overflow-y: auto; scrollbar-width: thin; }

.gm-row { display: flex; gap: 12px; padding: 12px 18px; cursor: pointer;
  border-bottom: 1px solid var(--border); align-items: flex-start;
  transition: background .15s; }
.gm-row:last-child { border-bottom: none; }
.gm-row:hover { background: rgba(34,211,238,.05); }
.gm-row .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px;
  flex-shrink: 0; background: transparent; }
.gm-row.unread .dot { background: var(--neon1); box-shadow: 0 0 8px rgba(34,211,238,.7); }
.gm-row .m { min-width: 0; flex: 1; }
.gm-row .from { font-size: 12px; color: var(--muted); display: flex; gap: 8px;
  align-items: baseline; }
.gm-row.unread .from { color: var(--text); font-weight: 600; }
.gm-row .from time { margin-left: auto; font-size: 11px; color: var(--muted);
  font-weight: 400; white-space: nowrap; }
.gm-row .subj { font-size: 13.5px; margin: 1px 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.gm-row.unread .subj { font-weight: 700; }
.gm-row .snip { font-size: 12px; color: var(--muted); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }

.gm-read { padding: 16px 20px 20px; }
.gm-back { background: none; border: none; color: var(--neon1); cursor: pointer;
  font-size: 12.5px; font-family: inherit; padding: 0; margin-bottom: 12px; }
.gm-read h3 { font-size: 15.5px; font-weight: 700; margin-bottom: 8px; }
.gm-read .meta { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  font-size: 12px; color: var(--muted); padding-bottom: 12px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border); }
.gm-read .meta b { color: var(--text); }
.gm-read .body p { font-size: 13.5px; line-height: 1.65; margin-bottom: 12px; }
.gm-read .gm-foot { display: flex; gap: 10px; align-items: center; margin-top: 6px;
  padding-top: 14px; border-top: 1px solid var(--border); }
.gm-read .gm-foot .note { color: var(--muted); font-size: 11.5px; }

/* ---- toast pop-up (обновление Remote Config) ---- */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(16, 22, 42, .92); backdrop-filter: blur(20px);
  border: 1px solid rgba(34,211,238,.4); border-radius: 14px; padding: 14px 20px;
  color: var(--text); font-size: 13.5px; line-height: 1.5; text-align: center;
  box-shadow: 0 16px 50px rgba(0,0,0,.5), 0 0 30px rgba(34,211,238,.15);
  opacity: 0; z-index: 100; transition: opacity .3s, transform .3s; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ============ Firebase Remote Config — «файл конфигурации» + поп-ап ============ */
/* Кликабельный «файл» в карточке приложения — открывает поп-ап со всем конфигом. */
.rc-file { display: flex; align-items: center; gap: 12px; width: 100%; cursor: pointer;
  margin: 4px 0 14px; padding: 12px 14px; text-align: left; font: inherit; color: var(--text);
  background: var(--card2); border: 1px solid var(--border); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s, transform .05s; }
.rc-file:hover { border-color: var(--border-glow); box-shadow: 0 0 16px rgba(34,211,238,.14); }
.rc-file:active { transform: translateY(1px); }
.rc-file-ic { font-size: 26px; line-height: 1; }
.rc-file-t { flex: 1; min-width: 0; }
.rc-file-t b { display: block; font-size: 13.5px; }
.rc-file-t i { display: block; font-style: normal; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.rc-file-go { color: var(--neon1); font-size: 12.5px; font-weight: 700; white-space: nowrap; }

/* Поп-ап (использует .veil/.glass из Gmail-окна) — шире под таблицу конфига. */
.rc-glass { max-width: 760px; max-height: 86vh; }
.rc-search { flex: 1; min-width: 120px; background: var(--card2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 11px; font: inherit;
  font-size: 12.5px; }
.rc-search:focus { outline: none; border-color: var(--border-glow); }
.rc-legend { display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  padding: 8px 18px; border-bottom: 1px solid var(--border); font-size: 11.5px;
  color: var(--muted); flex-shrink: 0; }
.rc-legend .rc-lg b { color: var(--text); }

.rc-rows { display: flex; flex-direction: column; }
.rc-row { display: flex; gap: 10px; align-items: center; padding: 9px 18px;
  border-bottom: 1px solid var(--border); }
.rc-row:last-child { border-bottom: none; }
.rc-row:hover { background: rgba(34,211,238,.04); }
.rc-row.absent { opacity: .5; }
.rc-main { flex: 1; min-width: 0; }
.rc-name { font-size: 12.5px; font-weight: 600; display: flex; align-items: center;
  gap: 7px; flex-wrap: wrap; }
.rc-lv { font-size: 10px; font-weight: 800; color: var(--neon1);
  border: 1px solid rgba(34,211,238,.35); border-radius: 5px; padding: 1px 5px; }
.rc-type { font-size: 9.5px; letter-spacing: .05em; color: var(--muted);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }
.rc-badge.crypt { font-size: 11px; }
.rc-val { margin-top: 3px; font-size: 11.5px; }
.rc-val code { color: var(--neon1); word-break: break-all; }
.rc-val.err code { color: var(--st-crit); }
.rc-err { display: block; color: var(--st-crit); font-style: normal; font-size: 10.5px; margin-top: 1px; }
.rc-ck { display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer; font-size: 13px; user-select: none; width: 34px; flex-shrink: 0; }
.rc-ck input { accent-color: var(--neon1); cursor: pointer; }

/* Портал клиента — компактные строки видимой конфигурации. */
.rc-crow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--border); }
.rc-crow:last-child { border-bottom: none; }
.rc-cmain { flex: 1; min-width: 180px; }
.rc-cname { font-size: 12px; font-weight: 600; }
.rc-cval { margin-top: 2px; font-size: 11.5px; }
.rc-cval code { color: var(--neon1); word-break: break-all; }
.rc-cval.err code { color: var(--st-crit); }
.rc-cform { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; margin-top: 6px; }
.rc-cform .rc-cinput { flex: 1; min-width: 220px; }


/* ---------- Центр обновлений ---------- */
.wave-grid { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(380px, 1.3fr); gap: 14px; }
@media (max-width: 900px) { .wave-grid { grid-template-columns: 1fr; } }
.tree-tools { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.tree-tools .rc-search { flex: 1; }
.tree { max-height: 62vh; overflow-y: auto; scrollbar-width: thin; }
.tree-client { margin-bottom: 10px; }
.tree-ch { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }
.tree-console { margin-left: 8px; padding-left: 10px; border-left: 1px solid var(--border); margin-bottom: 6px; }
.tree-cn { font-size: 11.5px; color: var(--muted); padding: 4px 0; text-transform: uppercase; letter-spacing: .04em;
  display: flex; align-items: center; gap: 8px; }
.tree-app { display: flex; align-items: center; gap: 9px; padding: 5px 6px; border-radius: 9px; cursor: pointer;
  transition: background .15s; }
.tree-app:hover { background: rgba(34,211,238,.05); }
.tree-app.off { opacity: .45; cursor: not-allowed; }
.tree-app input { accent-color: var(--neon1); }
.tree-app img, .tree-app .noicon { width: 26px; height: 26px; border-radius: 7px; object-fit: cover;
  display: inline-flex; align-items: center; justify-content: center; background: var(--card2); }
.tree-app .ta-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tree-app .ta-t b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-app .ta-t i { font-style: normal; font-size: 10.5px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
.tree-app .badge { font-size: 10px; padding: 2px 7px; }
.partrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.part-block { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
  background: rgba(16,22,42,.35); }
.part-block .exphead { margin-top: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.langbox { border-top: 1px dashed var(--border); padding-top: 10px; margin-top: 10px; }
.langbox:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.langbox textarea, .upd-glass textarea, .part-block textarea { width: 100%; resize: vertical; }
.field .cnt { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
.rollout { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 6px; }
.rollout .ro { border: 1px solid var(--border); border-radius: 20px; padding: 4px 12px; font-size: 12px;
  cursor: pointer; color: var(--muted); transition: all .15s; }
.rollout .ro.on { color: var(--neon1); border-color: rgba(34,211,238,.5); background: rgba(34,211,238,.08); }
.relchip { display: inline-block; margin-top: 4px; font-size: 10.5px; text-decoration: none; }
.kv { display: flex; gap: 10px; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border);
  font-size: 12.5px; }
.kv:last-child { border-bottom: none; }
.kv span { color: var(--muted); }
.kv b { text-align: right; font-weight: 600; word-break: break-word; }
.diffgrid { margin-bottom: 10px; }
.diffrow { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.diffrow .dk { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.diffrow .dv i { display: block; font-style: normal; color: var(--muted); text-decoration: line-through; font-size: 12px;
  white-space: pre-wrap; }
.diffrow .dv b { display: block; font-weight: 500; font-size: 12.5px; white-space: pre-wrap; margin-top: 3px; color: #9fe8a5; }
.upd-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px;
  border: 1px solid rgba(139,92,246,.4); border-radius: 12px; background: rgba(139,92,246,.07); }
.upd-bar > div { flex: 1; min-width: 200px; }
.upd-bar .muted { display: block; font-size: 11.5px; margin-top: 2px; }
.upd-glass { max-width: 760px; }
.upd-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); flex-shrink: 0; }
.kvlist { border: 1px solid var(--border); border-radius: 12px; padding: 4px 14px; }

/* ---- пользователи компании (настройки клиента) ---- */
.ulist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.urow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--card2); }
.urow.hl { border-color: var(--border-glow); box-shadow: 0 0 16px rgba(34,211,238,.15); }
.uinfo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.umail { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.umeta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.uact { display: flex; gap: 6px; flex-wrap: wrap; }
.uadd { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 8px; align-items: center; }
@media (max-width: 640px) { .uadd { grid-template-columns: 1fr; } }
