/* Дизайн-система «Сервисный портал 2.0»: композиция и оформление
   перенесены из прототипа команды (синие акценты Уралхим). */

:root {
  --brand: #003399;
  --brand-hover: #002876;
  --surface: #f4f7fb;
  --portal-50: #eef4ff;
  --portal-100: #e0ebff;
  --portal-200: #c3d7ff;
  --portal-300: #9abbfa;
  --portal-400: #608ee5;
  --portal-500: #3265c9;
  --portal-600: #174cae;
  --portal-700: #003399;
  --portal-800: #072a75;
  --portal-900: #102455;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --emerald-50: #ecfdf5;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --amber-50: #fffbeb;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --teal-50: #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --teal-700: #0f766e;
  --sky-100: #e0f2fe;
  --sky-700: #0369a1;
  --violet-100: #ede9fe;
  --violet-700: #6d28d9;
  --red-50: #fef2f2;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --shadow-pop: 0 20px 25px -5px rgb(15 23 42 / .1), 0 8px 10px -6px rgb(15 23 42 / .1);
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--slate-900);
  font: 16px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button { font: inherit; }
button:not(:disabled), select, label[for] { cursor: pointer; }
button:disabled { cursor: not-allowed; }
img { max-width: 100%; }
:where(button, a, select, summary, [tabindex], input, textarea):focus-visible {
  outline: 2px solid var(--portal-500);
  outline-offset: 2px;
}
.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;
}
.meta { color: var(--slate-500); font-size: .875rem; }
.error { color: var(--red-700); font-size: .875rem; }
.error:empty { display: none; }

.scroll-thin { scrollbar-width: thin; scrollbar-color: var(--slate-300) transparent; }
.scroll-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scroll-thin::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 999px; }
.scroll-thin::-webkit-scrollbar-track { background: transparent; }

svg.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg.ic.sm { width: 14px; height: 14px; }
svg.ic.md { width: 16px; height: 16px; }
svg.ic.lg { width: 20px; height: 20px; }

/* ───────── Каркас ───────── */
.layout { display: flex; height: 100dvh; overflow: hidden; }
.center { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.main { min-height: 0; flex: 1; overflow-y: auto; overflow-x: hidden; }
.page {
  max-width: 920px; margin: 0 auto; width: 100%;
  padding: 20px 16px 112px;
}
@media (min-width: 640px) { .page { padding: 24px 24px 40px; } }
@media (min-width: 1024px) { .page { padding: 32px 32px 32px; } }
.page > * { animation: fade-up .28s cubic-bezier(.2, .8, .2, 1) both; }

/* ───────── Сайдбар ───────── */
.sidebar {
  position: relative; z-index: 30; display: none; flex-direction: column; flex-shrink: 0;
  width: 240px; background: #fff; border-right: 1px solid var(--slate-200);
  transition: width .3s ease-out;
}
@media (min-width: 1024px) { .sidebar { display: flex; } }
.sidebar.collapsed { width: 72px; }
.sidebar-top {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; flex-shrink: 0; padding: 0 12px 0 20px;
  border-bottom: 1px solid var(--slate-200);
}
.sidebar.collapsed .sidebar-top { justify-content: center; padding: 0; }
.sidebar.collapsed .logo { display: none; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.logo img { width: 118px; height: auto; flex-shrink: 0; }
.sidebar-top .logo { overflow: hidden; }
.sidebar-top .logo img { width: 104px; }
.logo-badge {
  white-space: nowrap; border-left: 1px solid var(--slate-200); padding-left: 10px;
  font-size: .75rem; font-weight: 500; color: var(--slate-600);
}
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px; }
.nav-row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  height: 40px; padding: 0 15px; border: 0; border-radius: var(--radius-lg);
  background: transparent; color: var(--slate-600); font-size: .875rem; font-weight: 500;
  text-align: left; transition: background .15s, color .15s, transform .1s;
  overflow: hidden; white-space: nowrap;
}
.nav-row:hover { background: var(--slate-50); color: var(--slate-900); }
.nav-row:active { transform: scale(.98); }
.nav-row .nav-ic { color: var(--slate-500); position: relative; display: inline-flex; }
.nav-row.active { background: var(--portal-50); color: var(--portal-800); }
.nav-row.active .nav-ic, .nav-row.emphasized .nav-ic { color: var(--brand); }
.nav-row.emphasized { color: var(--slate-900); }
.nav-row.warn .nav-ic { color: var(--amber-500); }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-chevron { color: var(--slate-400); transition: transform .2s ease-out; display: inline-flex; }
.nav-chevron.open { transform: rotate(90deg); }
.nav-dot {
  position: absolute; right: -3px; top: -3px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px #fff;
}
.sidebar.collapsed .nav-label, .sidebar.collapsed .nav-chevron { display: none; }
.sidebar.collapsed .nav-row { justify-content: center; padding: 0; }
.nav-tip {
  pointer-events: none; position: absolute; left: 100%; top: 50%; z-index: 50;
  margin-left: 12px; transform: translateY(-50%) translateX(-4px);
  background: var(--slate-900); color: #fff; font-size: .75rem; font-weight: 500;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap; opacity: 0;
  transition: opacity .15s, transform .15s; box-shadow: var(--shadow-pop);
}
.sidebar.collapsed .nav-row-wrap:hover .nav-tip,
.sidebar.collapsed .nav-row-wrap:focus-within .nav-tip { opacity: 1; transform: translateY(-50%) translateX(0); }
.nav-row-wrap { position: relative; }
.submenu { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .3s cubic-bezier(.16, 1.25, .45, 1), opacity .18s ease-out; }
.submenu.open { grid-template-rows: 1fr; opacity: 1; }
.submenu > div { overflow: hidden; }
.submenu ul {
  list-style: none; margin: 4px 0 0 26px; padding: 0 0 4px 10px;
  border-left: 1px solid var(--slate-200); display: flex; flex-direction: column; gap: 2px;
}
.submenu button {
  display: flex; align-items: center; width: 100%; min-height: 36px; padding: 6px 12px;
  border: 0; border-radius: 8px; background: transparent; text-align: left;
  font-size: 13px; font-weight: 500; color: var(--slate-600); transition: background .15s, color .15s;
}
.submenu button:hover { background: var(--slate-50); color: var(--slate-900); }
.submenu button.active { background: var(--portal-50); color: var(--portal-700); font-weight: 600; }
.submenu-link {
  display: flex; align-items: center; width: 100%; min-height: 36px; padding: 6px 12px;
  border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 500;
  color: var(--slate-600); transition: background .15s, color .15s;
}
.submenu-link:hover { background: var(--slate-50); color: var(--slate-900); }
.submenu-link.active { background: var(--portal-50); color: var(--portal-700); font-weight: 600; }
.help-card { padding: 12px; }
.help-card > div {
  border: 1px solid var(--slate-200); background: rgb(248 250 252 / .7);
  border-radius: var(--radius-xl); padding: 14px;
}
.help-card-title { display: flex; align-items: center; gap: 8px; font-size: .75rem; font-weight: 600; color: var(--slate-700); }
.help-card-title .ic { color: var(--portal-600); }
.help-card p { margin-top: 6px; font-size: .75rem; line-height: 1.6; color: var(--slate-500); }
.help-card strong { color: var(--slate-700); }
.sidebar.collapsed .help-card { display: none; }

/* ───────── Шапка ───────── */
.header {
  position: relative; z-index: 20; display: flex; align-items: center; gap: 8px;
  height: 64px; flex-shrink: 0; padding: 0 12px;
  background: #fff; border-bottom: 1px solid var(--slate-200); border-top: 3px solid var(--brand);
}
@media (min-width: 640px) { .header { gap: 12px; padding: 0 20px; } }
.header-left { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
@media (min-width: 1024px) { .header-left { display: none; } }
.header-left .logo img { width: 104px; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
@media (min-width: 640px) { .header-right { gap: 8px; } }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 0; border-radius: var(--radius-lg);
  background: transparent; color: var(--slate-600); transition: background .15s, color .15s, transform .1s;
}
.icon-btn:hover { background: var(--slate-100); color: var(--slate-900); }
.icon-btn:active { transform: scale(.9); }
.round-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: transparent; color: var(--slate-500); transition: background .15s, color .15s, transform .1s;
}
.round-btn:hover { background: var(--slate-100); color: var(--slate-900); }
.round-btn:active { transform: scale(.9); }
.round-btn.open { background: var(--slate-100); color: var(--slate-900); }
.round-btn .dot {
  position: absolute; right: 8px; top: 8px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px #fff;
}
#search-open { border: 1px solid var(--slate-200); background: var(--slate-50); }
@media (min-width: 768px) { #search-open, #search-close { display: none; } }
.status-pill {
  display: none; align-items: center; gap: 8px; white-space: nowrap;
  border: 1px solid var(--slate-200); border-radius: 999px; background: #fff;
  padding: 6px 12px; font-size: .75rem; font-weight: 500; color: var(--slate-600);
}
@media (min-width: 1280px) { .status-pill { display: flex; } }
.pulse-dot { position: relative; display: inline-flex; width: 8px; height: 8px; flex-shrink: 0; }
.pulse-dot::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--portal-400); opacity: .6; animation: ping 1.6s cubic-bezier(0, 0, .2, 1) infinite;
}
.pulse-dot::after { content: ""; position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--portal-500); }
.pulse-dot.small { width: 6px; height: 6px; }
.pulse-dot.small::after { width: 6px; height: 6px; }
@keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }

/* Поиск в шапке */
.search-wrap { display: none; min-width: 0; flex: 1; align-items: center; gap: 8px; }
.search-wrap.mobile-open {
  display: flex; position: absolute; inset: 0; z-index: 30; background: #fff; padding: 0 12px;
}
@media (min-width: 768px) { .search-wrap { display: flex; position: static; padding: 0; background: transparent; } }
.search-field { position: relative; min-width: 0; flex: 1; max-width: 520px; margin: 0 auto; }
.search-box {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px;
  border: 1px solid var(--slate-200); border-radius: 999px; background: var(--slate-50);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.search-box:hover { border-color: var(--slate-300); background: #fff; }
.search-box.open { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgb(0 51 153 / .1); }
.search-icon { color: var(--slate-400); display: inline-flex; }
.search-box input {
  min-width: 0; flex: 1; border: 0; background: transparent; font-size: 1rem; color: var(--slate-900);
}
@media (min-width: 640px) { .search-box input { font-size: .875rem; } }
.search-box input:focus { outline: none; }
.search-box input::placeholder { color: var(--slate-400); }
.search-kbd {
  display: none; align-items: center; border: 1px solid var(--slate-200); border-radius: 6px;
  background: #fff; padding: 2px 6px; font-size: 11px; font-weight: 500; color: var(--slate-500); font-family: inherit;
}
@media (min-width: 1024px) { .search-kbd { display: inline-flex; } }
.search-pop {
  position: absolute; left: 0; right: 0; top: 48px; z-index: 40;
  border: 1px solid var(--slate-200); border-radius: var(--radius-xl); background: #fff;
  padding: 6px; box-shadow: var(--shadow-pop); animation: pop .18s ease-out both; overflow: hidden;
}
.search-pop-title {
  padding: 8px 12px 4px; font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .05em; color: var(--slate-400);
}
.search-pop-list { max-height: 60dvh; overflow-y: auto; }
.search-result {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px;
  border: 0; border-radius: var(--radius-lg); background: transparent; text-align: left;
  transition: background .15s;
}
.search-result:hover, .search-result:focus-visible { background: var(--slate-50); }
.search-result-ic {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 8px; background: var(--slate-100); color: var(--slate-500); flex-shrink: 0;
}
.search-result:hover .search-result-ic { background: var(--portal-50); color: var(--portal-600); }
.search-result-text { min-width: 0; flex: 1; }
.search-result-title { display: block; font-size: .875rem; font-weight: 500; color: var(--slate-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-sub { display: block; font-size: .75rem; color: var(--slate-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result .go { color: var(--slate-300); }
.search-result:hover .go { color: var(--portal-600); }
.search-empty { padding: 24px 12px; text-align: center; font-size: .875rem; color: var(--slate-500); }

/* Уведомления */
.notif-wrap { position: relative; }
.notif-pop {
  position: fixed; left: 12px; right: 12px; top: 68px; z-index: 40;
  border: 1px solid var(--slate-200); border-radius: var(--radius-xl); background: #fff;
  box-shadow: var(--shadow-pop); animation: pop .18s ease-out both; overflow: hidden;
}
@media (min-width: 640px) { .notif-pop { position: absolute; left: auto; right: 0; top: 48px; width: 320px; } }
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--slate-100);
}
.notif-head strong { font-size: .875rem; font-weight: 600; }
.notif-head span { font-size: .75rem; color: var(--slate-400); }
.notif-list { list-style: none; margin: 0; padding: 6px; max-height: 320px; overflow-y: auto; }
.notif-item {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 10px 12px;
  border: 0; border-radius: var(--radius-lg); background: transparent; text-align: left;
  transition: background .15s;
}
.notif-item:hover { background: var(--slate-50); }
.notif-item .ic { margin-top: 2px; color: var(--slate-400); }
.notif-item-title { display: block; font-size: .875rem; color: var(--slate-800); }
.notif-item-sub { display: block; font-size: .75rem; color: var(--slate-400); }
.notif-item.unread .notif-item-title { font-weight: 600; }
.notif-empty { padding: 20px 16px; text-align: center; font-size: .875rem; color: var(--slate-500); }

/* Аватар */
.avatar-btn { display: flex; align-items: center; gap: 10px; padding: 2px; border-radius: 999px; text-decoration: none; transition: background .15s; }
.avatar-btn:hover { background: var(--slate-50); }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--portal-400), var(--brand));
  color: #fff; font-size: .75rem; font-weight: 600; box-shadow: 0 0 0 2px #fff;
}
.avatar.lg { width: 40px; height: 40px; }
.avatar-name { display: none; text-align: left; }
.avatar-name strong { display: block; font-size: 13px; font-weight: 500; line-height: 1.2; color: var(--slate-900); }
.avatar-name span { display: block; font-size: 11px; line-height: 1.2; color: var(--slate-500); }
@media (min-width: 1536px) { .avatar-name { display: block; } }

/* ───────── Кнопки и поля ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-lg); border: 1px solid transparent;
  font-size: .875rem; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgb(16 36 85 / .1); }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); box-shadow: 0 4px 6px -1px rgb(16 36 85 / .15); }
.btn-secondary { background: #fff; border-color: var(--slate-200); color: var(--slate-700); }
.btn-secondary:hover:not(:disabled) { border-color: var(--slate-300); background: var(--slate-50); }
.btn-ghost { height: 36px; padding: 0 10px; background: transparent; color: var(--slate-600); font-weight: 500; }
.btn-ghost:hover:not(:disabled) { background: var(--slate-100); color: var(--slate-900); }
.btn-danger { background: #fff; border-color: var(--slate-200); color: var(--red-600); }
.btn-danger:hover:not(:disabled) { border-color: var(--red-600); background: var(--red-50); }
.btn-sm { height: 32px; padding: 0 10px; font-size: .8125rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-assistant { height: 36px; padding: 0 10px; border-radius: var(--radius-lg); }
.btn-assistant-label { display: none; }
@media (min-width: 768px) { .btn-assistant { padding: 0 12px; } .btn-assistant-label { display: inline; } }
@media (min-width: 1280px) { .btn-assistant { display: none; } }
.btn-icon { display: inline-flex; }

.input, textarea.input, select.input {
  width: 100%; border: 1px solid var(--slate-200); border-radius: var(--radius-lg);
  background: #fff; padding: 10px 14px; font: inherit; font-size: 1rem; color: var(--slate-900);
  transition: border-color .15s, box-shadow .15s;
}
@media (min-width: 640px) { .input, textarea.input, select.input { font-size: .875rem; } }
.input::placeholder { color: var(--slate-400); }
.input:hover { border-color: var(--slate-300); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgb(0 51 153 / .12); }
.input:disabled, .input[readonly] { background: var(--slate-50); color: var(--slate-500); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.6; }
select.input { appearance: auto; }
.field { display: block; }
.field-label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 6px; font-size: .75rem; font-weight: 500; color: var(--slate-600);
}
.field-hint { font-weight: 400; color: var(--slate-400); }

/* ───────── Карточки, бейджи, табы ───────── */
.card { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius-xl); }
.card-pad { padding: 16px; }
@media (min-width: 640px) { .card-pad { padding: 24px; } }
.card-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 20px 16px 16px;
}
@media (min-width: 640px) { .card-head { padding: 20px 24px 16px; } }
.card-head h2 { font-size: 1rem; font-weight: 600; }
.card-head .spacer { margin-left: auto; }
.card-title-link {
  display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 8px;
  border: 0; border-radius: 8px; background: transparent; color: var(--portal-700);
  font-size: .875rem; font-weight: 500; text-decoration: none; transition: background .15s;
}
.card-title-link:hover { background: var(--portal-50); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  border-radius: 999px; padding: 4px 10px; font-size: .75rem; font-weight: 500;
  box-shadow: inset 0 0 0 1px rgb(100 116 139 / .12);
}
.badge .badge-dot { width: 6px; height: 6px; border-radius: 50%; }
.badge[data-tone="work"] { background: var(--emerald-50); color: var(--emerald-700); box-shadow: inset 0 0 0 1px rgb(5 150 105 / .15); }
.badge[data-tone="work"] .badge-dot { background: var(--emerald-500); }
.badge[data-tone="pending"] { background: var(--amber-50); color: var(--amber-700); box-shadow: inset 0 0 0 1px rgb(217 119 6 / .15); }
.badge[data-tone="pending"] .badge-dot { background: var(--amber-500); }
.badge[data-tone="done"] { background: var(--slate-100); color: var(--slate-600); box-shadow: inset 0 0 0 1px rgb(100 116 139 / .1); }
.badge[data-tone="done"] .badge-dot { background: var(--slate-400); }
.badge[data-tone="rejected"] { background: var(--red-50); color: var(--red-700); box-shadow: inset 0 0 0 1px rgb(220 38 38 / .15); }
.badge[data-tone="rejected"] .badge-dot { background: var(--red-600); }
.badge[data-tone="brand"] { background: var(--portal-50); color: var(--portal-700); box-shadow: inset 0 0 0 1px rgb(23 76 174 / .15); }
.badge[data-tone="brand"] .badge-dot { background: var(--portal-500); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--slate-200); overflow-x: auto; padding-bottom: 0; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  background: transparent; color: var(--slate-500); font-size: .875rem; font-weight: 500;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--slate-800); }
.tab.active { color: var(--portal-700); border-bottom-color: var(--brand); font-weight: 600; }
.tab .count {
  border-radius: 999px; background: var(--slate-100); color: var(--slate-500);
  padding: 1px 8px; font-size: .75rem; font-weight: 600;
}
.tab.active .count { background: var(--portal-50); color: var(--portal-700); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  border: 1px solid var(--slate-200); border-radius: 999px; background: #fff;
  padding: 6px 14px; font-size: 13px; font-weight: 500; color: var(--slate-600);
  transition: border-color .15s, background .15s, color .15s;
}
.chip:hover { border-color: var(--slate-300); background: var(--slate-50); color: var(--slate-900); }
.chip.active { border-color: var(--portal-300); background: var(--portal-50); color: var(--portal-800); }
.chip .count { font-size: 11px; color: var(--slate-400); }
.chip.active .count { color: var(--portal-600); }
.empty {
  padding: 40px 24px; text-align: center; color: var(--slate-500); font-size: .875rem;
  display: grid; gap: 8px; justify-items: center;
}
.empty .ic { width: 28px; height: 28px; color: var(--slate-300); }
.empty strong { color: var(--slate-700); font-size: .9375rem; }
.loading { padding: 32px; text-align: center; color: var(--slate-500); font-size: .875rem; }

/* ───────── Экраны: заголовки ───────── */
.screen-head { margin-bottom: 20px; }
.screen-head h1 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.01em; }
@media (min-width: 640px) { .screen-head h1 { font-size: 1.5rem; } }
.screen-head .sub { margin-top: 4px; font-size: .875rem; color: var(--slate-500); }
.breadcrumbs { display: flex; align-items: center; gap: 6px; font-size: .875rem; color: var(--slate-500); margin-bottom: 12px; }
.breadcrumbs a { text-decoration: none; padding: 2px 4px; border-radius: 6px; }
.breadcrumbs a:hover { background: var(--slate-100); color: var(--slate-900); }
.breadcrumbs .ic { color: var(--slate-300); }
.breadcrumbs strong { color: var(--slate-900); font-weight: 500; }
.stack { display: grid; gap: 20px; }
@media (min-width: 640px) { .stack { gap: 24px; } }
.back-link {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; margin-left: -8px;
  border: 0; border-radius: 8px; background: transparent; color: var(--slate-600);
  font-size: .875rem; font-weight: 500; text-decoration: none; transition: background .15s;
}
.back-link:hover { background: var(--slate-100); color: var(--slate-900); }

/* Главная: быстрые действия */
.quick-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .quick-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.quick-card {
  display: flex; align-items: center; gap: 16px; padding: 16px; text-align: left;
  background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius-xl);
  text-decoration: none; transition: transform .2s, border-color .2s, box-shadow .2s;
}
@media (min-width: 640px) { .quick-card { flex-direction: column; align-items: stretch; gap: 0; padding: 20px; } }
.quick-card:hover { transform: translateY(-2px); border-color: var(--portal-500); box-shadow: 0 4px 6px -1px rgb(16 36 85 / .08); }
.quick-card:active { transform: scale(.98); }
.quick-ic {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: var(--radius-lg); background: var(--portal-50); color: var(--portal-600);
  flex-shrink: 0; transition: background .2s, color .2s;
}
.quick-card:hover .quick-ic { background: var(--brand); color: #fff; }
.quick-text { min-width: 0; flex: 1; }
@media (min-width: 640px) { .quick-text { margin-top: 16px; } }
.quick-title { display: block; font-size: 15px; font-weight: 600; color: var(--slate-900); }
.quick-sub { display: block; margin-top: 2px; font-size: .75rem; color: var(--slate-500); }
.quick-go { color: var(--slate-300); }
.quick-card:hover .quick-go { color: var(--brand); }
@media (min-width: 640px) { .quick-go.inline { display: none; } }
@media (max-width: 639px) { .quick-go.corner { display: none; } }

/* Списки строк (заявки, услуги, события) */
.row-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--slate-100); }
.row-list > li + li { border-top: 1px solid var(--slate-100); }
.row-item {
  display: flex; flex-direction: column; gap: 10px; width: 100%; padding: 14px 16px;
  border: 0; background: transparent; text-align: left; text-decoration: none;
  transition: background .15s;
}
@media (min-width: 640px) { .row-item { flex-direction: row; align-items: center; gap: 16px; padding: 16px 24px; } }
.row-item:hover { background: var(--slate-50); }
.row-main { min-width: 0; flex: 1; }
.row-title-line { display: flex; flex-direction: column; gap: 2px; }
@media (min-width: 640px) { .row-title-line { flex-direction: row; align-items: center; gap: 8px; } }
.row-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; font-weight: 500; color: var(--slate-400); }
.row-title { font-size: .875rem; font-weight: 500; color: var(--slate-900); overflow-wrap: anywhere; }
@media (min-width: 640px) { .row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
.row-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: .75rem; color: var(--slate-500); }
.row-sub .ic { color: var(--slate-400); }
.row-side { display: flex; align-items: center; gap: 12px; }
.row-chevron { color: var(--slate-300); display: none; }
@media (min-width: 640px) { .row-chevron { display: inline-flex; } }
.row-item:hover .row-chevron { color: var(--slate-500); }

/* Сетки услуг */
.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.service-tile {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  padding: 16px; border: 1px solid var(--slate-200); border-radius: var(--radius-xl);
  background: #fff; text-align: left; text-decoration: none;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.service-tile:hover { border-color: var(--portal-400); box-shadow: 0 4px 6px -1px rgb(16 36 85 / .08); transform: translateY(-2px); }
.service-tile.selected { border-color: var(--brand); background: rgb(238 244 255 / .4); box-shadow: 0 0 0 4px rgb(0 51 153 / .1); }
.service-tile-link { display: flex; flex-direction: column; min-width: 0; flex: 1; text-decoration: none; color: inherit; }
.service-tile-ic {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: var(--radius-lg); background: var(--slate-100); color: var(--slate-600);
  transition: background .2s, color .2s;
}
.service-tile:hover .service-tile-ic { background: var(--portal-50); color: var(--portal-600); }
.service-tile-title { margin-top: 12px; font-size: .875rem; font-weight: 600; line-height: 1.35; color: var(--slate-900); }
.service-tile-sub { margin-top: 2px; font-size: .75rem; color: var(--slate-500); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.service-tile-meta { margin-top: auto; padding-top: 12px; display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500; color: var(--slate-500); }
.fav-btn {
  position: absolute; right: 10px; top: 10px; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--slate-300);
  transition: background .15s, color .15s;
}
.fav-btn:hover { background: var(--portal-50); color: var(--portal-600); }
.fav-btn.on { color: var(--amber-500); }
.fav-btn.on svg { fill: currentColor; }

/* Секции главной */
.home-section h2 { font-size: 1rem; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.unread-badge {
  border-radius: 999px; background: var(--portal-50); color: var(--portal-700);
  padding: 2px 10px; font-size: .75rem; font-weight: 600;
}
.status-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; padding: 0; }
.status-chip {
  border-radius: 999px; background: var(--slate-100); color: var(--slate-600);
  padding: 5px 12px; font-size: .8125rem;
}
.status-chip strong { color: var(--slate-900); }

/* ───────── Карточка заявки ───────── */
.request-head { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 12px; }
@media (min-width: 640px) { .request-head { flex-direction: row; justify-content: space-between; } }
.request-head h1 { margin-top: 4px; font-size: 1.25rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
@media (min-width: 640px) { .request-head h1 { font-size: 1.5rem; } }
.request-created { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; font-size: .875rem; color: var(--slate-500); }
.request-created .ic { margin-top: 3px; color: var(--slate-400); }
.request-layout { display: grid; gap: 20px; align-items: start; }
@media (min-width: 860px) { .request-layout { grid-template-columns: minmax(0, 1fr) 250px; } }
.request-side { order: -1; }
@media (min-width: 860px) { .request-side { order: 1; } }
.info-label { font-size: .75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--slate-400); }
.info-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--slate-100); }
@media (min-width: 860px) { .info-list { grid-template-columns: 1fr; } }
.info-list dt { font-size: 11px; color: var(--slate-400); }
.info-list dd { margin: 0; font-size: 13px; font-weight: 500; color: var(--slate-800); overflow-wrap: anywhere; }
.assignee { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.assignee .avatar { background: var(--sky-100); color: var(--sky-700); box-shadow: none; }
.assignee-name { font-size: .875rem; font-weight: 500; color: var(--slate-900); }
.assignee-role { font-size: .75rem; color: var(--slate-500); }

/* Степпер */
.stepper { list-style: none; margin: 0; padding: 0; display: flex; }
.stepper li { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.stepper li:not(:last-child)::after {
  content: ""; position: absolute; left: 50%; top: 15px; height: 2px; width: 100%;
  border-radius: 999px; background: var(--slate-200);
}
.stepper li.done:not(:last-child)::after { background: var(--brand); }
.stepper li.active:not(:last-child)::after { background: linear-gradient(90deg, var(--teal-400), var(--slate-200)); }
.step-btn {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center;
  width: 100%; padding: 0 4px 4px; border: 0; border-radius: var(--radius-lg); background: transparent;
}
.step-circle {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 50%; font-size: .75rem; font-weight: 600; transition: box-shadow .15s;
}
.step-btn.done .step-circle { background: var(--brand); color: #fff; }
.step-btn.active .step-circle { background: var(--teal-500); color: #fff; box-shadow: 0 0 0 4px var(--teal-100); }
.step-btn.todo .step-circle { border: 2px solid var(--slate-200); background: #fff; color: var(--slate-400); }
.step-btn.selected.done .step-circle { box-shadow: 0 0 0 4px var(--portal-100); }
.step-btn.selected.todo .step-circle { box-shadow: 0 0 0 4px var(--slate-100); }
.step-title { margin-top: 12px; text-align: center; font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--slate-900); }
.step-btn.todo .step-title { color: var(--slate-400); }
.step-note { margin-top: 4px; text-align: center; font-size: .75rem; line-height: 1.3; color: var(--slate-500); padding: 0 4px; }
.step-btn.active .step-note { color: var(--teal-700); font-weight: 500; }
.step-detail {
  display: flex; align-items: flex-start; gap: 12px; margin-top: 16px;
  border-radius: var(--radius-lg); background: var(--slate-50); padding: 14px 16px;
  font-size: .875rem; animation: fade-up .28s cubic-bezier(.2, .8, .2, 1) both;
}
.step-detail > .ic { margin-top: 2px; }
.step-detail.done > .ic { color: var(--brand); }
.step-detail.active > .ic { color: var(--teal-500); }
.step-detail.todo > .ic { color: var(--slate-400); }
.step-detail-title { font-weight: 500; color: var(--slate-900); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step-state {
  border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 500;
}
.step-state.done { background: var(--portal-50); color: var(--portal-700); }
.step-state.active { background: var(--teal-50); color: var(--teal-700); }
.step-state.todo { background: rgb(226 232 240 / .7); color: var(--slate-500); }
.step-detail p { margin-top: 4px; line-height: 1.6; color: var(--slate-600); }
@media (max-width: 639px) {
  .stepper { flex-direction: column; gap: 0; }
  .stepper li { flex-direction: row; align-items: flex-start; }
  .stepper li:not(:last-child)::after { left: 15px; top: 36px; width: 2px; height: calc(100% - 24px); }
  .stepper li.done:not(:last-child)::after { background: var(--brand); }
  .stepper li.active:not(:last-child)::after { background: linear-gradient(180deg, var(--teal-400), var(--slate-200)); }
  .step-btn { flex-direction: row; align-items: flex-start; gap: 12px; padding: 0 0 20px; text-align: left; }
  .step-title { margin-top: 4px; text-align: left; }
  .step-note { margin-top: 2px; text-align: left; padding: 0; }
}

/* Лента активности */
.feed { display: grid; gap: 16px; max-height: 420px; overflow-y: auto; padding: 20px 16px; }
@media (min-width: 640px) { .feed { padding: 20px 24px; } }
.feed-event { display: flex; align-items: flex-start; gap: 12px; font-size: .75rem; color: var(--slate-500); }
.feed-event-ic {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border-radius: 50%; background: var(--slate-100); color: var(--slate-400); flex-shrink: 0;
}
.feed-event-text { min-width: 0; flex: 1; padding-top: 4px; overflow-wrap: anywhere; }
.feed-event-time { display: block; margin-top: 2px; color: var(--slate-400); }
@media (min-width: 640px) {
  .feed-event-text { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .feed-event-time { margin-top: 0; flex-shrink: 0; }
}
.feed-comment { display: flex; gap: 12px; }
.feed-comment .avatar { width: 32px; height: 32px; font-size: 11px; }
.feed-comment .avatar.engineer { background: var(--sky-100); color: var(--sky-700); box-shadow: none; }
.feed-comment .avatar.manager { background: var(--violet-100); color: var(--violet-700); box-shadow: none; }
.feed-comment-body { min-width: 0; flex: 1; }
.feed-comment-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.feed-comment-author { font-size: 13px; font-weight: 600; color: var(--slate-900); }
.feed-comment-role { font-size: 11px; font-weight: 500; color: var(--slate-400); }
.feed-comment-time { font-size: 11px; color: var(--slate-400); }
.feed-comment-text {
  margin-top: 4px; border-radius: var(--radius-xl); border-top-left-radius: 6px;
  padding: 10px 14px; font-size: 13px; line-height: 1.6; color: var(--slate-700);
  border: 1px solid var(--slate-200); background: var(--slate-50);
  overflow-wrap: anywhere; white-space: pre-wrap;
}
.feed-comment.mine .feed-comment-text { border: 0; background: var(--portal-50); color: var(--portal-900); }
.feed-form { display: flex; align-items: center; gap: 8px; padding: 12px; border-top: 1px solid var(--slate-100); }
.feed-form .input { flex: 1; min-width: 0; height: 44px; }
.feed-form .btn { height: 44px; flex-shrink: 0; }
@media (min-width: 640px) { .feed-form .input, .feed-form .btn { height: 40px; } }
.feed-form .btn span { display: none; }
@media (min-width: 640px) { .feed-form .btn span { display: inline; } }

/* Панели ролей и оценки */
.role-panel { border-top: 3px solid var(--brand); }
.role-panel h2 { font-size: 1rem; font-weight: 600; margin-bottom: 12px; }
.role-panel form { display: grid; gap: 10px; margin-top: 14px; }
.role-panel .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.history-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.history-list li { border-top: 1px solid var(--slate-100); padding-top: 10px; font-size: .875rem; }
.history-list time { display: block; font-size: .75rem; color: var(--slate-400); }
.history-list .transition { font-weight: 600; color: var(--slate-800); }
.history-list .comment { margin-top: 2px; color: var(--slate-600); overflow-wrap: anywhere; }
.rating-stars { display: flex; gap: 4px; }
.rating-stars input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.rating-stars label {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 10px; font-size: 24px; color: var(--slate-300); cursor: pointer; transition: color .15s, background .15s, transform .1s;
}
.rating-stars label:hover { background: var(--amber-50); }
.rating-stars label.filled { color: var(--amber-500); }
.rating-stars input:focus-visible + label { outline: 2px solid var(--portal-500); outline-offset: 2px; }
.rating-note { font-size: .875rem; color: var(--slate-500); margin-top: 6px; }
.rating-saved { display: flex; align-items: center; gap: 8px; color: var(--emerald-700); font-size: .875rem; font-weight: 500; }

/* ───────── Каталог и форма услуги ───────── */
.section-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.section-num {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border-radius: 50%; background: var(--portal-50); color: var(--portal-700);
  font-size: .75rem; font-weight: 600; box-shadow: inset 0 0 0 1px rgb(23 76 174 / .15); flex-shrink: 0;
}
.section-title h2 { font-size: 1rem; font-weight: 600; }
.section-title .hint { font-size: .75rem; color: var(--slate-400); }
.form-actions { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 640px) { .form-actions { flex-direction: row; align-items: center; gap: 16px; } }
.form-note { font-size: .75rem; color: var(--slate-500); text-align: center; }
@media (min-width: 640px) { .form-note { text-align: left; } }
.notice {
  display: flex; align-items: flex-start; gap: 12px; border-radius: var(--radius-lg);
  background: var(--portal-50); padding: 14px 16px; font-size: .875rem; color: var(--portal-900);
}
.notice .ic { margin-top: 2px; color: var(--portal-600); }
.notice.warn { background: var(--amber-50); color: var(--amber-700); }
.notice.warn .ic { color: var(--amber-600); }
.success-panel { display: grid; gap: 14px; justify-items: start; }
.success-ic {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 50%; background: var(--emerald-50); color: var(--emerald-600);
}

/* ───────── Ассистент ───────── */
.assistant {
  position: fixed; inset-block: 0; right: 0; z-index: 50; display: flex; flex-direction: column;
  width: 100%; height: 100dvh; background: #fff; border-left: 1px solid var(--slate-200);
  box-shadow: -25px 0 50px -12px rgb(15 23 42 / .25);
  transform: translateX(100%); visibility: hidden;
  transition: transform .3s cubic-bezier(.16, 1.25, .45, 1), visibility .3s;
}
@media (min-width: 768px) { .assistant { width: 380px; } }
.assistant.open { transform: translateX(0); visibility: visible; }
@media (min-width: 1280px) {
  .assistant:not(.open) { display: none; }
  .assistant {
    position: static; z-index: 10; width: 360px; height: auto; flex-shrink: 0;
    transform: none; visibility: visible; box-shadow: none; transition: none;
  }
}
.assistant-head {
  display: flex; align-items: center; gap: 12px; height: 64px; flex-shrink: 0;
  padding: 0 12px 0 20px; border-bottom: 1px solid var(--slate-200);
}
@media (min-width: 1280px) { .assistant-head { padding-right: 20px; } }
.assistant-logo {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--portal-400), var(--brand));
  color: #fff; flex-shrink: 0;
}
.assistant-head-text { min-width: 0; flex: 1; }
.assistant-head-text h2 { font-size: .875rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-online { display: flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--slate-500); }
.ai-badge {
  display: none; border-radius: 6px; background: var(--portal-50); color: var(--portal-700);
  padding: 2px 6px; font-size: 11px; font-weight: 600; box-shadow: inset 0 0 0 1px rgb(23 76 174 / .15);
}
@media (min-width: 1280px) { .ai-badge { display: inline-flex; } }
.assistant-messages { min-height: 0; flex: 1; overflow-y: auto; overscroll-contain; padding: 20px 16px 24px; display: flex; flex-direction: column; gap: 16px; }
.chat-day { display: flex; align-items: center; gap: 12px; font-size: 11px; font-weight: 500; color: var(--slate-400); }
.chat-day::before, .chat-day::after { content: ""; height: 1px; flex: 1; background: var(--slate-100); }
.chat-msg { display: flex; flex-direction: column; gap: 8px; animation: fade-up .28s cubic-bezier(.2, .8, .2, 1) both; }
.chat-msg.user { align-items: flex-end; }
.chat-msg.bot { align-items: flex-start; }
.chat-bubble {
  max-width: 88%; padding: 10px 14px; font-size: 13px; line-height: 1.6;
  white-space: pre-line; overflow-wrap: anywhere;
}
.chat-msg.user .chat-bubble {
  border-radius: var(--radius-xl); border-bottom-right-radius: 6px;
  background: var(--brand); color: #fff;
}
.chat-msg.bot .chat-bubble {
  border-radius: var(--radius-xl); border-bottom-left-radius: 6px;
  border: 1px solid var(--slate-200); background: var(--slate-50); color: var(--slate-700);
}
.chat-card {
  display: flex; align-items: center; gap: 12px; width: 88%; padding: 12px;
  border: 1px solid var(--slate-200); border-radius: var(--radius-xl); background: #fff;
  text-align: left; transition: border-color .15s, box-shadow .15s;
}
.chat-card:hover { border-color: var(--brand); box-shadow: 0 1px 2px rgb(15 23 42 / .06); }
.chat-card-text { min-width: 0; flex: 1; }
.chat-card-title { display: block; font-size: 13px; font-weight: 600; color: var(--slate-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-card-sub { display: block; font-size: .75rem; color: var(--slate-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-card .ic { color: var(--slate-300); }
.chat-card:hover .ic { color: var(--brand); }
.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.chat-chip {
  border: 1px solid var(--portal-200); border-radius: 999px; background: #fff;
  padding: 6px 12px; font-size: .75rem; font-weight: 500; color: var(--portal-700);
  transition: border-color .15s, background .15s;
}
.chat-chip:hover { border-color: var(--brand); background: var(--portal-50); }
.chat-typing { display: inline-flex; align-items: center; gap: 4px; border-radius: var(--radius-xl); border-bottom-left-radius: 6px; border: 1px solid var(--slate-200); background: var(--slate-50); padding: 14px 16px; }
.chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--slate-400); animation: bounce 1s infinite; }
.chat-typing span:nth-child(2) { animation-delay: .14s; }
.chat-typing span:nth-child(3) { animation-delay: .28s; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.assistant-input { flex-shrink: 0; padding: 8px 16px max(16px, env(safe-area-inset-bottom)); background: linear-gradient(to top, #fff 80%, rgb(255 255 255 / 0)); }
.assistant-input form {
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px;
  border: 1px solid var(--slate-200); border-radius: var(--radius-xl); background: #fff;
  box-shadow: 0 10px 15px -3px rgb(15 23 42 / .06); transition: border-color .15s, box-shadow .15s;
}
.assistant-input form:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgb(0 51 153 / .1); }
.assistant-input input { min-width: 0; flex: 1; border: 0; background: transparent; font-size: 1rem; color: var(--slate-900); }
@media (min-width: 640px) { .assistant-input input { font-size: .875rem; } }
.assistant-input input:focus { outline: none; }
.assistant-input input::placeholder { color: var(--slate-400); }
.send-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border: 0; border-radius: 50%; background: var(--slate-200); color: #fff; flex-shrink: 0;
  transition: background .15s, transform .1s;
}
.send-btn:not(:disabled) { background: var(--brand); }
.send-btn:not(:disabled):hover { background: var(--brand-hover); }
.send-btn:not(:disabled):active { transform: scale(.9); }
.assistant-note { margin-top: 8px; text-align: center; font-size: 11px; color: var(--slate-400); }

/* ───────── Шторки, FAB, тост ───────── */
.overlay {
  position: fixed; inset: 0; z-index: 40; background: rgb(15 23 42 / .4);
  backdrop-filter: blur(4px); opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .2s ease-out, visibility .2s;
}
.overlay.visible { opacity: 1; visibility: visible; pointer-events: auto; }
@media (min-width: 1280px) { #assistant-overlay { display: none; } }
.drawer {
  position: fixed; top: 12px; bottom: 12px; left: 12px; z-index: 50;
  display: flex; flex-direction: column; width: calc(100% - 24px); max-width: 320px;
  background: #fff; border: 1px solid rgb(226 232 240 / .8); border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgb(15 23 42 / .25); overflow: hidden;
  transform: translateX(-110%); visibility: hidden;
  transition: transform .3s cubic-bezier(.16, 1.25, .45, 1), visibility .3s;
}
.drawer.open { transform: translateX(0); visibility: visible; }
@media (min-width: 1024px) { .drawer, #drawer-overlay { display: none; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 12px; border-bottom: 1px solid var(--slate-100); flex-shrink: 0; }
.drawer-nav { min-height: 0; flex: 1; overflow-y: auto; overscroll-contain; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.drawer-nav .nav-row { height: 44px; }
.drawer-nav .submenu button { min-height: 40px; }
.drawer-foot { flex-shrink: 0; border-top: 1px solid var(--slate-100); background: rgb(248 250 252 / .5); padding: 16px 16px max(16px, env(safe-area-inset-bottom)); }
.drawer-user { display: flex; align-items: center; gap: 12px; }
.drawer-user-text { min-width: 0; }
.drawer-user-text p:first-child { font-size: .875rem; font-weight: 600; color: var(--slate-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-user-text p:last-child { font-size: .75rem; color: var(--slate-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-foot .btn { margin-top: 12px; }
.fab {
  position: fixed; right: 16px; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 30;
  display: flex; align-items: center; justify-content: center; width: 108px; height: 108px;
  border: 3px solid #1760ed; border-radius: 50%; background: #fff;
  color: #fff; box-shadow: 0 10px 15px -3px rgb(0 51 153 / .3);
  transition: box-shadow .2s, transform .1s;
}
.fab:hover { border-color: #003eb9; box-shadow: 0 10px 24px rgb(23 96 237 / .35); }
.fab:active { transform: scale(.9); }
.fab[hidden] { display: none; }
.fab-label {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border: 1px solid #1760ed;
  border-radius: 999px;
  background: #fff;
  color: #003eb9;
  font-size: .875rem;
  font-weight: 700;
  white-space: nowrap;
}
.fab-mark {
  width: 63px;
  height: 63px;
  background: url("/uralchem-logo.png") left center / auto 63px no-repeat;
}
.toast-root { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); z-index: 60; width: min(420px, calc(100vw - 32px)); display: grid; gap: 8px; }
@media (min-width: 768px) { .toast-root { bottom: 24px; } }
.toast {
  display: flex; align-items: flex-start; gap: 12px; padding: 16px;
  border: 1px solid var(--slate-200); border-radius: var(--radius-xl); background: #fff;
  box-shadow: var(--shadow-pop); animation: toast-in .32s cubic-bezier(.2, .8, .2, 1) both;
}
.toast-ic {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border-radius: 50%; background: var(--portal-50); color: var(--brand); flex-shrink: 0; margin-top: 2px;
}
.toast.error .toast-ic { background: var(--red-50); color: var(--red-600); }
.toast-body { min-width: 0; flex: 1; }
.toast-title { font-size: .875rem; font-weight: 600; overflow-wrap: anywhere; }
.toast-sub { margin-top: 2px; font-size: .75rem; line-height: 1.5; color: var(--slate-500); overflow-wrap: anywhere; }
.toast-close {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border: 0; border-radius: 6px; background: transparent; color: var(--slate-400); flex-shrink: 0;
}
.toast-close:hover { background: var(--slate-100); color: var(--slate-700); }

/* ───────── Профиль, вход, черновики ───────── */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.profile-card {
  display: flex; flex-direction: column; gap: 4px; padding: 18px;
  border: 1px solid var(--slate-200); border-radius: var(--radius-xl); background: #fff;
  text-align: left; text-decoration: none; transition: border-color .2s, box-shadow .2s, transform .2s;
}
.profile-card:hover { border-color: var(--portal-400); box-shadow: 0 4px 6px -1px rgb(16 36 85 / .08); transform: translateY(-2px); }
.profile-card.current { border-color: var(--brand); box-shadow: 0 0 0 4px rgb(0 51 153 / .1); }
.profile-card strong { font-size: .9375rem; color: var(--slate-900); }
.profile-card span { font-size: .8125rem; color: var(--slate-500); }
.profile-group-title { font-size: .8125rem; font-weight: 600; color: var(--slate-500); text-transform: uppercase; letter-spacing: .04em; margin: 20px 0 10px; }

.sign-in-page { background: #fff; }
.sign-in { display: grid; grid-template-columns: minmax(0, 2fr) minmax(340px, 1fr); min-height: 100dvh; }
.sign-in-visual {
  position: relative; overflow: hidden;
  background:
    linear-gradient(90deg, transparent 48%, #f6f7fc 100%),
    linear-gradient(145deg, #0c1937 2%, #3265c9 56%, #9abbfa 100%);
}
.sign-in-art {
  position: absolute; inset: 14% 4% 5% 13%;
  background:
    radial-gradient(circle at 54% 26%, #eef4ff 0 15%, transparent 15.4%),
    radial-gradient(circle at 83% 30%, #fff 0 12%, transparent 12.4%),
    radial-gradient(circle at 48% 72%, #e0ebff 0 13%, transparent 13.4%),
    radial-gradient(ellipse at 78% 69%, #eef4ff 0 22%, transparent 22.4%);
  opacity: .8;
}
.sign-in-content { padding: clamp(32px, 5vw, 72px) clamp(28px, 4vw, 60px); }
.sign-in-brand { display: block; width: min(230px, 100%); height: auto; margin-bottom: clamp(36px, 8vh, 85px); }
.sign-in-content h1 { font-size: clamp(24px, 2.5vw, 32px); font-weight: 600; margin-bottom: 20px; }
.sign-in-description { color: var(--slate-500); margin: 18px 0 0; font-size: .875rem; }
.sign-in-content form { display: grid; gap: 6px; max-width: 340px; }
.sign-in-content .field-label { font-size: .875rem; }
.sign-in-content .error { margin: 4px 0 0; }
@media (max-width: 720px) {
  .sign-in { grid-template-columns: 1fr; grid-template-rows: 26vh 1fr; }
  .sign-in-brand { margin-bottom: 24px; }
}

/* ───────── Вход: скрытие каркаса ───────── */
body.sign-in-page .sidebar, body.sign-in-page .header, body.sign-in-page .assistant,
body.sign-in-page .fab, body.sign-in-page .overlay, body.sign-in-page .drawer { display: none; }
body.sign-in-page .layout { display: block; height: auto; overflow: visible; }
body.sign-in-page .main { overflow: visible; }
body.sign-in-page .page { max-width: none; padding: 0; }
body.sign-in-page .page > * { animation: none; }

/* ───────── Рабочее пространство: сайдбар, полоса внимания, дашборд ───────── */
.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--slate-400); margin-bottom: 6px;
}
.home-greeting .eyebrow { margin-bottom: 8px; }

.sidebar-requests { flex-shrink: 0; padding: 10px 16px 6px; border-top: 1px solid var(--slate-100); }
.sidebar-section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.sidebar-section-title > a:first-child {
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--slate-400); text-decoration: none; padding: 4px 0;
}
.sidebar-section-title > a:first-child:hover { color: var(--slate-600); }
.sidebar-new-request {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border-radius: 6px; color: var(--slate-400); text-decoration: none;
}
.sidebar-new-request:hover { background: var(--slate-100); color: var(--portal-700); }
.sidebar-request { display: block; padding: 7px 0; text-decoration: none; }
.sidebar-request strong {
  display: block; font-size: 12.5px; font-weight: 500; color: var(--slate-700);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-request:hover strong { color: var(--portal-700); }
.sidebar-status { display: flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 11px; color: var(--slate-400); }
.sidebar-status i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.sidebar-status[data-tone="rejected"] { color: var(--red-600); }
.sidebar-status[data-tone="pending"] { color: var(--amber-600); }
.sidebar-status[data-tone="work"] { color: var(--emerald-600); }
.sidebar-status[data-tone="brand"] { color: var(--portal-600); }
.sidebar-empty { font-size: 12px; line-height: 1.7; color: var(--slate-400); padding: 8px 0; }
.all-requests {
  display: flex; align-items: center; gap: 6px; padding: 6px 0;
  font-size: 12px; font-weight: 500; color: var(--portal-700); text-decoration: none;
}
.all-requests:hover { text-decoration: underline; }
.sidebar-profile {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  padding: 12px 20px; border-top: 1px solid var(--slate-200); text-decoration: none;
}
.sidebar-profile:hover { background: var(--slate-50); }
.sidebar-profile-text { min-width: 0; flex: 1; }
.sidebar-profile-text strong {
  display: block; font-size: 13px; font-weight: 600; color: var(--slate-900);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-profile-text small { display: block; font-size: 11px; color: var(--slate-500); }
.sidebar-profile > .ic { color: var(--slate-300); }
.sidebar.collapsed .sidebar-requests, .sidebar.collapsed .sidebar-profile { display: none; }

.critical-bar {
  display: flex; align-items: center; gap: 8px; width: min(920px, calc(100% - 32px));
  margin: 16px auto -4px; padding: 10px 16px; text-align: left;
  border: 1px solid rgb(217 119 6 / .25); border-radius: var(--radius-lg);
  background: var(--amber-50); color: var(--amber-700); font-size: .875rem; font-weight: 500;
}
.critical-bar[hidden] { display: none; }
.critical-bar:hover { border-color: var(--amber-500); }
.critical-bar span { flex: 1; min-width: 0; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: stretch; }
@media (min-width: 1024px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr); }
  .dashboard-grid .week-card { grid-row: span 2; }
  .dashboard-grid .requests-card { grid-column: 1 / -1; }
}
.dashboard-card {
  background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius-xl);
  padding: 20px; min-width: 0;
}
.dashboard-card .card-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0; margin-bottom: 14px; min-height: 24px;
}
.dashboard-card .card-heading h2 {
  display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 600;
}
.dashboard-card .card-heading h2 .ic { color: var(--amber-600); }
.dashboard-card .card-heading .count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--amber-50); color: var(--amber-700); font-size: 11px; font-weight: 600;
}
.card-subtitle { font-size: .75rem; color: var(--slate-400); margin: -8px 0 10px; }
.attention-card { background: var(--amber-50); border-color: rgb(217 119 6 / .2); }
.attention-list { display: flex; flex-direction: column; }
.attention-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0; text-decoration: none;
}
.attention-row + .attention-row { border-top: 1px solid rgb(217 119 6 / .15); }
.attention-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber-500); flex-shrink: 0; }
.attention-dot[data-tone="rejected"] { background: var(--red-600); }
.attention-content { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.attention-content strong {
  font-size: .8125rem; font-weight: 600; color: var(--slate-800);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attention-content > span { font-size: .75rem; color: var(--slate-500); }
.attention-row > .ic { color: var(--slate-400); }
.attention-row:hover strong { color: var(--portal-700); }
.text-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 0;
  color: var(--portal-700); font-size: .8125rem; font-weight: 500; text-decoration: none;
}
.text-link:hover { text-decoration: underline; }
.attention-more { margin-top: 10px; }
.quiet-empty { display: flex; align-items: center; gap: 12px; min-height: 95px; padding: 12px 0; color: var(--slate-400); }
.quiet-empty p { font-size: .875rem; color: var(--slate-600); line-height: 1.7; }
.quiet-empty p span { font-size: .75rem; color: var(--slate-400); }
.week-list { margin-top: 4px; border-top: 0; }
.week-list .row-item { padding: 12px 0; }
.week-list .row-item:hover { background: transparent; }
.week-list .row-item:hover .row-title { color: var(--portal-700); }
.quick-access-card .small-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--slate-100); margin-bottom: 14px; }
.small-tabs button {
  display: inline-flex; align-items: center; gap: 5px; padding: 0 0 8px;
  border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent;
  color: var(--slate-400); font-size: .8125rem; font-weight: 500;
}
.small-tabs button:hover { color: var(--slate-700); }
.small-tabs button.active { color: var(--portal-700); border-bottom-color: var(--brand); font-weight: 600; }
.quick-panel[hidden] { display: none; }
.recommendations-card { background: var(--portal-50); border-color: var(--portal-100); }
.recommendations-card .card-heading { margin-bottom: 10px; }
.recommendations-card .eyebrow { margin-bottom: 0; color: var(--portal-600); }
.recommendations-card h2 { font-size: 1.0625rem; font-weight: 600; margin-bottom: 12px; color: var(--portal-900); }
.contribution-card .thanks-label {
  display: flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 500; color: var(--portal-600);
}
.contribution-card .thanks-quote {
  margin: 10px 0 14px; font-size: .9375rem; line-height: 1.7; color: var(--slate-600);
  overflow-wrap: anywhere;
}
.person-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person-line > span:not(.avatar) { display: flex; flex-direction: column; min-width: 0; }
.person-line strong { font-size: .8125rem; color: var(--slate-800); }
.person-line small { font-size: .75rem; color: var(--slate-400); }
.contribution-card .btn { margin-top: 12px; }
.requests-card .status-chips { margin: 10px 0; }
.requests-card .btn { margin-top: 4px; }

.search-starters { padding: 4px 0 6px; border-bottom: 1px solid var(--slate-100); margin-bottom: 4px; }
.search-starter {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px;
  border: 0; border-radius: var(--radius-lg); background: transparent; text-align: left;
  color: var(--slate-700); font-size: .875rem;
}
.search-starter:hover { background: var(--slate-50); }
.search-starter > .ic:first-child { color: var(--slate-400); }
.search-starter span { flex: 1; min-width: 0; }
.search-starter > .ic:last-child { color: var(--slate-300); }
.search-result.selected { background: var(--portal-50); }
.search-result.selected .search-result-ic { background: var(--portal-100); color: var(--portal-600); }

.catalog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.inline-search {
  display: flex; align-items: center; gap: 8px; flex: 1; max-width: 420px; height: 40px;
  padding: 0 14px; border: 1px solid var(--slate-200); border-radius: 999px;
  background: var(--slate-50); color: var(--slate-400);
}
.inline-search:focus-within { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgb(0 51 153 / .1); }
.inline-search input { min-width: 0; flex: 1; border: 0; background: transparent; font-size: .875rem; color: var(--slate-900); }
.inline-search input:focus { outline: none; }
.inline-search input::placeholder { color: var(--slate-400); }

.row-ic {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: var(--radius-lg); background: var(--slate-100); color: var(--slate-500); flex-shrink: 0;
}
.row-item:hover .row-ic { background: var(--portal-50); color: var(--portal-600); }

/* ───────── Анимации ───────── */
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.workspace-settings-group h2 {
  margin-bottom: 12px;
}
.workspace-settings-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.workspace-settings-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
  padding: 10px 0;
}
.workspace-settings-row + .workspace-settings-row {
  border-top: 1px solid var(--slate-200);
}
.workspace-settings-actions {
  display: flex;
  gap: 6px;
}
#sidebar-requests[hidden] {
  display: none;
}

/* Главная в композиции бенто из макета. Пользовательский порядок остаётся приоритетным. */
.bento-dashboard { gap: 16px; }
.bento-dashboard .dashboard-card { border-radius: 28px; }
.bento-dashboard .bento-actions { grid-column: 1 / -1; }
.bento-actions .quick-card { min-height: 132px; border-radius: 26px; }
.bento-actions .quick-card:nth-child(2) { background: #e7efff; }
.bento-dashboard .bento-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  order: -2;
  min-height: 340px;
  padding: clamp(20px, 3vw, 32px);
  border: 0;
  background: #135bb9;
  color: #fff;
}
.bento-vector { width: 100%; height: 100%; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.bento-vector-green { animation: bento-gradient-green 14s ease-in-out infinite alternate; }
.bento-vector-blue { animation: bento-gradient-blue 18s ease-in-out infinite alternate; }
@keyframes bento-gradient-green { to { transform: translate(-230px, 90px) scale(1.13); } }
@keyframes bento-gradient-blue { to { transform: translate(170px, -90px) scale(1.08); } }
@media (prefers-reduced-motion: reduce) {
  .bento-vector-green, .bento-vector-blue { animation: none; }
}
.bento-hero-content { display: flex; flex-direction: column; height: 100%; align-items: flex-start; }
.bento-role {
  display: inline-flex; padding: 5px 12px; border-radius: 999px;
  background: rgb(255 255 255 / .19); font-size: .75rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
}
.bento-hero h1 {
  margin: 12px 0 clamp(24px, 5vw, 65px); color: #fff;
  font-size: clamp(2.2rem, 5vw, 4.5rem); line-height: .98; letter-spacing: -.055em;
}
.bento-hero h2 { margin: auto 0 12px; font-size: clamp(1.02rem, 2vw, 1.3rem); color: #fff; }
.bento-hero .service-grid { width: 100%; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 10px; }
.bento-hero .service-tile { background: rgb(255 255 255 / .15); border-color: transparent; padding: 12px; min-height: 120px; }
.bento-hero .service-tile:hover { background: rgb(255 255 255 / .24); border-color: rgb(255 255 255 / .55); }
.bento-hero .service-tile-title, .bento-hero .service-tile-sub, .bento-hero .service-tile-meta { color: #fff; }
.bento-hero .service-tile-ic, .bento-hero .service-tile:hover .service-tile-ic { color: #fff; background: transparent; }
.bento-hero .meta { color: #fff; }
.bento-hero :focus-visible { outline-color: #fff; }
.bento-dashboard .requests-card { order: -1; background: linear-gradient(125deg, #1a69ed, #1846bb); color: #fff; border: 0; }
.bento-dashboard .requests-card h2, .bento-dashboard .requests-card .meta { color: #fff; }
.bento-request-total { display: flex; align-items: baseline; gap: 12px; margin: 12px 0; font-size: .875rem; }
.bento-request-total strong { font-size: clamp(2.75rem, 6vw, 5rem); line-height: 1; }
.bento-dashboard .contribution-card { background: #101a2d; color: #fff; border: 0; }
.bento-dashboard .contribution-card :is(h2, .thanks-quote, .meta, .thanks-label, .person-line small) { color: #f0f5ff; }
.bento-dashboard :is(.requests-card, .contribution-card) .card-title-link { background: #eff5ff; border-radius: 50%; }
@media (min-width: 1024px) {
  .bento-dashboard:not(.bento-custom) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas: "hero hero requests" "hero hero attention" "actions actions actions" "access contribution events";
  }
  .bento-dashboard:not(.bento-custom) .bento-hero { grid-area: hero; }
  .bento-dashboard:not(.bento-custom) .requests-card { grid-area: requests; }
  .bento-dashboard:not(.bento-custom) .attention-card { grid-area: attention; }
  .bento-dashboard:not(.bento-custom) .bento-actions { grid-area: actions; }
  .bento-dashboard:not(.bento-custom) .quick-access-card { grid-area: access; }
  .bento-dashboard:not(.bento-custom) .contribution-card { grid-area: contribution; }
  .bento-dashboard:not(.bento-custom) .week-card { grid-area: events; }
}
.bento-dashboard.bento-custom .home-section { order: 0; }
.bento-dashboard .requests-card { position: relative; }
.bento-dashboard .requests-card .card-title-link::after { content: ''; position: absolute; inset: 0; border-radius: 28px; }
.bento-dashboard .requests-card .card-title-link:focus-visible::after { outline: 3px solid var(--portal-700); outline-offset: 3px; }

/* Масштаб исходного фрейма применяется только к рабочей главной. */
.bento-page .main { container-type: inline-size; }
.bento-page .page { max-width: 1440px; }
@media (min-width: 1024px) {
  .bento-page .page { padding: 24px clamp(24px, 3.33vw, 48px) 36px; }
}
@media (min-width: 1280px) {
  .bento-page .assistant.open {
    position: fixed; inset-block: 64px 0; z-index: 19; width: 380px; height: auto;
    box-shadow: -25px 0 50px -12px rgb(15 23 42 / .25);
  }
}
@container (min-width: 900px) {
  .bento-dashboard:not(.bento-custom) {
    --bento-hero-height: clamp(360px, calc(34.8cqw - 33px), 470px);
    grid-template-rows: repeat(2, minmax(calc((var(--bento-hero-height) - 16px) / 2), auto)) auto auto;
  }
  .bento-dashboard:not(.bento-custom) .bento-hero {
    min-height: var(--bento-hero-height);
    padding: 32px;
    border-radius: 32px;
  }
  .bento-hero h1 { font-size: clamp(56px, 5cqw, 72px); margin-bottom: 32px; }
  .bento-hero .service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bento-hero .service-tile { min-height: clamp(142px, 12cqw, 168px); padding: 14px; }
  .bento-hero .service-tile-title { margin-top: auto; }
  .bento-hero .service-tile-meta { display: none; }
  .bento-actions .quick-card { min-height: 144px; }
  .bento-dashboard :is(.requests-card, .attention-card) { display: flex; flex-direction: column; }
  .bento-request-total, .bento-dashboard .attention-card .quiet-empty { margin-top: auto; }
}

/* «Мои заявки»: переключатель вида, экспорт, табличный список и канбан */
.requests-toolbar {
  position: relative; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.view-toggle {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--slate-100); border: 1px solid var(--slate-200); border-radius: 10px;
}
.view-toggle-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  font: inherit; font-size: .8125rem; font-weight: 500; color: var(--slate-600);
  transition: background .15s, color .15s;
}
.view-toggle-btn:hover { color: var(--slate-800); }
.view-toggle-btn[aria-pressed="true"] {
  background: #fff; color: var(--portal-700); font-weight: 600;
  box-shadow: 0 1px 2px rgb(15 23 42 / .08);
}
.export-wrap { position: relative; }
.export-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 240px;
  padding: 6px; background: #fff; border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
}
.export-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
  border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  font: inherit; text-align: left; color: var(--slate-800);
}
.export-item:hover:not(:disabled) { background: var(--slate-50); }
.export-item:disabled { opacity: .55; cursor: not-allowed; }
.export-item .ic { color: var(--portal-600); flex-shrink: 0; }
.export-item-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.export-item-text strong { font-size: .8125rem; font-weight: 600; }
.export-item-text small { font-size: .75rem; color: var(--slate-500); }

/* Табличный вид списка на широком экране; на узком остаются адаптивные строки */
.request-table-head { display: none; }
.row-created { display: none; }
@media (min-width: 900px) {
  .requests-board-card .request-table-head {
    display: grid; grid-template-columns: 40px minmax(200px, 1.2fr) minmax(0, 1.6fr) max-content max-content 20px;
    gap: 16px; align-items: center; padding: 10px 24px;
    border-bottom: 1px solid var(--slate-100);
    font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--slate-500);
  }
  .requests-board-card .row-item {
    display: grid; grid-template-columns: 40px minmax(200px, 1.2fr) minmax(0, 1.6fr) max-content max-content 20px;
    gap: 16px; align-items: center; padding: 12px 24px;
  }
  .requests-board-card .row-main, .requests-board-card .row-side { display: contents; }
  .requests-board-card .row-sub { margin-top: 0; flex-wrap: nowrap; overflow: hidden; }
  .requests-board-card .row-sub > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .requests-board-card .row-created { display: inline; font-size: .75rem; color: var(--slate-500); white-space: nowrap; }
  .requests-board-card .row-chevron { display: inline-flex; }
}

/* Канбан: цветные колонки по фактическим статусам, карточки ведут в карточку заявки */
.kanban {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr);
  gap: 12px; align-items: start; padding: 16px; overflow-x: auto;
  scroll-snap-type: x proximity;
}
.kanban-col {
  scroll-snap-align: start; min-width: 0; display: flex; flex-direction: column;
  background: var(--slate-50); border: 1px solid var(--slate-200);
  border-top: 3px solid var(--slate-400); border-radius: var(--radius-lg);
}
.kanban-col[data-tone="brand"] { border-top-color: var(--portal-500); }
.kanban-col[data-tone="pending"] { border-top-color: var(--amber-500); }
.kanban-col[data-tone="work"] { border-top-color: var(--emerald-500); }
.kanban-col[data-tone="done"] { border-top-color: var(--slate-400); }
.kanban-col[data-tone="rejected"] { border-top-color: var(--red-600); }
.kanban-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px;
}
.kanban-head h2 { margin: 0; font-size: .8125rem; font-weight: 600; color: var(--slate-800); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.kanban-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--slate-400); flex-shrink: 0; }
.kanban-col[data-tone="brand"] .kanban-dot { background: var(--portal-500); }
.kanban-col[data-tone="pending"] .kanban-dot { background: var(--amber-500); }
.kanban-col[data-tone="work"] .kanban-dot { background: var(--emerald-500); }
.kanban-col[data-tone="done"] .kanban-dot { background: var(--slate-400); }
.kanban-col[data-tone="rejected"] .kanban-dot { background: var(--red-600); }
.kanban-head .count {
  padding: 1px 8px; border-radius: 999px; background: var(--slate-200);
  font-size: .75rem; font-weight: 600; color: var(--slate-600);
}
.kanban-cards { display: flex; flex-direction: column; gap: 8px; padding: 4px 10px 12px; overflow-y: auto; max-height: 56vh; }
.kanban-card {
  display: flex; flex-direction: column; gap: 6px; padding: 12px;
  background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius-lg);
  text-decoration: none; transition: border-color .15s, box-shadow .15s;
}
.kanban-card:hover { border-color: var(--portal-400); box-shadow: 0 4px 6px -1px rgb(16 36 85 / .08); }
.kanban-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kanban-card-top .ic { color: var(--slate-400); }
.kanban-card-title { font-size: .8125rem; font-weight: 600; color: var(--slate-900); overflow-wrap: anywhere; }
.kanban-card-sub { font-size: .75rem; color: var(--slate-500); overflow-wrap: anywhere; }
.kanban-card-date { display: flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--slate-400); }
@media (max-width: 639px) {
  .requests-toolbar { justify-content: flex-start; }
  .kanban { grid-auto-columns: minmax(240px, 82vw); padding: 12px; }
  .kanban-cards { max-height: none; }
}
