/* Общий вид кабинета отеля и админки платформы — в оформлении сайта AI-hotel
   (app/static/site/site.css): светлый фон, белые карточки, синий #1A56DB,
   шрифт Manrope. Своё у каждого — в cabinet.css и admin.css.

   Шрифт берётся из файлов сайта (/site/fonts): политика страниц
   (font-src 'self') это разрешает.

   Цвета состояний проверены на контраст с белым и со своей подложкой
   (≥ 4.5:1): зелёный #0B7A4B, красный #C0362C, жёлтый #9A5B00. Цвет не несёт
   смысл один — рядом всегда текст, стрелка или знак. */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/site/fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/site/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --blue: #1A56DB;
  --blue-hover: #1649BE;
  --blue-deep: #0B3AA8;
  --ink: #0B0B0F;
  --ink-4: #555555;
  --slate: #37485F;
  --muted: #6B7280;
  --line: #E5E9F2;
  --hairline: #EDEFF4;
  --field: #E1E3E8;
  --tint: #E8EFFD;
  --panel: #DFE7FA;
  --gray: #F3F4F6;
  --page: #F7F9FD;
  --good: #0B7A4B;
  --good-bg: #E3F4EC;
  --bad: #C0362C;
  --bad-bg: #FBE9E7;
  --warn: #9A5B00;
  --warn-bg: #FFF3DC;
  --warn-line: #F3D9A4;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow: 0 1.5rem 3.75rem rgba(11, 58, 168, 0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font: 500 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.boot { padding: 96px 24px; color: var(--muted); text-align: center; }

/* --- общие элементы ------------------------------------------------------ */

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand img { width: 38px; height: 38px; flex: none; }
.brand b { font-size: 20px; font-weight: 800; line-height: 1; letter-spacing: -0.01em; }

.eyebrow {
  display: flex; align-items: center; gap: 8px;
  color: var(--blue); font-size: 11px; font-weight: 800; line-height: 1;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; }

input[type=text], input[type=email], input[type=password], input[type=url], select, textarea {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1px solid var(--field); border-radius: 12px; background: #fff;
  color: var(--ink); font: 500 15px var(--font);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
input::placeholder, textarea::placeholder { color: #9CA3AF; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(26, 86, 219, 0.14); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); cursor: pointer; }

.act {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--blue); color: #fff; font: 700 15px var(--font); text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color 0.2s, box-shadow 0.2s, color 0.2s, border-color 0.2s;
}
.act:hover { background: var(--blue-hover); box-shadow: 0 10px 24px rgba(26, 86, 219, 0.25); }
.act:disabled { opacity: 0.5; cursor: default; box-shadow: none; }
.act.block { width: 100%; height: 50px; }
.act.ghost { height: 40px; padding: 0 18px; border: 1px solid var(--field); background: #fff; color: var(--ink); font-size: 14px; }
.act.ghost:hover { border-color: var(--blue); background: #fff; color: var(--blue); box-shadow: none; }
.act.ghost:disabled:hover { border-color: var(--field); color: var(--ink); }

.msg { margin-bottom: 16px; padding: 12px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 600; line-height: 1.5; }
.msg.info { background: var(--tint); color: var(--slate); }
.msg.ok { background: var(--good-bg); color: var(--good); }
.msg.bad { background: var(--bad-bg); color: var(--bad); }
.msg.warn { border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--ink); font-weight: 500; }

.pill {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  background: var(--gray); color: #5C6069; font-size: 12px; font-weight: 700; line-height: 1.3;
  white-space: nowrap; vertical-align: middle;
}
.pill.ok { background: var(--good-bg); color: var(--good); }
.pill.wait { background: var(--tint); color: var(--blue); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }

.check { color: var(--good); font-weight: 600; }
.dash { color: var(--muted); }
.empty { padding: 28px 0; color: var(--muted); font-size: 13.5px; text-align: center; }
.gap-top { margin-top: 20px; }

/* --- вход ---------------------------------------------------------------- */

.gate {
  position: relative; display: grid; place-items: center; min-height: 100vh; padding: 24px;
  overflow: hidden; isolation: isolate; background: var(--panel);
}
.gate::before, .gate::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; }
.gate::before { top: -180px; right: -160px; width: 520px; height: 520px; background: var(--tint); }
.gate::after { bottom: -220px; left: -140px; width: 440px; height: 440px; border: 60px solid rgba(26, 86, 219, 0.06); }
.gate__card { width: min(440px, 100%); padding: 36px; border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.gate__logo { margin-bottom: 28px; }
.gate__hint { margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.gate__hint.eyebrow { margin-bottom: 12px; color: var(--blue); font-size: 11px; }
.gate__title { margin-bottom: 24px; font-size: 26px; font-weight: 800; line-height: 1.15; letter-spacing: -0.025em; }
.gate form > div + div { margin-top: 14px; }
.gate .tabs { display: flex; margin-bottom: 20px; }
.gate .tabs button { flex: 1; }

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

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

.side {
  position: sticky; top: 0; display: flex; flex-direction: column; gap: 28px;
  height: 100vh; padding: 28px 16px 20px; overflow-y: auto;
  border-right: 1px solid var(--line); background: #fff;
}
.side__head { padding: 0 8px; }
.side__hotel { margin-top: 12px; overflow: hidden; color: var(--slate); font-size: 13px; font-weight: 700;
               text-overflow: ellipsis; white-space: nowrap; }
.side__hotel.eyebrow { color: var(--blue); font-size: 11px; }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 14px; border-radius: 12px;
  color: var(--slate); font-size: 15px; font-weight: 600; text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.side nav a:hover { background: var(--page); color: var(--blue); }
.side nav a.on { background: var(--tint); color: var(--blue); font-weight: 700; }
.side__foot { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding: 16px 8px 0; border-top: 1px solid var(--hairline); }
.side__user { color: var(--muted); font-size: 12.5px; word-break: break-all; }

.content { min-width: 0; }
.main { max-width: 1280px; padding: 40px 36px 80px; }
.main > header { margin-bottom: 24px; }
.main h1 { font-size: 34px; font-weight: 800; line-height: 1.12; letter-spacing: -0.03em; }
.main > header p { max-width: 70ch; margin-top: 8px; color: var(--muted); font-size: 15px; }
.refreshing { opacity: 0.55; transition: opacity 0.15s; }

.tabs { display: inline-flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.tabs button {
  height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent;
  color: var(--slate); font: 600 14px var(--font); cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.tabs button:hover { color: var(--blue); }
.tabs button[aria-selected="true"] { background: var(--blue); color: #fff; }

/* --- карточки и цифры ---------------------------------------------------- */

.card { margin-bottom: 20px; padding: 24px 22px 22px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.card h2 { margin-bottom: 4px; font-size: 19px; font-weight: 800; line-height: 1.3; letter-spacing: -0.015em; }
.card .note { margin-bottom: 18px; color: var(--muted); font-size: 13px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { padding: 20px 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.stat__value { margin: 2px 0 6px; font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -0.025em; }
.stat__extra { margin-bottom: 4px; color: var(--ink-4); font-size: 13px; }
.stat__delta { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat__delta.good { color: var(--good); }
.stat__delta.bad { color: var(--bad); }

/* --- графики ------------------------------------------------------------- */

/* Одна серия — один цвет. Подписи и значения — цветом текста, не столбика. */
.chart { display: grid; grid-template-columns: 40px 1fr; height: 190px; margin-top: 18px; }
.chart__axis { position: relative; }
.chart__axis span {
  position: absolute; right: 10px; transform: translateY(50%);
  color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums;
}
.chart__plot { position: relative; border-bottom: 1px solid var(--field); }
.chart__grid { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--hairline); }
.chart__bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.chart__slot {
  display: flex; flex: 1 1 0; align-items: flex-end; justify-content: center;
  min-width: 0; height: 100%; padding: 0; border: 0; background: none; cursor: default;
}
.chart__bar { display: block; width: 100%; max-width: 22px; border-radius: 4px 4px 0 0; background: var(--blue); }
.chart__slot:hover .chart__bar, .chart__slot:focus .chart__bar { background: var(--blue-deep); }
.chart__tip {
  position: absolute; top: 4px; transform: translateX(-50%); pointer-events: none;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  box-shadow: 0 10px 30px rgba(11, 11, 15, 0.12); font-size: 12px; white-space: nowrap;
}
.chart__tip b { display: block; font-size: 14px; font-weight: 800; }
.chart__tip span { color: var(--muted); }
.chart__x { display: flex; justify-content: space-between; padding: 8px 0 0 40px; color: var(--muted); font-size: 11px; }

.table-view { margin-top: 16px; }
.table-view summary { color: var(--blue); font-size: 13px; font-weight: 700; cursor: pointer; }
.table-view table { margin-top: 8px; }

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

/* Широкие таблицы на узком экране прокручиваются внутри карточки. */
.table-wrap { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--field) transparent; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 12px 8px; border-bottom: 1px solid var(--hairline); text-align: left; vertical-align: top; }
th {
  border-bottom-color: var(--line); color: var(--muted);
  font-size: 11px; font-weight: 800; line-height: 1.35; letter-spacing: 0.06em; text-transform: uppercase;
  vertical-align: bottom;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--page); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { white-space: nowrap; }
table td .sub, .card td .note { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

/* --- узкие экраны -------------------------------------------------------- */

@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px;
    height: auto; padding: 16px; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .side__head { padding: 0; }
  .side__hotel { display: none; }
  .side nav { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; order: 3; }
  .side nav a { padding: 8px 14px; }
  .side__foot { flex-direction: row; align-items: center; margin: 0 0 0 auto; padding: 0; border: 0; }
  .side__user { display: none; }
  .main { padding: 28px 16px 64px; }
  .main h1 { font-size: 28px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 16px; }
  .stat__value { font-size: 26px; }
  .card { padding: 20px 16px; }
  .gate__card { padding: 28px 22px; }
}
