/*
 * ── ОФОРМЛЕНИЕ ОПЕРАТОРСКОЙ ────────────────────────────────────────────────
 *
 * Тёплый белый фон, белые карточки, коралловый акцент — по присланным
 * референсам. Цвета собраны в переменные не ради моды, а потому что тот же
 * коралл повторяется в семи местах, и менять его в семи местах — гарантия
 * рассинхрона.
 */

:root {
  --bg: #f6f4f1;
  --card: #ffffff;
  --ink: #171216;
  --muted: #8d8880;
  --line: #e8e4de;

  --coral: #ff5a4e;
  --lime: #c6f24e;
  --violet: #6b4eff;
  --deep: #241c2e;

  --radius: 18px;
  --shadow: 0 1px 2px rgba(23, 18, 22, 0.04), 0 8px 24px rgba(23, 18, 22, 0.04);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  cursor: pointer;
}

/* ── Каркас ─────────────────────────────────────────────────────────────── */

.shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100%;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 26px 20px;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand .mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(150deg, var(--coral), #ff8a5b);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
}

.brand .name {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.2px;
  line-height: 1.05;
}

.brand .sub {
  font-size: 10px;
  letter-spacing: 1.6px;
  color: var(--muted);
  text-transform: uppercase;
}

.section-label {
  font-size: 10px;
  letter-spacing: 1.8px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font-weight: 600;
  text-align: left;
}

.nav button:hover {
  background: rgba(23, 18, 22, 0.035);
}

.nav button.on {
  color: var(--ink);
}

.nav .live {
  margin-left: auto;
  background: var(--deep);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.side .spacer {
  flex: 1;
}

.botcard {
  background: var(--deep);
  color: #fff;
  border-radius: 14px;
  padding: 14px;
}

.botcard .head {
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  opacity: 0.55;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.botcard .who {
  margin-top: 8px;
  font-weight: 600;
  opacity: 0.75;
}

.botcard .state {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 2px;
}

.me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.me .av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--deep);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.me .out {
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 18px;
}

.main {
  padding: 30px 40px 60px;
  min-width: 0;
}

.crumbs {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.crumbs b {
  color: var(--ink);
  font-weight: 600;
}

h1 {
  font-size: 44px;
  letter-spacing: -1.4px;
  margin: 0 0 4px;
}

.lead {
  color: var(--muted);
  margin: 0 0 26px;
}

.head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

/* ── Карточки ───────────────────────────────────────────────────────────── */

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.card > .cap {
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
}

.card > h2 {
  font-size: 22px;
  letter-spacing: -0.5px;
  margin: 4px 0 18px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

.metric .bar {
  position: absolute;
  inset: 0 auto auto 55%;
  height: 5px;
  width: 45%;
  border-radius: 0 0 0 6px;
}

.metric .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric .icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
}

.metric .value {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1.5px;
  margin: 14px 0 6px;
}

.metric .note {
  color: var(--muted);
  font-size: 13px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.grid-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* ── График ─────────────────────────────────────────────────────────────── */

.chart {
  height: 230px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
}

.chart .col {
  flex: 1;
  background: var(--coral);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  opacity: 0.9;
}

.chart-x {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
}

/* ── Таблицы ────────────────────────────────────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 12px 10px;
  background: #faf8f6;
}

td {
  padding: 14px 10px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

tr.click:hover td {
  background: #faf8f6;
  cursor: pointer;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #f1efec;
  color: #6a645d;
}

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.ok {
  background: #e9f8dd;
  color: #3f7a1e;
}

.badge.warn {
  background: #efe9ff;
  color: #5a3fd6;
}

.badge.bad {
  background: #ffe9e7;
  color: #c33327;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.muted {
  color: var(--muted);
}

.progress {
  height: 6px;
  border-radius: 999px;
  background: #f1efec;
  overflow: hidden;
  min-width: 110px;
}

.progress > i {
  display: block;
  height: 100%;
  background: var(--coral);
}

/* ── Управление ─────────────────────────────────────────────────────────── */

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

input[type='text'],
input[type='password'],
input[type='number'],
select {
  font: inherit;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
}

input[type='text'],
input[type='password'] {
  flex: 1;
}

input[type='number'] {
  width: 118px;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 13px 18px;
  font-weight: 600;
  background: var(--deep);
  color: #fff;
}

.btn.accent {
  background: var(--coral);
}

.btn.ghost {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.switch {
  width: 46px;
  height: 27px;
  border-radius: 999px;
  background: #ded9d3;
  border: 0;
  position: relative;
  transition: background 0.15s;
}

.switch.on {
  background: var(--coral);
}

.switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.15s;
}

.switch.on i {
  left: 22px;
}

.rowline {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.rowline:first-of-type {
  border-top: 0;
}

.rowline .grow {
  flex: 1;
  min-width: 0;
}

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

.split {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 18px;
  align-items: start;
}

/* ── Вход ───────────────────────────────────────────────────────────────── */

.login {
  min-height: 100%;
  display: grid;
  place-items: center;
}

.login .card {
  width: 380px;
  padding: 30px;
}

.login h2 {
  margin: 16px 0 6px;
}

.login form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.err {
  color: var(--coral);
  font-size: 13px;
}

/* Журнал */

.log {
  display: flex;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 12px;
}

.log:hover {
  background: #faf8f6;
}

.log .ic {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffe9e7;
  color: var(--coral);
  display: grid;
  place-items: center;
  flex: none;
}

.log .t {
  font-weight: 600;
}

.log .when {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
