/* Управление секциями — стили web-приложения (авторизация, панель владельца/администратора, UI-кит). */
:root {
  --accent: #2f6fed;
  --accent-600: #2459c9;
  --accent-50: #eef3fe;
  --accent-100: #dce6fd;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-2: #cbd5e1;
  --hover: #f1f5f9;
  --green: #16a34a; --green-bg: #e8f7ee; --green-tx: #15803d;
  --red: #dc2626; --red-bg: #fdecec; --red-tx: #b91c1c;
  --yellow: #d97706; --yellow-bg: #fef4e2; --yellow-tx: #a16207;
  --blue: #2f6fed; --blue-bg: #eaf1fe; --blue-tx: #1d4ed8;
  --purple: #7c3aed; --purple-bg: #f1ebfe; --purple-tx: #6d28d9;
  --orange: #ea580c; --orange-bg: #fdeee4; --orange-tx: #c2410c;
  --gray-bg: #f1f5f9; --gray-tx: #475569;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 4px 16px rgba(15, 23, 42, .08);
  --shadow-lg: 0 16px 48px rgba(15, 23, 42, .18);
  --sidebar-w: 248px;
  --header-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
body.ui-noscroll { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0 0 8px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.small { font-size: 12.5px; }
.strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-red { color: var(--red-tx); } .t-green { color: var(--green-tx); } .t-yellow { color: var(--yellow-tx); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }
.stack > * + * { margin-top: 16px; }
.gap-lg { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mb-16 { margin-bottom: 16px; } .mb-8 { margin-bottom: 8px; }
.grow { flex: 1; min-width: 0; }
.flip { transform: rotate(180deg); }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--text-3); }
.ui-icon { flex: none; display: inline-block; vertical-align: middle; }

/* ---------- Кнопки ---------- */
.ui-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; font-weight: 550; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; user-select: none; }
.ui-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-100); }
.ui-btn:disabled { opacity: .55; cursor: default; }
.ui-btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.ui-btn-icon { padding: 0; width: 36px; }
.ui-btn-sm.ui-btn-icon { width: 30px; }
.ui-btn-block { width: 100%; }
.ui-btn-primary { background: var(--accent); color: #fff; }
.ui-btn-primary:hover:not(:disabled) { background: var(--accent-600); }
.ui-btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); box-shadow: var(--shadow-sm); }
.ui-btn-secondary:hover:not(:disabled) { background: var(--hover); border-color: var(--border-2); }
.ui-btn-ghost { background: transparent; color: var(--text-2); }
.ui-btn-ghost:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.ui-btn-danger { background: var(--surface); border-color: #f5c2c2; color: var(--red-tx); }
.ui-btn-danger:hover:not(:disabled) { background: var(--red-bg); }
.ui-btn-link { background: none; border: none; color: var(--accent); padding: 0; height: auto; }
.ui-btn-link:hover { text-decoration: underline; }
.ui-iconbtn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm); border: none; background: transparent; color: var(--text-2); cursor: pointer; }
.ui-iconbtn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.ui-iconbtn:disabled { opacity: .4; cursor: default; }
.ui-iconbtn-badge { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; border: 2px solid var(--surface); box-sizing: content-box; }

/* ---------- Поля ---------- */
.ui-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ui-label { font-size: 13px; font-weight: 550; color: var(--text-2); }
.ui-req { color: var(--red); }
.ui-field-msg { font-size: 12.5px; color: var(--red-tx); }
.ui-field-hint { font-size: 12.5px; color: var(--text-3); }
.ui-input { width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--surface); outline: none; transition: border-color .12s, box-shadow .12s; min-width: 0; }
.ui-input:hover:not(:disabled) { border-color: #94a3b8; }
.ui-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-100); }
.ui-input:disabled { background: var(--hover); color: var(--text-3); }
.ui-field-error .ui-input, .ui-input.is-invalid { border-color: var(--red); }
.ui-field-error .ui-input:focus { box-shadow: 0 0 0 3px #fbd5d5; }
.ui-textarea { height: auto; padding: 8px 11px; resize: vertical; min-height: 64px; }
.ui-select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.ui-select.is-empty { color: var(--text-3); }
.ui-select option { color: var(--text); }
input[type=color].ui-input { padding: 3px; width: 48px; }
.ui-check { display: inline-flex; align-items: flex-start; gap: 8px; cursor: pointer; user-select: none; line-height: 1.35; }
.ui-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.ui-check-box { flex: none; width: 18px; height: 18px; margin-top: 1px; border: 1.5px solid var(--border-2); border-radius: 5px; display: grid; place-items: center; background: var(--surface); color: transparent; transition: all .12s; }
.ui-check input:checked + .ui-check-box { background: var(--accent); border-color: var(--accent); color: #fff; }
.ui-check input:focus-visible + .ui-check-box { box-shadow: 0 0 0 3px var(--accent-100); }
.ui-check-label small, .ui-check-hint { display: block; color: var(--text-3); font-size: 12px; }
.ui-check.is-disabled { opacity: .55; cursor: default; }
.ui-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.ui-switch input { position: absolute; opacity: 0; }
.ui-switch-track { width: 34px; height: 20px; border-radius: 10px; background: var(--border-2); position: relative; transition: background .15s; }
.ui-switch-thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.ui-switch input:checked + .ui-switch-track { background: var(--accent); }
.ui-switch input:checked + .ui-switch-track .ui-switch-thumb { transform: translateX(14px); }

.ui-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--hover); border-radius: var(--radius-sm); border: 1px solid var(--border); flex-wrap: wrap; }
.ui-seg-item { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border: none; background: transparent; border-radius: 6px; cursor: pointer; color: var(--text-2); font-weight: 550; white-space: nowrap; }
.ui-seg-item:hover { color: var(--text); }
.ui-seg-item.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.ui-seg-sm .ui-seg-item { height: 26px; padding: 0 9px; font-size: 12.5px; }
.ui-seg-item.is-active.tone-green { background: var(--green); color: #fff; }
.ui-seg-item.is-active.tone-red { background: var(--red); color: #fff; }
.ui-seg-item.is-active.tone-yellow { background: var(--yellow); color: #fff; }
.ui-seg-item.is-active.tone-orange { background: var(--orange); color: #fff; }
.ui-seg-item.is-active.tone-purple { background: var(--purple); color: #fff; }

.ui-search { position: relative; display: flex; align-items: center; min-width: 220px; }
.ui-search > .ui-icon { position: absolute; left: 10px; color: var(--text-3); pointer-events: none; }
.ui-search .ui-input { padding-left: 32px; padding-right: 30px; }
.ui-search-clear { position: absolute; right: 6px; border: none; background: none; color: var(--text-3); cursor: pointer; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 4px; }
.ui-search-clear:hover { background: var(--hover); color: var(--text); }

.ui-formgrid { display: grid; gap: 14px 16px; }
.ui-formgrid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ui-formgrid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ui-formgrid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ui-formgrid .span-2 { grid-column: span 2; }
.ui-formgrid .span-all { grid-column: 1 / -1; }
.ui-formsection { border: none; padding: 0; margin: 0 0 22px; min-width: 0; }
.ui-formsection > legend { font-weight: 650; font-size: 14.5px; padding: 0; margin-bottom: 12px; color: var(--text); }
.ui-formsection-hint { color: var(--text-2); font-size: 13px; margin: -6px 0 12px; }
@media (max-width: 640px) { .ui-formgrid.cols-2, .ui-formgrid.cols-3, .ui-formgrid.cols-4 { grid-template-columns: 1fr; } .ui-formgrid .span-2 { grid-column: auto; } }

/* ---------- Бейджи, аватары ---------- */
.ui-badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ui-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tone-gray { background: var(--gray-bg); color: var(--gray-tx); }
.tone-blue { background: var(--blue-bg); color: var(--blue-tx); }
.tone-green { background: var(--green-bg); color: var(--green-tx); }
.tone-yellow { background: var(--yellow-bg); color: var(--yellow-tx); }
.tone-red { background: var(--red-bg); color: var(--red-tx); }
.tone-purple { background: var(--purple-bg); color: var(--purple-tx); }
.tone-orange { background: var(--orange-bg); color: var(--orange-tx); }
.ui-pill { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ui-avatar { flex: none; display: inline-grid; place-items: center; border-radius: 50%; background: var(--accent-100); color: var(--accent-600); font-weight: 650; overflow: hidden; }
.ui-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ui-colordot { display: inline-block; border-radius: 50%; flex: none; vertical-align: middle; }
.ui-progress { height: 6px; border-radius: 3px; background: var(--hover); overflow: hidden; background-color: var(--hover) !important; }
.ui-progress i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.ui-progress.tone-green i { background: var(--green); }
.ui-progress.tone-red i { background: var(--red); }
.ui-progress.tone-yellow i { background: var(--yellow); }

/* ---------- Спиннер, скелетоны ---------- */
.ui-spinner { display: inline-block; border: 2px solid var(--accent-100); border-top-color: var(--accent); border-radius: 50%; animation: ui-spin .7s linear infinite; flex: none; }
@keyframes ui-spin { to { transform: rotate(360deg); } }
.ui-skel { height: 14px; border-radius: 6px; background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 50%, #eef2f7 75%); background-size: 200% 100%; animation: ui-shimmer 1.2s infinite; }
.ui-skel-lines { display: flex; flex-direction: column; gap: 10px; }
@keyframes ui-shimmer { to { background-position: -200% 0; } }
.ui-pageloader { display: grid; place-items: center; min-height: 240px; }

/* ---------- Пустое состояние, алерты ---------- */
.ui-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 20px; gap: 6px; }
.ui-empty-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-50); color: var(--accent); margin-bottom: 8px; }
.ui-empty-title { font-weight: 650; font-size: 15.5px; }
.ui-empty-text { color: var(--text-2); max-width: 420px; }
.ui-empty-action { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.ui-alert { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm); line-height: 1.45; }
.ui-alert > .ui-icon { margin-top: 1px; }
.ui-alert-body { flex: 1; min-width: 0; }
.ui-alert-body > b { display: block; margin-bottom: 1px; }
.ui-alert-body div { color: inherit; opacity: .92; }
.ui-alert.tone-blue { border: 1px solid #cfdefc; }
.ui-alert.tone-yellow { border: 1px solid #f7dfb3; }
.ui-alert.tone-red { border: 1px solid #f6caca; }
.ui-alert.tone-green { border: 1px solid #c4ebd2; }

/* ---------- Карточки ---------- */
.ui-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.ui-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ui-card-head > div:first-child { min-width: 0; }
.ui-card-title { font-size: 15px; }
.ui-card-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.ui-card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ui-card-body { padding: 16px 18px; }
.ui-info { margin: 0; display: grid; gap: 0; }
.ui-info-row { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.ui-info-row:last-child { border-bottom: none; }
.ui-info dt { color: var(--text-2); }
.ui-info dd { margin: 0; word-break: break-word; white-space: pre-wrap; }
.ui-stat { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); color: inherit; min-width: 0; }
.ui-stat.is-link:hover { text-decoration: none; border-color: var(--accent-100); box-shadow: var(--shadow); }
.ui-stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.ui-stat-value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; }
.ui-stat-label { color: var(--text-2); font-size: 13px; }
.ui-stat-sub { color: var(--text-3); font-size: 12px; margin-top: 2px; }

/* ---------- Заголовок страницы, вкладки, тулбар ---------- */
.ui-pagehead { margin-bottom: 18px; }
.ui-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: 13px; color: var(--text-3); margin-bottom: 6px; }
.ui-crumbs > span { display: inline-flex; align-items: center; gap: 2px; }
.ui-crumbs > span:last-child .ui-icon { display: none; }
.ui-crumbs a { color: var(--text-2); }
.ui-pagehead-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.ui-pagehead-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.ui-pagehead-title h1 { font-size: 23px; line-height: 1.25; }
.ui-pagehead-main { flex: 1 1 320px; min-width: 0; }
.ui-pagehead-sub { color: var(--text-2); margin-top: 3px; }
.ui-pagehead-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ui-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.ui-tabs::-webkit-scrollbar { display: none; }
.ui-tab { position: relative; border: none; background: none; padding: 10px 14px; cursor: pointer; color: var(--text-2); font-weight: 550; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.ui-tab:hover { color: var(--text); }
.ui-tab.is-active { color: var(--accent); }
.ui-tab.is-active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.ui-tab-count { background: var(--hover); color: var(--text-2); border-radius: 9px; padding: 0 6px; font-size: 11.5px; line-height: 18px; }
.ui-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.ui-toolbar .ui-input, .ui-toolbar .ui-select { width: auto; min-width: 150px; }
.ui-toolbar .ui-field { min-width: 150px; }
.ui-toolbar .ui-search { flex: 1 1 240px; max-width: 360px; }
.ui-toolbar-spacer { flex: 1; }

/* ---------- Таблица ---------- */
.ui-table-wrap { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.ui-card .ui-table-wrap { border: none; box-shadow: none; border-radius: 0 0 var(--radius) var(--radius); }
.ui-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ui-table { width: 100%; border-collapse: collapse; }
.ui-table th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--text-2); background: #f8fafc; padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; }
.ui-table th.is-sortable { cursor: pointer; }
.ui-table th.is-sortable:hover { color: var(--text); }
.ui-th { display: inline-flex; align-items: center; gap: 3px; }
.ui-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ui-table tbody tr:last-child td { border-bottom: none; }
.ui-table tbody tr.is-clickable { cursor: pointer; }
.ui-table tbody tr:hover td { background: #fafbfd; }
.ui-table tfoot td { padding: 10px 12px; border-top: 1px solid var(--border); background: #f8fafc; font-weight: 600; }
.ui-table-wrap.is-compact td { padding: 7px 10px; }
.ui-table-wrap.is-compact th { padding: 7px 10px; }
.ui-table.sticky-first th:first-child, .ui-table.sticky-first td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--border); }
.ui-table.sticky-first th:first-child { background: #f8fafc; }
.ui-table-empty { }
.ui-table-loading { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 50% 100%; animation: ui-shimmer 1s linear infinite; }
.ui-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); flex-wrap: wrap; font-size: 13px; }
.ui-pager-btns { display: flex; align-items: center; gap: 2px; }
.ui-pager-btns .ui-iconbtn { width: 30px; height: 30px; }
.ui-pager-num { min-width: 30px; height: 30px; border: none; background: none; border-radius: 6px; cursor: pointer; color: var(--text-2); }
.ui-pager-num:hover { background: var(--hover); }
.ui-pager-num.is-active { background: var(--accent-50); color: var(--accent); font-weight: 650; }
.ui-pager-gap { padding: 0 4px; color: var(--text-3); }
tr.row-error td { background: #fff5f5 !important; }
tr.row-dup td { background: #fffbeb !important; }
tr.row-muted td { color: var(--text-3); }

/* ---------- Оверлеи ---------- */
.ui-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, .42); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; animation: ui-fade .15s ease; }
@keyframes ui-fade { from { opacity: 0; } }
.ui-modal { width: 100%; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: 88vh; animation: ui-pop .16s ease; }
@keyframes ui-pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.ui-modal-sm { max-width: 440px; } .ui-modal-md { max-width: 580px; } .ui-modal-lg { max-width: 820px; } .ui-modal-xl { max-width: 1100px; }
.ui-modal-head, .ui-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 12px 20px; border-bottom: 1px solid var(--border); }
.ui-modal-head h2, .ui-drawer-head h2 { font-size: 17px; line-height: 1.3; padding-top: 6px; }
.ui-modal-body { padding: 18px 20px; overflow-y: auto; }
.ui-modal-foot, .ui-drawer-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; background: #fbfcfe; border-radius: 0 0 14px 14px; }
.ui-confirm-text { color: var(--text-2); }
.ui-overlay-drawer { padding: 0; justify-content: flex-end; align-items: stretch; overflow: hidden; }
.ui-drawer { background: var(--surface); height: 100%; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: ui-slide .2s ease; }
@keyframes ui-slide { from { transform: translateX(30px); opacity: 0; } }
.ui-drawer-sub { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.ui-drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 24px; }
.ui-drawer-foot { border-radius: 0; }
.ui-toasts { position: fixed; z-index: 200; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.ui-toast { display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px 11px 14px; border-radius: var(--radius-sm); background: #0f172a; color: #fff !important; box-shadow: var(--shadow-lg); animation: ui-pop .18s ease; }
.ui-toast.tone-green .ui-icon { color: #4ade80; } .ui-toast.tone-red .ui-icon { color: #f87171; } .ui-toast.tone-blue .ui-icon { color: #93c5fd; }
.ui-toast.tone-green, .ui-toast.tone-red, .ui-toast.tone-blue { background: #0f172a; }
.ui-toast span { flex: 1; line-height: 1.4; }
.ui-toast button { background: none; border: none; color: #94a3b8; cursor: pointer; padding: 2px; }
.ui-dropdown { position: relative; }
.ui-dropdown-menu { position: absolute; top: calc(100% + 6px); z-index: 60; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; animation: ui-pop .12s ease; }
.ui-dropdown-menu.align-right { right: 0; } .ui-dropdown-menu.align-left { left: 0; }
.ui-menuitem { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: none; background: none; border-radius: 6px; cursor: pointer; text-align: left; color: var(--text); }
.ui-menuitem:hover { background: var(--hover); }
.ui-menuitem.is-danger { color: var(--red-tx); }
.ui-menu-sep { height: 1px; background: var(--border); margin: 5px 0; }
.ui-menu-head { padding: 8px 10px 6px; font-size: 12px; color: var(--text-3); }

.ui-copy { display: flex; flex-direction: column; gap: 4px; }
.ui-copy-label { font-size: 12.5px; color: var(--text-2); font-weight: 550; }
.ui-copy-row { display: flex; gap: 8px; align-items: center; }
.ui-copy-value { flex: 1; min-width: 0; padding: 7px 10px; border-radius: 6px; background: var(--hover); border: 1px solid var(--border); overflow-x: auto; white-space: nowrap; font-size: 13px; }
.ui-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 28px 16px; border: 2px dashed var(--border-2); border-radius: var(--radius); background: #fafbfd; color: var(--text-2); cursor: pointer; text-align: center; transition: all .12s; }
.ui-drop:hover, .ui-drop.is-over { border-color: var(--accent); background: var(--accent-50); color: var(--accent); }
.ui-drop-text { display: flex; flex-direction: column; gap: 2px; }
.ui-drop-text b { color: var(--text); }
.ui-drop-text u { color: var(--accent); text-decoration: none; }
.ui-drop-text small { color: var(--text-3); }
.ui-drop.is-compact { flex-direction: row; padding: 10px 14px; border-width: 1.5px; justify-content: flex-start; }

/* ======================= Каркас администратора ======================= */
.adm { display: flex; min-height: 100vh; }
.adm-sidebar { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: var(--sidebar-w); background: #0f1b33; color: #cbd5e1; display: flex; flex-direction: column; transition: width .18s ease, transform .2s ease; }
.adm-brand { display: flex; align-items: center; gap: 10px; height: var(--header-h); padding: 0 16px; color: #fff; font-weight: 700; flex: none; border-bottom: 1px solid rgba(255,255,255,.06); }
.adm-brand-logo { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; flex: none; color: #fff; }
.adm-brand-text { line-height: 1.15; white-space: nowrap; overflow: hidden; }
.adm-brand-text small { display: block; font-weight: 500; color: #8ea0bd; font-size: 11.5px; }
.adm-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; scrollbar-width: thin; scrollbar-color: #2a3a5c transparent; }
.adm-nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #62759a; padding: 14px 10px 6px; white-space: nowrap; }
.adm-nav a { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 11px; border-radius: 8px; color: #c3cee0; white-space: nowrap; margin-bottom: 1px; }
.adm-nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.adm-nav a.is-active { background: var(--accent); color: #fff; }
.adm-nav a span { overflow: hidden; text-overflow: ellipsis; }
.adm-collapse { flex: none; margin: 8px 10px 12px; border: none; background: rgba(255,255,255,.05); color: #8ea0bd; height: 34px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.adm-collapse:hover { color: #fff; background: rgba(255,255,255,.1); }
.adm-main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); transition: margin-left .18s ease; display: flex; flex-direction: column; }
.adm-header { position: sticky; top: 0; z-index: 30; height: var(--header-h); background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; padding: 0 20px; }
.adm-burger { display: none; }
.adm-org { display: flex; align-items: center; gap: 10px; min-width: 0; }
.adm-org-name { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-org-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); height: 36px; padding: 0 10px 0 8px; border-radius: var(--radius-sm); cursor: pointer; min-width: 0; max-width: 360px; }
.adm-org-btn:hover { background: var(--hover); }
.adm-header-spacer { flex: 1; }
.adm-user-btn { display: flex; align-items: center; gap: 8px; border: none; background: none; cursor: pointer; padding: 4px 6px 4px 4px; border-radius: 22px; }
.adm-user-btn:hover { background: var(--hover); }
.adm-user-name { font-weight: 550; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; line-height: 1.2; }
.adm-user-name small { display: block; font-weight: 400; color: var(--text-3); font-size: 11.5px; }
.adm-content { padding: 22px 24px 48px; width: 100%; max-width: 1480px; margin: 0 auto; }
.adm-backdrop { display: none; }

/* свёрнутое меню */
.adm.is-collapsed .adm-sidebar { width: 68px; }
.adm.is-collapsed .adm-main { margin-left: 68px; }
.adm.is-collapsed .adm-nav a span, .adm.is-collapsed .adm-brand-text, .adm.is-collapsed .adm-nav-group, .adm.is-collapsed .adm-collapse span { display: none; }
.adm.is-collapsed .adm-nav a { justify-content: center; padding: 0; }
.adm.is-collapsed .adm-nav-group { display: block; height: 10px; padding: 0; font-size: 0; }

@media (max-width: 1023px) {
  .adm-sidebar { transform: translateX(-100%); width: 260px !important; box-shadow: none; visibility: hidden; transition: transform .2s ease, visibility .2s; }
  .adm.is-mobile-open .adm-sidebar { transform: none; box-shadow: var(--shadow-lg); visibility: visible; }
  .adm.is-mobile-open .adm-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(15,23,42,.4); }
  .adm-main, .adm.is-collapsed .adm-main { margin-left: 0; }
  .adm.is-collapsed .adm-nav a span, .adm.is-collapsed .adm-brand-text, .adm.is-collapsed .adm-nav-group { display: initial; }
  .adm.is-collapsed .adm-nav a { justify-content: flex-start; padding: 0 11px; }
  .adm-collapse { display: none; }
  .adm-burger { display: inline-grid; }
  .adm-content { padding: 18px 16px 40px; }
  .adm-header { padding: 0 12px; }
}
@media (max-width: 640px) {
  .adm-user-name { display: none; }
  .ui-pagehead-title h1 { font-size: 20px; }
  .adm-org-btn { max-width: 180px; }
}

/* Уведомления */
.ntf-menu { width: 380px; max-width: calc(100vw - 24px); padding: 0; }
.ntf-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ntf-list { max-height: 420px; overflow-y: auto; }
.ntf-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: default; }
.ntf-item:last-child { border-bottom: none; }
.ntf-item.is-unread { background: var(--accent-50); }
.ntf-item .ui-icon { color: var(--accent); margin-top: 2px; }
.ntf-title { font-weight: 600; }
.ntf-body { color: var(--text-2); font-size: 13px; }
.ntf-time { color: var(--text-3); font-size: 11.5px; margin-top: 2px; }

/* Сетки страниц */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1180px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-main { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .grid-4 { grid-template-columns: 1fr; } }

/* Главная */
.dash-lesson { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.dash-lesson:last-child { border-bottom: none; }
.dash-lesson-time { font-variant-numeric: tabular-nums; font-weight: 600; width: 94px; flex: none; }
.dash-lesson-bar { width: 4px; align-self: stretch; border-radius: 2px; flex: none; }
.dash-money { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.dash-money > div { padding: 12px; border-radius: var(--radius-sm); background: var(--hover); }
.dash-money b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-money span { color: var(--text-2); font-size: 12.5px; }
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.checklist li .num-circle { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-50); color: var(--accent); font-weight: 700; font-size: 12px; flex: none; }
.change-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.change-item:last-child { border-bottom: none; }
.change-diff { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.change-diff del { color: var(--red-tx); text-decoration: line-through; background: var(--red-bg); padding: 0 3px; border-radius: 3px; }
.change-diff ins { color: var(--green-tx); text-decoration: none; background: var(--green-bg); padding: 0 3px; border-radius: 3px; }

/* Секции — карточки */
.sec-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.sec-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 16px 14px 18px; cursor: pointer; overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .12s, border-color .12s; display: flex; flex-direction: column; gap: 8px; }
.sec-card:hover { box-shadow: var(--shadow); border-color: var(--border-2); }
.sec-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--sec-color, var(--accent)); }
.sec-card h3 { font-size: 16px; }
.sec-card-meta { display: flex; flex-direction: column; gap: 4px; color: var(--text-2); font-size: 13px; }
.sec-card-meta > div { display: flex; align-items: center; gap: 7px; min-width: 0; }
.sec-card-meta .ui-icon { color: var(--text-3); }
.sec-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border); }
.color-pick { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.color-pick button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 2px #fff; }
.color-pick button.is-active { border-color: var(--text); }
.rule-block { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.rule-block + .rule-block { margin-top: 10px; }
.rule-title { font-weight: 600; }
.rule-hint { color: var(--text-3); font-size: 12.5px; margin: 2px 0 8px; }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.radio-card { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer; background: var(--surface); text-align: left; }
.radio-card:hover { border-color: var(--border-2); }
.radio-card.is-active { border-color: var(--accent); background: var(--accent-50); }
.radio-card b { font-weight: 600; font-size: 13px; }
.radio-card small { color: var(--text-3); font-size: 12px; line-height: 1.3; }
.list-editor { display: flex; flex-direction: column; gap: 8px; }
.list-editor-row { display: grid; gap: 8px; align-items: center; }

/* Расписание — неделя */
.week { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; min-width: 910px; }
.week-scroll { overflow-x: auto; border-radius: var(--radius); }
.week-day { border-right: 1px solid var(--border); min-height: 420px; display: flex; flex-direction: column; min-width: 0; }
.week-day:last-child { border-right: none; }
.week-day-head { padding: 9px 10px; border-bottom: 1px solid var(--border); background: #f8fafc; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.week-day-head b { font-size: 13px; }
.week-day-head span { color: var(--text-3); font-size: 12px; }
.week-day.is-today .week-day-head { background: var(--accent-50); }
.week-day.is-today .week-day-head b { color: var(--accent); }
.week-day-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.lesson-card { border: 1px solid var(--border); border-left: 4px solid var(--c, var(--accent)); border-radius: 7px; padding: 6px 8px; cursor: pointer; background: var(--surface); text-align: left; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; width: 100%; transition: box-shadow .1s; }
.lesson-card:hover { box-shadow: var(--shadow); }
.lesson-card-time { font-weight: 650; font-variant-numeric: tabular-nums; display: flex; justify-content: space-between; gap: 4px; }
.lesson-card-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-card-sub { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-card.is-cancelled { opacity: .6; background: repeating-linear-gradient(45deg, #fff, #fff 6px, #f8fafc 6px, #f8fafc 12px); }
.lesson-card.is-cancelled .lesson-card-name { text-decoration: line-through; }
.lesson-card.is-moved { opacity: .6; border-style: dashed; }
.week-empty { color: var(--text-3); font-size: 12px; text-align: center; padding: 16px 0; }

/* Посещаемость */
.att-list { display: flex; flex-direction: column; }
.att-row { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 8px 14px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.att-row:last-child { border-bottom: none; }
.att-row.is-dirty { background: #fbfdff; box-shadow: inset 3px 0 0 var(--accent); }
.att-child { display: flex; align-items: center; gap: 10px; min-width: 0; }
.att-child-name { font-weight: 600; }
.att-child-sub { font-size: 12px; color: var(--text-3); }
.att-comment { grid-column: 1 / -1; }
.att-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.att-btn { height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.att-btn:hover { border-color: var(--border-2); color: var(--text); }
.att-btn.is-active.tone-green { background: var(--green); border-color: var(--green); color: #fff; }
.att-btn.is-active.tone-red { background: var(--red); border-color: var(--red); color: #fff; }
.att-btn.is-active.tone-yellow { background: var(--yellow); border-color: var(--yellow); color: #fff; }
.att-btn.is-active.tone-orange { background: var(--orange); border-color: var(--orange); color: #fff; }
.att-btn.is-active.tone-purple { background: var(--purple); border-color: var(--purple); color: #fff; }
.att-lessons { display: flex; flex-direction: column; gap: 6px; }
.att-lesson { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); text-align: left; width: 100%; }
.att-lesson:hover { border-color: var(--border-2); }
.att-lesson.is-active { border-color: var(--accent); background: var(--accent-50); }
@media (max-width: 720px) { .att-row { grid-template-columns: 1fr; } .att-actions { justify-content: flex-start; } }
.matrix td, .matrix th { text-align: center; padding: 6px 6px !important; font-variant-numeric: tabular-nums; }
.matrix td:first-child, .matrix th:first-child { text-align: left; white-space: nowrap; }
.mx { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 5px; font-weight: 700; font-size: 12px; }
.mx-p { background: var(--green-bg); color: var(--green-tx); }
.mx-a { background: var(--red-bg); color: var(--red-tx); }
.mx-e { background: var(--yellow-bg); color: var(--yellow-tx); }
.mx-l { background: var(--orange-bg); color: var(--orange-tx); }
.mx-t { background: var(--purple-bg); color: var(--purple-tx); }
.mx-f { background: var(--blue-bg); color: var(--blue-tx); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-2); align-items: center; }
.legend > span { display: inline-flex; gap: 5px; align-items: center; }

/* Начисления */
.formula { background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; }
.formula div { padding: 3px 0; }
.formula div:last-child { font-weight: 700; border-top: 1px dashed var(--border-2); margin-top: 4px; padding-top: 6px; }
.money-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (max-width: 640px) { .money-summary { grid-template-columns: 1fr; } }
.lesson-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lesson-chip { font-size: 12px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); }
.lesson-chip.is-counted { border-color: #bfd3fb; background: var(--accent-50); }
.lesson-chip.is-out { opacity: .5; }

/* Журнал */
.diff { width: 100%; border-collapse: collapse; font-size: 13px; }
.diff th, .diff td { border: 1px solid var(--border); padding: 5px 8px; vertical-align: top; text-align: left; }
.diff th { background: #f8fafc; font-weight: 600; color: var(--text-2); }
.diff td.before { background: #fff7f7; color: var(--red-tx); }
.diff td.after { background: #f5fcf7; color: var(--green-tx); }
.diff td { word-break: break-word; white-space: pre-wrap; max-width: 380px; }
.timeline { display: flex; flex-direction: column; }
.timeline-item { position: relative; padding: 0 0 16px 22px; }
.timeline-item::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: -6px; width: 2px; background: var(--border); }
.timeline-item:last-child::before { display: none; }
.timeline-item::after { content: ""; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline-meta { color: var(--text-3); font-size: 12px; }

/* Импорт */
.steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); color: var(--text-3); font-weight: 550; }
.step i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--hover); font-size: 12px; }
.step.is-active { color: var(--accent); border-color: var(--accent-100); background: var(--accent-50); }
.step.is-active i { background: var(--accent); color: #fff; }
.step.is-done { color: var(--green-tx); }
.step.is-done i { background: var(--green); color: #fff; }
.entity-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.entity-card { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 3px; }
.entity-card:hover { border-color: var(--border-2); }
.entity-card.is-active { border-color: var(--accent); background: var(--accent-50); }
.entity-card b { font-size: 14.5px; }
.entity-card small { color: var(--text-2); }
.cell-err { color: var(--red-tx); font-size: 12px; display: block; }
.mapping-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 14px; }
.mapping-item { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; background: #f8fafc; }
.mapping-item .col-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ======================= Страницы авторизации ======================= */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); }
.auth-aside { background: linear-gradient(155deg, #1d4ed8 0%, #2f6fed 55%, #5b8cf5 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-aside::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; background: rgba(255,255,255,.08); }
.auth-aside::before { content: ""; position: absolute; right: 80px; top: -80px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.06); }
.auth-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.auth-logo i { width: 38px; height: 38px; border-radius: 11px; background: rgba(255,255,255,.18); display: grid; place-items: center; }
.auth-aside h2 { font-size: 32px; line-height: 1.2; margin-bottom: 14px; max-width: 460px; }
.auth-aside p { color: rgba(255,255,255,.85); font-size: 15.5px; max-width: 440px; }
.auth-features { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 1; }
.auth-features li { display: flex; gap: 10px; align-items: center; color: rgba(255,255,255,.92); }
.auth-features .ui-icon { background: rgba(255,255,255,.16); border-radius: 7px; padding: 4px; width: 26px; height: 26px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 420px; }
.auth-box h1 { font-size: 26px; margin-bottom: 6px; }
.auth-box .auth-sub { color: var(--text-2); margin-bottom: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .ui-input { height: 44px; font-size: 15px; }
.auth-form .ui-btn { height: 44px; font-size: 15px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 18px; font-size: 14px; }
.auth-foot { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 14px; text-align: center; }
.auth-mobile-logo { display: none; }
.invite-card { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--radius); background: var(--accent-50); border: 1px solid var(--accent-100); margin-bottom: 4px; }
.pw-wrap { position: relative; }
.pw-wrap .ui-input { padding-right: 42px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.noaccess { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; background: var(--bg); }
  .auth-aside { display: none; }
  .auth-main { align-items: flex-start; padding: 28px 16px; }
  .auth-box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px 20px; box-shadow: var(--shadow-sm); }
  .auth-mobile-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 20px; color: var(--accent); }
  .auth-mobile-logo i { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; }
  .auth-box h1 { font-size: 22px; }
  .auth-form .ui-input { font-size: 16px; }
}

/* ---------- Поиск сущностей, чипы, приглашения, доп. поля ---------- */
.ent-search { position: relative; min-width: 0; }
.ent-results { position: absolute; z-index: 70; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto; padding: 4px; min-width: 240px; }
.ent-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 7px 10px; border: none; background: none; border-radius: 6px; cursor: pointer; text-align: left; }
.ent-item:hover { background: var(--accent-50); }
.ent-empty { padding: 12px; color: var(--text-3); text-align: center; }
.ent-chosen { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 4px 4px 10px; border: 1px solid var(--accent-100); background: var(--accent-50); border-radius: var(--radius-sm); }
.ent-chosen > .ui-icon { color: var(--accent); }
.ent-chosen .ui-iconbtn { width: 28px; height: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 14px; background: var(--accent-50); color: var(--accent-600); font-weight: 550; font-size: 13px; }
.chip button { border: none; background: none; color: inherit; cursor: pointer; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; }
.chip button:hover { background: var(--accent-100); }
.invite-box { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px dashed var(--border-2); border-radius: var(--radius-sm); background: #fbfcfe; }
.cf-multi { display: flex; flex-wrap: wrap; gap: 8px 16px; padding-top: 4px; }
.cf-file { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.cf-file img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.contacts-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) 32px; }
.consents-row { grid-template-columns: 24px minmax(0, 1fr) 150px 32px; }
@media (max-width: 640px) { .contacts-row { grid-template-columns: 1fr 1fr; } .consents-row { grid-template-columns: 24px 1fr 32px; } .consents-row .ui-input[type=date] { grid-column: 2; } }
.att-layout { grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .att-layout { grid-template-columns: 1fr; } }
.month-input { width: 150px !important; min-width: 0 !important; }
@media (max-width: 900px) { .hide-sm { display: none; } }
.ui-card .ui-toolbar { margin-bottom: 0; }
.ui-toolbar .ui-search .ui-input { width: 100%; min-width: 0; }
.ui-toolbar > .ui-check { min-height: 36px; align-items: center; }
.ui-toolbar > .ui-check .ui-check-box { margin-top: 0; }
.ui-toolbar > .ui-seg, .ui-toolbar > .ui-btn-sm { margin-bottom: 3px; }
.ui-table-wrap.is-compact td { white-space: nowrap; }
.ui-toolbar > .muted, .ui-toolbar > .text-2 { padding-bottom: 8px; }
.cell-err { white-space: normal; }
/* узкий десктоп / планшет в горизонтали: меню свёрнуто до иконок */
@media (min-width: 1024px) and (max-width: 1199px) {
  .adm .adm-sidebar { width: 68px; }
  .adm .adm-main { margin-left: 68px; }
  .adm .adm-nav a span, .adm .adm-brand-text, .adm .adm-collapse { display: none; }
  .adm .adm-nav a { justify-content: center; padding: 0; }
  .adm .adm-nav-group { height: 10px; padding: 0; font-size: 0; }
}
.ui-iconbtn-badge { top: 1px; right: -1px; min-width: 15px; height: 15px; line-height: 15px; font-size: 10px; padding: 0 3px; }
.dash-money { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; }
.dash-money b { font-size: 17px; }
.dash-money > div { padding: 10px; min-width: 0; }
.ui-dropdown-menu { min-width: 260px; }
.ui-menuitem span { white-space: nowrap; }
.dash-money { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-money b { font-size: 15.5px; }
@media (max-width: 1180px) { .dash-money b { font-size: 18px; } }
.dash-money + .ui-progress { margin-top: 12px; }
/* узкие числовые колонки и индикатор горизонтальной прокрутки */
.ui-table td.col-num, .ui-table th.col-num { padding-left: 6px; padding-right: 8px; }
.ui-table td.col-status { min-width: 104px; }
.ui-table-wrap.is-compact td.col-status { white-space: normal; }
.ui-table-scroll {
  background:
    linear-gradient(to right, var(--surface) 30%, rgba(255,255,255,0)) left center / 24px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, rgba(255,255,255,0)) right center / 24px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(15,23,42,.14), transparent) left center / 10px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(15,23,42,.14), transparent) right center / 10px 100% no-repeat scroll;
}
.ui-table tbody td { background-clip: padding-box; }
.ent-item.is-disabled { cursor: default; opacity: .7; }
.ent-item.is-disabled:hover { background: none; }
/* тосты — справа сверху под шапкой, чтобы не перекрывать кнопки внизу панелей */
.ui-toasts { top: calc(var(--header-h) + 24px); bottom: auto; }
.auth ~ .ui-toasts, .auth .ui-toasts { top: 16px; }
