/* ============================================================
   Промсорт-Калуга — единая дизайн-система
   Подключается на всех страницах после Bootstrap.
   ============================================================ */

:root {
  --brand:        #2563eb;
  --brand-dark:   #1d4ed8;
  --brand-darker: #1e3a8a;
  --brand-soft:   #eff4ff;

  --bg:        #f4f6fb;
  --surface:   #ffffff;
  --border:    #e6e9f0;
  --text:      #1f2733;
  --muted:     #6b7280;

  --success:   #16a34a;
  --danger:    #dc2626;

  --radius:    14px;
  --radius-sm: 10px;
  --shadow:    0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .06);
  --shadow-lg: 0 20px 45px rgba(30, 58, 138, .18);

  --font: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
}

a { color: var(--brand); }

/* ---------- Бренд / логотип ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-darker));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .35);
}
.brand-name  { font-weight: 700; color: var(--text); line-height: 1.15; }
.brand-sub   { font-size: .78rem; color: var(--muted); }

/* ---------- Верхняя панель ---------- */
.app-navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.app-navbar .contact-info {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  font-size: .9rem;
  color: var(--muted);
}
.app-navbar .contact-info i { color: var(--brand); margin-right: 5px; }

/* ---------- Хлебные крошки ---------- */
.breadcrumb-section {
  background: var(--surface);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.breadcrumb-section .breadcrumb { margin: 0; }
.breadcrumb-section .breadcrumb a { text-decoration: none; }
.breadcrumb-item + .breadcrumb-item::before { content: "›"; color: var(--muted); }

/* ---------- Каркас страницы (sidebar + контент) ---------- */
.app-shell {
  display: flex;
  min-height: calc(100vh - 140px);
}
.sidebar {
  width: 270px;
  flex: 0 0 270px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 22px 0;
}
.sidebar-title {
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  padding: 0 22px 14px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.sidebar-nav { list-style: none; padding: 0 12px; margin: 0; }
.sidebar-nav li { margin-bottom: 4px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.sidebar-nav a:hover  { background: var(--brand-soft); color: var(--brand-dark); }
.sidebar-nav a.active { background: var(--brand); color: #fff; }
.sidebar-nav i { font-size: .72rem; opacity: .7; }

.main-content { flex: 1; padding: 30px; min-width: 0; }

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

.page-title {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 22px;
}

/* ---------- Секции с данными ---------- */
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.subsection-title {
  margin-top: 22px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 6px 28px;
}
.info-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.info-label { color: var(--muted); font-weight: 500; }
.info-value { color: var(--text); font-weight: 600; text-align: right; }

/* ---------- Кнопки ---------- */
.btn-brand {
  background: var(--brand);
  border: 1px solid var(--brand);
  color: #fff;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background .15s, transform .1s, box-shadow .15s;
}
.btn-brand:hover {
  background: var(--brand-dark);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .3);
}
.btn-brand:active { transform: translateY(1px); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--brand);
  color: var(--brand);
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background .15s, color .15s;
}
.btn-ghost:hover { background: var(--brand); color: #fff; }

/* ---------- Бейджи статусов ---------- */
.badge-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
}
.badge-ok { background: rgba(22, 163, 74, .12); color: var(--success); }

/* ---------- Таблицы ---------- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--brand-soft);
  padding: 12px 10px;
  text-align: left;
  font-weight: 600;
  color: var(--brand-darker);
  font-size: .85rem;
  white-space: nowrap;
}
.data-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.data-table tbody tr:hover { background: #fafbfe; }

/* ---------- Формы ---------- */
.app-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 1rem;
  transition: border-color .15s, box-shadow .15s;
}
.app-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

/* ---------- Пустые состояния / спиннер ---------- */
.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 28px 16px;
}
.empty-state i { font-size: 2rem; opacity: .4; margin-bottom: 10px; }

/* ---------- Адаптивность ---------- */
@media (max-width: 768px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-basis: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .app-navbar .contact-info { display: none; }
  .main-content { padding: 18px; }
  .info-item { flex-direction: column; gap: 2px; }
  .info-value { text-align: left; }
}
