/* HAIM Global: светлая рабочая область, мягкие формы и спокойные золотые акценты. */
:root {
  --background: #ffffff;
  --surface: #ffffff;
  --sidebar: #0b0b0a;
  --text: #101010;
  --muted: #696965;
  --border: #e8e8e5;
  --control-border: #b2b2aa;
  --gold: #bca245;
  --radius: 24px;
  --radius-control: 16px;
  --sidebar-width: 248px;
  --panel-soft: #f6f6f4;
  --panel-hover: #f0f0ec;
  --gold-tint: #f8f3e3;
}

body { font-size: 15px; letter-spacing: -.015em; }
h1, h2, h3 { color: var(--text); letter-spacing: -.045em; }
h1 { font-size: clamp(30px, 3.1vw, 48px); line-height: 1.12; font-weight: 600; }
h2 { font-size: clamp(22px, 2vw, 30px); line-height: 1.2; font-weight: 600; }
h3 { font-size: 21px; font-weight: 600; }

.sidebar {
  top: 16px;
  bottom: 16px;
  left: 16px;
  width: calc(var(--sidebar-width) - 16px);
  height: calc(100dvh - 32px);
  padding: 24px 16px;
  border: 0;
  border-radius: 32px;
}
.brand { background: transparent; padding: 8px 4px; margin-bottom: 16px; }
.brand-logo { width: 100%; height: auto; }
.brand-logo-dark { display: none; }
[data-theme="dark"] .brand-logo-light { display: none; }
[data-theme="dark"] .brand-logo-dark { display: block; }
.product-name { padding: 0 12px 24px; color: #d7d6ce; font-size: 11px; letter-spacing: .14em; }
.navigation { gap: 8px; }
.navigation-button {
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 400;
  color: #dfdfd9;
}
.navigation-button.active { background: var(--gold); border-color: var(--gold); color: var(--sidebar); }
.navigation-button:hover { background: #242420; color: #ffffff; border-color: #45453e; }
.navigation-button.active:hover { background: #cbb15a; color: var(--sidebar); }
.sidebar-footer { margin: auto 8px 0; padding-top: 24px; border-top: 1px solid #393932; color: #e0e0da; }
.sidebar-footer small { margin-top: 8px; color: #b5b5aa; }

.workspace { margin-left: var(--sidebar-width); padding: 16px 24px 0; }
.topbar {
  min-height: 72px;
  padding: 12px 24px;
  background: rgb(246 246 244 / 92%);
  border: 0;
  border-radius: 32px;
  color: var(--text);
  backdrop-filter: blur(16px);
}
.topbar .button { min-height: 40px; padding: 8px 20px; background: transparent; }
main { padding: 40px 8px 24px; }
.page-heading { align-items: center; gap: 24px; margin-bottom: 32px; }
.eyebrow { margin-bottom: 12px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .16em; }
.page-description { max-width: 600px; margin: 16px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.button { min-height: 46px; padding: 12px 20px; border-color: var(--border); border-radius: 16px; box-shadow: none; font-weight: 500; }
.button:hover { background: var(--panel-hover); border-color: var(--control-border); }
.button-primary { min-height: 54px; padding: 14px 28px; background: var(--gold); border-color: var(--gold); color: var(--sidebar); }
.button-primary:hover { background: #cbb15a; border-color: #cbb15a; color: var(--sidebar); }
.button:disabled { opacity: .5; }

.filter-panel { padding: 24px; background: var(--panel-soft); border: 0; border-radius: 24px; box-shadow: none; }
.filter-grid { gap: 16px; }
label { gap: 8px; font-size: 13px; font-weight: 400; }
input, select, textarea { background: var(--surface); color: var(--text); border-color: var(--border); border-radius: 14px; box-shadow: none; }
input, select { min-height: 46px; }
input:hover, select:hover, textarea:hover { border-color: var(--control-border); }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint); }
.filter-actions { gap: 12px; margin-top: 16px; }
.filter-footer { display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(180px, 1fr) minmax(160px, 1fr) auto; gap: 12px; }
.filter-footer > * { min-width: 0; width: 100%; }
.status-message { margin: 16px 0 24px; padding: 0 4px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.statistics-grid { gap: 16px; margin-bottom: 32px; }
.statistic { min-height: 144px; padding: 24px; background: var(--panel-soft); border: 0; border-radius: 24px; box-shadow: none; }
.statistic-label { color: var(--muted); font-size: 13px; font-weight: 400; }
.statistic-value { margin: 12px 0 8px; color: var(--text); font-size: clamp(32px, 3.2vw, 48px); font-weight: 500; line-height: 1.1; letter-spacing: -.055em; }
.statistic-description { color: var(--muted); font-size: 12px; line-height: 1.5; }
.card { padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: none; }
.section-heading { align-items: baseline; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.outcome-card { margin-bottom: 32px; padding: 32px 0; border-width: 1px 0; border-radius: 0; }
.outcome-grid { gap: 0; }
.outcome-item { padding: 8px 24px; background: transparent; border: 0; border-right: 1px solid var(--control-border); border-radius: 0; }
.outcome-item:last-child { border-right: 0; }
.outcome-item strong, .outcome-value { color: var(--text); font-size: 36px; font-weight: 500; letter-spacing: -.04em; }
.secondary-grid { gap: 16px; }
.secondary-grid .statistic, #additionalStatistics .statistic { min-height: 120px; padding: 20px; }
.secondary-grid .statistic-value, #additionalStatistics .statistic-value { font-size: 30px; }

.table-container { border: 0; border-radius: 0; }
th { background: var(--panel-soft); color: var(--muted); font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; }
th, td { padding: 18px 16px; border-color: var(--border); }
tbody tr:hover { background: var(--panel-soft); }
.employee-button { color: var(--text); text-decoration-color: var(--gold); }
.calls-layout { gap: 24px; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); }
.call-list { padding: 8px; background: var(--panel-soft); border: 0; }
.call-button { margin: 0 0 8px; padding: 20px; background: transparent; border: 1px solid transparent; border-radius: 18px; box-shadow: none; }
.call-button:last-child { margin-bottom: 0; }
.call-button:hover { background: var(--surface); border-color: var(--border); }
.call-button.active { background: var(--surface); border-color: var(--gold); box-shadow: none; }
.call-button strong { margin-top: 8px; font-size: 16px; font-weight: 500; }
.badge { padding: 5px 10px; border-radius: 8px; font-size: 11px; }
.call-details { padding: 32px; }
.notice { padding: 16px 20px; background: var(--gold-tint); border: 0; border-radius: 16px; color: var(--text); }
.analysis-point { padding: 20px 0; border-width: 0 0 1px; border-color: var(--border); background: transparent; border-radius: 0; }
blockquote { border-left-color: var(--gold); background: var(--panel-soft); border-radius: 0 12px 12px 0; }
details { margin-top: 24px; border-color: var(--border); border-radius: 16px; }
summary { padding-block: 16px; font-weight: 500; }
.empty-state { padding: 48px 24px; color: var(--muted); }
footer { margin-top: 48px; padding: 24px 4px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
dialog { border: 0; border-radius: 28px; padding: 32px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

@media (max-width: 1200px) {
  :root { --sidebar-width: 216px; }
  .workspace { padding-right: 16px; padding-left: 16px; }
  .statistic { padding: 20px; }
  .calls-layout { grid-template-columns: 260px minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 900px) {
  .filter-footer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar { position: static; width: auto; height: auto; margin: 12px; padding: 16px 20px; border-radius: 24px; }
  .brand { max-width: 168px; margin: 0 0 12px; }
  .product-name { padding: 0 0 16px; }
  .navigation { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
  .navigation-button { width: auto; flex: 1 1 auto; text-align: center; }
  .sidebar-footer { display: none; }
  .workspace { margin-left: 0; padding: 0 12px; }
  .topbar { min-height: 60px; padding: 12px 20px; border-radius: 24px; }
  main { padding: 28px 4px 16px; }
  .calls-layout { grid-template-columns: 1fr; }
  .call-list { max-height: 420px; overflow-y: auto; }
}
@media (max-width: 600px) {
  .filter-footer { grid-template-columns: 1fr; }
  .page-heading { align-items: stretch; flex-direction: column; gap: 20px; margin-bottom: 24px; }
  .page-description { margin-top: 12px; font-size: 14px; }
  .page-heading .button { width: 100%; }
  .filter-panel { padding: 16px; }
  .statistics-grid, .secondary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .statistic { min-height: 132px; padding: 16px; border-radius: 20px; }
  .statistic-value { font-size: 32px; }
  .card, .call-details { padding: 20px; }
  .call-list { padding: 8px; }
  .outcome-card { padding: 24px 0; }
  .outcome-grid { grid-template-columns: 1fr; }
  .outcome-item { padding: 16px 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .outcome-item:last-child { border-bottom: 0; }
  .topbar { font-size: 11px; }
  .topbar .button { padding: 8px 12px; font-size: 12px; }
}
/* Свет за стеклом делает прозрачность заметной и на пустом экране. */
body {
  background:
    radial-gradient(ellipse 600px 260px at 76% 0, rgb(215 185 95 / 14%), transparent 75%),
    radial-gradient(ellipse 440px 240px at 22% 0, rgb(192 204 213 / 20%), transparent 75%),
    var(--background);
  background-attachment: fixed;
}
/* Верхняя навигация вместо боковой панели. */
.glass-header {
  position: sticky;
  z-index: 50;
  top: 12px;
  left: auto;
  bottom: auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 24px;
  width: auto;
  height: auto;
  min-height: 88px;
  margin: 12px 20px 0;
  padding: 12px 24px;
  overflow: visible;
  background: linear-gradient(110deg, rgb(242 246 249 / 64%), rgb(231 239 245 / 42%) 48%, rgb(246 248 250 / 60%));
  color: var(--text);
  border: 1px solid rgb(255 255 255 / 50%);
  border-radius: 36px;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 55%),
    inset 0 -1px 0 rgb(255 255 255 / 20%),
    0 4px 20px rgb(35 38 40 / 4%);
  -webkit-backdrop-filter: blur(28px) saturate(85%);
  backdrop-filter: blur(28px) saturate(85%);
}
.glass-header::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(175deg, rgb(255 255 255 / 18%), transparent 55%, rgb(167 193 211 / 3%));
}
.glass-header > * { position: relative; }
.glass-header .brand {
  flex: 0 0 148px;
  width: 148px;
  max-width: none;
  margin: 0;
  padding: 6px 10px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.glass-header .product-name { padding: 0; color: var(--muted); white-space: nowrap; font-size: 11px; }
.glass-header .navigation { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 8px; margin: 0; }
.glass-header .navigation-button { flex: 0 0 auto; width: auto; min-height: 44px; padding: 10px 18px; color: var(--text); text-align: center; }
.glass-header .navigation-button,
.glass-header .navigation-button.active,
.glass-header .navigation-button:hover {
  background: transparent;
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
  color: var(--text);
  font-weight: 400;
}
.glass-header .navigation-button.active { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 8px; }
.glass-header .navigation-button:hover { color: #806a2c; }
.glass-header .sidebar-footer { display: block; margin: 0 0 0 auto; padding: 0; border: 0; color: var(--muted); font-size: 11px; }
.glass-header .sidebar-footer small { max-width: 200px; margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.glass-header #logoutButton { flex-shrink: 0; min-height: 40px; background: transparent; border-color: transparent; border-radius: 0; box-shadow: none; font-weight: 400; }
.glass-header #logoutButton:hover { background: transparent; color: #806a2c; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-header { background: rgb(240 245 248 / 97%); }
}
.workspace { margin-left: 0; padding: 0 32px; }
main { padding-top: 48px; }
@media (max-width: 1100px) {
  .glass-header { gap: 16px; padding: 12px 20px; }
  .glass-header .product-name, .glass-header .sidebar-footer { display: none; }
  .glass-header .navigation { margin-left: auto; }
}
@media (max-width: 600px) {
  .glass-header { top: 8px; margin: 8px 12px 0; padding: 12px; min-height: 0; flex-wrap: wrap; gap: 12px; border-radius: 24px; }
  .glass-header .brand { flex-basis: 128px; width: 128px; }
  .glass-header #logoutButton { margin-left: auto; order: 1; padding: 8px 16px; }
  .glass-header .navigation { order: 2; flex-basis: 100%; width: 100%; margin: 0; gap: 4px; }
  .glass-header .navigation-button { flex: 1 1 0; min-width: 0; padding: 8px; font-size: 14px; }
  .workspace { padding: 0 12px; }
  main { padding-top: 32px; }
}
.glass-header .theme-toggle { flex-shrink: 0; padding: 8px 12px; min-height: 40px; background: transparent; border-color: transparent; border-radius: 0; box-shadow: none; font-weight: 400; }
.glass-header .theme-toggle:hover { background: transparent; color: var(--gold); }
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #111315;
  --surface: #1b1e21;
  --text: #f1f0ea;
  --muted: #b4b8bc;
  --border: #34383d;
  --control-border: #646b73;
  --panel-soft: #202428;
  --panel-hover: #2b3035;
  --gold: #d7b95f;
  --gold-tint: #302b1f;
  --success-background: #1d3027;
  --success-text: #9ed1b1;
  --danger-background: #3c2427;
  --danger-text: #ffaaa5;
}
[data-theme="dark"] .glass-header { background: linear-gradient(110deg, rgb(32 39 46 / 76%), rgb(29 36 43 / 62%), rgb(39 45 51 / 75%)); border-color: rgb(200 220 240 / 12%); box-shadow: inset 0 1px 0 rgb(220 235 250 / 10%), 0 8px 32px rgb(0 0 0 / 15%); }
[data-theme="dark"] .glass-header::before { opacity: .25; }
[data-theme="dark"] .glass-header .brand { background: transparent; border-radius: 0; }
[data-theme="dark"] .glass-header .navigation-button:hover,
[data-theme="dark"] .glass-header #logoutButton:hover { color: var(--gold); }
[data-theme="dark"] .button-primary { color: #11110f; }
[data-theme="dark"] .button-primary:hover { background: #e3c66b; color: #11110f; }
[data-theme="dark"] .badge { background: var(--panel-hover); color: var(--text); }
[data-theme="dark"] .badge-success { background: var(--success-background); color: var(--success-text); }
[data-theme="dark"] .badge-danger { background: var(--danger-background); color: var(--danger-text); }
[data-theme="dark"] .employee-button { background: transparent; color: var(--gold); }
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: #959da5; }
@media (max-width: 600px) {
  .glass-header .brand { flex-basis: 112px; width: 112px; padding: 6px; }
  .glass-header .theme-toggle { margin-left: auto; order: 1; padding: 8px; font-size: 12px; }
  .glass-header #logoutButton { margin-left: 0; padding: 8px; font-size: 12px; }
}
@media print {
  .glass-header { display: none; }
  .workspace { margin: 0; padding: 0; }
  .statistic { border: 1px solid var(--border); }
}
