/* Свилки для сотрудников — простой интерфейс в духе CRM */
:root {
  --brand: #e91e85;
  --brand-hover: #c9176f;
  --brand-soft: #fdf0f6;
  --brand-line: #f9cde2;

  --bg: #f5f6f8;
  --surface: #ffffff;
  --line: #e6e8ec;
  --line-strong: #d5d9e0;
  --text: #1c2230;
  --muted: #6b7280;
  --faint: #9aa1ad;

  --ok: #15803d;      --ok-bg: #ecfdf3;
  --warn: #a15c07;    --warn-bg: #fff8e6;
  --err: #b42318;     --err-bg: #fef3f2;
  --info: #1d4ed8;    --info-bg: #eff4ff;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --sidebar: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
svg.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Каркас ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 20px 14px;
}
.brand { display: flex; flex-direction: column; gap: 4px; padding: 0 8px 20px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.brand img { width: 168px; height: auto; display: block; }
.brand-sub { font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--muted); padding-left: 2px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 10px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  color: var(--text); font-weight: 500; font-size: 14px;
  background: none; border: 0; width: 100%; text-align: left; cursor: pointer; font-family: inherit;
}
.nav-item svg { color: var(--faint); }
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); }
.nav-item.active svg { color: var(--brand); }
.nav-item .count { margin-left: auto; font-size: 12px; color: var(--muted); }

.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.user { display: flex; align-items: center; gap: 10px; padding: 4px 8px 8px; min-width: 0; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.user b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot form { margin: 0; }

.content { padding: 28px 32px 48px; min-width: 0; }
.content-inner { max-width: 1080px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; line-height: 1.3; margin: 0; font-weight: 700; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- Карточки и сетка ---------- */
.grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 15px; margin: 0; font-weight: 600; }
.card-body { padding: 20px; }
.card-body > :first-child { margin-top: 0; }
.card-body > :last-child { margin-bottom: 0; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); background: #fafbfc; border-radius: 0 0 var(--radius) var(--radius); font-size: 13px; color: var(--muted); }

/* Пары «название — значение» */
.props { margin: 0; }
.props > div { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.props > div:first-child { padding-top: 0; }
.props > div:last-child { border-bottom: 0; padding-bottom: 0; }
.props dt { color: var(--muted); font-size: 13px; }
.props dd { margin: 0; font-size: 14px; word-break: break-word; }

/* Таблица */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 20px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fcfcfd; }
.table .actions { text-align: right; white-space: nowrap; }
.table .title { font-weight: 600; }
.table .desc { color: var(--muted); font-size: 13px; }
.group-row td { background: #fafbfc; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 20px; }

/* Шаги установки */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 20px; }
.steps li { counter-increment: step; display: flex; gap: 12px; padding: 10px 0; }
.steps li::before {
  content: counter(step); flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.steps b { font-weight: 600; }

/* ---------- Элементы ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 8px;
  background: var(--brand); color: #fff; border: 1px solid var(--brand);
  font: 600 14px/1 inherit; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--bg); color: var(--text); }
.btn.ghost { background: none; border-color: transparent; color: var(--brand); padding: 0 8px; height: 32px; }
.btn.ghost:hover { background: var(--brand-soft); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.pending { background: var(--warn-bg); color: var(--warn); }
.chip.approved { background: var(--ok-bg); color: var(--ok); }
.chip.rejected, .chip.blocked { background: var(--err-bg); color: var(--err); }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; }
.alert.success { background: var(--ok-bg); color: var(--ok); border-color: #c6ecd4; }
.alert.error { background: var(--err-bg); color: var(--err); border-color: #fbd3cf; }
.alert.warning { background: var(--warn-bg); color: var(--warn); border-color: #f5e0b0; }
.alert.info { background: var(--info-bg); color: var(--info); border-color: #d1defe; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg { width: 32px; height: 32px; color: var(--faint); margin-bottom: 8px; }
.empty h3 { margin: 0 0 4px; color: var(--text); font-size: 15px; }
.empty p { margin: 0; font-size: 14px; }

.state { display: flex; gap: 16px; align-items: flex-start; }
.state-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.state-icon.pending { background: var(--warn-bg); color: var(--warn); }
.state-icon.rejected, .state-icon.blocked { background: var(--err-bg); color: var(--err); }
.state h2 { font-size: 16px; margin: 0 0 4px; }
.state p { margin: 0 0 6px; color: var(--muted); font-size: 14px; }

code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; background: var(--bg); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 16px; }

/* ---------- Формы ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field .req { color: var(--brand); }
.field input[type=text], .field input[type=tel], .field input[type=email], .field input[type=password] {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: #fff;
  font: inherit; color: var(--text);
}
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(233, 30, 133, .15); }
.field input[aria-invalid=true], .field.has-error input { border-color: var(--err); }
.field .help { color: var(--muted); font-size: 12px; margin-top: 4px; }
.field .errors { color: var(--err); font-size: 12px; margin: 4px 0 0; padding: 0; list-style: none; }
.field.check { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 18px; }
.field.check input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.field.check label { font-weight: 400; font-size: 13px; color: var(--muted); margin: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-section { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 6px 0 12px; }
.hp { position: absolute; left: -9999px; }

/* ---------- Вход и регистрация ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 16px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 24px; }
.auth-brand img { width: 200px; height: auto; }
.auth-brand span { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card.wide { max-width: 620px; }
.auth-card .card-body { padding: 28px; }
.auth-card h1 { font-size: 20px; margin: 0 0 4px; }
.auth-card .lead { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.auth-alt { margin-top: 16px; font-size: 14px; color: var(--muted); text-align: center; }
.auth-foot { margin-top: 24px; font-size: 12px; color: var(--faint); text-align: center; }

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { border: 0; padding: 0; margin: 0; flex-direction: row; align-items: center; gap: 8px; }
  .brand img { width: 112px; }
  .brand-sub { display: none; }
  .nav { order: 3; width: 100%; flex-direction: row; overflow-x: auto; gap: 4px; }
  .nav-label { display: none; }
  .nav-item { width: auto; white-space: nowrap; padding: 8px 10px; }
  .sidebar-foot { margin: 0 0 0 auto; border: 0; padding: 0; flex-direction: row; align-items: center; }
  .user { display: none; }
  .sidebar-foot .nav-item span { display: none; }
  .content { padding: 20px 16px 40px; }
  .props > div { grid-template-columns: 1fr; gap: 2px; }
  .table th:nth-child(2), .table td:nth-child(2) { display: none; }
  .table td, .table th { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .auth-card .card-body { padding: 20px; }
}
