:root {
  color-scheme: dark;
  --bg: #363a44;
  --bar: #2b2e36;
  --panel: #2e3139;
  --panel-2: #272a31;
  --panel-3: #23252b;
  --raise: #3a3e48;
  --line: #474b56;
  --line-soft: #3a3e47;
  --text: #f0efec;
  --text-2: #c3c2b7;
  --muted: #959aa5;
  --accent: #3987e5;
  --accent-2: #86b6ef;
  --ok: #0ca30c;
  --ok-bg: #1d4436;
  --ok-text: #4cd38a;
  --danger: #d03b3b;
  --warn: #fab219;
  --font: "Nunito Sans", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.icon { width: 16px; height: 16px; flex: none; }
.icon-lg { width: 20px; height: 20px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.strong { font-weight: 700; }
code { background: var(--panel-3); padding: 2px 6px; border-radius: 4px; font-size: 12.5px; word-break: break-all; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.grow { flex: 1; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* --- шапка ------------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 22px;
  height: 54px; padding: 0 20px;
  background: var(--bar); border-bottom: 1px solid #23252b;
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 16px; }
.logo:hover { text-decoration: none; }
.logo img { width: 26px; height: 26px; }
.nav { display: flex; gap: 2px; min-width: 0; overflow-x: auto; }
.nav a { color: var(--text-2); padding: 8px 12px; border-radius: 6px; font-weight: 700; white-space: nowrap; }
.nav a:hover { background: #343844; color: var(--text); text-decoration: none; }
.nav a.active { background: var(--raise); color: var(--text); }
.usermenu { margin-left: auto; position: relative; }
.usermenu-btn {
  display: flex; align-items: center; gap: 8px; background: none; border: 0; color: var(--text);
  font: inherit; font-weight: 700; padding: 8px 10px; border-radius: 6px; cursor: pointer;
}
.usermenu-btn:hover, .usermenu.open .usermenu-btn { background: #343844; }
.usermenu-drop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; display: none;
  background: #2f323a; border: 1px solid #3c404a; border-radius: 8px; padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}
.usermenu.open .usermenu-drop { display: block; }
.usermenu-drop a, .usermenu-drop button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px;
  color: var(--text); background: none; border: 0; font: inherit; font-weight: 600;
  border-radius: 6px; cursor: pointer; text-align: left;
}
.usermenu-drop a:hover, .usermenu-drop button:hover { background: var(--raise); text-decoration: none; }
.usermenu-drop hr { border: 0; border-top: 1px solid #3c404a; margin: 6px 0; }

/* --- общие блоки ------------------------------------------------------------ */
.page { padding: 4px 0 40px; }
.panel { background: var(--panel); border-radius: 6px; margin: 16px; padding: 18px 20px; }
.panel-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px dashed var(--line);
}
.panel-title { font-size: 15px; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 8px; }
.panel-title::before { content: "•"; }
.panel-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.section-label { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; margin-bottom: 10px; }
.hint { color: var(--muted); font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 5px; border: 0;
  background: var(--panel-3); color: var(--text); font: inherit; font-weight: 700; font-size: 13.5px;
  cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: #1e2025; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #2a78d6; }
.btn-danger { background: #5b2629; color: #ffc2c2; }
.btn-danger:hover { background: #6b2c30; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--raise); color: var(--text); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; flex: none;
  border-radius: 5px; background: var(--panel-3); color: var(--text-2); border: 0; cursor: pointer;
}
.icon-btn:hover { background: #1e2025; color: var(--text); text-decoration: none; }
.icon-btn.sm { width: 28px; height: 28px; }

.input {
  background: var(--panel-2); border: 1px solid #3d414b; color: var(--text); border-radius: 6px;
  padding: 8px 12px; font: inherit; min-height: 38px; min-width: 0;
}
.input:focus { outline: none; border-color: var(--accent); }
.input::placeholder { color: #7d828d; }
select.input { padding-right: 28px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; }
input[type="color"] { width: 38px; height: 34px; padding: 2px; border-radius: 6px; border: 1px solid #3d414b; background: var(--panel-2); cursor: pointer; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; color: var(--text-2); font-weight: 600; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.search { position: relative; }
.search .input { padding-right: 36px; width: 240px; }
.search .icon { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #4a4f5c; border-radius: 22px; transition: background .15s; cursor: pointer; }
.switch span::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: transform .15s;
}
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.badge { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; white-space: nowrap; }
.badge-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: var(--raise); color: var(--text-2); white-space: nowrap;
}
.pill.ok { background: var(--ok-bg); color: var(--ok-text); }
.pill.warn { background: #4a3a17; color: #ffd27a; }
.pill.off { background: #3a3236; color: #d6a5ad; }

/* --- таблицы (строки — отдельные плашки, как в референсе) ------------------------ */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0 8px; font-size: 13.5px; }
table.data th {
  text-align: left; color: var(--text-2); font-weight: 700; padding: 6px 14px; white-space: nowrap;
  user-select: none;
}
table.data th.num { text-align: right; }
table.data th.sortable { cursor: pointer; }
table.data th.sortable:hover { color: var(--text); }
table.data th .sort { display: inline-flex; vertical-align: middle; margin-left: 4px; opacity: .55; }
table.data th.sorted .sort { opacity: 1; color: var(--accent-2); }
table.data td { background: var(--panel-2); padding: 13px 14px; vertical-align: middle; }
table.data td:first-child { border-radius: 6px 0 0 6px; }
table.data td:last-child { border-radius: 0 6px 6px 0; }
table.data tr.clickable td { cursor: pointer; }
table.data tr.clickable:hover td { background: #22242a; }
table.data tr.total td { background: transparent; border-top: 1px solid var(--line); font-weight: 800; }
table.data td.strong { font-weight: 700; }
table.data .cell-sub { color: var(--muted); font-size: 12px; }
.table-empty { text-align: center; color: var(--muted); padding: 28px 0 12px; }
.table-loading { opacity: .55; transition: opacity .15s; }

.pager { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pager .info { margin-right: auto; color: var(--muted); font-size: 13px; }
.pager button {
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 5px; border: 1px solid transparent;
  background: var(--panel-2); color: var(--text-2); font: inherit; font-weight: 700; cursor: pointer;
}
.pager button.current { border-color: #6a7080; color: var(--text); background: var(--panel-3); }
.pager button:disabled { opacity: .4; cursor: default; }
.pager .gap { color: var(--muted); padding: 0 4px; }
.pager select { height: 32px; min-height: 32px; padding: 0 8px; }

/* --- экран менеджера ---------------------------------------------------------- */
.statusbar {
  display: flex; align-items: center; gap: 16px;
  margin: 12px 16px 0; padding: 14px 18px; background: var(--bar); border-radius: 6px;
}
.statusbar-label { font-weight: 700; white-space: nowrap; }
.statusbar-buttons { margin-left: auto; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.status-btn {
  border: 0; border-radius: 4px; padding: 0 18px; min-height: 40px;
  font: inherit; font-weight: 800; font-size: 13.5px; cursor: pointer;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .2);
  transition: filter .12s, transform .06s;
}
.status-btn:hover { filter: brightness(1.12); }
.status-btn:active { transform: translateY(1px); }
.status-btn:disabled { opacity: .5; cursor: progress; filter: none; }

.client { margin: 12px 16px 16px; padding: 22px 24px 24px; }
.client-head { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding-bottom: 16px; border-bottom: 1px dashed var(--line); }
.client-name { font-size: 19px; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 10px; word-break: break-word; }
.client-name::before { content: "•"; }
.meta { margin-left: auto; display: flex; flex-wrap: wrap; background: var(--panel-2); border-radius: 4px; font-size: 13px; }
.meta-seg { padding: 9px 14px; display: flex; gap: 8px; align-items: center; position: relative; }
.meta-seg + .meta-seg { padding-left: 22px; }
.meta-seg + .meta-seg::before {
  content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 12px;
  background: linear-gradient(to left top, transparent calc(50% - 1px), var(--line) 50%, transparent calc(50% + 1px));
}
.meta-seg b { font-weight: 800; }
.client-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; padding-top: 18px; }
.fields { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.field-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-height: 32px; }
.field-label { color: var(--muted); font-weight: 600; min-width: 112px; }
.field-value { font-weight: 700; word-break: break-word; }
.field-value.empty { color: #6e737e; font-weight: 600; }
.phone-value { font-size: 16px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.contact-actions { margin-left: auto; display: flex; gap: 8px; }
.callback-note { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 6px; background: #4a2a3b; color: #ffc4dc; font-weight: 700; }
.comment { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.comment textarea {
  flex: 1; width: 100%; min-height: 320px; resize: vertical;
  background: #2a2b2f; color: var(--text); border: 1px solid transparent; border-radius: 6px;
  padding: 16px; font: inherit; line-height: 1.55;
}
.comment textarea:focus { outline: none; border-color: #4f5565; }
.comment-state { font-size: 12px; color: var(--muted); min-height: 16px; text-align: right; }
.client-history { margin-top: 10px; padding-top: 14px; border-top: 1px dashed var(--line); }
.client-history h3, .block-title {
  font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin: 0 0 8px; font-weight: 800;
}
.hist-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.hist-item:last-child { border-bottom: 0; }
.hist-when { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.hist-who { color: var(--text-2); font-size: 12.5px; }
.hist-comment { flex-basis: 100%; color: var(--text-2); white-space: pre-wrap; font-size: 13px; }
.workline { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin: 10px 16px 0; color: var(--text-2); font-size: 13px; }
.workline .icon { color: var(--muted); }
.empty-state { text-align: center; padding: 70px 16px; color: var(--text-2); }
.empty-state h2 { color: var(--text); margin: 0 0 8px; font-size: 20px; }

/* --- история: период, диаграммы ------------------------------------------------- */
.hist-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; }
.period-list { background: var(--panel-3); border-radius: 6px; padding: 4px; }
.period-item {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 10px 12px; border: 0; background: none; color: var(--text-2);
  font: inherit; border-radius: 5px; cursor: pointer; text-align: left;
}
.period-item:hover { background: #2c2f36; }
.period-item.selected { background: #33363e; color: var(--text); font-weight: 700; }
.period-item .icon { color: var(--ok-text); visibility: hidden; width: 16px; height: 16px; stroke-width: 3; }
.period-item.selected .icon { visibility: visible; }
.period-range { display: flex; gap: 6px; align-items: center; padding: 10px 8px 6px; border-top: 1px solid var(--line-soft); margin-top: 4px; }
.period-range .input { flex: 1; min-height: 32px; padding: 4px 8px; font-size: 13px; }
.period-range .icon { color: var(--muted); }
.period-range.stacked { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; padding: 10px 10px 8px; }
.period-range.stacked .muted { font-size: 13px; }
.count-box {
  margin-top: 10px; background: var(--ok-bg); color: var(--ok-text); border-radius: 6px;
  padding: 12px 14px; display: flex; justify-content: space-between; gap: 10px; font-weight: 800;
}
.seg { display: flex; background: var(--panel-3); border-radius: 6px; padding: 5px; gap: 5px; }
.seg button {
  flex: 1; height: 34px; padding: 0 14px; border: 1px solid transparent; background: none; color: var(--text-2);
  font: inherit; font-weight: 700; border-radius: 5px; cursor: pointer; white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.active { background: #33363e; border-color: #4f5462; color: var(--text); }
.seg.inline { display: inline-flex; }
.seg.inline button { flex: none; }
.chart-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 24px; align-items: center; margin-top: 14px; }
.chart-wrap.wide { grid-template-columns: minmax(0, 1fr); }
.chart-box { position: relative; height: 300px; min-width: 0; }
.chart-title { font-size: 13px; color: var(--text-2); font-weight: 700; margin: 14px 0 0; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-weight: 600; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 52px; gap: 10px; align-items: center; font-size: 13px; }
.legend .swatch { width: 12px; height: 12px; border-radius: 3px; }
.legend .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.legend .val { font-weight: 800; font-variant-numeric: tabular-nums; }
.legend .pct { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.legend.row { flex-direction: row; flex-wrap: wrap; gap: 8px 18px; }
.legend.row li { display: flex; gap: 8px; }

/* --- админка ------------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 16px 0; }
.filters .period-range { border: 0; margin: 0; padding: 0; }
.filters .period-range .input { min-height: 38px; font-size: 13px; width: 190px; flex: none; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 16px; }
.tile { background: var(--panel); border-radius: 6px; padding: 16px 18px; }
.tile-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.tile-value { font-size: 28px; font-weight: 800; margin-top: 2px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; }
.stackbar { display: flex; gap: 2px; height: 10px; min-width: 150px; }
.stackbar span { height: 100%; min-width: 2px; }
.stackbar span:first-child { border-radius: 4px 0 0 4px; }
.stackbar span:last-child { border-radius: 0 4px 4px 0; }
.stackbar span:only-child { border-radius: 4px; }
.progress { height: 8px; background: #20222a; border-radius: 4px; overflow: hidden; min-width: 90px; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.progress.big { height: 12px; border-radius: 6px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  border: 2px dashed #4b505d; border-radius: 10px; padding: 48px 20px; text-align: center;
  color: var(--text-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: rgba(57, 135, 229, .06); }
.dropzone .icon { width: 34px; height: 34px; color: var(--accent-2); }
.dropzone b { color: var(--text); font-size: 16px; }
.map-table td, .map-table th { padding: 8px 10px; font-size: 13px; }
.map-table td { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-table select.input { min-width: 140px; min-height: 34px; padding: 4px 8px; }
.map-table tr.header-row td { color: var(--warn); font-weight: 700; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 24px; margin-top: 18px; }
.options .check { display: flex; }
.checklist { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow: auto; padding: 4px 2px; }
.report { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 14px 0; }
.report div { background: var(--panel-2); border-radius: 6px; padding: 12px 14px; }
.report b { display: block; font-size: 22px; }
.status-row { display: grid; grid-template-columns: 70px 44px minmax(140px, 1fr) 250px 64px 120px; gap: 12px; align-items: center; padding: 10px 12px; background: var(--panel-2); border-radius: 6px; margin-bottom: 8px; }
.status-row.head { background: none; padding-top: 0; padding-bottom: 0; color: var(--text-2); font-size: 13px; font-weight: 700; }
.status-row .order { display: flex; gap: 4px; }
.status-preview { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px; background: var(--bar); border-radius: 6px; }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 14px; margin-bottom: 16px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 700; word-break: break-word; }

/* --- модалки и уведомления ---------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(12, 13, 16, .62);
}
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column;
  background: #2f323a; border-radius: 10px; box-shadow: 0 24px 64px rgba(0, 0, 0, .55);
}
.modal.wide { width: min(780px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid #3c404a; }
.modal-head h2 { font-size: 16px; margin: 0; font-weight: 800; }
.modal-head .icon-btn { margin-left: auto; background: transparent; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 14px 20px; border-top: 1px solid #3c404a; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.toasts {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200;
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 16px;
  background: #1f2126; color: var(--text); font-weight: 600;
  border: 1px solid #3c404a; border-left: 4px solid var(--accent); border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}
.toast.error { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }
.toast .btn { height: 30px; }

/* --- вход: слева тёмная панель с дугой и логотипом, справа форма ------------------------- */
.auth {
  --auth-dark: #2a2b30;
  --auth-ring: #303138;
  --auth-bg: #393c46;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 44vw minmax(0, 1fr);
  background:
    radial-gradient(circle 83vw at -39vw 46%,
      var(--auth-dark) calc(83vw - 34px), var(--auth-ring) calc(83vw - 33px),
      var(--auth-ring) calc(83vw - 1px), transparent 83vw),
    var(--auth-bg);
}
.auth-art { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 46px; padding: 40px 24px; }
.auth-mark { width: min(330px, 24vw); }
.auth-wordmark { width: min(420px, 30vw); }
.auth-side { display: flex; align-items: center; padding: 40px 6vw 40px 8vw; }
.auth-form { width: min(360px, 100%); display: flex; flex-direction: column; gap: 16px; }
.auth-form h1 { margin: 0 0 4px; font-size: 19px; font-weight: 800; }
.auth-form .alert { margin: 0; }
.auth-input {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid transparent; border-radius: 4px;
  background: var(--auth-dark); color: var(--text); font: 13px/1 var(--font);
}
.auth-input::placeholder { color: #85878f; }
.auth-input:focus { outline: none; border-color: #555a68; }
.auth-pass { position: relative; }
.auth-pass .auth-input { padding-right: 52px; }
.auth-eye {
  position: absolute; right: 0; top: 6px; width: 42px; height: 30px; display: grid; place-items: center;
  border: 0; border-left: 1px solid #45474f; background: none; color: #c9cbd1; cursor: pointer;
}
.auth-eye:hover { color: #fff; }
.auth-submit {
  align-self: flex-start; height: 34px; padding: 0 13px; border: 0; border-radius: 4px;
  background: #fff; color: #1d1f24; font: 600 13px var(--font); cursor: pointer;
}
.auth-submit:hover { background: #e6e7eb; }
@media (max-width: 860px) {
  .auth { display: block; background: var(--auth-bg); }
  .auth-art { background: var(--auth-dark); border-radius: 0 0 50% 50% / 0 0 36px 36px; gap: 18px; padding: 44px 16px 38px; }
  .auth-mark { width: 120px; }
  .auth-wordmark { width: 220px; }
  .auth-side { justify-content: center; padding: 36px 16px 48px; }
}
.alert { padding: 10px 12px; border-radius: 6px; background: #4a2427; color: #ffc2c2; margin-bottom: 14px; font-weight: 600; }

@media (max-width: 1100px) {
  .chart-wrap { grid-template-columns: minmax(0, 1fr); }
  .two-col { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .client-body, .hist-grid { grid-template-columns: minmax(0, 1fr); }
  .statusbar { flex-direction: column; align-items: stretch; }
  .statusbar-buttons { margin-left: 0; justify-content: flex-start; }
  .meta { margin-left: 0; }
  .comment textarea { min-height: 180px; }
  .status-row { grid-template-columns: 60px 44px minmax(0, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .search .input { width: 100%; }
}
@media (max-width: 600px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .logo span { display: none; }
  .panel, .client { margin: 12px; padding: 16px; }
  .statusbar, .filters, .tiles { margin-left: 12px; margin-right: 12px; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
}
