/* AIFix — панель управления. Стиль по утверждённому макету ProjectAIfor1C (Figma) */
:root {
  --bg: #f4f6fa; --surface: #ffffff; --surface-2: #f8f9fc; --text: #182035; --muted: #697189; --line: #e6e9f0;
  --primary: #5b5ce2; --primary-dark: #4546c6; --primary-soft: #eeefff;
  --green: #149f6e; --green-soft: #e8f8f1; --red: #d84c5b; --red-soft: #fff0f1; --amber: #c58213; --amber-soft: #fff7e5;
  --violet: #8a58d6; --violet-soft: #f1ebfb; --blue: #3975d7; --blue-soft: #eaf2ff;
  --shadow: 0 6px 22px rgba(33, 42, 74, 0.06); --radius: 14px; --sidebar: #171d2e;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg:#10131d; --surface:#191e2b; --surface-2:#202635; --text:#eef1f7; --muted:#9ca5ba; --line:#2c3446;
  --primary-soft:#2b2c56; --green-soft:#153c32; --red-soft:#42262c; --amber-soft:#42361e; --violet-soft:#33284a; --blue-soft:#1d2d4a;
  --shadow:0 6px 22px rgba(0,0,0,.2); color-scheme: dark;
}
* { box-sizing: border-box; }
html { font-size: 14px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Manrope", system-ui, sans-serif; line-height: 1.45; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.icon { flex: 0 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }

/* Брендинг */
.brand-mark { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; color: #fff; background: linear-gradient(135deg,#7778f5,#4e4fc9); font-weight: 800; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.brand-mark.large { width: 46px; height: 46px; border-radius: 13px; font-size: 21px; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #33cf8e; display: inline-block; box-shadow: 0 0 0 4px rgba(51,207,142,.12); }

/* Каркас */
.admin-shell { min-height: 100vh; display: flex; }
.sidebar { width: 240px; background: var(--sidebar); color: #aeb7cb; padding: 22px 14px 14px; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 26px; color: #fff; }
.brand .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
.brand div { display: flex; flex-direction: column; }
.brand strong { font-size: 16px; letter-spacing: -.01em; }
.brand small { font-size: 11px; color: #858ea4; margin-top: 1px; }
.sidebar nav { display: flex; flex-direction: column; gap: 5px; }
.sidebar nav a { height: 44px; padding: 0 12px; border-radius: 10px; color: #a6afc2; display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; }
.sidebar nav a:hover { color: #fff; background: rgba(255,255,255,.04); }
.sidebar nav a.active { background: linear-gradient(90deg,rgba(103,104,236,.24),rgba(103,104,236,.1)); color: #fff; box-shadow: inset 3px 0 #7375ef; }
.sidebar nav a span { flex: 1; }
.sidebar nav a small { color: #707a90; font-size: 12px; }
.nav-alert { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #e75865; color: #fff; font-size: 11px; font-style: normal; display: grid; place-items: center; }
.sidebar-help { margin-top: auto; background: linear-gradient(145deg,#252d44,#1e2538); border: 1px solid #303950; padding: 14px; border-radius: 12px; font-size: 12px; }
.sidebar-help strong { color: #fff; font-size: 13px; display: block; }
.sidebar-help p { margin: 4px 0 0; color: #7f899e; }
.profile { margin-top: 12px; padding: 12px 6px 0; border-top: 1px solid #293044; color: #fff; display: flex; align-items: center; gap: 9px; }
.profile > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.profile strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile small { font-size: 11px; color: #818ba1; margin-top: 2px; }
.profile form { margin: 0; }
.profile button { border: 0; background: none; color: #818ba1; padding: 4px; border-radius: 6px; }
.profile button:hover { color: #fff; }
.avatar { width: 32px; height: 32px; border-radius: 10px; background: #e8e9ff; color: #5557ca; display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; flex: 0 0 auto; }
.avatar.tiny { width: 28px; height: 28px; border-radius: 50%; margin-right: 10px; font-size: 11px; }
.admin-main { margin-left: 240px; width: calc(100% - 240px); min-width: 0; }
.admin-header { height: 62px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 9; }
.breadcrumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.breadcrumbs strong { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-actions > button, .header-actions > a.hbtn { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); display: grid; place-items: center; position: relative; }
.hbtn i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #e85764; top: 8px; right: 8px; border: 1px solid var(--surface); }
.role-chip { border-left: 1px solid var(--line); padding-left: 12px; margin-left: 4px; font-size: 12px; color: var(--muted); }
.role-chip strong { color: var(--text); }
.content { padding: 28px 30px 48px; max-width: 1500px; margin: auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-heading h1 { font-size: 28px; line-height: 1.15; margin: 4px 0 6px; letter-spacing: -.03em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.page-heading .actions { display: flex; gap: 8px; }
.eyebrow { color: var(--primary) !important; font-size: 11px !important; letter-spacing: .14em; font-weight: 800; margin: 0; text-transform: uppercase; }

/* Кнопки */
.btn { border: 0; border-radius: 10px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 700; white-space: nowrap; text-decoration: none; line-height: 1.2; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(91,92,226,.2); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn-secondary:hover { border-color: #c4c6f2; }
.btn-danger { background: var(--red-soft); color: var(--red); border: 1px solid rgba(216,76,91,.25); }
.btn-success { background: var(--green-soft); color: var(--green); border: 1px solid rgba(20,159,110,.25); }
.btn-sm { padding: 7px 11px; font-size: 12px; border-radius: 8px; }
.btn.full { width: 100%; padding: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { border: 0; background: none; color: var(--primary); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; padding: 0; }
.inline-form { display: inline; margin: 0; }

/* Метрики */
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; color: var(--text); }
a.metric-card:hover { border-color: #bec0f5; }
.metric-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); grid-row: 1/3; }
.metric-icon.green, .event-icon.green { background: var(--green-soft); color: var(--green); }
.metric-icon.red, .event-icon.red { background: var(--red-soft); color: var(--red); }
.metric-icon.amber, .event-icon.amber { background: var(--amber-soft); color: var(--amber); }
.metric-icon.violet, .event-icon.violet { background: var(--violet-soft); color: var(--violet); }
.metric-icon.blue, .event-icon.blue { background: var(--blue-soft); color: var(--blue); }
.event-icon.gray { background: var(--surface-2); color: var(--muted); }
.metric-label { color: var(--muted); font-size: 12px; padding-top: 1px; }
.metric-value { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.metric-note { grid-column: 1/3; font-size: 12px; color: var(--muted); margin-top: 12px; }
.metric-note.green { color: var(--green); } .metric-note.red { color: var(--red); } .metric-note.amber { color: var(--amber); } .metric-note.violet { color: var(--violet); }

/* Панели */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.panel + .panel { margin-top: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.panel h2 { font-size: 16px; margin: 0 0 3px; }
.panel h3 { font-size: 14px; margin: 18px 0 10px; }
.panel-head p { margin: 0; color: var(--muted); font-size: 12px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(320px,1fr); gap: 16px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.legend-blue { background: var(--primary); } .legend-violet { background: #bb91eb; }
.chart { position: relative; height: 240px; margin-top: 6px; }
.chart svg { width: 100%; height: 210px; display: block; overflow: visible; }
.chart-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 6px; }
.event-list { margin-top: 4px; }
.event { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.event:last-child { border: 0; }
.event-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.event strong { font-size: 13px; display: block; margin-bottom: 2px; }
.event p { font-size: 12px; color: var(--muted); margin: 0; }

/* Бейджи */
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 20px; padding: 4px 9px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--green-soft); color: var(--green); } .badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); } .badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-blue { background: var(--blue-soft); color: var(--blue); } .badge-gray { background: var(--surface-2); color: var(--muted); }

/* Подменю и вкладки */
.subnav { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.subnav a { padding: 0 2px 11px; color: var(--muted); font-size: 14px; font-weight: 600; position: relative; white-space: nowrap; }
.subnav a.active { color: var(--primary); }
.subnav a.active:after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary); }
.subnav span { margin-left: 6px; padding: 2px 7px; background: var(--surface-2); border-radius: 9px; font-size: 11px; }
.subnav .hot { background: var(--red-soft); color: var(--red); }
.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 0 14px 12px; color: var(--muted); font-size: 14px; font-weight: 600; position: relative; white-space: nowrap; }
.tabs a:first-child { padding-left: 0; }
.tabs a.active { color: var(--primary); }
.tabs a.active:after { content: ""; position: absolute; bottom: -1px; left: 12px; right: 12px; height: 2px; background: var(--primary); }
.tabs a:first-child.active:after { left: 0; }
.tabs .count { background: var(--red-soft); color: var(--red); padding: 1px 7px; border-radius: 9px; margin-left: 6px; font-size: 11px; }

/* Панель фильтров */
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.search-box { height: 40px; min-width: 260px; flex: 1; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: var(--muted); }
.search-box input { border: 0; outline: 0; background: transparent; color: var(--text); width: 100%; font-size: 14px; }
.toolbar select, .toolbar input[type=date] { height: 40px; padding: 0 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-size: 13px; }
.check-filter { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.view-toggle { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.view-toggle a { width: 40px; height: 38px; background: var(--surface); color: var(--muted); display: grid; place-items: center; }
.view-toggle a.active { background: var(--primary-soft); color: var(--primary); }

/* Карточки компаний */
.company-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.company-card { display: block; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 16px; color: var(--text); box-shadow: var(--shadow); transition: .18s ease; }
.company-card:hover { border-color: #bec0f5; transform: translateY(-2px); box-shadow: 0 10px 25px rgba(35,42,80,.09); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.company-monogram { width: 42px; height: 42px; border-radius: 12px; background: #e7e9ff; color: #5557ce; display: grid; place-items: center; font-size: 14px; font-weight: 800; flex: 0 0 auto; }
.company-monogram.c1 { background: #e1f6f0; color: #168965; } .company-monogram.c2 { background: #fff0de; color: #c07416; } .company-monogram.c3 { background: #f2e9fa; color: #8651b3; } .company-monogram.c4 { background: #ffe9ed; color: #cf4d61; } .company-monogram.c5 { background: #e5f4ff; color: #2776ad; }
.company-monogram.small { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
.card-name { margin: 12px 0; } .card-name h3 { font-size: 15px; margin: 0 0 4px; } .card-name p { font-size: 12px; color: var(--muted); margin: 0; }
.card-data { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); padding-top: 10px; }
.card-data span { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 2px; } .card-data strong { font-size: 13px; color: var(--text); }
.seat-bar { margin: 10px 0; height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; } .seat-bar i { display: block; height: 100%; background: var(--primary); }
.card-bottom { border-top: 1px solid var(--line); padding-top: 10px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.card-bottom span:nth-child(2) { margin-left: auto; } .card-bottom span:first-child { display: flex; align-items: center; gap: 5px; }
.card-bottom i { width: 6px; height: 6px; border-radius: 50%; background: #aeb4c2; display: inline-block; }
.card-bottom .is-online { color: var(--green); } .card-bottom .is-online i { background: var(--green); }

/* Таблицы */
.table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 12px; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.clickable { cursor: pointer; } table.data tr.clickable:hover td { background: var(--surface-2); }
.user-cell { display: flex; align-items: center; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .metric-icon { margin: 0 auto 10px; }

/* Заявки */
.request-list { display: flex; flex-direction: column; gap: 10px; }
.request-card { display: grid; grid-template-columns: 96px 1.4fr 1fr .7fr 100px auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); font-size: 13px; }
.request-code { font-family: ui-monospace, Consolas, monospace; color: var(--primary); font-weight: 800; }
.request-card strong { display: block; } .request-main p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.cell-label { display: block; color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.request-time { color: var(--muted); font-size: 12px; } .request-actions { display: flex; gap: 6px; }

/* Карточка компании */
.back-link { color: var(--muted); font-size: 13px; display: inline-block; margin-bottom: 16px; }
.company-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.company-title { flex: 1; min-width: 240px; } .company-title > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.company-title h1 { font-size: 24px; margin: 0; letter-spacing: -.02em; } .company-title p { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.online-label { font-size: 12px; color: var(--green); display: flex; gap: 6px; align-items: center; }
.offline-label { font-size: 12px; color: var(--muted); }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; align-items: start; }
.detail-grid > .panel + .panel { margin-top: 0; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 26px; margin-top: 14px; }
.info-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; } .info-item span { color: var(--muted); font-size: 12px; } .info-item strong { font-size: 14px; word-break: break-word; }
.health-score { margin-top: 10px; } .health-score span { font-size: 34px; font-weight: 800; color: var(--green); } .health-score small { font-size: 13px; color: var(--muted); }
.health-row { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 10px 0; font-size: 13px; } .health-row span { color: var(--muted); }
.mini-bars { height: 110px; display: flex; gap: 14px; align-items: flex-end; margin-top: 10px; }
.mini-bars div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.mini-bars i { display: block; width: 100%; background: linear-gradient(var(--primary),#9d9eee); border-radius: 5px 5px 2px 2px; min-height: 2px; }
.mini-bars span { font-size: 11px; color: var(--muted); }
.license-key { display: flex; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; margin: 16px 0; padding: 12px 14px; gap: 12px; flex-wrap: wrap; }
.license-key code { flex: 1; font-size: 16px; letter-spacing: .1em; }
.license-key button { border: 0; background: none; color: var(--primary); font-size: 13px; font-weight: 600; display: inline-flex; gap: 5px; align-items: center; }
.license-actions { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.org-item { display: flex; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.org-item:last-child { border: 0; } .org-item strong { font-size: 13px; } .org-item p { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.usage-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 16px; }
.usage-head p { font-size: 12px; color: var(--muted); margin: 3px 0; }
.usage-head > div:last-child { text-align: right; font-size: 12px; } .usage-head > div:last-child strong { font-size: 18px; }
.progress { width: 170px; height: 5px; background: var(--line); border-radius: 4px; margin-top: 6px; overflow: hidden; margin-left: auto; } .progress i { display: block; height: 100%; background: var(--primary); }
.notice { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; }
.notice > div { flex: 1; } .notice strong { font-size: 13px; } .notice p { font-size: 12px; margin: 2px 0 0; }
.amber-notice { background: var(--amber-soft); color: var(--amber); } .red-notice { background: var(--red-soft); color: var(--red); }
.green-notice { background: var(--green-soft); color: var(--green); } .blue-notice { background: var(--primary-soft); color: var(--primary); }
.key-reveal { font-size: 20px; letter-spacing: .12em; font-weight: 800; color: var(--text); padding: 8px 0; user-select: all; }

/* Ошибки и обращения */
.issue { display: flex; gap: 12px; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid var(--line); }
.issue:last-child { border: 0; }
.issue-mark { width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-top: 6px; flex: 0 0 auto; } .issue-mark.open { background: var(--red); } .issue-mark.progress { background: var(--amber); }
.issue-main { flex: 1; min-width: 0; } .issue-main > div { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.issue-main code { font-size: 12px; color: var(--red); } .issue-main strong { font-size: 14px; }
.issue-main p { font-size: 12px; color: var(--muted); margin: 3px 0; }
.issue details { margin-top: 8px; font-size: 13px; } .issue summary { color: var(--primary); cursor: pointer; }
.issue pre, pre.code { padding: 10px; background: var(--surface-2); color: var(--muted); font-size: 12px; border-radius: 8px; white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; }
.comment-box { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-top: 6px; }

/* Журнал */
.timeline-row { display: grid; grid-template-columns: 82px 36px 1fr 190px 110px; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.timeline-row:last-child { border: 0; }
.timeline-time { display: flex; flex-direction: column; color: var(--muted); font-size: 12px; } .timeline-time small { font-size: 12px; margin-top: 2px; }
.timeline-row strong { font-size: 13px; } .timeline-row p { font-size: 12px; color: var(--muted); margin: 3px 0 0; } .timeline-row code { font-size: 12px; color: var(--muted); word-break: break-all; }
.unauth-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.unauth-row:last-child { border: 0; } .unauth-row > div { flex: 1; min-width: 240px; } .unauth-row strong { font-size: 14px; } .unauth-row p { font-size: 12px; color: var(--muted); margin: 3px 0 0; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 13px; color: var(--muted); }

/* Настройки */
.settings-layout { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 3px; }
.settings-nav a { display: flex; justify-content: space-between; align-items: center; color: var(--muted); padding: 11px 12px; border-radius: 9px; font-size: 14px; }
.settings-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.person { display: grid; grid-template-columns: 34px 1fr 140px 140px auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border: 0; } .person strong { font-size: 14px; } .person p { font-size: 12px; color: var(--muted); margin: 2px 0; }
.twofa { display: flex; align-items: center; gap: 5px; color: var(--green); font-size: 12px; } .twofa.off { color: var(--amber); }

/* Формы */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; margin-bottom: 12px; }
.form-grid .field { margin-bottom: 0; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); color: var(--text); font-size: 14px; width: 100%; }
.field textarea { min-height: 110px; resize: vertical; font-family: inherit; }
.field textarea.tall { min-height: 360px; font-size: 13px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.field small { color: var(--muted); font-size: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.form-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

/* Модальные окна */
.modal-wrap { position: fixed; inset: 0; background: rgba(10,14,24,.62); backdrop-filter: blur(3px); z-index: 50; display: none; place-items: center; padding: 16px; }
.modal-wrap.open { display: grid; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 18px; padding: 26px; box-shadow: 0 25px 80px rgba(0,0,0,.3); position: relative; }
.modal h2 { margin: 0 0 6px; font-size: 20px; } .modal > p { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.modal-close { position: absolute; right: 14px; top: 10px; background: none; border: 0; color: var(--muted); font-size: 24px; }

/* Флеш-сообщения */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.flash-success { background: var(--green-soft); color: var(--green); } .flash-error { background: var(--red-soft); color: var(--red); }
.flash-warning { background: var(--amber-soft); color: var(--amber); } .flash-info { background: var(--primary-soft); color: var(--primary); }

/* Вход */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 20% -10%, rgba(91,92,226,.18), transparent), var(--bg); }
.auth-modal { width: min(420px, 100%); background: var(--surface); border-radius: 18px; padding: 32px; box-shadow: 0 25px 80px rgba(20,25,50,.15); text-align: center; border: 1px solid var(--line); }
.auth-modal > .brand-mark { margin: auto; }
.auth-modal .eyebrow { margin: 16px 0 6px; }
.auth-modal h2 { font-size: 22px; margin: 0 0 6px; } .auth-modal > p { font-size: 13px; color: var(--muted); margin: 0 0 22px; }
.otp-input { width: 100%; text-align: center; letter-spacing: .5em; font-size: 26px !important; font-weight: 700; padding: 12px !important; }
.auth-security { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 12px; font-size: 12px; color: var(--muted); }
.qr-box { display: grid; place-items: center; padding: 14px; background: #fff; border-radius: 12px; border: 1px solid var(--line); margin: 0 auto 14px; width: 220px; height: 220px; }
.secret-box { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--surface-2); padding: 10px; border-radius: 8px; word-break: break-all; margin-bottom: 14px; user-select: all; }
.codes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; font-family: ui-monospace, Consolas, monospace; font-size: 15px; }
.codes-grid span { background: var(--surface-2); padding: 8px; border-radius: 8px; }

@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2,1fr); } .company-grid { grid-template-columns: repeat(2,1fr); }
  .dashboard-grid, .detail-grid { grid-template-columns: 1fr; }
  .request-card { grid-template-columns: 90px 1fr 1fr; }
  .timeline-row { grid-template-columns: 70px 34px 1fr; } .timeline-row code, .timeline-row .badge { display: none; }
}
@media (max-width: 760px) {
  .sidebar { width: 62px; padding: 16px 8px; }
  .brand div, .sidebar nav span, .sidebar nav small, .sidebar-help, .profile > span:nth-child(2) { display: none; }
  .brand { padding: 0 5px 20px; } .sidebar nav a { justify-content: center; padding: 0; } .profile { flex-direction: column; }
  .admin-main { margin-left: 62px; width: calc(100% - 62px); }
  .content { padding: 18px 16px; } .metrics, .company-grid { grid-template-columns: 1fr; }
  .page-heading { flex-direction: column; align-items: flex-start; } .admin-header { padding: 0 16px; } .role-chip { display: none; }
  .search-box { min-width: 100%; } .request-card { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; } .settings-nav { flex-direction: row; overflow: auto; } .settings-nav a { white-space: nowrap; }
  .form-grid, .info-grid { grid-template-columns: 1fr; } .person { grid-template-columns: 34px 1fr; } .person > :nth-child(n+3) { grid-column: 2; }
}
.dashboard-grid > .panel, .detail-grid > .panel, .detail-grid > div > .panel:first-child { margin-top: 0; }
.timeline-row .badge, td .badge { justify-self: start; }
