/* cfcl.ru — единая тема сервиса: тёмная (по умолчанию) и светлая */

:root,
html[data-theme="dark"] {
  --bg: #0d1117;
  --bg-soft: #131924;
  --card: #161d29;
  --card-2: #1b2331;
  --border: rgba(148, 163, 184, .18);
  --border-strong: rgba(148, 163, 184, .32);
  --text: #e6edf6;
  --muted: #93a1b5;
  --accent: #3b82f6;
  --accent-2: #2563eb;
  --accent-soft: rgba(59, 130, 246, .14);
  --hover: rgba(148, 163, 184, .08);
  --ok: #22c55e;
  --warn: #f59e0b;
  --bad: #f87171;
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --radius: 16px;
}

html[data-theme="light"] {
  --bg: #f5f7fa;
  --bg-soft: #eef1f6;
  --card: #ffffff;
  --card-2: #f8fafc;
  --border: rgba(15, 23, 42, .12);
  --border-strong: rgba(15, 23, 42, .22);
  --text: #101828;
  --muted: #5b6675;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, .1);
  --hover: rgba(15, 23, 42, .05);
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --shadow: 0 14px 40px rgba(15, 23, 42, .1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 10px; line-height: 1.25; font-weight: 650; letter-spacing: -.02em; }
p { margin: 0 0 12px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: 12.5px; color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

.container {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- Шапка ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-head { background: var(--bg); }
}

.site-head-in {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -.02em;
  font-size: 15.5px;
  white-space: nowrap;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand svg { flex: none; }
.brand b { color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
  padding: 4px 0;
}
.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--muted);
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s, color .15s;
}
.site-nav a:hover { background: var(--hover); color: var(--text); }
.site-nav a.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--border-strong); }

.head-user {
  display: none;
  font-size: 13px;
  color: var(--muted);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (min-width: 1100px) { .head-user { display: block; } }

/* ---------- Основной блок ---------- */

.site-main { padding: 0 0 48px; }

.page-hero {
  padding: 34px 0 10px;
}
.page-hero h1 {
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -.03em;
  margin-bottom: 8px;
}
.page-hero p { color: var(--muted); max-width: 720px; font-size: 14.5px; }

/* ---------- Карточки ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card > h3,
.card-head {
  margin: 0;
  padding: 14px 16px;
  font-size: 14.5px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-body { padding: 16px; }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn.mini { padding: 5px 11px; font-size: 12.5px; border-radius: 9px; }

/* ---------- Формы ---------- */

input, select, textarea, button { font-family: inherit; }

input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="search"], input[type="number"],
select, textarea {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:disabled, select:disabled { opacity: .6; }

label { font-size: 12.5px; color: var(--muted); }

/* ---------- Таблицы ---------- */

table { border-collapse: collapse; width: 100%; }
th {
  text-align: left;
  font-size: 11.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}
td { padding: 11px 14px; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- Подвал ---------- */

.site-foot {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 26px 0 34px;
  margin-top: 20px;
}
.site-foot-in {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}
.site-foot nav { display: flex; flex-wrap: wrap; gap: 16px; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }

/* ---------- Прокрутка ---------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

@media (max-width: 720px) {
  .container { padding: 0 14px; }
  .site-head-in { height: 56px; gap: 10px; }
  .brand span { display: none; }
}
