/* ==========================================================================
   Кастомная тема поверх Bootstrap 5 — строгая, но эстетичная.
   Единый стиль кнопок/карточек/бейджей, без эмодзи в действиях.
   ========================================================================== */

:root {
  --brand:           #2c5282;   /* тёмно-синий — навигация, акценты */
  --brand-dark:      #1a365d;
  --brand-light:     #ebf2fb;
  --accent:          #2c5282;
  --bg:              #f4f6f9;
  --card-bg:         #ffffff;
  --border:          #e2e8f0;
  --border-strong:   #cbd5e0;
  --text:            #1e293b;
  --text-muted:      #64748b;
  --radius:          8px;
  --radius-sm:       6px;
  --shadow-sm:       0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow:          0 1px 3px rgba(15, 23, 42, .06), 0 4px 12px rgba(15, 23, 42, .05);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.94rem;
}

/* ----- Навигация ----- */
.navbar-dark, .navbar.bg-dark {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%) !important;
  box-shadow: 0 2px 10px rgba(26, 54, 93, .18);
}
.navbar .navbar-brand,
.navbar .nav-brand {
  font-weight: 600;
  letter-spacing: .2px;
}
.navbar .btn-outline-light {
  border-color: rgba(255, 255, 255, .35);
  color: #e2e8f0;
  font-size: .85rem;
  padding: .3rem .7rem;
  border-radius: var(--radius-sm);
}
.navbar .btn-outline-light:hover {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .55);
  color: #fff;
}
.navbar .btn-light {
  background: rgba(255, 255, 255, .92);
  color: var(--brand-dark);
  border: none;
  font-size: .85rem;
  padding: .3rem .7rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.navbar .btn-light:hover {
  background: #fff;
}
.navbar-text { color: #cbd5e0 !important; font-size: .88rem; }

/* ----- Контейнер и заголовки ----- */
.container { max-width: 1080px; }
h4, .h4 {
  font-weight: 600;
  color: var(--brand-dark);
  letter-spacing: -.01em;
}
h6, .h6 {
  font-weight: 600;
  color: var(--text);
}

/* ----- Карточки — единый вид ----- */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}
.card-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--brand-dark);
  border-radius: var(--radius) var(--radius) 0 0 !important;
  padding: .65rem 1rem;
}
.card-body { padding: 1.1rem 1.2rem; }

/* ----- Таблицы — строгие, без двойных рамок ----- */
.table {
  margin-bottom: 0;
  vertical-align: middle;
}
.table > :not(caption) > * > * {
  padding: .7rem 1rem;
}
.table-bordered {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-bordered > :not(caption) > * {
  border-width: 0;
}
.table-bordered thead th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border) !important;
}
.table-bordered tbody tr {
  border-top: 1px solid var(--border);
}
.table-hover tbody tr:hover {
  background: var(--brand-light);
  cursor: pointer;
}
code {
  background: #eef2f7;
  color: var(--brand);
  padding: .1rem .35rem;
  border-radius: 4px;
  font-size: .88em;
}

/* ----- Единые кнопки ----- */
.btn { border-radius: var(--radius-sm); font-weight: 500; }
.btn-sm { font-size: .82rem; padding: .3rem .65rem; }
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
}
.btn-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}
.btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); }

/* Кнопки действий в таблицах — одинаковые, текстовые (без эмодзи),
   единая ширина, скругление. */
.btn-action {
  --bs-btn-padding-y: .28rem;
  --bs-btn-padding-x: .6rem;
  --bs-btn-font-size: .8rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.btn-group-action {
  display: inline-flex;
  gap: .35rem;
  flex-wrap: nowrap;
}
.btn-group-action .btn { border-radius: var(--radius-sm); }

/* ----- Бейджи статусов — скруглённые, пастельные, единый стиль ----- */
.badge {
  font-weight: 600;
  letter-spacing: .02em;
  padding: .4em .7em;
  border-radius: 999px;
  font-size: .76rem;
}
/* Цветовые модификаторы делаем мягче (пастель), чтобы выглядело строго */
.text-bg-secondary { background: #e2e8f0 !important; color: #475569 !important; }
.text-bg-primary    { background: #dbeafe !important; color: #1e40af !important; }
.text-bg-success    { background: #dcfce7 !important; color: #166534 !important; }
.text-bg-warning    { background: #fef3c7 !important; color: #92400e !important; }
.text-bg-danger     { background: #fee2e2 !important; color: #991b1b !important; }
.text-bg-info       { background: #cffafe !important; color: #155e75 !important; }

.status-badge { font-size: .82rem; }

/* ----- Список задач (batch) ----- */
.list-group-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) !important;
  margin-bottom: .5rem;
  padding: .9rem 1.1rem;
  box-shadow: var(--shadow-sm);
}
.list-group-item:last-child { margin-bottom: 0; }
.missing-list {
  font-size: .82rem;
  color: #92400e;
  margin-top: .35rem;
}
.missing-list ul { margin-top: .2rem; }
.missing-list code { color: #b45309; background: #fef3c7; }

/* ----- Формы ----- */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--border-strong);
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .2rem rgba(44, 82, 130, .15);
}
.form-label { font-weight: 500; color: var(--text); margin-bottom: .3rem; font-size: .88rem; }
.form-text { font-size: .8rem; color: var(--text-muted); }

/* ----- Алерты — мягче ----- */
.alert { border-radius: var(--radius); border: none; padding: .7rem 1rem; font-size: .9rem; }
.alert-danger   { background: #fee2e2; color: #991b1b; }
.alert-info     { background: #dbeafe; color: #1e40af; }
.alert-success  { background: #dcfce7; color: #166534; }
.alert-warning  { background: #fef3c7; color: #92400e; }

/* ----- Ссылки ----- */
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }

/* ----- Мелочи ----- */
.text-muted { color: var(--text-muted) !important; }
.modal-content { border: none; border-radius: var(--radius); box-shadow: var(--shadow); }
.modal-header { border-bottom: 1px solid var(--border); }
.modal-footer { border-top: 1px solid var(--border); }
.cursor-pointer { cursor: pointer; }
