/* CallCorp.cc — тёмный кабинет с синими акцентами.
   Шрифт Raleway и синий #4d83fa взяты из дизайна doc-lk; остальное — тёмная
   палитра: графит вместо белого, карточки с полупрозрачным фоном и размытием,
   чтобы сквозь них просвечивал объёмный фон на three.js. */

@font-face { font-family: Raleway; src: url(../fonts/Raleway-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Raleway; src: url(../fonts/Raleway-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Raleway; src: url(../fonts/Raleway-SemiBold.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: Raleway; src: url(../fonts/Raleway-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --blue: #4d83fa;
  --blue-soft: #7aa2ff;
  --blue-deep: #1b2a52;
  --bg: #080a12;
  --bg-2: #0d1018;
  --panel: rgba(18, 22, 33, .82);
  --panel-solid: #121621;
  --panel-2: rgba(28, 34, 50, .7);
  --line: rgba(122, 162, 255, .16);
  --line-strong: rgba(122, 162, 255, .32);
  --text: #e8ecf6;
  --muted: #8b93a8;
  --dim: #5d657a;
  --red: #ff7c8f;
  --green: #5fd98b;
  --amber: #ffc46b;
  --radius: 14px;
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, .9);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Raleway, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(90% 60% at 50% -10%, #152043 0%, rgba(8, 10, 18, 0) 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Фон: канвас на всю страницу, под интерфейсом, клики не перехватывает. */
#backdrop {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  mask-image: radial-gradient(120% 95% at 50% 0%, #000 30%, rgba(0, 0, 0, .15) 100%);
  -webkit-mask-image: radial-gradient(120% 95% at 50% 0%, #000 30%, rgba(0, 0, 0, .15) 100%);
}
.shell { position: relative; z-index: 1; }

a { color: var(--blue-soft); text-decoration: none; }
a:hover { color: #a8c3ff; }
h1 { font-size: 30px; line-height: 1.25; margin: 0 0 24px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 21px; margin: 0 0 16px; font-weight: 600; }
h3 { font-size: 17px; margin: 0 0 14px; font-weight: 600; }
h4 { font-size: 14px; margin: 0 0 8px; font-weight: 600; }
p { margin: 0 0 12px; }
small, .muted { color: var(--muted); font-size: 13px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--blue-soft); }

/* --- шапка ------------------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(8, 10, 18, .78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: 1360px; margin: 0 auto; padding: 13px 24px;
  display: flex; align-items: center; gap: 16px;
}
.logo { font-weight: 700; font-size: 19px; color: var(--text); letter-spacing: -.02em; }
.logo span { color: var(--blue); }
.logo small { color: var(--dim); font-weight: 500; font-size: 12px; letter-spacing: .06em; }
.topbar__spacer { flex: 1; }
.topbar__user { color: var(--dim); font-size: 12px; text-align: right; line-height: 1.3; }
.topbar__user b { display: block; color: var(--text); font-size: 14px; font-weight: 600; }

/* --- каркас ----------------------------------------------------------- */

.wrap { max-width: 1360px; margin: 0 auto; padding: 30px 24px 72px; }
.layout { display: grid; grid-template-columns: 258px minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; } }

/* --- консоль ---------------------------------------------------------- */

.console { position: sticky; top: 88px; }
.console__org {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); backdrop-filter: blur(10px); padding: 15px 17px; margin-bottom: 14px;
}
.console__org summary { cursor: pointer; list-style: none; font-weight: 700; font-size: 16px; }
.console__org summary::-webkit-details-marker { display: none; }
.console__org summary::after { content: "⌄"; float: right; color: var(--dim); }
.console__org[open] summary::after { content: "⌃"; }
.console__drop { margin-top: 13px; border-top: 1px solid var(--line); padding-top: 11px; }
.console__drop a { display: block; padding: 6px 0; font-size: 14px; }
.console__menu { list-style: none; margin: 0; padding: 0; }
.console__menu li + li { margin-top: 4px; }
.console__menu a {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 11px 15px; border-radius: 10px; color: var(--muted); font-weight: 500;
  border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.console__menu a:hover { background: var(--panel-2); color: var(--text); }
.console__menu .is-active a {
  background: linear-gradient(135deg, rgba(77, 131, 250, .22), rgba(77, 131, 250, .08));
  border-color: var(--line-strong); color: #fff;
}
.console__menu .count { font-size: 12px; color: var(--dim); }

/* --- карточки --------------------------------------------------------- */

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); backdrop-filter: blur(10px); padding: 22px;
}
.card + .card { margin-top: 18px; }
.card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card__head h1, .card__head h2, .card__head h3 { margin: 0; }
.card__head .spacer { flex: 1; }

/* Шапка страницы: заголовок слева, кнопки справа — одинаково на всех экранах. */
.page__head {
  display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; flex-wrap: wrap;
}
.page__head h1 { margin: 0; }
.page__head .spacer { flex: 1; }
.page__actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.grid--5 { grid-template-columns: repeat(auto-fit, minmax(186px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.metric {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 6px; min-height: 116px;
}
.metric__label { color: var(--muted); font-size: 13px; font-weight: 500; }
.metric__value { font-size: 34px; font-weight: 700; color: #fff; line-height: 1; }
.metric__hint { color: var(--dim); font-size: 12px; margin-top: auto; }
.metric--accent {
  background: linear-gradient(140deg, rgba(77, 131, 250, .3), rgba(77, 131, 250, .08));
  border-color: var(--line-strong);
}
.metric--accent .metric__label { color: #cfdcff; }

/* --- кнопки и поля ---------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  background: var(--blue); color: #fff; font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:hover { background: #3f74ef; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.btn--ghost:hover { background: rgba(77, 131, 250, .16); border-color: var(--line-strong); color: #fff; }
.btn--danger { background: rgba(255, 124, 143, .12); border-color: rgba(255, 124, 143, .35); color: var(--red); }
.btn--danger:hover { background: rgba(255, 124, 143, .2); color: #fff; }
.btn--small { padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=tel], select, textarea {
  width: 100%; padding: 10px 13px; font: inherit; font-size: 14px; color: var(--text);
  background: rgba(8, 10, 18, .6); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: var(--dim); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue); background: rgba(8, 10, 18, .85);
  box-shadow: 0 0 0 3px rgba(77, 131, 250, .18);
}
input[type=file] { padding: 9px 12px; color: var(--muted); }
select option { background: var(--panel-solid); color: var(--text); }
textarea { resize: vertical; min-height: 84px; }
.field { margin-bottom: 16px; }
.field__hint { color: var(--dim); font-size: 12px; margin-top: 6px; }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row > * { margin-bottom: 0; }
.row--tight { gap: 8px; }
.inline { display: inline-flex; gap: 8px; align-items: center; }
.checkline { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; color: var(--text); }
.checkline input { width: 18px; height: 18px; accent-color: var(--blue); }
.checkline label { margin: 0; color: var(--text); font-weight: 500; }

/* --- табы ------------------------------------------------------------- */

.tabs {
  display: inline-flex; background: rgba(8, 10, 18, .6); border: 1px solid var(--line);
  border-radius: 11px; padding: 4px; gap: 4px;
}
.tabs a { padding: 8px 17px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--muted); }
.tabs a:hover { color: var(--text); }
.tabs a.is-active { background: var(--blue); color: #fff; }

/* --- таблицы ---------------------------------------------------------- */

table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line); }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); font-weight: 600; }
td { font-size: 14px; color: var(--text); }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(77, 131, 250, .06); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

/* --- мелочи ----------------------------------------------------------- */

.badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(77, 131, 250, .16); color: var(--blue-soft); border: 1px solid var(--line);
}
.badge--green { background: rgba(95, 217, 139, .14); color: var(--green); border-color: rgba(95, 217, 139, .3); }
.badge--red { background: rgba(255, 124, 143, .14); color: var(--red); border-color: rgba(255, 124, 143, .3); }
.badge--grey { background: rgba(139, 147, 168, .12); color: var(--muted); }

.notice {
  border-radius: var(--radius); padding: 15px 17px; margin-bottom: 18px; font-size: 14px;
  background: rgba(77, 131, 250, .12); border: 1px solid var(--line-strong); color: #d8e3ff;
}
.notice--warn { background: rgba(255, 196, 107, .1); border-color: rgba(255, 196, 107, .32); color: #ffd79a; }
.notice--error { background: rgba(255, 124, 143, .1); border-color: rgba(255, 124, 143, .32); color: #ffc3cc; }
.notice--ok { background: rgba(95, 217, 139, .1); border-color: rgba(95, 217, 139, .32); color: #bdf2d2; }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty h3 { color: var(--text); }

.list { list-style: none; margin: 0; padding: 0; }
.list > li {
  display: flex; align-items: center; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line);
}
.list > li:last-child { border-bottom: none; }
.list__title { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.list__title a { color: var(--text); }
.list__title a:hover { color: var(--blue-soft); }
.list__meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.list__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* Меню и всплывающие формы без скриптов: details + абсолютный блок. */
.pop { position: relative; }
.pop > summary {
  list-style: none; cursor: pointer;
}
.pop > summary::-webkit-details-marker { display: none; }
.pop__menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 240px;
  background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 20px 44px -20px rgba(0, 0, 0, .95); padding: 12px;
}
.pop__menu--left { right: auto; left: 0; }
.pop__menu form { margin: 0; }
.pop__menu .btn { width: 100%; }
.pop__menu input, .pop__menu select { margin-bottom: 8px; }
.pop__menu hr { border: none; border-top: 1px solid var(--line); margin: 10px 0; }
.dots > summary {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  color: var(--muted); font-size: 18px; line-height: 1; border: 1px solid transparent;
}
.dots > summary:hover { background: var(--panel-2); color: var(--text); border-color: var(--line); }

.counter { display: flex; gap: 22px; flex-wrap: wrap; }
.counter div { font-size: 13px; color: var(--muted); }
.counter b { display: block; font-size: 20px; color: #fff; font-weight: 700; }

.repeat { display: grid; gap: 9px; }
.repeat__row { display: flex; gap: 8px; align-items: flex-start; }
.repeat__row > span { padding-top: 10px; color: var(--dim); font-size: 13px; width: 20px; flex-shrink: 0; }

.auth { max-width: 420px; margin: 64px auto; }
.auth .card { padding: 28px; }
.auth__switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }

.dialog { background: rgba(8, 10, 18, .55); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px; }
.dialog p { margin: 0 0 9px; font-size: 14px; }
.dialog p b { color: var(--blue-soft); }
.dialog p.client b { color: var(--amber); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); }
