/* ============================================================
   Zoom Hub — оформление
   Светлая база с синим отливом, белые карточки с крупным
   скруглением, глубокий сине-чёрный текст, насыщенный синий
   акцент. Тёмная только верхняя панель — как в референсе.
   Тема одна (светлая), поэтому контраст предсказуем везде.
   ============================================================ */

:root {
  color-scheme: light;          /* календарики и списки браузер рисует светлыми */

  --bg:        #EEF2FB;         /* фон страницы — белый с синим отливом */
  --bg-soft:   #F6F8FD;
  --surface:   #FFFFFF;         /* карточки */
  --surface-2: #F4F7FE;         /* вложенные блоки */
  --navy:      #111C3E;         /* верхняя панель, тёмные плашки */
  --navy-2:    #1B2A55;

  --ink:       #0E1733;         /* заголовки */
  --ink-2:     #33406B;         /* основной текст */
  --muted:     #6D799F;         /* второстепенное */

  --brand:     #3757F5;         /* акцент */
  --brand-lit: #5B79FF;
  --brand-deep:#2340D8;
  --brand-soft:#E8EDFF;         /* подложка акцента */
  --brand-ink: #FFFFFF;

  --line:      #E1E8F6;
  --line-2:    #D2DCF0;

  --ok:        #0F7A4F;
  --ok-bg:     #E2F6EC;
  --warn:      #8A5A00;
  --warn-bg:   #FCF1D8;
  --err:       #B32218;
  --err-bg:    #FDE9E7;

  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 12px;
  --pill: 999px;

  --shadow:    0 18px 40px -28px rgba(17, 28, 62, .45), 0 2px 6px -2px rgba(17, 28, 62, .06);
  --shadow-lg: 0 30px 70px -40px rgba(17, 28, 62, .55), 0 4px 12px -4px rgba(17, 28, 62, .08);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue",
          Inter, system-ui, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 560px at 50% -280px, rgba(55, 87, 245, .16), transparent 70%),
    radial-gradient(700px 400px at 100% 0%, rgba(90, 140, 255, .10), transparent 65%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink-2);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-deep); }
::selection { background: rgba(55, 87, 245, .18); color: var(--ink); }

/* ------------------------------------------------------------ шапка */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 26px;
  padding: 14px 28px;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 10px 30px -22px rgba(17, 28, 62, .8);
}
.brand {
  font-weight: 700; font-size: 17px; letter-spacing: -.02em; color: #fff;
  display: inline-flex; align-items: center; gap: 8px;
}
.brand:hover { color: #fff; opacity: .85; }
.topbar nav { display: flex; gap: 2px; }
.topbar nav a {
  color: rgba(255, 255, 255, .68);
  font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  padding: 8px 14px; border-radius: var(--pill);
  transition: background .15s, color .15s;
}
.topbar nav a:hover { color: #fff; background: rgba(255, 255, 255, .09); }
.topbar nav a.active { color: #fff; background: var(--brand); }

.pills { margin-left: auto; display: flex; gap: 8px; }
.pill {
  font-size: 12px; font-weight: 500; padding: 5px 12px; border-radius: var(--pill);
  white-space: nowrap; background: rgba(255, 255, 255, .12); color: #C7F5DF;
}
.pill.warn { background: rgba(255, 255, 255, .12); color: #FFDFA6; }

.who { display: flex; align-items: center; gap: 12px; }
.logout-form { display: inline; margin: 0; }
.whoami { color: rgba(255, 255, 255, .72); font-size: 13px; white-space: nowrap; }
.whoami:hover { color: #fff; }
.topbar .btn {
  background: transparent; color: #fff;
  border-color: rgba(255, 255, 255, .4);
}
.topbar .btn:hover { background: rgba(255, 255, 255, .12); border-color: #fff; color: #fff; }
.topbar .tag { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; }

main { max-width: 1180px; margin: 36px auto 90px; padding: 0 24px; }
.panel { overflow-wrap: anywhere; }
pre.code { white-space: pre-wrap; word-break: break-all; }

/* ---------------------------------------------------------- панели */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 30px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.panel h1 {
  font-size: 27px; line-height: 1.15; letter-spacing: -.03em; font-weight: 700;
  margin: 0 0 16px; color: var(--ink);
}
.panel h1.tight { margin-bottom: 8px; }
.panel h2 {
  font-size: 17px; letter-spacing: -.02em; font-weight: 700; margin: 0 0 14px; color: var(--ink);
}
.panel h3 {
  font-size: 11px; margin: 24px 0 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .16em; font-weight: 700;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }

.count {
  display: inline-block; font-size: 12px; font-weight: 700; vertical-align: 5px;
  color: var(--brand); background: var(--brand-soft);
  border-radius: var(--pill); padding: 3px 11px; margin-left: 9px;
}

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.crumbs { margin-bottom: 14px; font-size: 13.5px; }
.crumbs a { color: var(--muted); font-weight: 500; }
.crumbs a:hover { color: var(--brand); }

/* ----------------------------------------------------------- формы */

.grid-form { display: grid; grid-template-columns: repeat(12, 1fr); gap: 15px; }
.grid-form > label, .grid-form > fieldset {
  display: flex; flex-direction: column; gap: 7px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em;
  font-weight: 700; color: var(--muted);
}
.col-2 { grid-column: span 2; } .col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; } .col-8 { grid-column: span 8; } .col-12 { grid-column: span 12; }

input, select, textarea, .search {
  font: 400 14.5px/1.5 var(--font);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  width: 100%;
  text-transform: none; letter-spacing: normal;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #9AA5C4; }
input:hover, select:hover, textarea:hover { border-color: #B9C7E6; }
input:focus, select:focus, textarea:focus, .search:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(55, 87, 245, .14);
}
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
select option { background: #fff; color: var(--ink); }
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { padding: 0 0 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; color: var(--muted); }
.row-end { display: flex; justify-content: flex-end; align-items: center; gap: 14px; flex-wrap: wrap; }
.search { margin-bottom: 14px; background: var(--surface); }
.with-btn { display: flex; gap: 8px; align-items: center; }
.with-btn input { flex: 1; }

/* --------------------------------------------------------- кнопки */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: var(--pill);
  font: 600 14px/1 var(--font);
  letter-spacing: -.01em;
  cursor: pointer; white-space: nowrap;
  transition: transform .12s, box-shadow .2s, background .2s, border-color .2s, color .2s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--brand); border-color: var(--brand); color: var(--brand-ink);
  box-shadow: 0 12px 26px -14px rgba(55, 87, 245, .9);
}
.btn.primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.btn.ghost { background: transparent; }
.btn.tiny { padding: 6px 12px; font-size: 12.5px; }
.btn.big { padding: 13px 26px; font-size: 15px; }
.btn.full { width: 100%; }
.btn.danger:hover { border-color: var(--err); color: var(--err); background: var(--err-bg); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.file { cursor: pointer; }

/* ---------------------------------------------------- чипы, метки */

.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chips.vertical { flex-direction: column; max-height: 280px; overflow: auto; }
.chip {
  display: inline-flex; flex-direction: row; align-items: center; gap: 9px;
  border: 1px solid var(--line-2); border-radius: var(--pill);
  padding: 8px 15px; cursor: pointer; background: var(--surface);
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  text-transform: none; letter-spacing: normal;
  transition: border-color .15s, background .15s, color .15s;
}
.chip:hover { border-color: #B9C7E6; }
.chip input { width: auto; margin: 0; accent-color: var(--brand); }
.chip em { color: var(--muted); font-style: normal; font-size: 12px; }
.chip:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--ink); }

.tag {
  font-size: 11.5px; font-weight: 600; border-radius: var(--pill); padding: 3px 10px;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
  border: 1px solid var(--line);
}
.tag.ok  { background: var(--ok-bg);   color: var(--ok);   border-color: #BFE8D3; }
.tag.warn, .tag.external { background: var(--warn-bg); color: var(--warn); border-color: #F0DFB4; }
.tag.err { background: var(--err-bg);  color: var(--err);  border-color: #F5C9C4; }

.badge {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700;
  border-radius: var(--pill); padding: 3px 9px; color: var(--muted);
  border: 1px solid var(--line-2);
}
.badge.live { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }

/* -------------------------------------------------- карточки встреч */

.cards { display: flex; flex-direction: column; gap: 12px; }
.card {
  display: flex; align-items: center; gap: 18px; justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 20px;
  background: var(--surface);
  transition: border-color .2s, transform .15s, box-shadow .25s;
}
.card:hover { border-color: var(--line-2); transform: translateY(-1px); box-shadow: var(--shadow); }
.card.live { border-color: var(--brand); background: linear-gradient(180deg, var(--brand-soft), var(--surface) 70%); }
.card-title { font-weight: 700; font-size: 16px; letter-spacing: -.02em; color: var(--ink); }
.card-title:hover { color: var(--brand); }
.card-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-top: 6px; }
.dot { opacity: .4; }
.excerpt { margin: 10px 0 0; color: var(--ink-2); font-size: 13.5px; max-width: 72ch; }
.avatars { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.avatar {
  font-size: 12px; border-radius: var(--pill); padding: 3px 11px;
  color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line);
}

/* -------------------------------------------------- карточка встречи */

.meeting-head { display: flex; gap: 24px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.meeting-head h1 { font-size: 34px; letter-spacing: -.035em; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.agenda { margin: 14px 0 0; white-space: pre-wrap; color: var(--ink-2); max-width: 75ch; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
@media (max-width: 940px) {
  .two-col { grid-template-columns: 1fr; }
  .grid-form > * { grid-column: 1 / -1 !important; }
  main { padding: 0 16px; }
  .topbar { padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
  .topbar nav { flex-wrap: wrap; }
  .pills { display: none; }
  .who { margin-left: auto; }
}

/* Узкий экран: меню переносится, карточки становятся в столбик,
   строка нигде не уезжает вбок. */
@media (max-width: 560px) {
  body { overflow-x: hidden; }
  .topbar { gap: 10px; }
  .topbar nav { gap: 2px; width: 100%; }
  .topbar nav a { font-size: 10.5px; letter-spacing: .06em; padding: 7px 10px; }
  .brand { font-size: 16px; }
  .who { width: 100%; margin-left: 0; justify-content: space-between; }
  main { margin-top: 22px; }
  .panel { padding: 20px 18px; border-radius: 20px; }
  .panel h1 { font-size: 23px; }
  .meeting-head h1 { font-size: 27px; }
  .panel-head { flex-wrap: wrap; }
  .panel-head .row { flex-wrap: wrap; }
  .card { flex-direction: column; align-items: stretch; gap: 14px; }
  .card-actions { justify-content: flex-start; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1 1 auto; }
  .table { font-size: 13px; }
  .table th, .table td { padding: 10px 8px; }
  ul.events .when { min-width: 0; }
}

.pipeline {
  display: flex; align-items: center; gap: 11px; font-size: 13.5px; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--pill); padding: 9px 16px; margin-bottom: 18px;
}
.dot-status { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.pipeline.s-ready .dot-status { background: #17A66A; }
.pipeline.s-error .dot-status { background: #D6392C; }
.pipeline.s-downloading .dot-status, .pipeline.s-transcribing .dot-status,
.pipeline.s-analyzing .dot-status, .pipeline.s-waiting_recording .dot-status {
  background: var(--brand); animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.pipeline .err { color: var(--err); }
.status.s-ready { color: var(--ok); }
.status.s-error { color: var(--err); }

.summary { font-size: 16.5px; line-height: 1.7; white-space: pre-wrap; color: var(--ink); max-width: 76ch; }
ul.bullets { margin: 0; padding-left: 20px; color: var(--ink-2); }
ul.bullets li { margin: 7px 0; }
ul.bullets li::marker { color: var(--brand); }

ul.actions { list-style: none; margin: 0; padding: 0; }
ul.actions li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 12px 15px; margin-bottom: 9px;
}
ul.actions .task { flex: 1 1 260px; color: var(--ink); font-weight: 500; }
ul.actions .owner {
  font-size: 12.5px; font-weight: 600; color: var(--brand);
  background: var(--brand-soft); border-radius: var(--pill); padding: 2px 11px;
}
ul.actions .due { font-size: 12.5px; color: var(--warn); font-weight: 600; }

video, audio {
  width: 100%; border-radius: var(--r-md); background: var(--navy); margin-bottom: 14px;
  border: 1px solid var(--line);
}
ul.files { list-style: none; margin: 0 0 14px; padding: 0; }
ul.files li {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2);
}
ul.files li:last-child { border-bottom: 0; }
.ftype { font-weight: 700; min-width: 88px; color: var(--ink); }
.upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

pre.transcript {
  max-height: 470px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 16px; margin: 0;
  font: 13px/1.75 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-2);
}
pre.code {
  background: var(--navy); border-radius: var(--r-sm); padding: 14px; overflow-x: auto;
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: #BFD0FF;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--brand-deep); }
mark { background: #FFE68A; color: #3B2C00; border-radius: 3px; padding: 0 2px; }

ul.people-list, ul.events { list-style: none; margin: 0; padding: 0; }
ul.people-list li { padding: 11px 0; border-bottom: 1px solid var(--line); }
ul.people-list li:last-child { border-bottom: 0; }
ul.people-list strong { color: var(--ink); font-weight: 700; }
ul.events li {
  display: flex; gap: 12px; padding: 8px 0; font-size: 13px;
  border-bottom: 1px solid var(--line); color: var(--ink-2);
}
ul.events li:last-child { border-bottom: 0; }
ul.events .when { color: var(--muted); white-space: nowrap; font-size: 12px; min-width: 122px; }
ul.events li.lvl-error span:last-child { color: var(--err); }
ul.events li.lvl-warn span:last-child { color: var(--warn); }

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

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-weight: 700; color: var(--muted); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .15em;
  padding: 10px 12px; border-bottom: 1px solid var(--line-2);
}
.table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--bg-soft); }
.table tr:last-child td { border-bottom: 0; }
.table tr.inactive { opacity: .5; }
.table strong { color: var(--ink); font-weight: 700; }

/* ------------------------------------------------ вход, смена пароля */

body.centered { display: flex; align-items: center; justify-content: center; padding: 28px; }
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 36px 34px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 16px;
}
.auth-brand { font-weight: 700; font-size: 15px; letter-spacing: -.01em; color: var(--muted); }
.auth-card h1 {
  font-size: 32px; line-height: 1.1; letter-spacing: -.035em; font-weight: 700;
  margin: 0 0 2px; color: var(--ink);
}
.auth-card label {
  display: flex; flex-direction: column; gap: 7px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em;
  font-weight: 700; color: var(--muted);
}
.center { text-align: center; }

.alert { border-radius: var(--r-sm); padding: 12px 14px; font-size: 13.5px; line-height: 1.55; border: 1px solid transparent; }
.alert.error { background: var(--err-bg); color: var(--err); border-color: #F5C9C4; }
.alert.warn  { background: var(--warn-bg); color: var(--warn); border-color: #F0DFB4; }
.alert.ok    { background: var(--ok-bg); color: var(--ok); border-color: #BFE8D3; }

/* -------------------------------------------------------- мелочи */

details summary { cursor: pointer; font-size: 13px; margin-top: 14px; color: var(--muted); list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "▸ "; color: var(--brand); }
details[open] summary::before { content: "▾ "; }
details p { margin-top: 10px; line-height: 1.8; }

.danger-zone { border-color: #F0D2CE; }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 70px);
  background: var(--navy); color: #fff;
  padding: 13px 20px; border-radius: var(--pill);
  font-size: 14px; opacity: 0; transition: .28s cubic-bezier(.2, .8, .2, 1);
  pointer-events: none; z-index: 60; max-width: 90vw;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #B32218; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #C6D2EA; border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #A9B9DC; background-clip: content-box; }
