/* Базовые стили нового MPA-каркаса. Токены и шапка перенесены из монолита
   (MP/site/styles.css). Светлый компактный SaaS, верхняя горизонтальная
   навигация — без изменений визуала по RULES.md. */

:root {
  --bg: #f6f8fc;
  --panel: #ffffff;
  --ink: #182033;
  --muted: #738098;
  --line: #e7ecf4;
  --blue: #1557ff;
  --blue-2: #0f46dd;
  --green: #12a05c;
  --red: #ef4444;
  --orange: #f59e0b;
  --purple: #7c3aed;
  --sidebar: #ffffff;
  --sidebar-2: #f9fbff;
  --shadow: 0 6px 18px rgba(29, 42, 68, 0.045);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button, input, select { font: inherit; }

input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { appearance: none; -webkit-appearance: none; margin: 0; }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Верхняя навигация */
.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 18px;
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  box-shadow: 0 12px 30px rgba(9, 18, 35, 0.14);
}

.logo { display: flex; align-items: center; flex: 0 0 auto; gap: 8px; min-height: 40px; padding: 0 6px; }
.logo-mark {
  display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 8px; background: linear-gradient(135deg, #1c6bff, #1745ea);
  color: #fff; font-weight: 900; font-size: 13px;
}
.logo strong { font-size: 14px; white-space: nowrap; }

.side-nav {
  display: flex; flex: 1 1 auto; gap: 5px; min-width: 0;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: thin;
}
.side-nav a {
  display: flex; align-items: center; flex: 0 0 auto; gap: 7px;
  min-height: 36px; padding: 0 10px; border-radius: 8px;
  color: #45506a; font-size: 12px; font-weight: 800; white-space: nowrap;
}
.side-nav a svg {
  flex: 0 0 17px; width: 17px; height: 17px; color: #6b7793;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.side-nav a.is-active {
  background: linear-gradient(135deg, #1564ff, #0d46e9); color: #fff;
  box-shadow: 0 8px 16px rgba(21, 100, 255, 0.25);
}
.side-nav a.is-active svg { color: #fff; }

/* Контент */
.app-main { padding: 18px 24px 28px; min-width: 0; }

.page-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; margin-bottom: 24px;
}
.title-row { display: flex; align-items: center; gap: 10px; }

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 30px; line-height: 1.1; }
h2 { margin-bottom: 12px; font-size: 20px; }
.muted { color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; justify-content: flex-end; }

.action-button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel); color: #1b2740;
  font-weight: 800; box-shadow: var(--shadow);
}
.action-button.primary { background: linear-gradient(135deg, #1564ff, #0d46e9); color: #fff; border-color: transparent; }

/* Панели / карточки */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 18px 20px; box-shadow: var(--shadow);
}

/* Базовая рабочая таблица: тонкие разделители, компактно (RULES) */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 8px 10px; color: var(--muted);
  font-weight: 800; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.data-table tr:hover td { background: #fafcff; }

.badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 999px; font-size: 12px; font-weight: 800;
  background: #eef2fb; color: #45506a;
}
.badge.green { background: rgba(18, 160, 92, 0.12); color: var(--green); }
.badge.red { background: rgba(239, 68, 68, 0.12); color: var(--red); }
.badge.orange { background: rgba(245, 158, 11, 0.14); color: #b9760a; }
