/* Фулик77 — базовые токены и компоненты, общие для лендинга, ЛК и админки. */
:root {
  --navy: #10233f;
  --navy-soft: #1c3557;
  --navy-deep: #0b1828;
  --lime: #b6f36a;
  --lime-deep: #94d94a;
  --paper: #f5f8fc;
  --white: #ffffff;
  --ink: #0d1a2d;
  --muted: #6b7c95;
  --line: #dde6f2;
  --danger: #e2564d;
  --warning: #f0a92f;
  --success: #2fa36b;
  --info: #3f7fd0;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 8px rgba(16, 35, 63, 0.07);
  --shadow: 0 12px 32px rgba(16, 35, 63, 0.1);
  --shadow-lg: 0 26px 60px rgba(16, 35, 63, 0.16);
  --container: 1180px;
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--navy);
  background: var(--white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; }
h1 { font-size: clamp(32px, 4.4vw, 58px); }
h2 { font-size: clamp(26px, 3vw, 40px); }
h3 { font-size: clamp(19px, 1.6vw, 24px); }
p { margin: 0 0 1em; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--navy-soft); }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding-left: 1.2em; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: 'JetBrains Mono', 'Consolas', monospace; font-size: 0.92em; background: var(--paper); padding: 2px 6px; border-radius: 6px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.row-actions { gap: 6px; flex-wrap: nowrap; }
.row-actions .btn-sm { padding: 6px 10px; font-size: 12.5px; white-space: nowrap; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Кнопки --- */
.btn {
  --btn-bg: var(--navy);
  --btn-fg: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
  text-align: center;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-lime { --btn-bg: var(--lime); --btn-fg: var(--navy); }
.btn-lime:hover { --btn-bg: var(--lime-deep); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--navy); }
.btn-ghost.btn-danger { --btn-bg: transparent; --btn-fg: var(--danger); border-color: rgba(226, 86, 77, 0.35); }
.btn-ghost.btn-danger:hover { border-color: var(--danger); }
.btn-outline-light { --btn-bg: transparent; --btn-fg: var(--white); border-color: rgba(255, 255, 255, 0.4); }
.btn-outline-light:hover { border-color: var(--lime); color: var(--lime); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-width: 1px; }
.btn-danger { --btn-bg: var(--danger); }
.btn-block { width: 100%; }
.btn-link {
  background: none; border: 0; padding: 0; color: var(--info);
  font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}

/* --- Карточки --- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-flat { box-shadow: none; }
.card-dark { background: var(--navy); border-color: var(--navy); color: var(--white); }
.card-dark .muted { color: rgba(255, 255, 255, 0.62); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title h3, .card-title h4 { margin: 0; }

/* --- Бейджи и статусы --- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--paper); color: var(--navy);
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
}
.badge-lime { background: rgba(182, 243, 106, 0.28); color: #40661a; }
.badge-ok { background: rgba(47, 163, 107, 0.14); color: var(--success); }
.badge-warn { background: rgba(240, 169, 47, 0.16); color: #96620a; }
.badge-danger { background: rgba(226, 86, 77, 0.14); color: var(--danger); }
.badge-info { background: rgba(63, 127, 208, 0.14); color: var(--info); }
.badge-dark { background: var(--navy); color: var(--white); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* --- Формы --- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font-size: 13px; font-weight: 700; color: var(--navy-soft); }
.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(16, 35, 63, 0.1);
}
.textarea { min-height: 96px; resize: vertical; }
.field-hint, .auth-hint { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.auth-hint { margin-top: 10px; }
.select {
  appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 49%, var(--navy) 50%), linear-gradient(135deg, var(--navy) 50%, transparent 51%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--navy); }
.inline-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.error-text { color: var(--danger); font-size: 13px; font-weight: 600; }

/* --- Таблицы --- */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.table th {
  text-align: left; padding: 12px 14px; background: var(--paper);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(245, 248, 252, 0.7); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty-state { padding: 28px 18px; text-align: center; color: var(--muted); font-size: 14px; }

/* --- Прогресс и полоски --- */
.progress { height: 8px; border-radius: 999px; background: var(--paper); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--lime); transition: width 0.3s ease; }
.progress.danger > span { background: var(--danger); }
.progress.warn > span { background: var(--warning); }

/* --- Уведомления и модальные окна --- */
.toast-stack {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 36px));
}
.toast {
  background: var(--navy); color: var(--white);
  padding: 13px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow);
  animation: toast-in 0.2s ease;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(11, 24, 40, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  width: min(620px, 100%); max-height: min(86vh, 820px);
  overflow-y: auto; padding: 24px; box-shadow: var(--shadow-lg);
  animation: modal-in 0.18s ease;
}
.modal h3 { margin-bottom: 4px; }
.modal-wide { width: min(900px, 100%); }
@keyframes modal-in { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: none; } }

/* --- Скелетоны и спиннеры --- */
.skeleton { background: linear-gradient(90deg, #eef3fa, #e2eaf5, #eef3fa); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 10px; min-height: 14px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: var(--white); animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Печать КП --- */
@media print {
  .no-print { display: none !important; }
  body { background: var(--white); }
  .card { box-shadow: none; border-color: #c9d4e4; }
}
