:root {
  --bg: #eef2f7;
  --bg-accent: linear-gradient(160deg, #e8f0fb 0%, #f4f6f9 45%, #eef1f6 100%);
  --surface: #ffffff;
  --text: #1a2332;
  --muted: #5c6575;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-soft: #dbeafe;
  --topbar: #0f172a;
  --admin-chrome: #0f172a;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06);
  --layout-max-width: 1220px;
}

* { box-sizing: border-box; }

html {
  background: var(--admin-chrome);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
  background-color: #e8eef6;
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -30%, rgba(59, 130, 246, 0.12), transparent 55%),
    var(--bg-accent);
  color: var(--text);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: min(var(--layout-max-width), 93%);
  margin: 0 auto;
}

.topbar {
  background: var(--topbar);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  flex-wrap: wrap;
  gap: 12px;
}

.brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.brand-logo--footer {
  width: 36px;
  height: 36px;
  box-shadow: none;
}

.brand-mark {
  width: 10px;
  height: 28px;
  border-radius: 4px;
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.nav-links a,
.nav-links .link-btn {
  color: #cbd5e1;
  text-decoration: none;
  margin-left: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  font: inherit;
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover,
.nav-links .link-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-links a.nav-link-active {
  color: #fff;
  background: rgba(37, 99, 235, 0.45);
}

.nav-badge {
  display: inline-block;
  min-width: 1.25em;
  padding: 0 6px;
  margin-left: 4px;
  border-radius: 999px;
  background: #f97316;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  vertical-align: middle;
}

.link-btn {
  background: transparent;
  border: 0;
  cursor: pointer;
}

.main-content {
  padding-bottom: 32px;
  flex: 1;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin: 22px 0;
  box-shadow: var(--shadow);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.card-form {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.card-form--wide {
  max-width: none;
  margin-top: 0;
}

.ticket-new-page .card-form {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.ticket-new-tips {
  margin: 0;
}

.ticket-new-tips__title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 800;
}

.form-ticket .input-file--wide {
  width: 100%;
  max-width: none;
  padding: 12px 14px;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  background: #f8fafc;
  cursor: pointer;
}

.form-ticket .input-file--wide:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.form-ticket .textarea-fixed {
  min-height: 160px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 6px;
}

.page-title {
  margin: 0 0 10px;
  font-size: 1.65rem;
  letter-spacing: -0.03em;
}

.lead {
  margin: 0 0 22px;
  font-size: 0.95rem;
}

.hero h1 { margin-top: 0; font-size: clamp(1.6rem, 4vw, 2.1rem); letter-spacing: -0.03em; }
.hero p { font-size: 1.05rem; color: var(--muted); max-width: 52ch; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 11px 18px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s, transform 0.1s;
}

.btn:hover {
  background: var(--primary-hover);
  color: #fff;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }

.btn-danger {
  background: #b91c1c;
  color: #fff;
}

.btn-danger:hover {
  background: #991b1b;
  color: #fff;
}

.btn-ghost {
  background: #f1f5f9;
  color: var(--text);
  border: 1px solid #e2e8f0;
}

.btn-ghost:hover {
  background: #e2e8f0;
  color: var(--text);
}

.btn.ghost {
  background: #f1f5f9;
  color: var(--text);
  border: 1px solid #e2e8f0;
}

.btn.ghost:hover {
  background: #e2e8f0;
  color: var(--text);
}

.form { display: grid; gap: 18px; }

.form-ticket .field {
  display: grid;
  gap: 8px;
}

.field-label {
  font-weight: 600;
  font-size: 0.9rem;
}

label.field { margin: 0; }

input, select, textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
  background: #fafbfc;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: #fff;
}

.textarea-fixed {
  resize: none;
  min-height: 150px;
  line-height: 1.5;
}

.input-file {
  padding: 10px;
  border-style: dashed;
  border-color: #94a3b8;
  background: #f8fafc;
  cursor: pointer;
}

.input-file::file-selector-button {
  margin-right: 14px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.input-file::file-selector-button:hover {
  background: var(--primary-hover);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
}

.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }

.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 0.95rem;
}

th, td {
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  padding: 12px 10px;
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

tbody tr:hover {
  background: #f8fafc;
}

tbody a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

tbody a:hover {
  text-decoration: underline;
}

.flash {
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: 16px;
  font-weight: 500;
}

.flash.error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.flash.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

.inline, .inline-form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.chat { display: grid; gap: 10px; margin-bottom: 12px; }

.msg {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
}

.muted { color: var(--muted); font-size: 0.9rem; }

.list { margin: 0; padding-left: 18px; }

.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.subheading {
  margin: 20px 0 12px;
  font-size: 1rem;
  font-weight: 700;
}

.attachments-block { margin-top: 18px; }

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.thumb {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s, box-shadow 0.12s;
  background: #f1f5f9;
}

.thumb:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.thumb img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  vertical-align: middle;
}

h2, h3 { letter-spacing: -0.02em; }

h2 { font-size: 1.35rem; }

section.card > h2:first-child,
section.card > h3:first-child {
  margin-top: 0;
}

.form label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  font-size: 0.92rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Шапка страницы (внутренние разделы) */
.page-intro {
  background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 48%, #eef2ff 100%);
  border: 1px solid rgba(37, 99, 235, 0.15);
  margin-bottom: 0;
}

.page-intro--narrow {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.page-intro__lead {
  margin: 0;
  max-width: 52ch;
}

/* Главная: герой */
.landing-hero {
  padding: 32px 34px;
  background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 40%, #e8f0fe 100%);
  border: 1px solid rgba(37, 99, 235, 0.18);
  overflow: hidden;
}

.landing-hero--home {
  padding: 40px 42px 24px;
  background: linear-gradient(145deg, #ffffff 0%, #eff6ff 35%, #dbeafe 100%);
  border: none;
  box-shadow: var(--shadow);
}

.landing-hero.landing-hero--home.card {
  border: none;
}

.landing-hero--home h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
}

.landing-hero--home .landing-stats {
  margin: 28px 0 0;
  padding: 20px 0 0;
}

.landing-hero--home .landing-stats strong {
  font-size: 1.35rem;
}

.landing-hero--home .landing-stats span {
  font-size: 0.92rem;
}

.eyebrow--home {
  color: var(--primary);
  font-weight: 800;
}

.btn-lg {
  padding: 12px 22px;
  font-size: 1rem;
}

.landing-hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
}

.landing-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(1.75rem, 4.5vw, 2.35rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.landing-hero__lead {
  margin: 0 0 22px;
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 48ch;
  line-height: 1.6;
}

.landing-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 28px;
  list-style: none;
  margin: 28px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid rgba(37, 99, 235, 0.12);
}

.landing-stats li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.landing-stats strong {
  font-size: 1.1rem;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.landing-stats span {
  font-size: 0.82rem;
  color: var(--muted);
}

.landing-hero__visual {
  position: relative;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-hero__card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: 0.9rem;
}

.landing-hero__card--1 { top: 8%; left: 5%; transform: rotate(-2deg); }
.landing-hero__card--2 { top: 38%; right: 0; transform: rotate(1deg); z-index: 2; }
.landing-hero__card--3 { bottom: 8%; left: 12%; transform: rotate(-1deg); }

.landing-hero__icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--primary-soft);
  font-size: 1.1rem;
}

/* Секции главной */
.section-head {
  text-align: center;
  margin-bottom: 24px;
}

.section-head--compact {
  margin-bottom: 18px;
  text-align: left;
}

.section-head__title {
  margin: 0 0 8px;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.section-head__lead {
  margin: 0;
  font-size: 0.95rem;
}

.features-section {
  margin: 28px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.feature-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px 22px 24px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.feature-card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  font-size: 1.4rem;
  margin-bottom: 14px;
}

.feature-card__title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
}

.feature-card__text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.steps-section {
  margin-top: 8px;
}

.steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.steps-list__item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.steps-list__item p {
  margin: 4px 0 0;
  font-size: 0.9rem;
}

.steps-list__num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
}

/* Главная: единая типографика (блок hero без изменений) */
.home-content {
  font-size: 15px;
}

.home-content .section-head__title,
.home-content .feature-card__title,
.home-content .service-card__title,
.home-content .steps-list__item strong,
.home-content .info-list__item dt,
.home-content .quick-action__label,
.home-content .faq-item summary {
  font-size: 17px;
}

.home-content .features-section .section-head__title,
.home-content .services-section .section-head__title {
  font-size: 23px;
}

.home-content .steps-section .section-head__title,
.home-content .home-info__title,
.home-content .faq-section .section-head__title {
  font-size: 19px;
}

.home-content .home-info__title {
  margin-bottom: 8px;
}

.home-content .section-head__lead,
.home-content .feature-card__text,
.home-content .steps-list__item p,
.home-content .info-list__item dd,
.home-content .service-card__text,
.home-content .service-card__links,
.home-content .quick-action__hint,
.home-content .faq-item p {
  font-size: 15px;
}

/* Подвал */
.site-footer {
  margin-top: auto;
  background: var(--admin-chrome);
  color: #cbd5e1;
  padding: 36px 0 28px;
  border-top: 3px solid #2563eb;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.site-footer__brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.site-footer__brand strong {
  display: block;
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.site-footer__tagline {
  margin: 0;
  font-size: 0.88rem;
  color: #94a3b8;
}

.site-footer__contact {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: #94a3b8;
}

.site-footer__copy {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.82rem;
}

@media (max-width: 720px) {
  .landing-hero__grid {
    grid-template-columns: 1fr;
  }

  .landing-hero__visual {
    min-height: 200px;
    margin-top: 8px;
  }

  .landing-hero__card--1 { top: 0; left: 0; }
  .landing-hero__card--2 { top: 50%; right: 0; transform: translateY(-50%) rotate(1deg); }
  .landing-hero__card--3 { bottom: 0; left: 10%; }
}

/* Профиль */
.profile-page {
  max-width: 720px;
  margin: 0 auto;
}

.profile-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 28px 30px;
  background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 48%, #eef2ff 100%);
  border: 1px solid rgba(37, 99, 235, 0.15);
}

.profile-hero-text {
  flex: 1;
  min-width: 200px;
}

.profile-name {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.profile-role-badge {
  display: inline-block;
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #3b82f6 0%, #1d4ed8 50%, #1e3a8a 100%);
  box-shadow: 0 10px 28px rgba(29, 78, 216, 0.35);
  flex-shrink: 0;
}

.profile-section-title {
  margin: 0 0 18px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.profile-tiles {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.profile-tile {
  padding: 16px 18px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: grid;
  gap: 6px;
}

.profile-tile-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.profile-tile-value {
  font-size: 1.02rem;
  font-weight: 600;
  word-break: break-word;
}

.profile-hint {
  background: linear-gradient(180deg, #fafbfc 0%, #f4f6f9 100%);
}

.profile-hint-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 58ch;
}

.profile-logout {
  display: flex;
  justify-content: center;
  margin: 8px 0 24px;
}

.profile-logout__btn {
  min-width: 160px;
  padding: 12px 28px;
  font-weight: 700;
}

.ticket-created {
  margin: 0 0 12px;
  font-size: 0.88rem;
}

.ticket-parties {
  margin: 12px 0 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.ticket-party-line {
  margin: 0 0 8px;
}

.ticket-party-line:last-child {
  margin-bottom: 0;
}

.admin-page {
  max-width: 960px;
  margin: 0 auto;
}

.admin-header .page-title {
  margin-bottom: 8px;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.admin-stat {
  text-align: center;
  padding: 20px 16px;
}

.admin-stat-value {
  display: block;
  font-size: 2.035rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
}

.admin-stat-label {
  display: block;
  margin-top: 6px;
  font-size: 0.935rem;
  color: var(--muted);
  font-weight: 600;
}

.main-content.wrap:has(.admin-shell) {
  max-width: none;
  width: 100%;
  padding: 0;
}

body.layout-admin {
  background: #eef2f7;
}

body.layout-admin .main-content .flash {
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(220px, 270px) 1fr;
  gap: 0;
  max-width: none;
  margin: 0;
  width: 100%;
  min-height: calc(100vh - 62px);
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  background: transparent;
  border: 0;
}

@media (max-width: 820px) {
  .admin-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .admin-main {
    padding: 16px 14px 28px;
  }

  .admin-hero {
    margin-bottom: 16px;
  }

  .admin-hero-title {
    font-size: 1.45rem;
  }

  .admin-hero-lead {
    font-size: 0.95rem;
    max-width: none;
  }

  .admin-hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

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

  .admin-stat-card {
    padding: 14px;
    gap: 10px;
  }

  .admin-stat-card .admin-stat-value {
    font-size: 1.45rem;
  }

  .admin-panel.card,
  .admin-panel .card {
    padding: 16px;
  }

  .admin-chart-panel {
    padding: 16px;
  }

  .admin-filters {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 14px;
  }

  .admin-filter-actions {
    width: 100%;
  }

  .admin-filter-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .admin-inline-role {
    width: 100%;
  }

  .admin-inline-role .admin-role-select {
    flex: 1;
    min-width: 0;
    width: 100%;
  }

  .admin-inline-role .btn {
    flex: 1;
    justify-content: center;
  }

  .admin-user-actions {
    width: 100%;
  }

  .admin-user-actions .inline-form {
    width: 100%;
  }

  .admin-user-actions .inline-form .btn {
    width: 100%;
    justify-content: center;
  }

  .admin-role-confirm__box {
    padding: 20px 18px;
  }

  .admin-role-confirm__actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .admin-role-confirm__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .narrow-admin-form {
    max-width: none;
  }

  .admin-hero-lead .btn {
    display: flex;
    width: 100%;
    margin-top: 10px;
    justify-content: center;
  }

  .admin-chat-form {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-chat-form input[type="text"] {
    width: 100%;
  }

  .admin-chat-form .btn {
    width: 100%;
    justify-content: center;
  }
}

.admin-sidebar {
  background: var(--admin-chrome);
  color: #e2e8f0;
  padding: 20px 18px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-sidebar-head {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-sidebar-title {
  display: block;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: #fff;
}

.admin-sidebar-sub {
  display: block;
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 4px;
}

.admin-side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-side-link {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 600;
  transition: background 0.12s, color 0.12s;
}

.admin-side-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.admin-side-link.is-active {
  color: #fff;
  background: rgba(37, 99, 235, 0.45);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.35);
}

.admin-sidebar-foot {
  margin-top: auto;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #64748b;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-main {
  padding: 26px 28px 40px;
  background: linear-gradient(180deg, #fafbfc 0%, #eef2f7 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
}

.admin-main > * {
  width: 100%;
  max-width: none;
}

.admin-hero {
  margin-bottom: 22px;
}

.admin-hero-title {
  margin: 0 0 8px;
  font-size: 1.815rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.admin-hero-lead {
  margin: 0;
  font-size: 1.045rem;
  color: var(--muted);
  max-width: 60ch;
}

.admin-hero-lead--inline {
  max-width: none;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.admin-stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.admin-stat-icon {
  font-size: 1.925rem;
  line-height: 1;
  opacity: 0.9;
}

.admin-stat-card .admin-stat-value {
  display: block;
  font-size: 1.815rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
}

.admin-stat-card .admin-stat-label {
  display: block;
  margin-top: 2px;
  font-size: 0.902rem;
  color: var(--muted);
  font-weight: 600;
}

.admin-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.admin-panel-title {
  margin: 0 0 14px;
  font-size: 1.155rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.admin-panel .card,
.admin-panel.card {
  margin: 0;
}

.admin-panel.card.admin-chart-panel {
  margin-bottom: 16px;
}

.admin-role-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text);
  font-size: 1.012rem;
  line-height: 1.65;
}

.admin-role-list li {
  margin-bottom: 8px;
}

.admin-table-wrap {
  overflow-x: auto;
  margin: -4px;
  padding: 4px;
  width: 100%;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.99rem;
  table-layout: auto;
}

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.admin-table th {
  font-size: 0.792rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  background: #f8fafc;
}

.admin-table tbody tr:hover {
  background: #f8fafc;
}

.admin-table .admin-table__actions {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}

.admin-table .admin-table__go {
  min-width: 88px;
  justify-content: center;
}

.admin-table-sort-th {
  white-space: nowrap;
}

.admin-table-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
}

.admin-table-sort:hover {
  color: var(--primary);
}

.admin-table-sort__icon {
  font-size: 0.95em;
  line-height: 1;
  color: var(--primary);
  font-weight: 800;
}

.admin-table-sort:not(.is-active) .admin-table-sort__icon {
  color: #94a3b8;
  font-weight: 600;
}

.admin-table-sort--mobile {
  display: none;
  margin-left: auto;
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--primary);
}

.admin-filter-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.admin-pill {
  display: inline-block;
  min-width: 2em;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  text-align: center;
}

.admin-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.825rem;
  font-weight: 700;
}

.admin-badge--res { background: #dbeafe; color: #1e40af; }
.admin-badge--asg { background: #fef3c7; color: #92400e; }
.admin-badge--adm { background: #ede9fe; color: #5b21b6; }
.admin-badge--ok { background: #dcfce7; color: #166534; }
.admin-badge--muted { background: #f1f5f9; color: #64748b; }

.admin-stars {
  letter-spacing: 1px;
  color: #f59e0b;
  margin-right: 6px;
}

.admin-hero-actions {
  margin: 12px 0 0;
}

.admin-inline-role {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.admin-chat-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.admin-chat-form input[type="text"] {
  flex: 1;
  min-width: 200px;
  width: auto;
}

.admin-user-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.admin-role-select {
  width: auto;
  min-width: 130px;
  padding: 8px 10px;
  font-size: 0.968rem;
}

.narrow-admin-form {
  max-width: 520px;
}

.admin-filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px 16px;
  align-items: end;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e5e7eb;
}

.admin-filter-field {
  display: grid;
  gap: 6px;
  margin: 0;
}

.admin-filter-label {
  font-size: 0.792rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.admin-filter-field input,
.admin-filter-field select {
  padding: 9px 11px;
  font-size: 1.012rem;
}

.admin-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-reports-toolbar-form {
  margin: 0;
}

.admin-reports-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-reports-panel .admin-panel-title,
.admin-reports-panel .admin-filter-summary,
.admin-reports-panel .admin-reports-toolbar-form {
  margin: 0;
}

.admin-reports-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-reports-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}

.admin-reports-toolbar__month {
  display: grid;
  gap: 6px;
  margin: 0;
  min-width: min(100%, 220px);
}

.admin-reports-toolbar__month input[type="month"] {
  padding: 9px 11px;
  font-size: 1.012rem;
  min-height: 42px;
  box-sizing: border-box;
}

.admin-reports-toolbar__export {
  flex-shrink: 0;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.admin-reports-filter {
  margin-bottom: 12px;
  padding-bottom: 0;
  border-bottom: 0;
}

.admin-reports-detail-table {
  font-size: 0.95rem;
}

.admin-reports-table tfoot td {
  background: #f8fafc;
  border-top: 2px solid #e2e8f0;
  font-weight: 700;
}

.admin-report-overdue {
  color: #b91c1c;
  font-weight: 800;
}

.admin-filter-summary {
  margin: 0 0 14px;
  font-size: 0.99rem;
}

.admin-filter-summary strong {
  color: var(--primary);
}

.admin-main .btn {
  font-size: 1.045rem;
}

.admin-main .btn-sm {
  font-size: 14.3px;
}

.admin-main .status-badge,
.admin-main .status-overdue {
  font-size: 0.858rem;
}

.admin-main .muted {
  font-size: 0.99rem;
}

.admin-main .form label {
  font-size: 1.012rem;
}

.admin-main input,
.admin-main select,
.admin-main textarea {
  font-size: 1.1rem;
}

.admin-role-confirm {
  border: 0;
  padding: 0;
  max-width: min(480px, calc(100vw - 32px));
  background: transparent;
}

.admin-role-confirm::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.admin-role-confirm__box {
  padding: 24px 26px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

.admin-role-confirm__title {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.admin-role-confirm__text {
  margin: 0 0 10px;
  font-size: 1.02rem;
  line-height: 1.55;
}

.admin-role-confirm__admin {
  color: #b91c1c;
  font-weight: 800;
}

.admin-role-confirm__hint {
  margin: 0 0 18px;
  font-size: 0.92rem;
  line-height: 1.55;
}

.admin-role-confirm__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

/* ПК: +10% к базовому размеру (как масштаб 110% в Chrome) — жители, гости, исполнители */
@media (min-width: 769px) {
  html:has(body.layout-resident),
  html:has(body.layout-assignee),
  html:has(body.layout-guest) {
    font-size: 110%;
  }
}

.workspace-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 24px;
  max-width: var(--layout-max-width);
  margin: 0 auto;
}

.workspace-page > .card,
.workspace-page > .workspace-kpi-grid {
  margin: 0;
}

.workspace-hero {
  padding: 26px 28px;
  background: linear-gradient(135deg, #fff 0%, #eff6ff 55%, #eef2ff 100%);
  border: 1px solid rgba(37, 99, 235, 0.18);
}

.workspace-title {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.workspace-lead {
  margin: 0;
  max-width: 58ch;
}

.workspace-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.workspace-kpi-grid > .card {
  margin: 0;
}

.workspace-kpi {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-radius: 14px;
}

.workspace-kpi--accent {
  background: linear-gradient(160deg, #fffbeb 0%, #fff 100%);
  border: 1px solid #fde68a;
}

.workspace-kpi-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.workspace-kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
}

.workspace-kpi--accent .workspace-kpi-value {
  color: #b45309;
}

.workspace-kpi-hint {
  font-size: 0.82rem;
  color: var(--muted);
}

.workspace-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.workspace-panel {
  margin: 0;
}

.workspace-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.workspace-panel-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.link-inline {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.link-inline:hover {
  text-decoration: underline;
}

.workspace-list {
  margin: 0;
  padding-left: 1.15rem;
  line-height: 1.65;
  font-size: 0.95rem;
}

.workspace-list li {
  margin-bottom: 8px;
}

.workspace-remind-text {
  margin: 0 0 12px;
  font-size: 0.9rem;
}

.workspace-remind-form {
  margin: 0;
}

.workspace-table-wrap {
  overflow-x: auto;
}

.workspace-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.workspace-table th,
.workspace-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.workspace-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}

.workspace-chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.workspace-chat-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.workspace-chat-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.workspace-chat-author {
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 4px;
}

.workspace-chat-text {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.45;
}

.text-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.text-link:hover {
  text-decoration: underline;
  color: var(--primary-hover);
}

.news-page-hero {
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 45%, #eff6ff 100%);
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.news-page-title {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.news-page-lead {
  margin: 0;
  max-width: 52ch;
  font-size: 1.02rem;
}

.news-feed {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.news-feed-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0;
  background: var(--surface);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(148, 163, 184, 0.2);
  transition: box-shadow 0.2s, transform 0.2s;
}

.news-feed-card:hover {
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.news-feed-card__media-link {
  display: block;
  text-decoration: none;
  color: inherit;
  min-height: 220px;
}

.news-feed-card__media {
  height: 100%;
  min-height: 220px;
  background: linear-gradient(160deg, #e0e7ff 0%, #dbeafe 40%, #f1f5f9 100%);
}

.news-feed-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  max-height: 340px;
  object-fit: cover;
}

.news-feed-card__placeholder {
  min-height: 240px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(145deg, #1e3a8a 0%, #1d4ed8 50%, #3b82f6 100%);
  color: #e0e7ff;
}

.news-feed-card__placeholder-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.news-feed-card__placeholder-text {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.news-feed-card__body {
  padding: 22px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}

.news-feed-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 0.86rem;
  color: var(--muted);
}

.news-feed-card__date {
  font-weight: 600;
  color: var(--muted);
}

.news-feed-card__author {
  color: var(--muted);
}

.news-feed-card__badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
  font-size: 0.78rem;
}

.news-feed-card__title {
  margin: 0;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.news-feed-card__title a {
  color: var(--text);
  text-decoration: none;
}

.news-feed-card__title a:hover {
  color: var(--primary);
}

.news-feed-card__snippet {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-feed-card__cta {
  margin-top: 6px;
  align-self: flex-start;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--primary);
  text-decoration: none;
}

.news-feed-card__cta:hover {
  text-decoration: underline;
}

.news-empty {
  text-align: center;
  padding: 36px 24px;
}

@media (max-width: 800px) {
  .news-feed-card {
    grid-template-columns: 1fr;
  }

  .news-feed-card__media-link {
    min-height: 200px;
  }

  .news-feed-card__media img {
    max-height: 260px;
    min-height: 200px;
  }

  .news-feed-card__placeholder {
    min-height: 200px;
  }
}

.news-home-block {
  margin-top: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.news-home-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.news-home-title {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.news-home-sub {
  margin: 0;
  font-size: 0.92rem;
}

.news-home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.news-home-card {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, box-shadow 0.18s;
}

.news-home-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.news-home-card__media-link {
  display: block;
  text-decoration: none;
}

.news-home-card__media {
  aspect-ratio: 16 / 10;
  background: linear-gradient(160deg, #e0e7ff 0%, #dbeafe 100%);
  overflow: hidden;
}

.news-home-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-home-card__placeholder {
  width: 100%;
  height: 100%;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #1e3a8a 0%, #2563eb 100%);
  color: #e0e7ff;
  font-weight: 700;
  font-size: 0.9rem;
}

.news-home-card__body {
  padding: 14px 16px 16px;
}

.news-home-card__date {
  font-size: 0.8rem;
  display: block;
  margin-bottom: 6px;
}

.news-home-card__title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.news-home-card__title a {
  color: var(--text);
  text-decoration: none;
}

.news-home-card__title a:hover {
  color: var(--primary);
}

.news-home-card__snippet {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.news-article h1 {
  margin-top: 8px;
}

.news-back {
  margin: 0 0 12px;
}

.news-meta {
  margin: 0 0 20px;
  font-size: 0.95rem;
}

.news-cover {
  margin: 0 0 22px;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: var(--shadow-sm);
  background: #e2e8f0;
}

.news-cover img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: cover;
}

.news-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.news-gallery-item {
  margin: 0;
}

.news-gallery-item img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  border: 1px solid rgba(148, 163, 184, 0.25);
  object-fit: cover;
  max-height: 280px;
}

.news-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: 4px;
}

.news-admin-actions {
  margin: 0 0 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}

.news-delete-form {
  margin: 0;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.notifications-page .notifications-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
}

.notifications-title {
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.notifications-lead {
  margin: 0;
  max-width: 52ch;
  font-size: 0.92rem;
}

.notify-feed {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notify-feed__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px 16px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #fafbfc;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.notify-feed__item:hover {
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: var(--shadow-sm);
}

.notify-feed__item--status-new {
  border-left: 4px solid #3b82f6;
}

.notify-feed__item--status-in_progress {
  border-left: 4px solid #f59e0b;
}

.notify-feed__item--status-closed {
  border-left: 4px solid #22c55e;
}

.notify-feed__item--message {
  border-left: 4px solid #6366f1;
}

.notify-feed__item--news {
  border-left: 4px solid #0ea5e9;
}

.notify-feed__item--assign {
  border-left: 4px solid #8b5cf6;
}

.notify-feed__item--deadline,
.notify-feed__item--deadline-overdue {
  border-left: 4px solid #ef4444;
}

.notify-feed__icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #fff;
  font-size: 1.25rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.notify-feed__body {
  min-width: 0;
}

.notify-feed__title {
  margin: 0 0 4px;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

.notify-feed__hint {
  margin: 0 0 6px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.notify-feed__time {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
}

.notify-feed__action {
  flex-shrink: 0;
}

.notify-feed__more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.notify-feed__count {
  margin: 0;
  font-size: 0.88rem;
}

.notifications-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.notifications-item {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 16px 20px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.notifications-item:last-child {
  border-bottom: 0;
}

.notifications-item__time {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.45;
}

.notifications-item__text {
  margin: 0 0 8px;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--text);
}

.notifications-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notifications-empty {
  margin: 12px 0 0;
}

@media (max-width: 640px) {
  .notify-feed__item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .notify-feed__action {
    grid-column: 1 / -1;
    justify-self: start;
    padding-left: 58px;
  }
}

@media (max-width: 560px) {
  .notifications-item {
    grid-template-columns: 1fr;
  }

  .notifications-item__time {
    font-size: 0.82rem;
  }
}

.status-overdue {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  vertical-align: middle;
}

.status-overdue--inline {
  margin-left: 6px;
}

.ticket-status-line .status-overdue {
  margin-top: 4px;
  margin-left: 0;
}

/* Единый стиль страниц (как главная для гостей) */
.page-hero {
  padding: 28px 32px;
  background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 40%, #e8f0fe 100%);
  border: 1px solid rgba(37, 99, 235, 0.18);
}

.page-hero__grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}

.page-hero__title {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.page-hero__lead {
  margin: 0;
  font-size: 1rem;
  max-width: 52ch;
  line-height: 1.6;
}

.page-hero__icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-hero__icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  font-size: 2rem;
  box-shadow: var(--shadow-sm);
}

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 22px;
  align-items: start;
  margin: 22px 0;
}

.page-layout--solo {
  grid-template-columns: 1fr;
}

.page-layout--auth .page-layout__main,
.page-layout--news .page-layout__main {
  min-width: 0;
}

/* Страница новостей — на всю ширину */
.news-page {
  max-width: var(--layout-max-width);
  margin: 0 auto;
}

.news-page-info {
  margin: 0 0 22px;
}

.news-page-info__card {
  margin: 0;
  width: 100%;
}

.news-page-info .info-bullets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 28px;
  font-size: 0.98rem;
  line-height: 1.7;
}

.news-page-info .info-bullets li {
  margin-bottom: 10px;
}

.news-page-info__title {
  margin: 0 0 16px;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.news-page-info .info-list {
  gap: 16px;
}

.news-page-info .info-list__item dt {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.news-page-info .info-list__item dd {
  font-size: 0.98rem;
  line-height: 1.6;
}

.news-page-feed {
  margin: 0;
  padding: 22px 24px 24px;
}

.news-page .news-feed {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.news-page .news-feed-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  height: auto;
}

.news-page .news-feed-card__media-link {
  min-height: 200px;
}

.news-page .news-feed-card__media {
  min-height: 200px;
  max-height: none;
  height: 100%;
}

.news-page .news-feed-card__media img {
  min-height: 200px;
  max-height: 280px;
  height: 100%;
}

.news-page .news-feed-card__placeholder {
  min-height: 200px;
}

.news-page .news-feed-card__body {
  padding: 20px 24px;
}

.news-page .news-feed-card__title {
  font-size: 1.2rem;
}

.news-page .news-feed-card__snippet {
  font-size: 1rem;
}

@media (max-width: 768px) {
  .news-page-info .info-bullets {
    grid-template-columns: 1fr;
  }

  .news-page .news-feed-card {
    grid-template-columns: 1fr;
  }
}

.page-layout__main {
  min-width: 0;
}

.page-layout__main > .card,
.page-layout__main > section {
  margin-top: 0;
}

.page-layout__aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page-layout__aside .info-aside {
  margin: 0;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 0 0 22px;
}

.quick-action {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.quick-action:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--text);
}

.quick-action__icon {
  font-size: 1.35rem;
  line-height: 1;
}

.quick-action__label {
  font-weight: 700;
  font-size: 0.95rem;
}

.quick-action__hint {
  font-size: 0.78rem;
  line-height: 1.35;
}

.info-aside {
  padding: 20px 22px;
}

.info-aside__title {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.info-aside__body {
  font-size: 0.9rem;
}

.info-aside__action {
  margin: 14px 0 0;
}

.info-list {
  margin: 0;
  display: grid;
  gap: 14px;
}

.info-list__item dt {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 4px;
}

.info-list__item dd {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.info-bullets {
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.65;
  font-size: 0.88rem;
}

.info-bullets li {
  margin-bottom: 8px;
}

.section-inline-lead {
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.field-hint {
  font-size: 0.82rem;
}

.steps-section--compact {
  margin-top: 0;
}

.status-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 0.92rem;
}

.status-legend__pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-right: 6px;
}

.status-legend__pill--new { background: #dbeafe; color: #1e40af; }
.status-legend__pill--progress { background: #fef3c7; color: #92400e; }
.status-legend__pill--closed { background: #dcfce7; color: #166534; }

.empty-state {
  padding: 24px 8px;
  text-align: center;
}

.empty-state__title {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 1.05rem;
}

.ticket-back {
  margin: 0 0 12px;
}

body.layout-resident .main-content,
body.layout-assignee .main-content,
body.layout-guest .main-content {
  padding-top: 24px;
}

.profile-hint-text {
  margin: 0 0 12px;
  line-height: 1.65;
}

.profile-hint-text:last-child {
  margin-bottom: 0;
}

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

  .page-hero__grid {
    grid-template-columns: 1fr;
  }

  .page-hero__icon-wrap {
    justify-content: flex-start;
  }

  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .quick-actions {
    grid-template-columns: 1fr;
  }
}

/* --- UI enhancements --- */

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

.link-inline {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.link-inline:hover {
  text-decoration: underline;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge--new { background: #dbeafe; color: #1e40af; }
.status-badge--in_progress { background: #fef3c7; color: #92400e; }
.status-badge--closed { background: #dcfce7; color: #166534; }

/* Ticket progress */
.ticket-progress {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 0 20px;
  padding: 16px 8px;
}

.ticket-progress__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 72px;
}

.ticket-progress__dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #64748b;
  border: 2px solid #cbd5e1;
}

.ticket-progress__step.is-done .ticket-progress__dot {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.ticket-progress__step.is-current .ticket-progress__dot {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.ticket-progress__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-align: center;
}

.ticket-progress__step.is-current .ticket-progress__label {
  color: var(--accent);
}

.ticket-progress__line {
  flex: 1;
  height: 3px;
  background: #e2e8f0;
  margin: 0 4px;
  margin-bottom: 22px;
  border-radius: 2px;
}

.ticket-progress__line.is-done {
  background: #86efac;
}

/* Important banner */
.important-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-left: 4px solid #f59e0b;
  transition: transform 0.15s, box-shadow 0.15s;
}

.important-banner:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.important-banner__label {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.important-banner__text {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
}

.important-banner__arrow {
  flex-shrink: 0;
  font-size: 1.2rem;
  color: #92400e;
}

/* Ticket cards */
.ticket-cards {
  display: grid;
  gap: 10px;
}

.ticket-cards--full {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.ticket-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.ticket-card:hover {
  border-color: var(--accent);
  background: #f8fafc;
}

.ticket-card--full {
  flex-direction: column;
  align-items: flex-start;
}

.ticket-card__num {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.9rem;
}

.ticket-card__title {
  flex: 1;
  font-size: 0.92rem;
}

.ticket-card__meta {
  font-size: 0.82rem;
}

/* Tickets toolbar */
.tickets-toolbar {
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.tickets-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-left: auto;
}

.tickets-filter {
  margin: 0;
}

.tickets-filter select {
  min-width: 140px;
  min-height: 42px;
}

.tickets-toolbar__new {
  min-height: 42px;
  align-self: flex-end;
}

.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.view-toggle__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  text-decoration: none;
  color: #64748b;
  background: #fff;
  font-size: 1rem;
}

.view-toggle__btn.is-active {
  background: var(--accent);
  color: #fff;
}

.view-toggle__btn:hover:not(.is-active) {
  background: #f1f5f9;
}

/* Empty state */
.empty-state__icon {
  display: block;
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.empty-state__text {
  margin: 0 0 16px;
}

/* Profile stats */
.profile-stats {
  margin-bottom: 16px;
}

.profile-stats-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.profile-stat {
  text-align: center;
  padding: 12px 8px;
  background: #f8fafc;
  border-radius: var(--radius);
}

.profile-stat__value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}

.profile-stat__label {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 4px;
}

/* Services */
.services-section {
  margin: 24px 0;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.service-card {
  position: relative;
  padding: 20px;
  background: var(--card);
  border: 2px solid #cbd5e1;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.service-card:hover {
  border-color: #93c5fd;
  box-shadow: var(--shadow);
}

.service-card--soon {
  opacity: 0.85;
}

.service-card__icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 8px;
}

.service-card__title {
  margin: 0 0 8px;
  font-size: 1rem;
}

.service-card__text {
  margin: 0 0 12px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.service-card__badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.72rem;
  font-weight: 700;
}

.service-card__links {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
}

.service-card__links li + li {
  margin-top: 6px;
}

/* Главная: полезная информация */
.home-info {
  margin-top: 0;
}

.home-info__title {
  margin: 0 0 16px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Главная: компактные новости */
.news-home-compact {
  border: 1px solid #e2e8f0;
  background: #fff;
}

.news-home-compact__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 4px;
  padding-bottom: 14px;
  border-bottom: 2px solid #e2e8f0;
}

.news-home-compact__eyebrow {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.news-home-compact__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.news-home-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-home-list__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 14px;
  align-items: center;
  padding: 14px 8px;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.news-home-list__item:hover {
  background: #f8fafc;
}

.news-home-list__item:hover .news-home-list__title {
  color: var(--primary);
}

.news-home-list li:last-child .news-home-list__item {
  border-bottom: none;
}

.news-home-list__date {
  grid-row: 1 / span 2;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  min-width: 110px;
}

.news-home-list__title {
  font-weight: 700;
  font-size: 0.95rem;
  transition: color 0.15s;
}

.news-home-list__snippet {
  grid-column: 2;
  font-size: 0.82rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-home-list__arrow {
  grid-row: 1 / span 2;
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 700;
}

@media (max-width: 600px) {
  .news-home-list__item {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
  }

  .news-home-list__date {
    grid-row: auto;
    grid-column: 1 / -1;
    min-width: 0;
  }

  .news-home-list__arrow {
    grid-row: 2;
    grid-column: 2;
    align-self: start;
  }
}

/* FAQ */
.faq-section {
  margin: 24px 0 0;
}

.faq-list {
  display: grid;
  gap: 8px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item summary {
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  background: #f8fafc;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  font-weight: 400;
  color: #64748b;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  margin: 0;
  padding: 12px 16px 16px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #475569;
}

/* Search */
.search-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-form input[type="search"] {
  flex: 1;
}

.search-results {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}

.search-results li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.search-results li:last-child {
  border-bottom: none;
}

/* Toasts */
.toast-root {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 32px));
}

.toast {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.15);
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: auto;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.toast--success { background: #dcfce7; color: #166534; border-left: 4px solid #22c55e; }
.toast--error { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.toast--info { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }

/* Mobile bottom nav */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #0f172a;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
  align-items: flex-end;
  gap: 4px;
}

.mobile-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  font-size: 0.65rem;
  font-weight: 600;
  color: #94a3b8;
  text-decoration: none;
  position: relative;
  min-width: 52px;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}

.mobile-nav__item.is-active {
  color: #fff;
}

.mobile-nav__item.is-active span:first-child {
  transform: scale(1.05);
}

.mobile-nav__more-btn {
  appearance: none;
}

.mobile-nav__item span:first-child {
  font-size: 1.25rem;
}

.mobile-nav__item--fab {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  justify-content: center;
  margin-top: -20px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  font-size: 1.5rem;
}

.mobile-nav__item--fab span {
  font-size: 1.5rem;
  line-height: 1;
}

.mobile-nav__badge {
  position: absolute;
  top: 2px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .mobile-nav {
    display: flex;
  }

  body.has-mobile-nav .main-content {
    padding-bottom: calc(72px + 32px);
  }

  body.has-mobile-nav .topbar .nav-links a:not(.brand),
  body.has-mobile-nav .topbar .nav-links form {
    display: none;
  }

  .admin-sidebar {
    display: none;
  }

  .profile-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ticket-progress {
    padding: 12px 0;
  }

  .ticket-progress__label {
    font-size: 0.68rem;
  }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__img {
  max-width: min(92vw, 960px);
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
}

.lightbox__prev { left: 16px; }
.lightbox__next { right: 16px; }

.lightbox__counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Admin chart */
.admin-chart-panel {
  padding: 26px 28px 30px;
  border: 1px solid #dbeafe;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.admin-chart-panel__head {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e2e8f0;
}

.admin-chart-panel__head .admin-panel-title {
  margin: 0 0 6px;
}

.admin-chart-panel__hint {
  margin: 0;
  font-size: 0.99rem;
}

.admin-two-col--below-chart {
  margin-top: 4px;
}

.month-stats-chart {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 6px 0 2px;
}

.month-stats-chart__row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 18px;
}

.month-stats-chart__month {
  font-size: 0.99rem;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.02em;
}

.month-stats-chart__track {
  height: 32px;
  background: #e8eef4;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.month-stats-chart__fill {
  height: 100%;
  min-width: 0;
  background: linear-gradient(90deg, #60a5fa 0%, #2563eb 100%);
  border-radius: 999px;
  transition: width 0.45s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.month-stats-chart__count {
  font-size: 1.155rem;
  font-weight: 800;
  color: var(--primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Ticket chat — заметный вход для жителя */
.ticket-chat-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
  text-decoration: none;
  color: inherit;
  border: 2px solid #93c5fd;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  transition: border-color 0.15s, transform 0.15s;
  scroll-margin-top: 80px;
}

.ticket-chat-banner:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.ticket-chat-banner__icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.ticket-chat-banner__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.92rem;
}

.ticket-chat-banner__text strong {
  font-size: 1rem;
  color: var(--primary);
}

.ticket-chat-banner__arrow {
  font-size: 1.25rem;
  color: var(--primary);
  flex-shrink: 0;
}

.ticket-chat-section {
  scroll-margin-top: 80px;
  border: 2px solid #bfdbfe;
}

.ticket-card--split {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  overflow: hidden;
}

.ticket-card--split .ticket-card__main {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
}

.ticket-card--split .ticket-card__main:hover {
  background: #f8fafc;
}

.ticket-card__chat {
  flex-shrink: 0;
  margin: 8px 12px 8px 0;
  white-space: nowrap;
}

.ticket-list-chat {
  white-space: nowrap;
  min-width: 88px;
  text-align: center;
}

table .ticket-list-chat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Таблицы → карточки на телефоне */
@media (max-width: 720px) {
  .admin-table--stack thead,
  .stack-table thead {
    display: none;
  }

  .admin-table--stack tbody tr,
  .admin-table--stack tfoot tr,
  .stack-table tbody tr,
  .stack-table tfoot tr {
    display: block;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow-sm);
  }

  .admin-table--stack tbody tr:hover,
  .stack-table tbody tr:hover {
    background: #fff;
  }

  .admin-table--stack tfoot tr,
  .stack-table tfoot tr {
    background: #f8fafc;
    border-width: 2px;
  }

  .admin-table--stack td,
  .admin-table--stack tfoot td,
  .stack-table td,
  .stack-table tfoot td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    text-align: right;
  }

  .admin-table--stack td:last-child,
  .admin-table--stack tfoot td:last-child,
  .stack-table td:last-child,
  .stack-table tfoot td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .admin-table--stack td:first-child,
  .admin-table--stack tfoot td:first-child,
  .stack-table td:first-child,
  .stack-table tfoot td:first-child {
    padding-top: 0;
  }

  .admin-table--stack td::before,
  .admin-table--stack tfoot td::before,
  .stack-table td::before,
  .stack-table tfoot td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    text-align: left;
    flex: 0 0 42%;
    max-width: 48%;
  }

  .admin-table--stack td.admin-table__empty,
  .stack-table td.stack-table__empty {
    display: block;
    text-align: center;
    padding: 12px 0;
  }

  .admin-table--stack td.admin-table__empty::before,
  .stack-table td.stack-table__empty::before {
    display: none;
  }

  .stack-table--tickets tbody tr {
    cursor: default;
  }

  .stack-table td.stack-table__actions[data-label=""]::before {
    display: none;
  }

  .stack-table td.stack-table__actions .stack-table__go {
    width: 100%;
    justify-content: center;
  }

  .admin-table--stack td.admin-table__actions,
  .stack-table td.stack-table__actions {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }

  .admin-table--stack td.admin-table__actions::before,
  .stack-table td.stack-table__actions::before {
    margin-bottom: 2px;
  }

  .admin-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .admin-table-actions .btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  .admin-table--stack td.admin-table__actions[data-label=""]::before {
    display: none;
  }

  .admin-table--stack td.admin-table__actions {
    padding-top: 4px;
    border-bottom: 0;
  }

  .admin-table--stack td.admin-table__actions .admin-table__go {
    width: 100%;
    justify-content: center;
  }

  .admin-table-sort--mobile {
    display: inline-flex;
  }

  .admin-table-sort-th {
    display: none;
  }

  .admin-table-status {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex: 1;
    min-width: 0;
    text-align: right;
  }

  .admin-table-status .status-overdue {
    margin-left: 0;
    white-space: nowrap;
  }

  .month-stats-chart__row {
    grid-template-columns: 58px minmax(0, 1fr) 40px;
    gap: 10px;
  }

  .month-stats-chart__month {
    font-size: 0.82rem;
  }

  .month-stats-chart__count {
    font-size: 1rem;
  }
}

/* Admin «Ещё» — дополнительные разделы на телефоне */
.mobile-more-sheet {
  border: 0;
  padding: 0;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  background: transparent;
}

.mobile-more-sheet::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.mobile-more-sheet__box {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  border-radius: 18px 18px 0 0;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.15);
}

.mobile-more-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.mobile-more-sheet__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.mobile-more-sheet__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: #f1f5f9;
  color: #334155;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.mobile-more-sheet__links {
  display: grid;
  gap: 8px;
}

.mobile-more-sheet__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.mobile-more-sheet__link.is-active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: rgba(37, 99, 235, 0.25);
}

.mobile-more-sheet__link span[aria-hidden="true"] {
  font-size: 1.15rem;
  width: 1.4rem;
  text-align: center;
}

@media (max-width: 480px) {
  .admin-stat-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== Житель: телефонный интерфейс ========== */
.stack-table-wrap {
  overflow-x: auto;
  margin: 0 -4px;
  padding: 4px;
}

@media (max-width: 768px) {
  body.layout-guest .wrap,
  body.layout-resident .wrap {
    width: 100%;
    max-width: none;
    padding-left: 14px;
    padding-right: 14px;
  }

  body.layout-guest .card,
  body.layout-resident .card {
    margin: 10px 0;
    padding: 16px 14px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
  }

  body.layout-guest .page-hero,
  body.layout-resident .page-hero {
    padding: 18px 16px;
    margin-top: 0;
  }

  body.layout-guest .page-hero__icon-wrap,
  body.layout-resident .page-hero__icon-wrap {
    display: none;
  }

  body.layout-guest .page-hero__title,
  body.layout-resident .page-hero__title {
    font-size: 1.35rem;
  }

  body.layout-guest .page-hero__lead,
  body.layout-resident .page-hero__lead {
    font-size: 0.92rem;
    max-width: none;
  }

  body.layout-guest .page-layout,
  body.layout-resident .page-layout {
    margin: 10px 0;
    gap: 10px;
  }

  body.layout-guest .page-layout__aside,
  body.layout-resident .page-layout__aside {
    display: none;
  }

  body.layout-guest .landing-hero--home,
  body.layout-resident .landing-hero--home {
    padding: 20px 16px;
  }

  body.layout-guest .landing-hero--home .landing-hero__visual,
  body.layout-resident .landing-hero--home .landing-hero__visual {
    display: none;
  }

  body.layout-guest .landing-hero--home .actions,
  body.layout-resident .landing-hero--home .actions {
    flex-direction: column;
    align-items: stretch;
  }

  body.layout-guest .landing-hero--home .actions .btn,
  body.layout-resident .landing-hero--home .actions .btn {
    width: 100%;
    justify-content: center;
  }

  body.layout-guest .landing-hero--home .landing-stats,
  body.layout-resident .landing-hero--home .landing-stats {
    display: none;
  }

  body.layout-resident .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.layout-guest .features-grid,
  body.layout-guest .services-grid,
  body.layout-resident .features-grid,
  body.layout-resident .services-grid {
    grid-template-columns: 1fr;
  }

  body.layout-guest .form-actions,
  body.layout-resident .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  body.layout-guest .form-actions .btn,
  body.layout-resident .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  body.layout-guest .news-page .news-feed-card,
  body.layout-resident .news-page .news-feed-card {
    grid-template-columns: 1fr;
  }

  body.layout-guest .news-page-feed,
  body.layout-resident .news-page-feed {
    padding: 14px;
  }

  body.layout-guest .news-back .btn,
  body.layout-resident .ticket-back .btn {
    width: 100%;
    justify-content: center;
  }

  body.layout-guest .site-footer__inner {
    gap: 16px;
  }

  body.layout-guest .site-footer__brand {
    flex-direction: column;
    align-items: flex-start;
  }

  body.layout-resident .tickets-toolbar {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
  }

  body.layout-resident .tickets-toolbar__actions {
    display: grid;
    gap: 10px;
    width: 100%;
  }

  body.layout-resident .tickets-filter {
    display: grid;
    gap: 6px;
    width: 100%;
  }

  body.layout-resident .tickets-filter__label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
  }

  body.layout-resident .tickets-filter select {
    width: 100%;
  }

  body.layout-resident .tickets-toolbar__new {
    width: 100%;
    justify-content: center;
  }

  body.layout-resident .stack-table--tickets td.stack-table__actions {
    padding-top: 4px;
    border-bottom: 0;
  }

  body.layout-resident .status-legend li {
    font-size: 0.88rem;
    line-height: 1.5;
  }

  body.layout-resident .ticket-back .btn {
    width: 100%;
    justify-content: center;
  }

  body.layout-resident .ticket-progress {
    padding: 10px 0;
    margin-bottom: 14px;
  }

  body.layout-resident .ticket-progress__label {
    font-size: 0.62rem;
  }

  body.layout-resident .ticket-progress__dot {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  body.layout-resident .ticket-compose-form {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-top: 12px;
  }

  body.layout-resident .ticket-compose-form input[type="text"],
  body.layout-resident .ticket-compose-form select {
    width: 100%;
  }

  body.layout-resident .ticket-compose-form .btn {
    width: 100%;
    justify-content: center;
  }

  body.layout-resident .ticket-rate-form select {
    width: 100%;
  }

  body.layout-resident .msg {
    word-break: break-word;
  }

  body.layout-resident .profile-page .page-hero {
    margin-bottom: 0;
  }

  body.layout-resident .profile-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.layout-resident .profile-stat {
    padding: 14px 12px;
  }

  body.layout-resident .profile-tiles {
    grid-template-columns: 1fr;
  }

  body.layout-resident .profile-logout__btn {
    width: 100%;
    justify-content: center;
  }

  body.layout-resident .notify-feed__item {
    padding: 14px;
  }

  body.layout-resident .notify-feed__action .btn {
    width: 100%;
    justify-content: center;
  }

  body.layout-resident .ticket-new-tips {
    margin-top: 0;
  }

  body.layout-guest .empty-state .btn,
  body.layout-resident .empty-state .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  body.layout-resident .quick-actions {
    grid-template-columns: 1fr;
  }

  body.layout-resident .profile-stats-grid {
    grid-template-columns: 1fr;
  }

  body.layout-assignee .wrap {
    width: 100%;
    max-width: none;
    padding-left: 14px;
    padding-right: 14px;
  }

  body.layout-assignee .card {
    margin: 10px 0;
    padding: 16px 14px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
  }

  body.layout-assignee .workspace-page > .card,
  body.layout-assignee .workspace-page > .workspace-kpi-grid {
    margin: 0;
  }

  body.layout-assignee .workspace-page {
    gap: 24px;
  }

  body.layout-assignee .workspace-hero {
    padding: 18px 16px;
  }

  body.layout-assignee .workspace-title {
    font-size: 1.35rem;
  }

  body.layout-assignee .workspace-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.layout-assignee .workspace-kpi {
    padding: 14px 12px;
  }

  body.layout-assignee .workspace-kpi-value {
    font-size: 1.45rem;
  }

  body.layout-assignee .workspace-panel-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  body.layout-assignee .workspace-list li {
    font-size: 0.95rem;
    line-height: 1.45;
  }

  body.layout-assignee .profile-page .page-hero {
    padding: 18px 16px;
  }

  body.layout-assignee .profile-tiles {
    grid-template-columns: 1fr;
  }

  body.layout-assignee .profile-logout__btn {
    width: 100%;
  }
}

/* Push-уведомления: модальное окно и переключатель в профиле */
.browser-notify-modal {
  border: 0;
  padding: 0;
  max-width: min(420px, calc(100vw - 28px));
  width: 100%;
  background: transparent;
}

.browser-notify-modal::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.browser-notify-modal__box {
  background: linear-gradient(160deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 18px;
  padding: 28px 24px 22px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  text-align: center;
}

.browser-notify-modal__icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 12px;
}

.browser-notify-modal__title {
  margin: 0 0 10px;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.browser-notify-modal__text {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.browser-notify-modal__notes {
  margin: 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.browser-notify-modal__tip {
  margin: 0;
  padding: 10px 12px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #1e3a5f;
  text-align: center;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
}

.browser-notify-modal__hint {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}

.browser-notify-modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.browser-notify-modal__btn {
  width: 100%;
  justify-content: center;
  min-height: 46px;
  font-weight: 700;
  border-radius: 12px;
}

.browser-notify-modal__btn--yes {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.browser-notify-modal__btn--yes:hover {
  background: #15803d;
  border-color: #15803d;
  color: #fff;
}

.browser-notify-modal__btn--no {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.browser-notify-modal__btn--no:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.profile-notify__lead {
  margin: 0 0 14px;
  font-size: 0.95rem;
}

.profile-notify__hint {
  margin: 12px 0 0;
  font-size: 0.88rem;
}

.profile-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
}

.profile-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.profile-toggle__track {
  position: relative;
  flex-shrink: 0;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.2s ease;
}

.profile-toggle__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s ease;
}

.profile-toggle input:checked + .profile-toggle__track {
  background: #2563eb;
}

.profile-toggle input:checked + .profile-toggle__track::after {
  transform: translateX(22px);
}

.profile-toggle__label {
  font-weight: 700;
  color: var(--text);
}

.profile-toggle input:focus-visible + .profile-toggle__track {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
