/* ЕВРОКОНВЕЙЕР — фирменная тема. Палитра с euroconveyor-st.ru. */

/* Шрифт Inter (вариативный, локально). Latin + Cyrillic. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

:root {
  --color-primary: #3a4d63;        /* графит/сталь — акцент: кнопки, ссылки, активное */
  --color-primary-hover: #2a394b;
  --color-primary-soft: #eef1f5;

  --color-bg: #f4f6f8;             /* холодный светло-серый фон */
  --color-surface: #ffffff;

  --color-text: #1f2733;           /* холодный почти-чёрный (сталь) */
  --color-text-muted: #687180;
  --color-border: #e4e7ec;

  --color-bar: #475569;            /* стальные прогресс-бары */
  --color-hover: #eceff3;          /* холодный серый ховер/активный пункт */

  --color-success: #3ba776;
  --color-warning: #e0a23b;
  --color-danger: #e0533b;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(28, 28, 43, 0.06);
  --shadow: 0 4px 16px rgba(28, 28, 43, 0.08);
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
  letter-spacing: -0.01em;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-hover); }

h1, h2, h3 { color: var(--color-text); margin: 0 0 .5em; font-weight: 700; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 20px 14px;
  position: fixed;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 6px; font-weight: 800; font-size: 17px; letter-spacing: .2px; }
.brand .logo { flex-shrink: 0; }
.brand-name { font-weight: 800; font-size: 16px; }
.workspace { padding: 0 8px 14px; font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--color-text-muted); }

/* Меню: прокручиваемое (под много пунктов) */
.nav { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; overflow-y: auto; min-height: 0; margin-right: -6px; padding-right: 6px; }
.nav-section { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--color-text-muted); padding: 11px 12px 3px; }
.nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 12px; border-radius: var(--radius-sm);
  color: var(--color-text); font-weight: 600; font-size: 12px;
  opacity: 1; transition: background .12s, box-shadow .12s;
}
.nav a:hover { background: var(--color-hover); }
.nav a.active { background: var(--color-hover); color: var(--color-text); font-weight: 700; box-shadow: inset 3px 0 0 var(--color-primary); }
/* Ещё не запущенные разделы — блёклые */
.nav a.muted { opacity: .4; font-weight: 500; }
.nav a.muted:hover { opacity: .6; background: transparent; cursor: default; }

/* Выпадающее меню (разделы-дропдауны) */
.nav-drop > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center;
  padding: 7px 12px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 13px; color: var(--color-text); transition: background .12s;
}
.nav-drop > summary::-webkit-details-marker { display: none; }
.nav-drop > summary::marker { content: ""; }
.nav-drop > summary:hover { background: var(--color-hover); }
.nav-drop > summary .chev { margin-left: auto; font-size: 9px; color: var(--color-text-muted); transition: transform .15s; }
.nav-drop[open] > summary .chev { transform: rotate(90deg); }
.nav-sub2 { display: flex; flex-direction: column; gap: 1px; margin: 1px 0 3px; }
.nav-sub2 a { padding-left: 26px; }
/* Круглые точки вместо иконок */
.nav-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; flex-shrink: 0; margin: 0 5px;
  transition: background .12s, transform .12s;
}
.nav a.active .nav-dot { background: var(--color-primary); transform: scale(1.15); }
.nav a .ico { width: 18px; text-align: center; }

/* Раскрывающийся раздел меню (HR и т.п.) */
.nav-group > summary {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font-weight: 600; color: var(--color-text);
  list-style: none; user-select: none;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary:hover { background: var(--color-hover); }
.nav-group > summary .chev { margin-left: auto; font-size: 10px; color: var(--color-text-muted); transition: transform .15s; }
.nav-group[open] > summary .chev { transform: rotate(90deg); }
.nav-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 4px 17px; padding-left: 11px; border-left: 1px solid var(--color-border); }
.nav-sub a { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--color-text); font-weight: 500; opacity: 1; font-size: 14px; }
.nav-sub a:hover { background: var(--color-hover); }
.nav-sub a.active { background: var(--color-hover); font-weight: 600; }
.nav-sub a.muted { opacity: .35; font-weight: 500; }
.nav-sub a.muted:hover { opacity: .5; background: transparent; cursor: default; }

/* Гантт отпусков */
.gantt-scroll { overflow-x: auto; cursor: grab; }
.gantt-scroll.drag { cursor: grabbing; user-select: none; }
.gantt { min-width: 1600px; }
.gantt-head { display: flex; align-items: stretch; border-bottom: 1px solid var(--color-border); }
.gantt-row { display: flex; align-items: center; border-bottom: 1px solid var(--color-border); }
.gantt-row:last-child { border-bottom: none; }
.gantt-row:hover { background: var(--color-bg); }
.g-name { width: 230px; flex-shrink: 0; display: flex; align-items: center; gap: 9px; padding: 8px 16px; }
.g-fio { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-track { position: relative; flex: 1; height: 34px; }
.g-months { display: flex; height: 38px; }
.g-month { display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--color-text-muted); border-left: 1px solid var(--color-border); }
.g-month.today { color: var(--color-primary); font-weight: 700; background: var(--color-primary-soft); }
/* Слой сетки-ячеек внутри строки */
.g-cells { position: absolute; inset: 0; display: flex; }
.g-cell { border-left: 1px solid var(--color-border); opacity: .7; }
.g-cell.today { background: var(--color-primary-soft); opacity: 1; }
.g-bar {
  position: absolute; top: 7px; height: 20px; min-width: 6px; z-index: 2;
  background: var(--color-primary); border-radius: 6px; overflow: visible;
}
/* Подпись с датой — справа от полосы, тёмным текстом (влезает при любой ширине) */
.g-bar span {
  position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
  margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--color-text);
  white-space: nowrap; pointer-events: none;
}
.g-dept {
  padding: 9px 16px; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: var(--color-text-muted);
  background: var(--color-bg); border-bottom: 1px solid var(--color-border);
}

.sidebar-footer { margin-top: auto; border-top: 1px solid var(--color-border); padding-top: 14px; font-size: 13px; color: var(--color-text-muted); }
.sidebar-footer .user { display: flex; align-items: center; gap: 10px; }

/* Скачать приложение */
.app-dl { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--color-border); }
.app-dl-title { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--color-text-muted); font-weight: 600; margin-bottom: 9px; }
.app-dl-btns { display: flex; gap: 6px; }
.app-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border: 1px solid var(--color-border); border-radius: 9px; font-size: 11px; font-weight: 600; color: var(--color-text); background: var(--color-surface); }
.app-btn span { font-size: 16px; line-height: 1; }
.app-btn:hover { background: var(--color-hover); border-color: var(--color-primary); color: var(--color-text); }

.content { margin-left: var(--sidebar-w); flex: 1; padding: 28px 36px; width: calc(100% - var(--sidebar-w)); }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-head h1 { font-size: 20px; margin: 0; }

/* ---------- Components ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--color-primary); color: #fff;
  border: none; padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--color-primary-hover); color: #fff; }
.btn-ghost { background: transparent; color: var(--color-text); border: 1px solid var(--color-border); }
.btn-ghost:hover { background: var(--color-bg); color: var(--color-text); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* Вкладки страницы */
.tabs { display: flex; gap: 2px; margin-bottom: 20px; border-bottom: 1px solid var(--color-border); }
.tabs a { padding: 9px 16px; font-weight: 600; color: var(--color-text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--color-text); }
.tabs a.active { color: var(--color-text); border-bottom-color: var(--color-primary); }

/* Панель фильтров */
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filters select { width: auto; min-width: 150px; }

.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px;
}

.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr; } }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .num { font-size: 30px; font-weight: 800; line-height: 1; }
.stat .label { color: var(--color-text-muted); font-size: 13px; }
.stat.danger .num { color: var(--color-danger); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 600; }
.badge-planning { background: #eef0f4; color: #5a6172; }
.badge-active { background: var(--color-primary-soft); color: var(--color-primary-hover); }
.badge-on_hold { background: #fdf2e0; color: var(--color-warning); }
.badge-done { background: #e6f6ee; color: var(--color-success); }
.badge-lost { background: #fdecea; color: var(--color-danger); }

.prio { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.prio-low { background: #9aa0ad; }
.prio-medium { background: var(--color-primary); }
.prio-high { background: var(--color-warning); }
.prio-urgent { background: var(--color-danger); }

.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--color-primary-soft);
  color: var(--color-primary-hover); font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.progress { height: 6px; background: var(--color-bg); border-radius: 100px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--color-bar); border-radius: 100px; }

.muted { color: var(--color-text-muted); }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }

/* Tables / lists */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--color-border); }
.list-item:last-child { border-bottom: none; }

/* Forms */
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); font: inherit; background: #fff; color: var(--color-text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-soft); }
label { font-size: 13px; font-weight: 600; color: var(--color-text-muted); display: block; margin-bottom: 5px; }
.field { margin-bottom: 14px; }

/* ---------- Kanban ---------- */
.board { display: flex; gap: 16px; align-items: flex-start; overflow-x: auto; padding-bottom: 12px; }
.column { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); width: 280px; flex-shrink: 0; padding: 12px; }
.column-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 14px; margin-bottom: 12px; padding: 0 4px; }
.column-head .count { background: #fff; border: 1px solid var(--color-border); border-radius: 100px; padding: 1px 9px; font-size: 12px; color: var(--color-text-muted); }
.column-body { display: flex; flex-direction: column; gap: 10px; min-height: 40px; }
.tcard {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  padding: 12px; box-shadow: var(--shadow-sm); cursor: grab;
}
.tcard:active { cursor: grabbing; }
.tcard.dragging { opacity: .5; }
.tcard .title { font-weight: 600; margin-bottom: 8px; font-size: 14px; }
.tcard .meta { display: flex; align-items: center; justify-content: space-between; }
.tcard .due { font-size: 12px; color: var(--color-text-muted); }
.tcard .due.overdue { color: var(--color-danger); font-weight: 600; }
.column.drag-over { outline: 2px dashed var(--color-primary); outline-offset: -4px; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(28,28,43,.45); display: none; align-items: flex-start; justify-content: center; padding-top: 80px; z-index: 50; }
.modal-bg.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius); width: 460px; max-width: 90vw; padding: 24px; box-shadow: var(--shadow); }

/* Tree */
.tree { list-style: none; padding-left: 0; }
.tree ul { list-style: none; padding-left: 22px; border-left: 1px solid var(--color-border); margin-left: 6px; }
.tree-dept { font-weight: 700; padding: 6px 0; }
.tree-emp { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: background .12s; }
.tree-emp:hover { background: var(--color-hover); }
.tree-emp .pos { color: var(--color-text-muted); font-size: 13px; }

/* Панель сотрудника (выезжает справа) */
.emp-overlay { position: fixed; inset: 0; background: rgba(28,28,43,.25); opacity: 0; visibility: hidden; transition: opacity .18s, visibility .18s; z-index: 60; }
.emp-overlay.open { opacity: 1; visibility: visible; }
.emp-panel { position: fixed; top: 0; right: 0; height: 100vh; width: 340px; max-width: 90vw; background: var(--color-surface); border-left: 1px solid var(--color-border); box-shadow: -8px 0 28px rgba(28,28,43,.10); transform: translateX(100%); transition: transform .22s ease; z-index: 61; padding: 26px 24px; overflow-y: auto; }
.emp-panel.open { transform: translateX(0); }
.emp-close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 17px; line-height: 1; cursor: pointer; color: var(--color-text-muted); padding: 4px; }
.emp-close:hover { color: var(--color-text); }
.emp-top { text-align: center; padding: 6px 0 18px; border-bottom: 1px solid var(--color-border); }
.emp-avatar { width: 76px; height: 76px; border-radius: 50%; background: var(--color-primary-soft); color: var(--color-primary-hover); font-size: 26px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.emp-top h2 { font-size: 18px; margin: 0 0 4px; }
.emp-pos { color: var(--color-text-muted); font-size: 14px; margin-bottom: 12px; }
.emp-section { padding-top: 18px; display: flex; flex-direction: column; gap: 15px; }
.emp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.emp-row .emp-lab { color: var(--color-text-muted); flex-shrink: 0; }
.emp-row > span:last-child, .emp-row a { font-weight: 500; text-align: right; word-break: break-word; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 360px; }
.login-card .brand { justify-content: center; }

.alert { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 14px; }
.alert-error { background: #fdecea; color: var(--color-danger); }
.empty { text-align: center; color: var(--color-text-muted); padding: 40px; }

/* ---------- Analytics ---------- */
.section-head { display: flex; align-items: center; gap: 10px; margin: 26px 0 14px; }
.section-head h2 { font-size: 17px; margin: 0; }
.section-head .pill { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 100px; padding: 2px 12px; font-size: 13px; color: var(--color-text-muted); font-weight: 600; }

.card-title { font-size: 15px; font-weight: 700; margin: 0 0 14px; }

/* Карточки аналитики — мягче и просторнее */
.kpi-grid .card, .analytics-row .card, .widget { box-shadow: 0 2px 10px rgba(28,28,43,.05); border-radius: 16px; }
.widget, .kpi { display: flex; flex-direction: column; gap: 12px; padding: 18px; }

.ico-chip { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; color: #fff; font-weight: 700; flex-shrink: 0; }
.ico-site, .ico-lead, .ico-smm { background: #f0eff2; color: #6f6c74; }
.ico-youtube { background: #ff0000; }
.ico-instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.ico-avito { background: #04e061; color: #0a2540; }

.w-head { display: flex; align-items: center; gap: 10px; }
.w-title { font-size: 13.5px; font-weight: 600; color: var(--color-text-muted); }
.w-title a { color: inherit; }
.w-value { font-size: 27px; font-weight: 800; line-height: 1; letter-spacing: -.5px; }
.w-unit { font-size: 12px; color: var(--color-text-muted); font-weight: 500; margin-left: 4px; }
.w-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }

.delta { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; padding: 3px 9px; border-radius: 100px; white-space: nowrap; }
.delta-up { background: #e6f6ee; color: var(--color-success); }
.delta-down { background: #fdecea; color: var(--color-danger); }
.delta-flat { background: var(--color-bg); color: var(--color-text-muted); }

/* Контейнеры ECharts */
.ec { width: 100%; }
.widget .ec, .chart.ec { height: 54px; }
.kpi .ec { height: 46px; }
.ec-big { width: 100%; height: 215px; }
.ec-donut { width: 140px; height: 140px; flex-shrink: 0; }
.ec-gauge { width: 100%; height: 150px; }
.ec-geo { width: 100%; height: 215px; }

/* География + Директ в один ряд */
.geo-direct-row { grid-template-columns: 1.15fr 1fr; margin-top: 18px; }
@media (max-width: 1100px) { .geo-direct-row { grid-template-columns: 1fr; } }

/* Яндекс.Директ */
.ico-direct { background: #fc3f1d; color: #fff; }
.direct-stats { display: flex; gap: 10px; margin: 4px 0 8px; }
.direct-stats .d-stat { flex: 1; background: var(--color-bg); border-radius: var(--radius-sm); padding: 12px 14px; }
.direct-stats .d-val { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.5px; }
.direct-stats .d-lab { font-size: 12px; color: var(--color-text-muted); }
.d-foot { font-size: 13px; padding-top: 10px; border-top: 1px solid var(--color-border); margin-top: 4px; }
.d-foot b { color: var(--color-text); }

/* SEO-позиции */
.seo-list { display: flex; flex-direction: column; }
.seo-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--color-border); }
.seo-row:last-child { border-bottom: none; }
.seo-q { display: flex; flex-direction: column; min-width: 0; }
.seo-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seo-freq { font-size: 11px; color: var(--color-text-muted); }
.seo-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.seo-pos { min-width: 30px; height: 28px; padding: 0 8px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; }
.seo-pos.top { background: #e6f6ee; color: var(--color-success); }
.seo-pos.mid { background: var(--color-bg); color: var(--color-text); }
.seo-pos.low { background: #fdecea; color: var(--color-danger); }
.seo-delta { font-size: 12px; font-weight: 700; min-width: 34px; text-align: right; }
.seo-delta.up { color: var(--color-success); }
.seo-delta.down { color: var(--color-danger); }
.seo-delta.flat { color: var(--color-text-muted); }

/* KPI goal */
.goal { margin-top: 2px; }
.goal-bar { height: 6px; background: var(--color-bg); border-radius: 100px; overflow: hidden; margin-bottom: 6px; }
.goal-bar > span { display: block; height: 100%; background: var(--color-bar); border-radius: 100px; }
.goal-lab { font-size: 12px; color: var(--color-text-muted); }

.w-subs { display: flex; gap: 20px; border-top: 1px solid var(--color-border); padding-top: 12px; }
.w-subs .sub { display: flex; flex-direction: column; }
.w-subs .sub .s-val { font-weight: 700; font-size: 16px; }
.w-subs .sub .s-lab { font-size: 11px; color: var(--color-text-muted); }

/* Ряд donut / большой график / gauge */
.analytics-row { grid-template-columns: 0.85fr 1.5fr 0.85fr; margin-top: 18px; }
@media (max-width: 1200px) { .analytics-row { grid-template-columns: 1fr; } }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut { width: 130px; height: 130px; flex-shrink: 0; transform: rotate(-90deg); }
.donut-bg { fill: none; stroke: var(--color-bg); stroke-width: 4; }
.donut-seg { fill: none; stroke-width: 4; stroke-linecap: round; }
.donut-num { transform: rotate(90deg); transform-origin: 21px 21px; font-size: 7px; font-weight: 800; fill: var(--color-text); text-anchor: middle; }
.donut-cap { transform: rotate(90deg); transform-origin: 21px 21px; font-size: 2.6px; fill: var(--color-text-muted); text-anchor: middle; }
.legend { display: flex; flex-direction: column; gap: 9px; flex: 1; }
.leg-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.leg-item .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.leg-item .leg-val { margin-left: auto; color: var(--color-text-muted); font-weight: 600; font-size: 12px; }

/* Gauge */
.gauge { width: 100%; max-width: 200px; height: 110px; }
.g-bg { fill: none; stroke: var(--color-bg); stroke-width: 12; stroke-linecap: round; }
.g-val { fill: none; stroke: var(--color-primary); stroke-width: 12; stroke-linecap: round; }
.g-num { font-size: 22px; font-weight: 800; fill: var(--color-text); text-anchor: middle; }

/* География */
.geo-list { display: flex; flex-direction: column; gap: 12px; }
.geo-row { display: grid; grid-template-columns: 150px 1fr 60px; align-items: center; gap: 14px; }
.geo-name { font-size: 14px; font-weight: 500; }
.geo-bar { height: 8px; background: var(--color-bg); border-radius: 100px; overflow: hidden; }
.geo-bar > span { display: block; height: 100%; background: linear-gradient(90deg, #3a4d63, #7689a0); border-radius: 100px; }
.geo-val { text-align: right; font-weight: 700; font-size: 14px; }

/* Таблица */
.dtable { width: 100%; border-collapse: collapse; }
.dtable th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--color-text-muted); font-weight: 600; padding: 12px 20px; border-bottom: 1px solid var(--color-border); }
.dtable td { padding: 14px 20px; border-bottom: 1px solid var(--color-border); font-size: 14px; vertical-align: middle; }
.dtable tbody tr:last-child td { border-bottom: none; }
.dtable tbody tr:hover { background: var(--color-bg); }
.dtable tr.crow, .dtable tr.lrow { cursor: pointer; }

/* Карточка клиента */
.lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 700px) { .lead-grid { grid-template-columns: 1fr; } }
.btn.is-disabled { opacity: .4; pointer-events: none; }

/* Финансы: список «кто прислал» */
.sub-list { display: flex; flex-direction: column; }
.sub-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--color-border); }
.sub-row:last-child { border-bottom: none; }
.sub-name { font-weight: 600; font-size: 14px; }
.sub-cnt { font-size: 13px; }
.sub-sum { margin-left: auto; font-weight: 700; font-size: 14px; }

/* Архив файлов */
.archive-search { display: flex; align-items: center; gap: 10px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; padding: 5px 5px 5px 14px; margin-bottom: 22px; box-shadow: var(--shadow-sm); }
.archive-search svg { color: var(--color-text-muted); flex-shrink: 0; }
.archive-search input { border: none; box-shadow: none !important; padding: 11px 4px; font-size: 15px; background: transparent; }
.archive-search input:focus { outline: none; }
.crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 14px; flex-wrap: wrap; }
.crumbs a { font-weight: 600; color: var(--color-text); }
.crumbs .sep { color: var(--color-text-muted); }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.fcard { display: flex; flex-direction: column; gap: 3px; padding: 16px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; box-shadow: var(--shadow-sm); color: var(--color-text); transition: border-color .12s, background .12s; }
.fcard:hover { border-color: var(--color-primary); background: var(--color-hover); color: var(--color-text); }
.folder-ico { width: 30px; height: 30px; color: var(--color-primary); margin-bottom: 5px; }
.fcard .fname { font-weight: 600; font-size: 14px; }
.ext-badge { display: inline-block; min-width: 40px; text-align: center; font-size: 10px; font-weight: 800; letter-spacing: .3px; color: var(--color-text-muted); background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 6px; padding: 3px 6px; margin-right: 8px; vertical-align: middle; }
/* Ссылки в таблицах — чёрные bold, без фиолетового «звона» */
.dtable a { color: var(--color-text); font-weight: 600; }
.dtable a:hover { text-decoration: underline; }

/* Прочитанные / непрочитанные (как письма) */
.read-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 10px; vertical-align: middle; cursor: pointer; border: 2px solid var(--color-border); background: transparent; transition: background .12s, border-color .12s; }
.read-dot:hover { border-color: var(--color-primary); }
tr.crow.unread .read-dot { background: var(--color-primary); border-color: var(--color-primary); }
tr.crow.unread td a { color: var(--color-text); font-weight: 800; }
tr.crow:not(.unread) td a { color: var(--color-text-muted); font-weight: 500; }
tr.crow:not(.unread) { background: #fbfbfa; }

/* Бейдж релевантности */
.rbadge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 100px; margin-left: 8px; vertical-align: middle; }
.rbadge-relevant { background: #e6f6ee; color: var(--color-success); }
.rbadge-maybe { background: #fdf2e0; color: var(--color-warning); }
.rbadge-irrelevant { background: #fdecea; color: var(--color-danger); }

.unread-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.unread-toggle input { width: auto; }

.nav-badge { background: var(--color-primary); color: #fff; border-radius: 100px; font-size: 11px; font-weight: 700; padding: 1px 7px; margin-left: auto; }
.dtable .ico-chip { width: 26px; height: 26px; font-size: 12px; vertical-align: middle; }
