:root {
  --bg: #0a0a0d;
  --bg-soft: #111116;
  --panel: #15151c;
  --panel-strong: #1b1b24;
  --text: #f5f5f7;
  --muted: #9696a3;
  --line: #2a2a35;
  --accent: #8257ff;
  --accent-strong: #6d3df2;
  --accent-soft: rgba(130, 87, 255, 0.16);
  --success: #b7ff36;
  --warning: #ffc857;
  --danger: #ff6577;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  --radius: 18px;
  --radius-sm: 12px;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="light"] {
  --bg: #f2f3f7;
  --bg-soft: #eaecf2;
  --panel: #ffffff;
  --panel-strong: #f7f7fa;
  --text: #17171c;
  --muted: #686875;
  --line: #dedfe7;
  --accent: #7047e8;
  --accent-strong: #5e34d3;
  --accent-soft: rgba(112, 71, 232, 0.12);
  --success: #397300;
  --warning: #9a5b00;
  --danger: #c53145;
  --shadow: 0 18px 50px rgba(44, 37, 69, 0.11);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, var(--accent-soft), transparent 32rem),
    var(--bg);
  color: var(--text);
}
button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.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;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  padding: 24px;
  gap: 24px;
}

.login-main, .login-aside {
  border: 1px solid var(--line);
  border-radius: 28px;
  min-height: calc(100vh - 48px);
}

.login-main {
  display: grid;
  align-content: space-between;
  padding: clamp(28px, 6vw, 76px);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: var(--shadow);
}

.product-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: .04em;
}

.product-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.login-card { width: min(440px, 100%); margin: 56px 0; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.login-card h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: .98;
  letter-spacing: -.045em;
}
.login-lead {
  margin: 20px 0 32px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 38ch;
}

.form-field { display: grid; gap: 9px; margin-bottom: 18px; }
.form-field label { font-size: 13px; font-weight: 700; }
.input-wrap { position: relative; }
.input-wrap input, .filter-field input, .filter-field select, .theme-select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input-wrap input { height: 50px; padding: 0 48px 0 15px; }
.input-wrap input:focus, .filter-field input:focus, .filter-field select:focus, .theme-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 9px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.password-toggle:hover { background: var(--accent-soft); color: var(--text); }
.primary-button {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s, background .2s, opacity .2s;
}
.primary-button:hover { background: var(--accent-strong); transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: wait; transform: none; }
.form-error {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}
.login-footnote { color: var(--muted); font-size: 12px; line-height: 1.55; }

.login-aside {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 5vw, 64px);
  display: grid;
  align-content: end;
  background:
    linear-gradient(145deg, rgba(130, 87, 255, .26), transparent 55%),
    var(--panel);
}
.login-aside::before, .login-aside::after {
  content: "";
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  border-radius: 50%;
}
.login-aside::before { width: 520px; height: 520px; top: -210px; right: -190px; }
.login-aside::after { width: 320px; height: 320px; top: -75px; right: -85px; }
.aside-content { position: relative; z-index: 1; max-width: 520px; }
.aside-content h2 { margin: 0 0 18px; font-size: clamp(30px, 4vw, 52px); line-height: 1.02; letter-spacing: -.04em; }
.aside-content p { color: var(--muted); line-height: 1.7; }
.feature-list { display: grid; gap: 12px; margin-top: 30px; }
.feature-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--panel-strong) 76%, transparent);
}
.feature-index { color: var(--success); font-size: 12px; font-weight: 900; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.sidebar-title { padding: 8px 10px 24px; font-weight: 820; letter-spacing: -.02em; }
.nav { display: grid; gap: 5px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  padding: 0 12px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 680;
}
.nav-link:hover { background: var(--panel-strong); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--text); }
.nav-icon {
  width: 8px;
  height: 8px;
  border: 1px solid currentColor;
  border-radius: 3px;
}
.nav-link.active .nav-icon { background: var(--accent); border-color: var(--accent); }

.nav-group { display: grid; gap: 4px; }
.nav-parent { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; font-family: inherit; }
.nav-chevron { margin-left: auto; font-size: 16px; line-height: 1; transition: transform .18s ease; }
.nav-group.open .nav-chevron { transform: rotate(180deg); }
.nav-submenu { display: none; gap: 3px; padding: 1px 0 3px 31px; }
.nav-group.open .nav-submenu { display: grid; }
.nav-sub-link { min-height: 34px; display: flex; align-items: center; padding: 0 10px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 680; }
.nav-sub-link:hover { background: var(--panel-strong); color: var(--text); }
.nav-sub-link.active { background: color-mix(in srgb, var(--accent-soft) 70%, transparent); color: var(--text); }
.nav-spacer { flex: 1; }
.sidebar-version { padding: 16px 10px 4px; color: var(--muted); font-size: 11px; }

.main { min-width: 0; }
.topbar {
  height: 72px;
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}
.page-title { font-size: 15px; font-weight: 800; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.theme-select { height: 38px; width: auto; padding: 0 34px 0 12px; font-size: 12px; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
}
.user-avatar {
  width: 25px;
  height: 25px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}
.user-meta { display: grid; line-height: 1.05; }
.user-meta strong { font-size: 12px; }
.user-meta span { margin-top: 4px; color: var(--muted); font-size: 10px; text-transform: capitalize; }
.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  cursor: pointer;
  color: var(--muted);
}
.icon-button:hover { color: var(--text); border-color: var(--accent); }

.content { padding: 28px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.04em; }
.page-head p { margin: 9px 0 0; color: var(--muted); }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 14%, transparent); }

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  margin-bottom: 18px;
}
.filter-field { display: grid; gap: 7px; }
.filter-field label { color: var(--muted); font-size: 11px; font-weight: 760; text-transform: uppercase; letter-spacing: .08em; }
.filter-field input, .filter-field select { height: 40px; padding: 0 11px; }
.filter-button { align-self: end; height: 40px; padding: 0 18px; border: 0; border-radius: 11px; background: var(--accent); color: #fff; font-weight: 800; cursor: pointer; }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 14px; }
.metric-card, .panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 8px 30px color-mix(in srgb, var(--bg) 80%, transparent);
}
.metric-card { padding: 18px; min-height: 126px; display: grid; align-content: space-between; }
.metric-label { color: var(--muted); font-size: 12px; line-height: 1.4; }
.metric-value { margin-top: 14px; font-size: 30px; font-weight: 850; letter-spacing: -.04em; }
.metric-hint { margin-top: 7px; color: var(--muted); font-size: 10px; }
.metric-card.primary .metric-value { color: var(--accent); }
.metric-card.success .metric-value { color: var(--success); }
.metric-card.warning .metric-value { color: var(--warning); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr); gap: 14px; margin-top: 14px; }
.panel { padding: 18px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 15px; }
.panel-caption { color: var(--muted); font-size: 11px; }
.chart-wrap { height: 260px; position: relative; }
.chart-wrap svg { width: 100%; height: 100%; overflow: visible; }
.chart-grid-line { stroke: var(--line); stroke-width: 1; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: var(--accent-soft); }
.chart-empty { display: grid; height: 100%; place-items: center; color: var(--muted); font-size: 13px; }
.legend { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.legend-mark { width: 18px; height: 3px; border-radius: 999px; background: var(--accent); }

.table-panel { margin-top: 14px; overflow: hidden; padding: 0; }
.table-panel .panel-head { padding: 18px 18px 0; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 700px; }
th, td { padding: 13px 18px; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
td { font-size: 12px; }
td.number { text-align: right; font-variant-numeric: tabular-nums; }
.platform-tag { display: inline-flex; padding: 5px 8px; border-radius: 7px; background: var(--panel-strong); color: var(--muted); font-size: 10px; }

.placeholder {
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  padding: 40px;
}
.placeholder h1 { margin: 0 0 12px; font-size: 32px; letter-spacing: -.04em; }
.placeholder p { margin: 0; max-width: 540px; color: var(--muted); line-height: 1.65; }

.mobile-menu { display: none; }
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  max-width: 360px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  font-size: 12px;
}
.toast.error { border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); color: var(--danger); }

@media (max-width: 1200px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .filter-button { grid-column: span 2; }
}

@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: inline-grid; place-items: center; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .login-page { padding: 0; }
  .login-main { min-height: 100vh; border: 0; border-radius: 0; padding: 24px; }
  .topbar { padding: 0 14px; }
  .content { padding: 18px 14px; }
  .user-meta { display: none; }
  .theme-select { max-width: 116px; }
  .filters { grid-template-columns: 1fr; }
  .filter-button { grid-column: auto; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .page-head { align-items: flex-start; flex-direction: column; }
}

th.number { text-align: right; font-variant-numeric: tabular-nums; }

/* Точное выравнивание последнего столбца таблицы вакансий */
.vacancy-table th:last-child,
.vacancy-table td:last-child {
  width: 82px;
  min-width: 82px;
  max-width: 82px;
  box-sizing: border-box;
  text-align: center;
  padding-left: 12px;
  padding-right: 12px;
}


/* Accounts Core 0.3.0 */
.page-action,
.ghost-button,
.table-action {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s, opacity .2s;
}
.page-action {
  border: 0;
  background: var(--accent);
  color: #fff;
}
.page-action:hover { background: var(--accent-strong); transform: translateY(-1px); }
.page-action:disabled { opacity: .55; cursor: wait; transform: none; }
.ghost-button,
.table-action {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
}
.ghost-button:hover,
.table-action:hover { border-color: var(--accent); background: var(--accent-soft); }
.table-action { min-height: 32px; padding: 0 11px; margin-top: 9px; font-size: 11px; }

.accounts-page-head { align-items: center; }
.account-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.compact-stat {
  min-height: 88px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
  display: grid;
  align-content: space-between;
}
.compact-stat span { color: var(--muted); font-size: 11px; }
.compact-stat strong { font-size: 25px; letter-spacing: -.04em; }
.compact-stat small { color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-stat.success strong { color: var(--success); }
.compact-stat.warning strong { color: var(--warning); }
.compact-stat.danger strong { color: var(--danger); }

.account-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(135px, .65fr)) auto auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.account-filters .filter-button,
.account-filters .ghost-button { align-self: end; }
.account-search-field { min-width: 0; }
.accounts-table-panel { margin-top: 14px; }
.accounts-table-panel .panel-head { align-items: flex-end; }
.account-access-note { color: var(--muted); font-size: 11px; }
.accounts-table { min-width: 1500px; }
.accounts-table th:nth-child(1) { min-width: 200px; }
.accounts-table th:nth-child(4) { min-width: 220px; }
.accounts-table th:nth-child(5) { min-width: 190px; }
.accounts-table th:nth-child(7) { min-width: 180px; }
.accounts-table th:nth-child(8) { min-width: 190px; }
.accounts-table td { vertical-align: top; }
.account-identity,
.activity-cell,
.account-metrics,
.account-config { display: grid; gap: 5px; }
.account-identity strong { font-size: 13px; }
.account-identity span,
.activity-cell span,
.account-metrics span:not(:first-child),
.account-config span { color: var(--muted); font-size: 10px; line-height: 1.4; }
.activity-cell strong { font-size: 11px; }
.account-config strong { color: var(--text); font-weight: 700; }
.platform-badge {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  font-size: 10px;
  font-weight: 780;
}
.account-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.account-status span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.account-status.active { color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, var(--line)); }
.account-status.active span { background: var(--success); }
.account-status.paused { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 35%, var(--line)); }
.account-status.paused span { background: var(--warning); }
.account-status.disabled { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.account-status.disabled span { background: var(--danger); }
.technical-stack { display: grid; gap: 5px; }
.technical-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 7px;
  border-radius: 7px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 9px;
}
.technical-chip strong { color: var(--text); font-size: 9px; }
.technical-chip.ok strong,
.technical-chip.authenticated strong { color: var(--success); }
.technical-chip.error strong,
.technical-chip.expired strong { color: var(--danger); }
.technical-chip.offline strong,
.technical-chip.disabled strong { color: var(--warning); }
.quota-cell { min-width: 86px; font-variant-numeric: tabular-nums; }
.quota-value { font-size: 17px; }
.quota-limit { color: var(--muted); font-size: 11px; }
.account-metrics strong { font-size: 16px; }
.muted-value { color: var(--muted); font-size: 10px; }
.empty-table { padding: 34px; color: var(--muted); text-align: center; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(8px);
}
.modal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.modal-head h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.modal-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-strong);
  color: var(--muted);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}
.modal-close:hover { border-color: var(--accent); color: var(--text); }
.modal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.modal-card .form-field { margin: 0; }
.modal-card input,
.modal-card select,
.modal-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-strong);
  color: var(--text);
  outline: none;
}
.modal-card input,
.modal-card select { height: 44px; padding: 0 12px; }
.modal-card textarea { min-height: 96px; padding: 12px; resize: vertical; }
.modal-card input:focus,
.modal-card select:focus,
.modal-card textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.modal-span-2 { grid-column: span 2; }
.check-field {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
  cursor: pointer;
}
.check-field input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); }
.check-field span { display: grid; gap: 4px; }
.check-field strong { font-size: 12px; }
.check-field small { color: var(--muted); line-height: 1.4; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

@media (max-width: 1200px) {
  .account-summary-grid { grid-template-columns: repeat(3, 1fr); }
  .account-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-filters .filter-button,
  .account-filters .ghost-button { width: 100%; }
}

@media (max-width: 640px) {
  .account-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .accounts-page-head { align-items: stretch; }
  .accounts-page-head .page-action { width: 100%; }
  .account-filters { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal-card { max-height: 94vh; border-radius: 22px 22px 0 0; }
  .modal-grid { grid-template-columns: 1fr; }
  .modal-span-2 { grid-column: auto; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; }
}

/* Proxy Core 0.4.0 */
.field-hint {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}
.table-action:disabled { opacity: .55; cursor: wait; }
.proxy-summary-grid { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
.proxy-filters { grid-template-columns: minmax(280px, 1.5fr) repeat(2, minmax(150px, .65fr)) auto auto; }
.proxy-table-panel { margin-top: 14px; }
.proxy-table { min-width: 1680px; }
.proxy-table th:nth-child(1) { min-width: 210px; }
.proxy-table th:nth-child(4) { min-width: 220px; }
.proxy-table th:nth-child(6) { min-width: 240px; }
.proxy-table th:nth-child(7) { min-width: 230px; }
.proxy-table th:nth-child(8) { min-width: 250px; }
.proxy-table td { vertical-align: top; }
.proxy-identity,
.proxy-ip,
.proxy-location,
.proxy-latency,
.proxy-check-meta { display: grid; gap: 5px; }
.proxy-identity strong { font-size: 13px; }
.proxy-identity span,
.proxy-ip span,
.proxy-location span,
.proxy-latency span,
.proxy-check-meta span { color: var(--muted); font-size: 10px; line-height: 1.4; }
.proxy-ip strong,
.proxy-latency strong { font-variant-numeric: tabular-nums; }
.proxy-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.proxy-state span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.proxy-state.working { color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, var(--line)); }
.proxy-state.working span { background: var(--success); }
.proxy-state.error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.proxy-state.error span { background: var(--danger); }
.proxy-state.unchecked { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 35%, var(--line)); }
.proxy-state.unchecked span { background: var(--warning); }
.proxy-state.disabled { color: var(--muted); }
.proxy-protocol { display: block; margin-top: 7px; color: var(--muted); text-transform: uppercase; }
.proxy-account-list { display: grid; gap: 7px; }
.proxy-account-list > span { display: grid; gap: 2px; }
.proxy-account-list strong { font-size: 11px; }
.proxy-account-list small { color: var(--muted); font-size: 9px; }
.proxy-account-list em { color: var(--accent); font-size: 10px; font-style: normal; }
.proxy-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.proxy-actions .table-action { margin-top: 0; }
.proxy-check-meta em {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--danger);
  font-size: 9px;
  font-style: normal;
  white-space: nowrap;
}
.proxy-modal-card { width: min(720px, 100%); }
.proxy-details-card { width: min(1180px, 100%); }
.proxy-detail-section { margin-top: 22px; }
.proxy-detail-section h3 { margin: 0 0 10px; font-size: 14px; }
.history-table { min-width: 850px; border: 1px solid var(--line); }
.history-table th,
.history-table td { padding: 10px 12px; }
.check-history-table { min-width: 1020px; }
.history-error { max-width: 330px; overflow: hidden; text-overflow: ellipsis; }
.success-text { color: var(--success); font-weight: 750; }
.technical-chip.working strong { color: var(--success); }
.technical-chip.unchecked strong { color: var(--warning); }

@media (max-width: 1200px) {
  .proxy-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .proxy-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .proxy-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .proxy-filters { grid-template-columns: 1fr; }
  .proxy-actions { flex-direction: column; }
  .proxy-actions .table-action { width: 100%; }
}
.proxy-auto-note {
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
}
.proxy-auto-note strong { font-size: 12px; }
.proxy-auto-note span { color: var(--muted); font-size: 10px; line-height: 1.45; }

/* Account Runner Core 0.5.0 */
.accounts-table { min-width: 1680px; }
.runner-cell { display: grid; gap: 6px; min-width: 180px; }
.runner-cell small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.runner-cell em {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--danger);
  font-size: 9px;
  font-style: normal;
  white-space: nowrap;
}
.runner-state {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.runner-state > span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.runner-state.queued,
.runner-state.claimed,
.runner-state.starting { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 35%, var(--line)); }
.runner-state.running { color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, var(--line)); }
.runner-state.stopping { color: var(--warning); }
.runner-state.authentication_required { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 35%, var(--line)); }
.runner-state.completed,
.runner-state.idle { color: var(--muted); }
.runner-state.failed { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.runner-state.cancelled,
.runner-state.disabled { color: var(--muted); }
.account-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; max-width: 300px; }
.account-actions .table-action { margin-top: 0; }
.table-action.primary-action { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); color: var(--accent); }
.table-action.danger-action { color: var(--danger); }
.account-history-card { width: min(1320px, 100%); }
.account-history-card code {
  display: block;
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
  white-space: nowrap;
}


/* Account settings horizontal layout */
.accounts-table th:nth-child(9) {
  min-width: 560px;
}

.account-settings-layout {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(260px, 300px);
  gap: 18px;
  align-items: start;
}

.account-settings-layout .account-config {
  min-width: 0;
}

.account-settings-layout .account-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 0;
  max-width: none;
}

.account-settings-layout .account-actions .table-action {
  width: 100%;
  margin-top: 0;
  white-space: nowrap;
}

.account-settings-layout .account-actions .run-action,
.account-settings-layout .account-actions [data-stop-account] {
  grid-column: 1 / -1;
}
/* Accounts layout: bottom horizontal actions */
.accounts-table {
  min-width: 1380px;
}

.accounts-table th:nth-child(9) {
  min-width: 210px;
}

.account-settings-layout {
  display: block;
}

.account-data-row > td {
  border-bottom: 0;
}

.account-actions-row > td {
  padding-top: 0;
  border-top: 0;
}

.account-actions-row .account-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  width: 100%;
  max-width: none;
  margin-top: 0;
  padding: 10px 0 4px;
}

.account-actions-row .table-action {
  min-height: 34px;
  margin-top: 0;
  white-space: nowrap;
}

.account-actions-row [data-pause-account],
.account-actions-row [data-resume-account],
.account-actions-row [data-enable-account] {
  margin-left: auto;
}

html[data-theme="light"] .account-actions-row .table-action {
  color: #3f4352;
  background: #ffffff;
  border-color: #d9dce6;
  box-shadow: 0 1px 2px rgba(32, 38, 55, .05);
}

html[data-theme="light"] .account-actions-row .primary-action {
  color: #5d35c6;
  background: #f1ecff;
  border-color: #cfc0f5;
}

html[data-theme="light"] .account-actions-row .danger-action {
  color: #c83745;
  background: #fff5f6;
  border-color: #f0c7cc;
}

html[data-theme="light"] .account-actions-row .table-action:disabled {
  color: #a5a8b3;
  background: #f3f4f7;
  border-color: #e5e6eb;
  opacity: 1;
}

/* Accounts responsive cards */
.runner-cell small {
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  body,
  .shell,
  .main,
  .content {
    min-width: 0;
    overflow-x: hidden;
  }

  .account-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .account-summary-grid .compact-stat:last-child {
    grid-column: 1 / -1;
  }

  .account-summary-grid .compact-stat {
    min-width: 0;
    min-height: 78px;
    padding: 13px;
  }

  .accounts-table-panel {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .accounts-table-panel .panel-head {
    padding: 14px 2px 8px;
  }

  .accounts-table-panel .table-scroll {
    overflow: visible;
  }

  .accounts-table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .accounts-table thead {
    display: none;
  }

  .accounts-table tbody {
    display: block;
  }

  .accounts-table .account-data-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 13px;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    background: var(--panel);
  }

  .accounts-table .account-data-row > td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    white-space: normal;
  }
}
@media (max-width: 640px) {
  .accounts-table .account-data-row > td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }

  .accounts-table .account-data-row > td:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .accounts-table .account-data-row > td:nth-child(2),
  .accounts-table .account-data-row > td:nth-child(4),
  .accounts-table .account-data-row > td:nth-child(8),
  .accounts-table .account-data-row > td:nth-child(9) {
    grid-column: 1 / -1;
  }

  .accounts-table .technical-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .accounts-table .technical-chip {
    display: grid;
    justify-content: start;
    gap: 5px;
    min-width: 0;
    padding: 9px 8px;
  }

  .accounts-table .technical-chip span,
  .accounts-table .technical-chip strong {
    overflow-wrap: anywhere;
  }

  .accounts-table .account-data-row > td:nth-child(5),
  .accounts-table .account-data-row > td:nth-child(6),
  .accounts-table .account-data-row > td:nth-child(7),
  .accounts-table .account-data-row > td:nth-child(8),
  .accounts-table .account-data-row > td:nth-child(9) {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-strong);
  }

  .accounts-table .account-data-row > td:nth-child(5)::before,
  .accounts-table .account-data-row > td:nth-child(6)::before,
  .accounts-table .account-data-row > td:nth-child(7)::before,
  .accounts-table .account-data-row > td:nth-child(8)::before,
  .accounts-table .account-data-row > td:nth-child(9)::before {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
  }

  .accounts-table .account-data-row > td:nth-child(5)::before {
    content: "Последняя активность";
  }

  .accounts-table .account-data-row > td:nth-child(6)::before {
    content: "Квота сегодня";
  }

  .accounts-table .account-data-row > td:nth-child(7)::before {
    content: "Результаты";
  }

  .accounts-table .account-data-row > td:nth-child(8)::before {
    content: "Автоматизация";
  }

  .accounts-table .account-data-row > td:nth-child(9)::before {
    content: "Настройки";
  }

  .accounts-table .runner-cell {
    min-width: 0;
  }

  .accounts-table .account-actions-row {
    display: block;
    width: 100%;
    margin-bottom: 10px;
  }

  .accounts-table .account-actions-row > td {
    display: block;
    width: 100%;
    padding: 0 13px 13px;
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 16px 16px;
    background: var(--panel);
  }

  .account-actions-row .account-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding-top: 11px;
    border-top: 1px solid var(--line);
  }

  .account-actions-row .table-action {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 6px 8px;
    white-space: normal;
    line-height: 1.25;
  }

  .account-actions-row [data-pause-account],
  .account-actions-row [data-resume-account],
  .account-actions-row [data-enable-account] {
    margin-left: 0;
  }
}

/* Leads Core 0.5.3 */
.leads-page-head { align-items: center; }

.leads-metric-grid {
  margin-bottom: 14px;
}

.lead-filters {
  grid-template-columns: minmax(220px, 1.6fr) repeat(5, minmax(130px, 1fr)) auto auto;
  align-items: end;
}

.lead-search-field {
  min-width: 220px;
}

.leads-table-panel {
  margin-top: 0;
}

.leads-table-panel table {
  min-width: 1320px;
}

.leads-table-panel td {
  vertical-align: middle;
}

.lead-person {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 220px;
}

.lead-person > span:last-child,
.lead-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.lead-person strong,
.lead-meta strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  white-space: normal;
}

.lead-person small,
.lead-meta small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  white-space: normal;
}

.lead-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
}

.lead-source,
.lead-state {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

.lead-source.application {
  border-color: color-mix(in srgb, var(--success) 34%, var(--line));
  background: color-mix(in srgb, var(--success) 10%, var(--panel));
  color: var(--success);
}

.lead-source.recommended {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
}

.lead-state.success {
  border-color: color-mix(in srgb, var(--success) 32%, var(--line));
  color: var(--success);
}

.lead-state.warning {
  border-color: color-mix(in srgb, var(--warning) 35%, var(--line));
  color: var(--warning);
}

.lead-state.muted {
  color: var(--muted);
}

.lead-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: max-content;
}

.lead-actions .table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  text-decoration: none;
  white-space: nowrap;
}

.lead-link.primary-action {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  color: var(--accent);
}

.lead-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.lead-pagination > div {
  display: flex;
  gap: 8px;
}

.lead-pagination .ghost-button {
  min-height: 34px;
  padding: 0 13px;
}

.lead-pagination button:disabled {
  opacity: .45;
  cursor: default;
}

.leads-mobile-list {
  display: none;
}

.lead-detail-card {
  width: min(880px, 100%);
}

.lead-detail-subtitle {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.lead-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.lead-detail-summary > div,
.lead-detail-grid > div {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
}

.lead-detail-summary span,
.lead-detail-grid > div > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.lead-detail-summary strong,
.lead-detail-grid strong {
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.45;
}

.lead-detail-section {
  margin-top: 17px;
}

.lead-detail-section h3 {
  margin: 0 0 10px;
  font-size: 13px;
}

.lead-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.lead-detail-wide {
  grid-column: 1 / -1;
}

.lead-detail-links {
  display: grid;
  gap: 6px;
}

.lead-detail-links a,
.lead-detail-links span {
  color: var(--text);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.lead-detail-links a {
  color: var(--accent);
  text-decoration: none;
}

.lead-detail-links a:hover {
  text-decoration: underline;
}

.lead-detail-empty {
  color: var(--muted);
  font-size: 11px;
}

.lead-experience-summary {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 11px;
}

.lead-experience {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
  font-size: 12px;
  line-height: 1.7;
}

.lead-detail-actions {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.lead-modal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  text-decoration: none;
}

@media (max-width: 1450px) {
  .lead-filters {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }

  .lead-search-field {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .lead-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lead-search-field {
    grid-column: 1 / -1;
  }

  .leads-desktop-table {
    display: none;
  }

  .leads-mobile-list {
    display: grid;
    gap: 11px;
    padding: 0 14px 14px;
  }

  .lead-mobile-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--panel-strong);
  }

  .lead-mobile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--line);
  }

  .lead-mobile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 13px 0;
  }

  .lead-mobile-grid > div {
    display: grid;
    gap: 5px;
    min-width: 0;
  }

  .lead-mobile-grid span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
  }

  .lead-mobile-grid strong {
    overflow-wrap: anywhere;
    font-size: 11px;
    line-height: 1.45;
  }

  .lead-mobile-grid .lead-state {
    margin-right: 4px;
  }

  .lead-mobile-card .lead-actions {
    flex-wrap: wrap;
  }

  .lead-mobile-card .lead-actions > * {
    flex: 1 1 auto;
  }

  .lead-detail-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .lead-filters {
    grid-template-columns: 1fr;
  }

  .lead-search-field {
    grid-column: auto;
  }

  .lead-filters .filter-button,
  .lead-filters .ghost-button {
    width: 100%;
  }

  .leads-mobile-list {
    padding: 0 10px 10px;
  }

  .lead-mobile-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .lead-mobile-grid {
    grid-template-columns: 1fr;
  }

  .lead-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .lead-pagination > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .lead-detail-summary,
  .lead-detail-grid {
    grid-template-columns: 1fr;
  }

  .lead-detail-wide {
    grid-column: auto;
  }

  .lead-detail-actions {
    flex-direction: column-reverse;
  }

  .lead-detail-actions a {
    width: 100%;
  }
}

/* ===== Recruiters and flexible RBAC ===== */

.recruiters-page-head .page-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.recruiters-metric-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.recruiter-filters {
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(150px, 1fr)) auto auto;
}

.recruiter-search-field {
  min-width: 0;
}

.recruiters-table-panel table {
  min-width: 1240px;
}

.recruiter-person {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 210px;
}

.recruiter-person > span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.recruiter-person strong,
.recruiter-person small {
  overflow-wrap: anywhere;
}

.recruiter-person small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.recruiter-person em {
  color: var(--warning);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.recruiter-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
}

.recruiter-role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 150px;
}

.recruiter-role {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.recruiter-role.system {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  color: var(--accent);
}

.recruiter-empty {
  color: var(--muted);
  font-size: 10px;
}

.recruiter-status,
.recruitment-access {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.recruiter-status span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.recruiter-status.active,
.recruitment-access.enabled {
  border-color: color-mix(in srgb, var(--success) 45%, var(--line));
  color: var(--success);
}

.recruiter-status.suspended {
  border-color: color-mix(in srgb, var(--warning) 45%, var(--line));
  color: var(--warning);
}

.recruiter-status.disabled,
.recruitment-access.disabled {
  color: var(--muted);
}

.recruiter-meta {
  display: grid;
  gap: 4px;
  min-width: 130px;
}

.recruiter-meta strong {
  overflow-wrap: anywhere;
  font-size: 11px;
}

.recruiter-meta small {
  color: var(--muted);
  font-size: 9px;
}

.recruiter-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 215px;
}

.recruiter-actions .danger-action {
  color: var(--danger);
}

.owner-protected {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.recruiters-mobile-list {
  display: none;
}

.recruiter-modal-card {
  width: min(840px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.recruiter-password-card {
  width: min(520px, calc(100vw - 32px));
}

.recruiter-access-toggle-field {
  align-self: end;
}

.recruiter-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  cursor: pointer;
}

.recruiter-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.recruiter-switch > span {
  position: relative;
  flex: 0 0 40px;
  width: 40px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  transition: .18s ease;
}

.recruiter-switch > span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: .18s ease;
}

.recruiter-switch input:checked + span {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--panel-strong));
}

.recruiter-switch input:checked + span::after {
  left: 21px;
  background: var(--accent);
}

.recruiter-switch input:disabled + span {
  opacity: .55;
  cursor: not-allowed;
}

.recruiter-switch strong {
  font-size: 11px;
}

.recruiter-checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}

.recruiter-role-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 7px;
}

.recruiter-role-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
  cursor: pointer;
}

.recruiter-role-option input {
  margin-top: 2px;
}

.recruiter-role-option span {
  display: grid;
  gap: 3px;
}

.recruiter-role-option strong {
  font-size: 11px;
}

.recruiter-role-option small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.access-roles-card {
  width: min(940px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.access-roles-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 17px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel-strong);
}

.access-roles-toolbar > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.access-roles-toolbar strong {
  font-size: 12px;
}

.access-roles-toolbar span {
  color: var(--muted);
  font-size: 10px;
}

.access-role-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.access-role-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel-strong);
}

.access-role-card.inactive {
  opacity: .62;
}

.access-role-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.access-role-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.access-role-title-row h3 {
  margin: 0;
  font-size: 13px;
}

.access-role-card code,
.permission-row code {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
}

.access-role-card p {
  min-height: 34px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.access-role-kind {
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.access-role-kind.system {
  color: var(--accent);
}

.access-role-kind.custom {
  color: var(--success);
}

.access-role-kind.inactive {
  color: var(--muted);
}

.access-role-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.access-role-meta strong {
  color: var(--text);
}

.access-role-editor-card {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 24px);
  overflow: auto;
}

.access-role-form-grid {
  margin-bottom: 18px;
}

.permission-editor {
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.permission-editor-head {
  margin-bottom: 13px;
}

.permission-editor-head h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.permission-editor-head p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.permission-category {
  margin-top: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.permission-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong);
}

.permission-category-head h3 {
  margin: 0;
  font-size: 12px;
}

.permission-category-head span {
  color: var(--muted);
  font-size: 9px;
}

.permission-list {
  display: grid;
}

.permission-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  align-items: center;
  gap: 14px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}

.permission-row:last-child {
  border-bottom: 0;
}

.permission-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  cursor: pointer;
}

.permission-checkbox input {
  margin-top: 3px;
}

.permission-checkbox span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.permission-checkbox strong {
  font-size: 11px;
}

.permission-checkbox small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.permission-row select {
  width: 100%;
}

.recruiter-password-warning {
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--warning) 40%, var(--line));
  border-radius: 10px;
  color: var(--warning);
  font-size: 9px;
  font-weight: 800;
}

@media (max-width: 1450px) {
  .recruiters-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .recruiter-filters {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }

  .recruiter-search-field {
    grid-column: span 2;
  }
}

@media (max-width: 1000px) {
  .access-role-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .recruiters-page-head {
    align-items: stretch;
  }

  .recruiters-page-head .page-head-actions {
    width: 100%;
  }

  .recruiters-page-head .page-head-actions > * {
    flex: 1 1 auto;
  }

  .recruiters-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recruiter-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recruiter-search-field {
    grid-column: 1 / -1;
  }

  .recruiters-desktop-table {
    display: none;
  }

  .recruiters-mobile-list {
    display: grid;
    gap: 11px;
    padding: 0 14px 14px;
  }

  .recruiter-mobile-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--panel-strong);
  }

  .recruiter-mobile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
  }

  .recruiter-mobile-roles {
    padding: 12px 0;
  }

  .recruiter-mobile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-bottom: 13px;
  }

  .recruiter-mobile-grid > div {
    display: grid;
    gap: 4px;
    min-width: 0;
  }

  .recruiter-mobile-grid span {
    color: var(--muted);
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
  }

  .recruiter-mobile-grid strong {
    overflow-wrap: anywhere;
    font-size: 10px;
    line-height: 1.45;
  }

  .recruiter-mobile-card .recruiter-actions {
    min-width: 0;
  }

  .recruiter-mobile-card .recruiter-actions button {
    flex: 1 1 calc(33.333% - 6px);
  }

  .permission-row {
    grid-template-columns: 1fr;
  }

  .permission-row select {
    margin-left: 25px;
    width: calc(100% - 25px);
  }
}

@media (max-width: 640px) {
  .recruiters-page-head .page-head-actions {
    flex-direction: column;
  }

  .recruiters-page-head .page-head-actions > * {
    width: 100%;
  }

  .recruiters-metric-grid,
  .recruiter-filters,
  .recruiter-role-picker,
  .recruiter-mobile-grid {
    grid-template-columns: 1fr;
  }

  .recruiter-search-field {
    grid-column: auto;
  }

  .recruiter-filters .filter-button,
  .recruiter-filters .ghost-button {
    width: 100%;
  }

  .recruiters-mobile-list {
    padding: 0 10px 10px;
  }

  .recruiter-mobile-head {
    flex-direction: column;
  }

  .recruiter-mobile-card .recruiter-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .recruiter-mobile-card .recruiter-actions button,
  .recruiter-mobile-card .owner-protected {
    width: 100%;
  }

  .access-roles-toolbar,
  .access-role-card-head,
  .access-role-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .access-roles-toolbar .page-action,
  .access-role-card-head .table-action {
    width: 100%;
  }

  .permission-row select {
    margin-left: 0;
    width: 100%;
  }
}

/* Recruitment RBAC permission layout fixes */

.permission-row {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  align-items: stretch;
  gap: 18px;
  padding: 15px 16px;
}

.permission-checkbox {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: stretch;
  gap: 11px;
  min-width: 0;
}

.permission-check-control {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-width: 34px !important;
  min-height: 100%;
  border-right: 1px solid var(--line);
}

.permission-check-control input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.permission-copy {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
}

.permission-copy strong {
  font-size: 11px;
  line-height: 1.35;
}

.permission-copy small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.permission-copy code {
  margin-top: 2px;
}

.permission-scope-field {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
}

.permission-scope-field > label {
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.permission-scope-field select {
  width: 100%;
  margin: 0;
}

.permission-scope-description {
  display: block;
  min-height: 42px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.permission-row:has(input:not(:checked)) .permission-scope-field {
  opacity: .55;
}

@media (max-width: 900px) {
  .permission-row {
    grid-template-columns: 1fr;
  }

  .permission-scope-field {
    margin-left: 45px;
  }

  .permission-row select {
    width: 100%;
    margin: 0;
  }
}

@media (max-width: 640px) {
  .permission-checkbox {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .permission-check-control {
    min-width: 30px !important;
  }

  .permission-scope-field {
    margin-left: 0;
  }
}

/* System Pilot 0.1.0 */
.system-page {
  display: grid;
  gap: 14px;
}

.system-page-head {
  align-items: center;
  margin-bottom: 10px;
}

.system-page-head .page-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.system-metric-grid {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
}

.system-metric-grid .metric-hint {
  display: flex;
  align-items: center;
  min-height: 28px;
}

.system-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 14px;
}

.system-panel {
  margin: 0;
  overflow: hidden;
}

.system-panel .panel-head {
  align-items: flex-start;
}

.system-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  min-height: 27px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

.system-state > span {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: currentColor;
}

.system-state.success {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 34%, var(--line));
  background: color-mix(in srgb, var(--success) 8%, var(--panel));
}

.system-state.warning {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 36%, var(--line));
  background: color-mix(in srgb, var(--warning) 8%, var(--panel));
}

.system-state.error {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 36%, var(--line));
  background: color-mix(in srgb, var(--danger) 8%, var(--panel));
}

.system-state.muted {
  color: var(--muted);
}

.system-table {
  min-width: 820px;
}

.system-table td {
  vertical-align: middle;
}

.system-primary-cell {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.system-primary-cell strong {
  color: var(--text);
  font-size: 12px;
  white-space: normal;
}

.system-primary-cell small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  white-space: normal;
}

.system-table code,
.system-result-table code {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.system-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}

.system-detail-item {
  display: grid;
  gap: 8px;
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel-strong);
}

.system-detail-item span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.system-detail-item strong {
  color: var(--text);
  font-size: 17px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.system-note {
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.system-integration-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.system-integration-card {
  display: grid;
  align-content: space-between;
  gap: 14px;
  min-height: 174px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel-strong);
}

.system-integration-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.system-integration-head > div {
  display: grid;
  gap: 5px;
}

.system-integration-head strong {
  font-size: 14px;
}

.system-integration-head small,
.system-integration-card p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.system-integration-card p {
  margin: 0;
}

.system-integration-card .ghost-button {
  width: max-content;
}

.system-result-table {
  margin: 16px -18px -18px;
  border-top: 1px solid var(--line);
}

.system-result-table table {
  min-width: 760px;
}

.system-errors-panel {
  margin-top: 0;
}

.system-errors-table {
  min-width: 980px;
}

@media (max-width: 1280px) {
  .system-metric-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .system-main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .system-page-head {
    align-items: stretch;
  }

  .system-page-head .page-head-actions,
  .system-page-head .page-head-actions > * {
    width: 100%;
  }

  .system-page-head .status-pill,
  .system-page-head .page-action {
    justify-content: center;
  }

  .system-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-integration-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .system-metric-grid {
    grid-template-columns: 1fr;
  }

  .system-metric-grid .metric-card {
    min-height: 108px;
  }

  .system-detail-grid {
    grid-template-columns: 1fr;
  }

  .system-integration-head {
    flex-direction: column;
  }

  .system-integration-card .ghost-button {
    width: 100%;
  }
}

/* Schedule batch details */
.schedule-batches-table {
  min-width: 1080px;
}

.schedule-batch-row > td {
  vertical-align: middle;
}

.schedule-batch-row .table-action {
  margin-top: 0;
}

.schedule-current-account {
  margin-top: 4px;
}

.schedule-batch-detail-row > td {
  padding: 0;
  white-space: normal;
  background: color-mix(in srgb, var(--panel-strong) 72%, transparent);
}

.schedule-batch-detail {
  padding: 14px 18px 18px;
}

.schedule-batch-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.schedule-items-table {
  min-width: 1100px;
  border: 1px solid var(--line);
}

.schedule-items-table th,
.schedule-items-table td {
  padding: 10px 12px;
}

.schedule-items-table td {
  vertical-align: top;
}

.schedule-result-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 360px;
}

.schedule-result-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.schedule-item-error {
  max-width: 360px;
  margin-top: 7px;
  color: var(--danger);
  font-size: 10px;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 820px) {
  .schedule-batch-detail-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .schedule-batch-detail {
    padding: 12px;
  }
}

@media (max-width: 520px) {
  .schedule-batch-detail {
    padding: 10px 8px 12px;
  }
}
