/* Chopa B5: the same cream, ink, cobalt, orange and sage as the clients.
   Presentation only; no changes to admin authorization or operations. */
:root {
  color-scheme: light;
  font-family: "Bahnschrift", "Trebuchet MS", "Segoe UI", sans-serif;
  --bg: #f0eadf;
  --sidebar: #0e0e0d;
  --surface: #f7f2e8;
  --surface-2: #e8e2d6;
  --surface-3: #e1e6cd;
  --line: #cec7b9;
  --line-strong: #201f1b;
  --text: #201f1b;
  --muted: #69665e;
  --green: #3656d4;
  --green-soft: #2945b6;
  --cyan: #3656d4;
  --amber: #855016;
  --red: #a33225;
  --radius: 0;
  --shadow: 6px 6px 0 #201f1b;
  background: var(--bg);
  color: var(--text);
}
html { scroll-padding-top: 18px; }
body { min-width: 0; background: var(--bg); line-height: 1.5; }
button { min-height: 44px; padding: 10px 16px; border-radius: 0; background: #3656d4; color: #fffaf1; line-height: 1.35; overflow-wrap: anywhere; }
button:hover { transform: none; background: #2945b6; }
button:disabled { opacity: .55; }
button.danger { border-color: #a33225; color: #a33225; }
button.danger:hover { background: #f2dbcf; }
input, select, textarea { min-width: 0; max-width: 100%; border-radius: 0; background: var(--surface); line-height: 1.5; }
input:focus, select:focus, textarea:focus { background: #fffaf2; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:disabled, select:disabled, textarea:disabled { color: var(--muted); background: var(--surface-2); opacity: 1; }
input[type="checkbox"] { flex: 0 0 19px; margin: 0; }
h1, h2, h3, .brand-row strong { font-family: "Bahnschrift", "Trebuchet MS", "Segoe UI", sans-serif; overflow-wrap: anywhere; }
h1 { font-weight: 900; line-height: 1.08; letter-spacing: -.045em; }
h2 { line-height: 1.3; }
code, p, label, small { overflow-wrap: anywhere; }
label { min-width: 0; }

.login-panel { padding: 34px; border: 1px solid #201f1b; border-radius: 0; background: var(--surface); }
.login-panel::before { width: 5px; background: #ed5b2a; }
.login-panel > label { display: grid; gap: 7px; font-size: 14px; font-weight: 700; }
.login-panel > small { font-size: 12px; }
.brand-mark { border: 1px solid #201f1b; border-radius: 0; background: #bdd078; color: #201f1b; box-shadow: none; }
.admin-shell { grid-template-columns: 244px minmax(0, 1fr); }
.sidebar {
  --text: #f0eadf;
  --muted: #bfb9ad;
  --line: #444239;
  --line-strong: #f0eadf;
  --surface: #27261f;
  --surface-2: #323028;
  color: var(--text);
  background: #0e0e0d;
  backdrop-filter: none;
  gap: 24px;
}
.brand-row > span { min-width: 0; }
.brand-row strong { font-weight: 900; letter-spacing: -.025em; }
.sidebar nav { gap: 6px; }
.sidebar nav button { min-width: 0; padding: 11px 12px; line-height: 1.35; }
.sidebar nav button.active { border-color: #bdd078; background: #bdd078; color: #201f1b; }
.sidebar nav b { max-width: 100%; border-radius: 0; }
.sidebar nav button.active b { border-color: #7a8a45; color: #201f1b; }
.sidebar .brand-mark { border-color: #bdd078; }
.sidebar .sync-button, .sidebar .logout-button { min-height: 44px; }
.sidebar button:focus-visible { outline-color: #bdd078; outline-offset: -4px; }

.workspace { min-width: 0; gap: 26px; padding-inline: clamp(20px, 2.8vw, 42px); }
.workspace > *, .topbar > *, .detail-head > *, .section-head > *, .row > *, .server-row > *, .admin-list li > * { min-width: 0; }
.topbar > div:first-child { flex: 1; }
.topbar-status { flex: 0 1 230px; font-size: 13px; }
.eyebrow { color: #3656d4; letter-spacing: .12em; }
.workspace-summary span { border-radius: 0; border-color: #c3bcaf; background: var(--surface); }
.workspace-summary span:first-child { border-color: #859450; background: #dee6c3; }
.split { grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr); }
.panel { border-color: #c3bcaf; border-radius: 0; background: var(--surface); box-shadow: none; }
.panel > h2:first-child { border-bottom-color: #201f1b; }
.row, .access-code-card, .server-row, .build-list article { border-radius: 0; background: var(--surface); }
.row { grid-template-columns: minmax(0, 1fr) minmax(0, auto); }
button.row:hover { transform: none; background: #e4e9d2; }
.row.active { border-color: #3656d4; background: #e8eafa; box-shadow: inset 3px 0 0 #3656d4; }
.row > span, .server-row > div { overflow-wrap: anywhere; }
.row.static { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.row.static > button { justify-self: start; }
.table:empty::after { content: "Пока нет записей"; color: var(--muted); padding: 14px 0; font-size: 14px; }
.detail-head { flex-wrap: wrap; }
.detail-head > div:first-child { flex: 1 1 220px; }
.detail-head .actions { flex: 1 1 240px; }
.actions button, .code-actions button { max-width: 100%; }
.metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); border-radius: 0; }
.metrics div, .control-summary div { background: #eee8dc; }
.metrics dt, .control-summary dt { overflow-wrap: anywhere; }
.metrics dd { color: #3656d4; font-size: 1.05rem; }
.info-grid, .code-facts { gap: 12px 18px; }
.code-facts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
.info-grid > *, .code-facts > *, .contact-grid > * { min-width: 0; }
.contact-grid { grid-template-columns: minmax(0, .7fr) minmax(0, 1fr); }
.admin-list li { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.device-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.code-value { grid-template-columns: minmax(0, 1fr) auto; border-color: #859450; border-radius: 0; background: #e1e8cc; }
.code-value span, .code-value code { color: #33431d; }
.access-code-card.friend { border-color: #919d66; background: #edf0df; }
.access-code-card.test { border-color: #cf9e81; background: #f6e7d9; }
.status-badge { max-width: 100%; border-radius: 0; color: #4a473f; background: #e9e3d7; white-space: normal; overflow-wrap: anywhere; }
.status-badge.active, .status-badge.redeemed { border-color: #83914e; color: #33431d; background: #e1e8cc; }
.status-text.active { color: #405a23; }
.status-badge.suspended, .status-badge.banned, .status-badge.revoked { border-color: #a33225; background: #f5ded4; }
.status-badge.expired { border-color: #bb9766; color: #855016; background: #f1e4ca; }
.code-note, .operation-notice p, .inline-notice, .affected-users code, .confirmation-modal p { color: var(--text); }
.operation-notice, .recovery-token, .inline-notice { min-width: 0; margin-block: 12px; padding: 12px; border-color: #6f8744; background: #e7edda; overflow-wrap: anywhere; }
.operation-notice.warning, .recovery-token { border-color: #b47735; background: #f3e5ce; }
.operation-notice.error, .inline-notice.error { border-color: #a33225; color: #a33225; background: #f5ded4; }
.control-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: 0; }
.server-row { grid-template-columns: minmax(0, 1fr); }
.server-row .actions { justify-content: flex-start; }
.build-list article { border-left: 4px solid #3656d4; }
.build-list a { text-underline-offset: 3px; }
.secondary { border: 1px solid var(--line-strong); background: transparent; color: var(--text); }
.secondary:hover { background: var(--surface-2); }

.modal-backdrop { overflow: auto; overscroll-behavior: contain; padding: 20px; background: rgba(14, 14, 13, .76); backdrop-filter: blur(4px); }
.confirmation-modal { min-width: 0; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow: auto; overscroll-behavior: contain; border: 1px solid #201f1b; border-radius: 0; background: var(--surface); }
.confirmation-modal p { overflow-wrap: anywhere; }
.modal-actions { position: sticky; bottom: -24px; margin: 0 -24px -24px; padding: 16px 24px 24px; background: var(--surface); border-top: 1px solid var(--line); }
body:has(.modal-backdrop) { overflow: hidden; }

@media (max-width: 1240px) { .split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1060px) { .admin-shell { grid-template-columns: 218px minmax(0, 1fr); } .topbar { flex-wrap: wrap; } .topbar-status { flex-basis: 100%; justify-items: start; text-align: left; max-width: 100%; } }
@media (max-width: 820px) {
  html { scroll-padding-top: 140px; }
  .admin-shell { display: block; }
  .sidebar { grid-template-columns: minmax(0, 1fr) auto auto; padding: 12px; gap: 10px; }
  .sidebar nav { display: flex; grid-row: 2; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: #817e6b #24231d; padding: 4px 1px 8px; }
  .sidebar nav::-webkit-scrollbar { display: block; height: 4px; }
  .sidebar nav::-webkit-scrollbar-thumb { background: #817e6b; }
  .sidebar nav button { flex: 0 0 auto; min-width: max-content; width: auto; min-height: 44px; padding-inline: 12px; }
  .workspace { padding: 24px 16px 36px; }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .code-facts, .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .brand-mark { border-radius: 0; }
}
@media (max-width: 560px) {
  html { scroll-padding-top: 20px; }
  .sidebar { position: relative; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar .brand-row { grid-column: 1 / -1; }
  .sidebar nav { grid-row: 3; }
  .sidebar nav button { font-size: 12px; }
  .sidebar .sync-button, .sidebar .logout-button { min-height: 44px; font-size: 12px; }
  .workspace { padding-inline: 12px; gap: 22px; }
  .panel { padding: 16px; border-radius: 0; }
  .detail-head > div:first-child, .detail-head .actions { flex-basis: auto; }
  .login-shell { padding: 16px; }
  .login-panel { padding: 24px; box-shadow: 4px 4px 0 #201f1b; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .code-facts, .info-grid, .device-actions, .code-value, .row { grid-template-columns: minmax(0, 1fr); }
  .modal-backdrop { padding: 12px; }
  .confirmation-modal { max-height: calc(100dvh - 24px); padding: 20px; box-shadow: 4px 4px 0 #201f1b; }
  .modal-actions { bottom: -20px; margin: 0 -20px -20px; padding: 14px 20px 20px; }
}
