/* insomniabus admin — рабочий режим: светлое поле для таблиц, ночной сайдбар из мира сайта, янтарь котобуса как единственный акцент. */
@font-face { font-family: "Shantell Sans"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/static/public/fonts/shantell-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Shantell Sans"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/static/public/fonts/shantell-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/static/public/fonts/nunito-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/static/public/fonts/nunito-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+20A0-20AB, U+20AD-20C0; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/static/public/fonts/nunito-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212; }

:root {
  --night: #1d1f4e;
  --night-2: #2a2b63;
  --night-3: #3b3a78;
  --moon: #f6edd9;
  --bg: #eceef4;
  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --line: #d9dce8;
  --line-2: #e7e9f1;
  --ink: #1b1d33;
  --ink-2: #4a4e68;
  --ink-3: #6b6f88;
  --amber: #e7a136;
  --amber-hi: #f3b553;
  --amber-ink: #2a1a0c;
  --amber-soft: #fdf1dc;
  --teal: #22403e;
  --ok: #1f7a4a;
  --ok-bg: #e2f4ea;
  --warn: #8a5a00;
  --warn-bg: #fdf0d6;
  --bad: #b3261e;
  --bad-bg: #fbe4e1;
  --muted-bg: #eceef4;
  --r: 12px;
  --shadow: 0 1px 2px rgba(27, 29, 51, .06), 0 8px 24px -14px rgba(27, 29, 51, .25);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Shantell Sans", "Nunito", sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; font: 500 15px/1.45 var(--font); color: var(--ink); background: var(--bg); }
::selection { background: var(--amber); color: var(--amber-ink); }
a { color: #3a3f9e; text-underline-offset: 3px; }
a:hover { color: var(--night); }
button, input, textarea { font: inherit; color: inherit; }
svg { display: block; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num, td.num, .tabular { font-variant-numeric: tabular-nums; }

.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; overflow: auto; background: linear-gradient(180deg, #161842, var(--night) 40%, #23264f); color: var(--moon);
  display: flex; flex-direction: column; padding: 16px 12px; }
.side .logo { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; color: var(--moon); text-decoration: none; font: 700 18px/1.1 var(--display); }
.side .logo svg { width: 36px; height: 30px; color: var(--moon); }
.side .logo small { display: block; font: 600 12px/1.2 var(--font); color: #b9b7d9; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #dcd8ee; text-decoration: none; font-weight: 700; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.on { background: var(--amber); color: var(--amber-ink); }
.nav .sep { height: 1px; background: rgba(255, 255, 255, .1); margin: 10px 8px; }
.nav .cap { padding: 4px 12px; font-size: 12px; font-weight: 700; color: #9c99c4; }
.side .me { margin-top: auto; padding: 12px; font-size: 13px; color: #b9b7d9; }
.side .me button { margin-top: 6px; background: none; border: 0; color: #fff; padding: 0; cursor: pointer; font-weight: 700; display: inline-flex; gap: 8px; align-items: center; }

.main { min-width: 0; padding: 22px 26px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; font: 800 26px/1.15 var(--display); }
.page-head .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 14px; color: var(--ink-3); margin-bottom: 4px; }
.crumb a { color: var(--ink-3); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.card-pad { padding: 16px 18px; }
.card h2 { margin: 0 0 12px; font: 800 18px/1.2 var(--font); }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.filters-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line-2); align-items: center; }
.summary { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); }
.summary b { color: var(--ink); font-variant-numeric: tabular-nums; }
.summary .big b { font-size: 18px; }

/* поля */
.f { display: grid; gap: 5px; }
.f > label, .f .lbl { font-weight: 700; font-size: 13.5px; color: var(--ink-2); }
.req { color: var(--bad); margin-left: 2px; }
.in { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-weight: 600; }
textarea.in { height: auto; min-height: 120px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.in::placeholder { color: #8b8fa6; font-weight: 500; }
.in:hover { border-color: #b8bdd3; }
.in:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(231, 161, 54, .22); }
.in[aria-invalid="true"] { border-color: var(--bad); }
.hint { font-size: 12.5px; color: var(--ink-3); }

.dd { position: relative; }
.dd-btn { width: 100%; height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); cursor: pointer; text-align: left; font-weight: 600; }
.dd-btn:hover { border-color: #b8bdd3; }
.dd-btn[aria-expanded="true"] { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(231, 161, 54, .22); }
.dd-btn .v { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-btn .ph { color: #8b8fa6; font-weight: 500; }
.dd-btn .i { color: var(--ink-3); }
.dd-list { position: absolute; z-index: 40; left: 0; min-width: 100%; top: calc(100% + 4px); max-height: 300px; overflow: auto; padding: 5px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px -10px rgba(27, 29, 51, .35); animation: pop .15s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.dd-opt { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; background: none; text-align: left; cursor: pointer; font-weight: 600; white-space: nowrap; }
.dd-opt:hover, .dd-opt.kb { background: var(--surface-2); }
.dd-opt[aria-selected="true"] { background: var(--amber-soft); color: #7a4a06; }
.dd-opt .box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #b8bdd3; display: grid; place-items: center; }
.dd-opt[aria-selected="true"] .box { background: var(--amber); border-color: var(--amber); }

.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 600; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid #b8bdd3; display: grid; place-items: center; background: var(--surface); }
.check .box .i { width: 14px; height: 14px; stroke-width: 3; color: var(--amber-ink); opacity: 0; }
.check input:checked + .box { background: var(--amber); border-color: var(--amber); }
.check input:checked + .box .i { opacity: 1; }
.check input:focus-visible + .box { outline: 3px solid var(--amber); outline-offset: 2px; }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; font-weight: 800; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--amber); color: var(--amber-ink); }
.btn-primary:hover { background: var(--amber-hi); color: var(--amber-ink); }
.btn-line { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-line:hover { border-color: var(--amber); color: var(--ink); }
.btn-danger { background: var(--surface); border-color: #f0c2bd; color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-ghost { background: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--muted-bg); color: var(--ink); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13.5px; border-radius: 8px; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; pointer-events: none; }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px; border: 0; background: none; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--muted-bg); color: var(--ink); }
.icon-btn.bad:hover { background: var(--bad-bg); color: var(--bad); }

/* таблицы */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12.5px; font-weight: 800; color: var(--ink-2); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:hover td { background: #fafbfd; }
tr.sub td { background: var(--surface-2); padding: 0; }
td.num, th.num { text-align: right; }
td .muted, .muted { color: var(--ink-3); }
.mono { font: 700 13.5px/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .02em; }

.empty { padding: 40px 18px; text-align: center; color: var(--ink-3); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 10px 18px; color: var(--ink-2); flex-wrap: wrap; }
.pager .dd { width: 90px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-mute { background: var(--muted-bg); color: var(--ink-2); }
.b-night { background: #e6e5f6; color: var(--night-3); }

.menu { position: absolute; z-index: 45; right: 0; top: calc(100% + 4px); min-width: 220px; padding: 5px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 30px -10px rgba(27, 29, 51, .35); animation: pop .15s var(--ease); }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; background: none; text-align: left;
  cursor: pointer; font-weight: 600; color: var(--ink); text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--surface-2); }
.menu .bad { color: var(--bad); }
.rel { position: relative; display: inline-block; }

/* выдвижная форма */
.drawer-back { position: fixed; inset: 0; z-index: 60; background: rgba(20, 22, 50, .38); animation: fade .2s; }
.drawer { position: fixed; z-index: 61; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); box-shadow: -20px 0 50px -20px rgba(20, 22, 50, .45);
  display: flex; flex-direction: column; animation: slide .3s var(--ease); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.drawer-head h2 { margin: 0; font: 800 20px/1.2 var(--display); }
.drawer-body { flex: 1; overflow: auto; padding: 18px 20px; display: grid; gap: 14px; align-content: start; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; justify-content: flex-end; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.section-t { margin: 6px 0 -4px; font-weight: 800; font-size: 13px; color: var(--night-3); }
.err { padding: 10px 12px; border-radius: 9px; background: var(--bad-bg); color: var(--bad); font-weight: 700; display: flex; gap: 8px; }
.svc-pick { display: grid; gap: 6px; }
.svc-pick .row { display: grid; grid-template-columns: 1fr 120px; gap: 8px; align-items: center; }

/* детальные страницы */
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; }
.kv dt { color: var(--ink-3); font-weight: 600; }
.kv dd { margin: 0; font-weight: 700; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.log { display: grid; gap: 6px; font-size: 13.5px; }
.log div { display: grid; grid-template-columns: 140px 1fr; gap: 10px; }

.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(ellipse at 50% 120%, #3b3a78, var(--night) 55%, #121433); }
.login form { width: min(400px, 100%); padding: 26px; border-radius: 16px; background: var(--surface); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6); display: grid; gap: 14px; }
.login .eye { width: 64px; height: 54px; color: var(--night); margin: 0 auto; }
.login h1 { margin: 0; text-align: center; font: 800 24px/1.2 var(--display); }

#toast { position: fixed; z-index: 90; right: 20px; bottom: 20px; padding: 12px 16px; border-radius: 10px; background: var(--night); color: var(--moon); font-weight: 700;
  box-shadow: 0 12px 30px -10px rgba(20, 22, 50, .5); transform: translateY(16px); opacity: 0; transition: .25s var(--ease); pointer-events: none; max-width: calc(100vw - 40px); }
#toast.show { transform: none; opacity: 1; }
#toast.bad { background: var(--bad); color: #fff; }

.burger { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 70; left: 0; width: 260px; transform: translateX(-100%); transition: transform .25s var(--ease); }
  .side.open { transform: none; box-shadow: 20px 0 50px -20px rgba(0, 0, 0, .5); }
  .burger { display: inline-grid; }
  .main { padding: 14px 12px 50px; }
  .cols, .grid2, .grid3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
.row-acts { text-align: right; white-space: nowrap; }
.row-acts > * { vertical-align: middle; }
table.dense th, table.dense td { padding: 9px 8px; }
table.dense th { white-space: normal; }
