/* Outreach Engine — design system из утверждённого макета.
   Токены и компоненты. Без сборки: чистый CSS, подключается напрямую. */

:root {
  --ink: #132b3d;
  --muted: #5d6b78;
  --faint: #8b9aa8;
  --line: #dfe7ee;
  --hair: #eef3f7;
  --head: #f7fafc;
  --page: #eef3f8;
  --main: #f4f8fb;
  --navy: #0d4f80;
  --navy-deep: #083456;
  --primary: #1f7ac0;
  --primary-dark: #17618f;
  --sky: #2fb3e8;
  --ice: #7fd4ff;
  --lime: #7ed321;
  --danger: #ef4d3d;

  --grey-bg: #e7edf3;  --grey-fg: #5d6b78;
  --blue-bg: #e7effc;  --blue-fg: #2f6fd0;
  --green-bg: #e6f3ec; --green-fg: #1b7a48;
  --yel-bg: #fdf3dd;   --yel-fg: #91620a;
  --red-bg: #fbe9e7;   --red-fg: #b83a2c;

  --r-sm: 8px; --r-md: 11px; --r-lg: 13px; --r-xl: 18px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--navy); }
body {
  font-family: Manrope, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
input, textarea, button, select { font-family: inherit; font-size: inherit; background: #fff; color: var(--ink); }
input::placeholder, textarea::placeholder { color: #98a7b5; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #b9c6d2; border-radius: var(--r-sm); border: 3px solid transparent; background-clip: padding-box; }

.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }

/* ── каркас ─────────────────────────────────────────────── */
.oe-bg {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(1200px 600px at 15% -10%, #2fb3e8 0%, transparent 60%),
              radial-gradient(900px 500px at 90% 0%, #1f7ac0 0%, transparent 55%),
              linear-gradient(160deg, #0d4f80, #083456 70%);
}
.oe-shell { position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 100vh; }

.oe-header { position: sticky; top: 0; z-index: 20; background: rgba(8, 52, 86, .82); backdrop-filter: blur(12px); }
.oe-header__top { display: flex; align-items: center; gap: 16px; padding: 11px 24px; }
.oe-logo { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.oe-logo img { width: 32px; height: 32px; object-fit: contain; border-radius: 9px; background: #fff; padding: 2px; }
.oe-logo__text { font-size: 17px; font-weight: 700; color: #fff; letter-spacing: -.01em; }
.oe-logo__text span { color: var(--ice); font-weight: 500; }

.oe-search { flex: 0 1 300px; min-width: 150px; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.16); border-radius: 20px; padding: 8px 14px; }
.oe-search span { color: rgba(255,255,255,.7); font-size: 13px; }
.oe-search input { border: 0; outline: 0; font-size: 13px; width: 100%; background: transparent; color: #fff; }

.oe-crumb { flex: 1; min-width: 0; font-size: 12.5px; color: rgba(255,255,255,.72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.oe-cap { flex: 0 0 auto; text-align: right; white-space: nowrap; }
.oe-cap__val { font-size: 12px; font-weight: 600; color: #fff; }
.oe-cap__val i { color: rgba(255,255,255,.6); font-style: normal; }
.oe-cap__bar { width: 74px; height: 4px; background: rgba(255,255,255,.22); border-radius: 4px; margin-top: 4px; overflow: hidden; }
.oe-cap__bar div { height: 100%; background: var(--lime); }

.oe-bell { position: relative; cursor: pointer; font-size: 15px; }
.oe-bell__dot { position: absolute; top: -2px; right: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 2px solid var(--navy); }

.oe-me { display: flex; align-items: center; gap: 9px; white-space: nowrap; cursor: pointer; }
.oe-me__ava { width: 30px; height: 30px; border-radius: 50%; background: var(--ice); color: #084b78; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; }
.oe-me__name { font-size: 12.5px; color: #fff; font-weight: 600; }
.oe-me__role { font-size: 10.5px; color: rgba(255,255,255,.66); }

.oe-nav { display: flex; gap: 2px; padding: 0 20px; overflow-x: auto; }
.oe-tab {
  flex: 0 0 auto; display: flex; align-items: center; gap: 7px;
  padding: 10px 15px; border-radius: 10px 10px 0 0;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  color: rgba(255,255,255,.78); background: transparent;
}
.oe-tab:hover { background: rgba(255,255,255,.14); color: #fff; }
.oe-tab--on { background: var(--main); color: var(--ink); }
.oe-tab--on:hover { background: var(--main); color: var(--ink); }
.oe-tab__badge { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 700; background: var(--danger); color: #fff; border-radius: 20px; padding: 1px 6px; }

.oe-alert { background: var(--red-bg); border-bottom: 1px solid #f1cdc7; padding: 10px 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13px; color: #8f2b1e; }
.oe-alert b { font-weight: 700; }
.oe-alert a { margin-left: auto; color: #8f2b1e; font-weight: 700; border-bottom: 1px solid #d8a9a1; white-space: nowrap; }

.oe-main {
  flex: 1; margin: 0 12px 16px; padding: 22px 24px 40px;
  background: var(--main); border-radius: 0 0 14px 14px;
  box-shadow: 0 18px 48px rgba(8, 52, 86, .22);
}

/* ── типографика страниц ────────────────────────────────── */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-title { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.page-sub { font-size: 12.5px; color: var(--faint); }
.page-head .spacer { flex: 1; }
.section-title { font-size: 13.5px; font-weight: 700; margin-bottom: 12px; }
.hint { font-size: 11.5px; color: var(--faint); line-height: 1.55; }

/* ── карточки, плитки, KPI ──────────────────────────────── */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; }
.card--flat { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 12px; }
.grid--tiles { grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); }
.grid--kpi { grid-template-columns: repeat(auto-fit, minmax(184px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg); color: #fff; }
.tile__icon { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.22); display: grid; place-items: center; font-size: 15px; }
.tile__label { font-size: 13.5px; font-weight: 700; }
.tile__meta { font-size: 11.5px; color: rgba(255,255,255,.82); margin-top: 2px; }

.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 15px 17px; }
.kpi__label { font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.kpi__row { display: flex; align-items: baseline; gap: 8px; margin-top: 7px; }
.kpi__value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.kpi__delta { font-size: 12px; font-weight: 700; color: var(--green-fg); }
.kpi__sub { font-size: 11.5px; color: var(--faint); margin-top: 5px; }

/* ── воронка ────────────────────────────────────────────── */
.funnel-row { display: grid; grid-template-columns: 92px 1fr 116px; align-items: center; gap: 12px; padding: 6px 0; }
.funnel-row__label { font-size: 12px; color: var(--muted); font-weight: 600; }
.funnel-bar { height: 22px; border-radius: 6px; background: var(--hair); overflow: hidden; }
.funnel-bar div { height: 100%; background: linear-gradient(90deg, #1f7ac0, #2fb3e8); }
.funnel-row__num { font-size: 12.5px; text-align: right; }
.funnel-row__num b { font-weight: 700; }
.funnel-row__num span { color: var(--faint); margin-left: 6px; }

/* ── бейджи и чипы ──────────────────────────────────────── */
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 6px; white-space: nowrap; }
.badge--grey  { background: var(--grey-bg);  color: var(--grey-fg); }
.badge--blue  { background: var(--blue-bg);  color: var(--blue-fg); }
.badge--green { background: var(--green-bg); color: var(--green-fg); }
.badge--yel   { background: var(--yel-bg);   color: var(--yel-fg); }
.badge--red   { background: var(--red-bg);   color: var(--red-fg); }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 20px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip--on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip--on:hover { background: var(--ink); color: #fff; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }

/* ── кнопки ─────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; padding: 9px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.btn--primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn--ghost { background: transparent; border-color: rgba(255,255,255,.3); color: #fff; }
.btn--sm { padding: 6px 11px; font-size: 11.5px; }
.btn--danger { color: var(--red-fg); border-color: #f1cdc7; }

/* ── таблицы ────────────────────────────────────────────── */
.table-wrap { border: 1px solid var(--line); border-radius: var(--r-md); overflow-x: auto; background: #fff; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tbl th {
  text-align: left; padding: 10px 14px; background: var(--head);
  border-bottom: 1px solid #e6edf3; font-size: 11px; font-weight: 700;
  color: var(--faint); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
table.tbl th a { color: inherit; }
table.tbl th a:hover { color: var(--primary); }
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: #f9fcfe; }
table.tbl td.num, table.tbl th.num { text-align: right; font-family: 'IBM Plex Mono', monospace; }
.t-name { font-weight: 700; }
.t-sub { font-size: 11px; color: var(--faint); margin-top: 2px; }

/* ── прочее ─────────────────────────────────────────────── */
.progress { height: 5px; background: var(--hair); border-radius: 4px; overflow: hidden; }
.progress div { height: 100%; background: var(--primary); }

.dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.alert-line { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; line-height: 1.5; padding: 7px 0; border-bottom: 1px solid var(--hair); }
.alert-line:last-child { border-bottom: 0; }

.empty { text-align: center; padding: 46px 20px; color: var(--faint); }
.empty__icon { font-size: 30px; opacity: .5; }
.empty__title { font-size: 14px; font-weight: 700; color: var(--ink); margin-top: 10px; }
.empty__text { font-size: 12.5px; margin-top: 6px; }

.skeleton { background: var(--hair); border-radius: 6px; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { 0% { opacity: .55 } 50% { opacity: 1 } 100% { opacity: .55 } }

.subtabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.subtab { padding: 9px 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.subtab:hover { color: var(--primary); }
.subtab--on { color: var(--primary); border-bottom-color: var(--primary); }

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

.note { background: #f6fbfe; border: 1px solid #a9d5ef; border-radius: var(--r-md); padding: 12px 14px; font-size: 12.5px; color: var(--primary); line-height: 1.55; }
.note--warn { background: #fffdf6; border-color: #f0dfb4; color: var(--yel-fg); }
.note--bad { background: #fdf6f5; border-color: #f1cdc7; color: var(--red-fg); }

@media (max-width: 720px) {
  .oe-search, .oe-crumb, .oe-cap { display: none; }
  .oe-main { margin: 0 6px 10px; padding: 16px 14px 30px; }
  .funnel-row { grid-template-columns: 74px 1fr 92px; }
}
