/* SG_T&D_manager — фирменная тёмная тема.
   База #0A0A0D, синий #1467F5, циан #00BFDC.
   Шрифты: Manrope (интерфейс), JetBrains Mono (числовые данные). */

:root {
  --bg: #0a0a0d;
  --bg-elev: #121218;
  --bg-card: #16161d;
  --border: #24242e;
  --border-strong: #33333f;
  --text: #eef0f4;
  --text-muted: #9aa0ac;
  --text-dim: #6b7280;
  --blue: #1467f5;
  --blue-hover: #2f7bff;
  --cyan: #00bfdc;
  --cyan-soft: rgba(0, 191, 220, 0.14);
  --blue-soft: rgba(20, 103, 245, 0.14);
  --danger: #ff5470;
  --success: #35d0a0;
  --warning: #f5b014;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  --font-ui: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Тонкое фоновое свечение бренда */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 55% at 82% -8%, rgba(20, 103, 245, 0.16), transparent 60%),
    radial-gradient(50% 45% at 0% 100%, rgba(0, 191, 220, 0.10), transparent 60%);
  pointer-events: none;
}

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

/* ---------- Числовые данные ---------- */
.mono,
.num {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1;
}

/* ---------- Шапка ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(10, 10, 13, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--text);
  font-size: 17px;
}
.brand:hover {
  color: var(--text);
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(20, 103, 245, 0.4);
}
.brand-sep {
  color: var(--cyan);
  opacity: 0.9;
}
.brand-sub {
  color: var(--text-muted);
  font-weight: 700;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}
.user-name {
  font-weight: 700;
  font-size: 14px;
}
.user-role {
  font-size: 12px;
  color: var(--cyan);
}

/* Колокольчик-заглушка */
.bell {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-muted);
  cursor: default;
}
.bell svg {
  width: 18px;
  height: 18px;
}
.bell .dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 2px var(--bg-elev);
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-primary:hover {
  background: var(--blue-hover);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-muted);
}
.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--text);
}
.btn-block {
  width: 100%;
  justify-content: center;
}

/* ---------- Основной контейнер ---------- */
.app-main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page-title {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.page-subtitle {
  margin: 0 0 28px;
  color: var(--text-muted);
}

/* ---------- Карточки ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card + .card {
  margin-top: 18px;
}

.stub {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-muted);
}
.stub-badge {
  flex: none;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 6px;
}
.meta-item {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.meta-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.meta-value {
  font-weight: 700;
  font-size: 16px;
}

/* ---------- Бейджи ролей ---------- */
.role-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--cyan-soft);
  color: var(--cyan);
  border: 1px solid rgba(0, 191, 220, 0.3);
}

/* ---------- Flash-сообщения ---------- */
.flashes {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.flash {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  font-size: 14px;
  background: var(--bg-elev);
}
.flash-error {
  border-color: rgba(255, 84, 112, 0.5);
  color: #ffb3c0;
  background: rgba(255, 84, 112, 0.08);
}
.flash-info {
  border-color: rgba(0, 191, 220, 0.45);
  color: #a9ecf5;
  background: var(--cyan-soft);
}

/* ---------- Экран логина ---------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 34px 30px;
  box-shadow: var(--shadow);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.auth-title {
  margin: 18px 0 2px;
  font-size: 22px;
  font-weight: 800;
}
.auth-hint {
  margin: 0 0 22px;
  color: var(--text-muted);
  font-size: 14px;
}

.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}
.field input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

/* ---------- Навигация в шапке ---------- */
.app-nav {
  display: flex;
  gap: 6px;
  margin-right: auto;
  margin-left: 22px;
}
.nav-link {
  padding: 7px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 14px;
}
.nav-link:hover {
  color: var(--text);
  background: var(--bg-elev);
}
.nav-link.active {
  color: var(--text);
  background: var(--blue-soft);
}

/* ---------- Заголовок страницы с действиями ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-head .page-subtitle {
  margin: 0;
}
.page-head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.breadcrumbs {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---------- Вкладки ---------- */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.tab {
  padding: 9px 16px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover {
  color: var(--text);
}
.tab.active {
  color: var(--text);
  border-bottom-color: var(--blue);
}

/* ---------- Таблицы ---------- */
.table-card {
  padding: 6px 0;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table thead th {
  text-align: left;
  padding: 12px 18px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-dim);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}
.data-table tbody td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}
.row-link {
  cursor: pointer;
}
.row-muted td {
  opacity: 0.5;
}
.row-current {
  background: var(--blue-soft) !important;
}
.td-strong {
  font-weight: 700;
}
.ta-right {
  text-align: right;
}
.dim {
  color: var(--text-dim);
}
.accent {
  color: var(--cyan);
}
.pos {
  color: var(--success);
}
.neg {
  color: var(--danger);
}

/* ---------- Пилюли-статусы ---------- */
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.pill-ok {
  background: rgba(53, 208, 160, 0.14);
  color: var(--success);
}
.pill-muted {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}
.pill-accent {
  background: var(--cyan-soft);
  color: var(--cyan);
  margin-left: 6px;
}

/* ---------- Карточки-контент ---------- */
.card-title {
  margin: 0 0 18px;
  font-size: 17px;
  font-weight: 800;
}
.subsection {
  margin: 26px 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.notes-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.notes-block p {
  margin: 6px 0 0;
  color: var(--text-muted);
  white-space: pre-wrap;
}

/* ---------- Формы ---------- */
.form-card {
  max-width: 720px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
.form-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea {
  resize: vertical;
}
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.field input.num,
.field input.mono {
  font-family: var(--font-mono);
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}
.hint {
  font-size: 13px;
  margin: 10px 0 0;
}
.mt-16 {
  margin-top: 16px;
}

/* details-раскрывашка для инлайн-форм */
.inline-form {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.inline-form > summary {
  display: inline-flex;
  list-style: none;
  cursor: pointer;
}
.inline-form > summary::-webkit-details-marker {
  display: none;
}

.btn-link {
  background: none;
  border: none;
  color: var(--cyan);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.btn-link:hover {
  color: var(--blue-hover);
}

/* ---------- Пустые состояния ---------- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-title {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 6px;
}
.empty-state .btn {
  margin-top: 18px;
}
.empty-inline {
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Адаптив ---------- */
@media (max-width: 640px) {
  .app-header {
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  .brand-sub {
    display: none;
  }
  .user-box {
    display: none;
  }
  .app-nav {
    margin-left: 0;
    order: 3;
    width: 100%;
  }
  .app-main {
    padding: 24px 16px 48px;
  }
  .page-title {
    font-size: 22px;
  }
  .form-grid,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
  .data-table {
    font-size: 13px;
  }
  .data-table thead th,
  .data-table tbody td {
    padding: 10px 12px;
  }
}

/* ===================== Стадия 3: задачи и уведомления ===================== */

.btn-danger {
  background: transparent;
  border-color: rgba(255, 84, 112, 0.5);
  color: #ffb3c0;
}
.btn-danger:hover {
  background: rgba(255, 84, 112, 0.12);
  color: #ffd0d9;
}

/* ---------- Бейджи статусов задач ---------- */
.status-badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.status-new,
.status-estimate_pending {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}
.status-approved {
  background: rgba(20, 103, 245, 0.12);
  color: #7fb0ff;
}
.status-in_progress {
  background: var(--blue-soft);
  color: #7fb0ff;
  border: 1px solid rgba(20, 103, 245, 0.4);
}
.status-clarification {
  background: rgba(245, 176, 20, 0.14);
  color: var(--warning);
}
.status-done {
  background: var(--cyan-soft);
  color: var(--cyan);
}
.status-accepted {
  background: rgba(53, 208, 160, 0.16);
  color: var(--success);
}
.status-rejected {
  background: rgba(255, 84, 112, 0.12);
  color: #d98a97;
}

/* ---------- Метки приоритета ---------- */
.prio {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}
.prio-low {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}
.prio-medium {
  background: rgba(0, 191, 220, 0.12);
  color: var(--cyan);
}
.prio-high {
  background: rgba(245, 176, 20, 0.16);
  color: var(--warning);
}
.prio-urgent {
  background: rgba(255, 84, 112, 0.16);
  color: #ff8496;
}

/* ---------- Предупреждение о лимите ---------- */
.warn-box {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(245, 176, 20, 0.1);
  border: 1px solid rgba(245, 176, 20, 0.4);
  color: #f5cf7a;
  font-size: 14px;
  margin-bottom: 16px;
}

/* ---------- Ряд кнопок действий ---------- */
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.action-row form {
  display: inline;
}

/* ---------- Колокольчик: выпадающий список ---------- */
.bell-menu {
  position: relative;
}
.bell-menu > summary {
  list-style: none;
  cursor: pointer;
}
.bell-menu > summary::-webkit-details-marker {
  display: none;
}
.bell-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px var(--bg-elev);
}
.bell-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  max-width: 86vw;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 40;
  overflow: hidden;
}
.bell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 14px;
}
.bell-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 380px;
  overflow-y: auto;
}
.bell-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.bell-item:last-child {
  border-bottom: none;
}
.bell-item a {
  color: var(--text);
}
.bell-item a:hover {
  color: var(--cyan);
}
.bell-item.unread {
  background: rgba(20, 103, 245, 0.07);
  border-left: 2px solid var(--blue);
}
.bell-item time {
  font-size: 11px;
}
.bell-empty {
  padding: 20px 16px;
  font-size: 14px;
  text-align: center;
}

/* ---------- Комментарии ---------- */
.comments {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.comment {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.comment-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 13px;
}
.comment-author {
  font-weight: 700;
}
.comment-role {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--cyan-soft);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
}
.comment-head time {
  margin-left: auto;
  font-size: 12px;
}
.comment-body {
  color: var(--text);
  white-space: pre-wrap;
  font-size: 14px;
}
.comment-form {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* ===================== Стадия 4: трекинг времени ===================== */

/* Блок лимита месяца в карточке задачи */
.limit-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.limit-cell {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.limit-value {
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
  text-align: right;
}

/* Короткая строка лимита в списке задач клиента */
.limit-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  padding: 14px 20px;
  margin-bottom: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-muted);
}
.limit-strip b {
  color: var(--text);
  margin-left: 6px;
}

/* Форма записи времени */
.time-form {
  margin-bottom: 4px;
}
.data-table tfoot td {
  padding: 13px 18px;
  border-top: 2px solid var(--border-strong);
}
.nowrap {
  white-space: nowrap;
}
.danger-link {
  color: #d98a97;
  margin-left: 10px;
}
.danger-link:hover {
  color: var(--danger);
}

/* Инлайн-редактирование записи времени */
.mini-menu {
  display: inline;
}
.mini-menu > summary {
  list-style: none;
  cursor: pointer;
  display: inline;
}
.mini-menu > summary::-webkit-details-marker {
  display: none;
}
.mini-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.mini-edit input {
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
}
.mini-edit input[name="hours"] {
  width: 80px;
  font-family: var(--font-mono);
}
.mini-edit input[name="note"] {
  flex: 1;
  min-width: 120px;
}
.mini-edit input[name="full_name"],
.mini-edit input[name="email"],
.mini-edit input[name="password"] {
  min-width: 170px;
}

@media (max-width: 640px) {
  .limit-row {
    grid-template-columns: 1fr;
  }
}

/* ===================== Стадия 5: дашборды и доска ===================== */

/* Навигация по месяцам */
.month-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.month-label {
  font-size: 16px;
  font-weight: 700;
}

/* Переключатель вид/список */
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.toggle-btn {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
}
.toggle-btn:hover {
  color: var(--text);
  background: var(--bg-elev);
}
.toggle-btn.active {
  background: var(--blue);
  color: #fff;
}

/* ---------- Дашборд клиента: сетки ---------- */
.dash-top {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.dash-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.dash-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

/* Гейдж */
.gauge-card .card-title { margin-bottom: 10px; }
.gauge-wrap {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}
.gauge-canvas-box {
  position: relative;
  width: 220px;
  height: 220px;
  flex: none;
}
.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.gauge-big {
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}
.gauge-sub {
  font-size: 12px;
  margin-top: 4px;
}
.gauge-legend {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gl-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.gl-row b { font-size: 16px; }

/* KPI */
.kpi-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.kpi-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 22px;
}
.kpi-num {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}
.kpi-label {
  font-size: 13px;
  margin-top: 6px;
}

/* Донат-контейнер */
.donut-box {
  position: relative;
  height: 260px;
}

/* ---------- Баланс по клиентам (прогресс-бары) ---------- */
.balance-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.balance-row {
  display: block;
  color: var(--text);
}
.balance-row:hover .balance-name { color: var(--cyan); }
.balance-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
  font-size: 14px;
}
.balance-name { font-weight: 700; }
.warn-text { color: var(--warning); }
.progress {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}
.progress-fill.warn { background: var(--warning); }
.progress-fill.over { background: var(--danger); }

/* ---------- Фильтры ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}
.filter-select {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  cursor: pointer;
}
.filter-select:focus {
  outline: none;
  border-color: var(--blue);
}

/* ---------- Доска ---------- */
.board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  align-items: flex-start;
}
.board-col {
  flex: 0 0 260px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}
.board-col-rejected { opacity: 0.82; }
.board-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}
.board-count {
  font-size: 13px;
  color: var(--text-dim);
}
.board-col-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}
.board-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.board-card-title {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 6px;
}
.board-card-title:hover { color: var(--cyan); }
.board-card-meta { font-size: 12px; margin-bottom: 8px; }
.board-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.tag-mini { font-size: 11px; }
.board-card-hours {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.board-card-author {
  font-size: 12px;
  margin-bottom: 10px;
}
.board-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.board-card-actions .action-row { gap: 6px; }
.board-card-actions .inline-form {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}
.board-empty {
  text-align: center;
  padding: 16px 0;
  font-size: 13px;
}

/* Компактные кнопки на доске */
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

@media (max-width: 900px) {
  .dash-top { grid-template-columns: 1fr; }
  .dash-charts { grid-template-columns: 1fr; }
  .dash-summary { grid-template-columns: repeat(2, 1fr); }
  .kpi-col { flex-direction: row; }
  .kpi-col .kpi-card { flex: 1; }
}
@media (max-width: 640px) {
  .board-col { flex-basis: 82vw; }
  .dash-summary { grid-template-columns: 1fr 1fr; }
  .kpi-col { flex-direction: column; }
}

/* ===================== Стадия 6: админка и фрод-монитор ===================== */

.bar-box {
  position: relative;
  height: 280px;
}

/* Блок «сегодня» */
.today-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.today-cell {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.today-cell.over {
  border-color: rgba(255, 84, 112, 0.5);
  background: rgba(255, 84, 112, 0.08);
}
.today-name {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.today-hours {
  font-size: 22px;
  font-weight: 700;
}
.today-cell.over .today-hours {
  color: #ff8496;
}

/* Матрица фрод-монитора */
.fraud-scroll {
  overflow-x: auto;
}
.fraud-table {
  min-width: 720px;
}
.fraud-table th,
.fraud-table td {
  white-space: nowrap;
}
.sticky-col {
  position: sticky;
  left: 0;
  background: var(--bg-card);
  z-index: 2;
}
.fraud-table thead .sticky-col {
  z-index: 3;
}
.col-weekend {
  color: var(--text-dim);
}
.fraud-cell.over {
  background: rgba(255, 84, 112, 0.14);
}
.fraud-cell.over a {
  color: #ff8496;
  font-weight: 700;
}
.fraud-cell a {
  color: var(--text);
}
.fraud-cell a:hover {
  color: var(--cyan);
}

/* Опасная зона (удаление) */
.danger-zone {
  border-color: rgba(255, 84, 112, 0.35);
}
.danger-zone .card-title {
  color: #ff8496;
}

/* Telegram-действия в профиле клиента */
.tg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 4px;
}
.tg-actions form { display: inline; }

/* Чекбокс-строка в настройках */
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}
.check-row span { font-weight: 600; }
