/* Клиентский портал — фирменный стиль Про-Софт / БезЛимит
   Палитра с itbezlimit.ru: тёмно-синий #061b43, оранжевый #ff7925, фон #f4f7fb */
:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --ink: #061b43;
  --muted: #5b6b85;
  --line: #e2e8f0;
  --brand: #061b43;        /* основной тёмно-синий */
  --brand-2: #0b2552;
  --brand-3: #12336b;
  --accent: #ff7925;       /* оранжевый CTA */
  --accent-dark: #f26a12;
  --accent-deep: #dc5a06;
  --accent-soft: #ff79251a;
  --danger: #c92a3f;
  --ok: #1c7c43;
  --warn: #a05e03;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: Inter, "PT Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, .brand, .login-logo { font-family: Montserrat, Inter, "PT Sans", Arial, sans-serif; }
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
main.container { flex: 1; padding-top: 24px; padding-bottom: 40px; }
.footer { color: var(--muted); font-size: .8rem; padding: 16px; text-align: center; }

/* Шапка */
.topbar { background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 100%); color: #fff; box-shadow: 0 2px 10px rgba(6,27,67,.25); }
.topbar-inner { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1rem; letter-spacing: .2px; }
.brand img { height: 28px; width: auto; }
.brand-mark { color: var(--accent); }
.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a { color: #c9d6ec; text-decoration: none; padding: 6px 14px; border-radius: 999px; font-size: .95rem; }
.topnav a:hover { background: rgba(255,255,255,.09); color: #fff; }
.topnav a.active { background: rgba(255,121,37,.18); color: #fff; }
.userbox { display: flex; align-items: center; gap: 10px; }

/* Поднавигация админки: все вкладки всегда на месте */
.subnav { background: #fff; border-bottom: 1px solid var(--line); }
.subnav-inner { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.subnav a {
  color: var(--brand-3); text-decoration: none; font-size: .92rem; font-weight: 600;
  padding: 7px 16px; border-radius: 999px; border: 1.5px solid transparent;
}
.subnav a:hover { background: #eef3fb; }
.subnav a.active { background: var(--brand); color: #fff; }
.user-name { color: #e5edf9; text-decoration: none; font-size: .9rem; }
.user-name:hover { text-decoration: underline; }

/* Кнопки — pill, как на сайте */
.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  background: var(--accent); color: #fff; font-size: .92rem; font-weight: 700;
  font-family: inherit;
  padding: 10px 20px; border-radius: 999px; transition: background .15s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(255,121,37,.35);
}
.btn:hover { background: var(--accent-dark); }
.btn-sm { padding: 6px 14px; font-size: .82rem; }
.btn-ghost { background: transparent; color: #c9d6ec; border: 1px solid rgba(255,255,255,.3); box-shadow: none; }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-outline { background: #fff; color: var(--brand); border: 1.5px solid var(--brand); box-shadow: none; }
.btn-outline:hover { background: #eef3fb; }
.btn-danger { background: var(--danger); box-shadow: 0 2px 8px rgba(201,42,63,.3); }
.btn-danger:hover { background: #a12033; }
.btn-ok { background: var(--ok); box-shadow: 0 2px 8px rgba(28,124,67,.3); }
.btn-ok:hover { background: #156335; }
.inline-form { display: inline; }

/* Карточки */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(6,27,67,.05);
}
.card h1, .card h2 { margin-top: 0; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 18px; }
.page-title h1 { font-size: 1.35rem; margin: 0; }
.subtitle { color: var(--muted); font-size: .9rem; margin-top: 4px; }

/* Формы */
label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin: 12px 0 4px; }
input[type=text], input[type=password], input[type=email], select, textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: .95rem; background: #fff; color: var(--ink); font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-narrow { max-width: 420px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form-row > div { flex: 1; min-width: 160px; }
.checkbox-line { display: flex; align-items: center; gap: 8px; margin: 12px 0; font-size: .9rem; color: var(--ink); }
.checkbox-line input { width: auto; }

/* Таблицы */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #f7faff; }
td .btn { margin: 2px 4px 2px 0; }

/* Бейджи — pill */
.badge {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: .75rem; font-weight: 700; background: #e8eef8; color: #44536b;
}
.badge-ok { background: #e0f3e7; color: var(--ok); }
.badge-warn { background: #fdf0dc; color: var(--warn); }
.badge-danger { background: #fbe3e7; color: var(--danger); }
.badge-info { background: #dbe6f8; color: var(--brand-3); }

/* Сообщения */
.alert { border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: .92rem; }
.alert-error { background: #fbe3e7; color: #8f1f30; border: 1px solid #f0b9c3; }
.alert-info { background: #dbe6f8; color: #12336b; border: 1px solid #bcd0f5; }
.alert-warn { background: #fdf0dc; color: #7a4a06; border: 1px solid #efd6a8; }

/* Список ресурсов */
.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.resource-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
  box-shadow: 0 1px 3px rgba(6,27,67,.05);
}
.resource-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(255,121,37,.18); }
.resource-card .rc-title { font-weight: 700; font-size: 1.02rem; overflow-wrap: anywhere; }
.resource-card .rc-meta { color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }

/* Карточка ресурса в админке: длинные имена не двигают кнопки управления */
.res-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.res-info { flex: 1 1 240px; min-width: 0; }
.res-name { font-weight: 700; font-size: 1.02rem; overflow-wrap: anywhere; }
.res-meta { margin-top: 4px; font-size: .88rem; overflow-wrap: anywhere; }
.res-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; flex-wrap: wrap; }

/* Раскрывающиеся блоки */
details.box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 10px 0; background: #fbfcfe; }
details.box summary { cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--brand-3); }
details.box[open] summary { margin-bottom: 6px; }

/* Инструкция */
ol.steps { padding-left: 22px; line-height: 1.7; font-size: .95rem; }

/* Логин */
.login-wrap { max-width: 400px; margin: 7vh auto 0; }
.login-wrap-wide { max-width: 800px; }
.login-logo { text-align: center; margin-bottom: 20px; }
.login-logo img { height: 44px; width: auto; }
.login-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
.card-fresh { border-color: #ffd6b8; background: #fff9f3; }
.btn-fresh { background: var(--brand); box-shadow: 0 2px 8px rgba(6,27,67,.3); }
.btn-fresh:hover { background: var(--brand-2); }
@media (max-width: 700px) { .login-grid { grid-template-columns: 1fr; } }

.muted { color: var(--muted); font-size: .85rem; }
.right { text-align: right; }
.mt0 { margin-top: 0; }
details.box > form { margin-top: 8px; }

@media (max-width: 720px) {
  .topbar-inner { gap: 10px; }
  .user-name { display: none; }
  td .btn { display: block; margin: 4px 0; }
}
