@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --ink: #102b55;
  --muted: #71819b;
  --blue: #0878f9;
  --line: #dce8f5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background-color: #f4f8fc;
  background-image: url("../zakbg.png");
  background-repeat: no-repeat;
  background-position: right 58px;
  background-size: 54% auto;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 1rem;
}
.rp-warning {
  display: block;
  padding: 7px 14px;
  color: #dbeafe;
  background: #071d3d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
}
.site-navbar {
  min-height: 58px;
  padding: 0.45rem 2.3rem;
  background: linear-gradient(100deg, #09284e, #071d3d) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.site-navbar .container-fluid {
  padding-left: 0;
  padding-right: 0;
}
.site-navbar .navbar-brand {
  display: inline-flex;
  align-items: center;
  color: #fff;
  white-space: nowrap;
}
.site-navbar .navbar-brand img {
  display: block;
  width: 164px;
  max-height: 42px;
  object-fit: contain;
}
.site-navbar .navbar-nav {
  gap: 0.35rem;
}
.site-navbar .nav-link {
  color: #e7effb;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.65rem 0.7rem !important;
  border-radius: 6px;
  white-space: nowrap;
}
.site-navbar .nav-link:hover,
.site-navbar .nav-link.active {
  color: #fff;
  background: #0d6dde;
}
.site-navbar .login-link {
  min-width: 92px;
  text-align: center;
  background: #0878f9;
  border-radius: 6px;
}
.profile-icon {
  width: 17px;
  height: 17px;
  object-fit: contain;
  vertical-align: -3px;
  margin-right: 4px;
}
.notification-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: -5px;
}
.notification-icon {
  color: #fff;
}
.container {
  width: auto;
  max-width: none;
  margin-left: 2.3rem;
  margin-right: 2.3rem;
}
.home-hero {
  min-height: 164px;
  padding: 30px 10px 0;
  position: relative;
  overflow: hidden;
  background: transparent;
  border-radius: 0 0 18px 18px;
}
.hero-copy {
  position: relative;
  z-index: 1;
}
.hero-copy h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.hero-copy p {
  color: #5d7394;
  font-size: 1.08rem;
  line-height: 1.45;
}
.home-panels {
  margin-top: -1px;
}
.section-card,
.stats-card,
.initiatives-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.07);
}
.section-card {
  padding: 0;
}
.feature-card {
  min-height: 156px;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 16px 18px;
  border: 1px solid #d7e7f7;
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(145deg, #fff, #f8fbff);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.feature-card:hover {
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 7px 18px rgba(10, 100, 200, 0.14);
}
.feature-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  font-size: 1.65rem;
  font-weight: 700;
  margin-bottom: 13px;
}
.feature-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.icon-blue {
  background: #0878f9;
}
.icon-purple {
  background: #7b4bf4;
}
.icon-green {
  background: #00b66f;
}
.icon-orange {
  background: #ffad0a;
}
.feature-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 5px;
}
.feature-card small {
  color: #72829a;
  font-size: 0.88rem;
  line-height: 1.45;
}
.feature-arrow {
  position: absolute;
  right: 14px;
  bottom: 18px;
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eaf4ff;
  color: var(--blue);
  font-size: 1.35rem;
}
.stats-card {
  padding: 14px 15px;
}
.stats-card h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 800;
}
.stats-title-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.stats-symbol,
.heading-icon {
  color: var(--blue);
}
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  border-bottom: 1px solid #e6edf5;
  color: #6b7d99;
  font-size: 0.82rem;
}
.stat-row > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.stat-row > span img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex: 0 0 16px;
}
.stat-row:last-child {
  border-bottom: 0;
}
.stat-row strong {
  color: #142849;
  font-size: 0.95rem;
}
.initiatives-card {
  padding: 14px 12px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.07);
}
.initiative-heading h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 2px;
  font-size: 1.15rem;
  font-weight: 800;
}
.initiative-heading .heading-icon {
  width: 19px;
  height: 19px;
  object-fit: contain;
}
.initiative-heading p {
  font-size: 0.82rem;
  color: #8a9ab0 !important;
}
.initiative-heading a {
  color: var(--blue);
  text-decoration: none;
}
.submit-btn {
  align-items: center;
  padding: 8px 13px;
  color: #fff;
  background: #092b59;
  border-radius: 7px;
  font-size: 0.72rem;
  text-decoration: none;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid #dce7f2;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.07);
}
.table {
  min-width: 1100px;
  color: #304568;
  font-size: 0.84rem;
}
.table thead th {
  padding: 9px 11px;
  background: #edf4fb;
  color: #233b60;
  border: 0;
  font-weight: 800;
  white-space: nowrap;
}
.table tbody td {
  padding: 10px 11px;
  border-color: #e7eef6;
  vertical-align: middle;
}
.table tbody tr:last-child td {
  border-bottom: 0;
}
.table .badge {
  padding: 0.42em 0.7em;
  font-size: 0.74rem;
  font-weight: 600;
}
.server-badge,
.type-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.38em 0.72em !important;
  border: 0;
  border-radius: 6px;
  font-weight: 700 !important;
  white-space: nowrap;
}
.server-badge {
  color: #0877c9 !important;
  background: #cfefff !important;
}
.type-amendment {
  color: #fff !important;
  background: #aebdce !important;
}
.type-new {
  color: #1264cf !important;
  background: #cfe0ff !important;
}
.type-resolution {
  color: #159761 !important;
  background: #d0f5df !important;
}
.type-extension {
  color: #6256bd !important;
  background: #e5e3ff !important;
}
.status-danger {
  color: #ed4050 !important;
  background: #ffd9dd !important;
}
.status-success {
  color: #159761 !important;
  background: #d0f5df !important;
}
.status-primary {
  color: #1264cf !important;
  background: #cfe0ff !important;
}
.status-info {
  color: #0877c9 !important;
  background: #cfefff !important;
}
.status-secondary {
  color: #60748c !important;
  background: #e2e8ef !important;
}
.status-warning {
  color: #6256bd !important;
  background: #e5e3ff !important;
}
.bills-page {
  color: var(--ink);
}
.bills-header {
  padding: 4px 0 0;
}
.bills-header h2 {
  margin: 0 0 4px;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 800 !important;
  letter-spacing: -0.025em;
}
.bills-header p {
  color: #7b8da7 !important;
  font-size: 0.96rem;
}
.submit-initiative-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  color: #fff !important;
  background: #0878f9;
  border: 0;
  border-radius: 7px;
  box-shadow: 0 5px 12px rgba(8, 120, 249, 0.2);
}
.submit-initiative-btn:hover {
  background: #0668db;
}
.bills-divider {
  margin: 0 0 18px;
  border-color: #dbe7f2;
  opacity: 1;
}
.bills-filters {
  padding: 13px 14px 9px;
  margin-bottom: 18px !important;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.06);
}
.bills-filters .form-control,
.bills-filters .form-select {
  min-height: 42px;
  border-color: #d4e2ef;
  border-radius: 6px;
  color: #304568;
  font-size: 0.9rem;
}
.bills-filters .form-control:focus,
.bills-filters .form-select:focus {
  border-color: #5ca8f7;
  box-shadow: 0 0 0 0.2rem rgba(8, 120, 249, 0.12);
}
.bills-filters .filter-btn {
  min-height: 34px;
  padding: 6px 11px;
  margin: 0 !important;
  border-color: #bfd1e2;
  color: #506b89;
  background: #fff;
  border-radius: 6px !important;
  font-size: 0.8rem;
  font-weight: 700;
}
.bills-filters .server-filter-group {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  width: 100%;
}
.bills-filters .filter-btn:hover,
.bills-filters .filter-btn.active,
.bills-filters .filter-btn.btn-dark {
  color: #fff;
  background: #12345f;
  border-color: #12345f;
}
.bills-table-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.07) !important;
}
.bills-table-card .card-body {
  overflow-x: auto;
}
.bills-table {
  min-width: 1180px;
}
.bills-table thead th {
  padding: 12px 11px;
  background: #edf4fb;
  color: #233b60;
  border: 0;
  font-size: 0.78rem;
}
.bills-table tbody td {
  padding: 12px 11px;
  font-size: 0.84rem;
}
.bills-table tbody tr {
  transition: background 0.15s ease;
}
.bills-table tbody tr:hover {
  background: #f5faff;
}
.bills-table .toggle-detail-btn {
  color: #0878f9;
  border-color: #b9d6f4;
  background: #fff;
}
.bills-table .toggle-detail-btn:hover {
  color: #fff;
  background: #0878f9;
}
.bills-page .alert {
  border-radius: 7px;
  font-size: 0.9rem;
}
.bills-page .modal-content {
  overflow: hidden;
  border: 1px solid #d4e3f0;
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(10, 45, 85, 0.2);
}
.bills-page .modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(16, 43, 85, 0.1);
}
.bills-page .modal-header.bg-dark {
  color: #fff;
  background: #092b59 !important;
}
.bills-page .modal-header.bg-primary,
.bills-page .modal-header.bg-info {
  color: #fff !important;
  background: #0878f9 !important;
}
.bills-page .modal-header.bg-success {
  color: #fff !important;
  background: #159761 !important;
}
.bills-page .modal-header.bg-warning {
  color: #fff !important;
  background: #6256bd !important;
}
.bills-page .modal-body {
  padding: 20px;
  background: #f9fbfe;
}
.bills-page .modal-footer {
  padding: 13px 20px;
  background: #fff;
  border-top: 1px solid #e1eaf2;
}
.bills-page .modal-body .form-label {
  color: #233b60;
  font-size: 0.88rem;
}
.bills-page .modal-body .form-control,
.bills-page .modal-body .form-select {
  border-color: #d3e1ee;
  border-radius: 6px;
}
.bills-page .modal-body .form-control:focus,
.bills-page .modal-body .form-select:focus {
  border-color: #5ca8f7;
  box-shadow: 0 0 0 0.2rem rgba(8, 120, 249, 0.12);
}
.bills-page .modal-body .card {
  border-color: #d7e4ef !important;
  border-radius: 8px;
}
.bills-page .modal-body .btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bills-page .modal-body .btn-group > .btn {
  border-radius: 5px !important;
}
.bills-page #comparisonTable,
.bills-page .comparison-table,
.bills-page .edit-comparison-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}
.bills-page #comparisonTable th,
.bills-page #comparisonTable td,
.bills-page .comparison-table th,
.bills-page .comparison-table td,
.bills-page .edit-comparison-table th,
.bills-page .edit-comparison-table td {
  width: 50%;
  max-width: 50%;
  border: 2px solid #aebfd0 !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.bills-page #comparisonTable td > div,
.bills-page .edit-comparison-table td > div {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.bills-page #stepTwoAmendmentModal .table-responsive,
.bills-page .edit-comparison-wrapper .table-responsive {
  overflow-x: hidden;
}
.bills-page .comparison-table th + th,
.bills-page .comparison-table td + td {
  border-left: 2px solid #aebfd0 !important;
}
.bills-page .action-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-width: 1px;
  border-radius: 6px;
  font-size: 0.95rem;
  line-height: 1;
  background: #fff;
}
.bills-page .bill-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 150px;
  white-space: normal;
}
.bills-page .bill-action-form {
  display: inline-flex;
  margin: 0 !important;
}
.bills-page .action-btn-withdraw {
  width: auto;
  min-width: 112px;
  padding: 0 10px;
  color: #a56800;
  border-color: #e9c46a;
}
.bills-page .action-btn-withdraw:hover {
  color: #fff;
  background: #d99400;
  border-color: #d99400;
}
.bills-page .action-btn-view {
  color: #0878f9;
  border-color: #b9d6f4;
}
.bills-page .action-btn-edit {
  color: #6256bd;
  border-color: #c9c1f2;
}
.bills-page .action-btn-delete {
  color: #ed4050;
  border-color: #f0b9c0;
}
.bills-page .action-btn:hover {
  color: #fff;
}
.bills-page .action-btn-view:hover {
  background: #0878f9;
}
.bills-page .action-btn-edit:hover {
  background: #6256bd;
}
.bills-page .action-btn-delete:hover {
  background: #ed4050;
}
@media (max-width: 767px) {
  .bills-header {
    align-items: flex-start !important;
    flex-direction: column;
    gap: 14px;
  }
  .bills-header .submit-initiative-btn {
    align-self: stretch;
    justify-content: center;
  }
  .bills-filters {
    padding: 11px 10px 7px;
  }
  .bills-filters .server-filter-group {
    justify-content: flex-start;
  }
}
.all-bills-btn {
  display: inline-flex;
  gap: 35px;
  align-items: center;
  padding: 9px 14px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}
.all-bills-btn:hover {
  background: #edf6ff;
  color: var(--blue);
}
.all-bills-btn span {
  font-size: 1.15rem;
}
@media (max-width: 1199px) {
  .site-navbar {
    padding-inline: 1rem;
  }
  .site-navbar .navbar-nav {
    gap: 0;
  }
  .site-navbar .nav-link {
    padding-inline: 0.4rem !important;
  }
}
@media (max-width: 991px) {
  .site-navbar .navbar-collapse {
    padding-top: 0.75rem;
  }
  .site-navbar .login-link {
    margin-top: 0.5rem;
  }
  .home-hero {
    padding-left: 5px;
  }
}
@media (max-width: 991px) {
  .container {
    margin-left: 1rem;
    margin-right: 1rem;
  }
}
@media (max-width: 575px) {
  body {
    background-size: 78% auto;
    background-position: right 58px;
  }
  .home-hero {
    min-height: 190px;
    padding-top: 25px;
  }
  .hero-copy h1 {
    font-size: 2rem;
  }
  .feature-card {
    min-height: 145px;
  }
  .initiatives-card {
    padding-inline: 8px;
  }
}

/* Existing social icon styles used by other pages. */
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.social-btn:hover {
  transform: scale(1.1);
}

/* Размер и плавное изменение цвета SVG */
.svg-icon {
  width: 32px;
  height: 32px;
  transition: fill 0.2s ease;
}

/* ==========================================================
   1. КАБИНЕТ ПАРТИИ (класс .cabinet-page)
   ========================================================== */
.cabinet-page .svg-icon {
  fill: #000000; /* Цвет по умолчанию */
}
.cabinet-page .social-btn:hover .svg-icon {
  fill: #198754; /* Цвет при наведении (зеленый) */
}

/* ==========================================================
   2. СПИСОК ПАРТИЙ (класс .parties-page)
   ========================================================== */
.parties-page .svg-icon {
  display: block;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  transform: translateX(-1px);
  fill: #6c757d; /* Цвет по умолчанию */
}
.parties-page .social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  line-height: 0;
  vertical-align: middle;
}
.parties-page .social-btn:hover .svg-icon {
  fill: #0d6efd; /* Цвет при наведении (синий) */
}

/* ==========================================================
   3. СТРАНИЦА "МОЯ ПАРТИЯ" (класс .myparty-page)
   ========================================================== */
.myparty-page .svg-icon {
  fill: #212529; /* Цвет по умолчанию */
}
.myparty-page .social-btn:hover .svg-icon {
  fill: #ffc107; /* Цвет при наведении (желтый) */
}

/* ==========================================================
   СТРАНИЦА РЕЕСТРА ПАРТИЙ
   ========================================================== */
.parties-registry-page {
  color: var(--ink);
}
.parties-heading {
  margin-bottom: 22px !important;
}
.parties-heading h2 {
  margin: 0 0 5px;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 800 !important;
  letter-spacing: -0.025em;
}
.parties-heading p {
  margin: 0;
  color: #7b8da7;
  font-size: 0.96rem;
}
.parties-heading hr {
  margin: 18px 0 0;
  border-color: #dbe7f2;
  opacity: 1;
}
.party-tabs {
  gap: 7px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.06);
}
.party-tabs .nav-item {
  flex: 0 0 auto;
}
.party-tabs .nav-link {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 6px;
  color: #506b89;
  font-size: 0.84rem;
  font-weight: 700;
}
.party-tabs .nav-link:hover {
  color: #0878f9;
  background: #edf6ff;
}
.party-tabs .nav-link.active {
  color: #fff;
  background: #0878f9;
  box-shadow: 0 4px 10px rgba(8, 120, 249, 0.2);
}
.party-card {
  overflow: hidden;
  border: 1px solid #d8e6f2 !important;
  border-radius: 9px;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.07) !important;
}
.party-card.border-primary {
  border-color: #cfe0f0 !important;
}
.party-card.border-success {
  border-color: #cfe0f0 !important;
}
.party-card-header {
  min-height: 66px;
  padding: 10px 16px;
  border: 0;
  background: #092b59 !important;
}
.party-card.border-success .party-card-header {
  background: #123d69 !important;
}
.party-card-header h5 {
  font-size: 1.02rem;
}
.party-card-header img {
  width: 42px !important;
  height: 42px !important;
  padding: 0;
  background: transparent;
  border-radius: 7px !important;
}
.party-card-header .badge {
  padding: 0.42em 0.7em;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
}
.party-card-header .bg-light {
  color: #264568 !important;
  background: #e8f3ff !important;
}
.party-card-header .bg-info {
  color: #0877c9 !important;
  background: #cfefff !important;
}
.party-card-body {
  padding: 16px;
  background: #fff;
}
.party-card-body > [class*="col-"] {
  padding-top: 4px;
  padding-bottom: 4px;
}
.party-card-body .border-end {
  border-color: #e1eaf2 !important;
}
.party-card-body p {
  color: #506783;
  font-size: 0.9rem;
}
.party-card-body p strong {
  color: #233b60;
}
.party-card-body .accordion {
  border: 1px solid #dce8f2;
  border-radius: 7px;
  overflow: hidden;
}
.party-card-body .accordion-item {
  border: 0;
}
.party-card-body .accordion-button {
  padding: 11px 14px !important;
  color: #233b60;
  background: #f4f8fc;
  font-size: 0.88rem;
  box-shadow: none;
}
.party-card-body .accordion-button:not(.collapsed) {
  color: #0878f9;
  background: #edf6ff;
}
.party-card-body .accordion-button::after {
  background-size: 14px;
}
.party-members-table {
  min-width: 0 !important;
  margin: 0;
  font-size: 0.82rem;
}
.party-members-table thead th {
  padding: 9px 10px;
  background: #edf4fb;
  color: #233b60;
  border: 0;
  font-size: 0.75rem;
}
.party-members-table tbody td {
  padding: 9px 10px;
  border-color: #e2ebf3;
}
.party-members-table .role-badge,
.party-members-table .position-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.38em 0.68em;
  border: 0;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.party-members-table .position-badge {
  color: #fff !important;
  background: #6c757d !important;
}
.party-members-table .role-chairman {
  color: #fff !important;
  background: #e9344c !important;
}
.party-members-table .role-deputy-chairman {
  color: #fff !important;
  background: #5b7fc4 !important;
}
.party-members-table .role-pzs {
  color: #fff !important;
  background: #198fc2 !important;
}
.party-members-table .role-zpzs {
  color: #fff !important;
  background: #20a4d8 !important;
}
.party-members-table .role-senator {
  color: #fff !important;
  background: #6f42c1 !important;
}
.party-members-table .role-deputy {
  color: #fff !important;
  background: #0d6efd !important;
}
.party-card-body .text-secondary {
  color: #71839b !important;
}
.parties-registry-page .social-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
}
.parties-registry-page .social-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}
.parties-registry-page .social-btn .svg-icon {
  width: 21px !important;
  height: 21px !important;
  fill: #fff !important;
}
.parties-registry-page .text-center.py-5 {
  padding: 42px 20px !important;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed #cbdbea;
  border-radius: 8px;
}
@media (max-width: 767px) {
  .party-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .party-tabs .nav-link {
    white-space: nowrap;
  }
  .party-card-header {
    align-items: flex-start !important;
    flex-direction: column;
    gap: 10px;
  }
  .party-card-header > div:last-child {
    width: 100%;
    justify-content: space-between;
  }
  .party-card-body .border-end {
    border-right: 0 !important;
    border-bottom: 1px solid #e1eaf2;
    margin-bottom: 10px;
    padding-bottom: 12px;
  }
}

/* ==========================================================
   СТРАНИЦА ЗАСЕДАНИЙ
   Визуально согласовано со страницей реестра партий.
   ========================================================== */
.meetings-page {
  color: var(--ink);
}

.meetings-page .meetings-header {
  margin: 0 0 22px !important;
  padding: 0;
}

.meetings-page .meetings-header h2 {
  margin: 0 0 5px;
  color: #12365f;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 800 !important;
  letter-spacing: -0.025em;
}

.meetings-page .meetings-header p {
  margin: 0;
  color: #7b8da7 !important;
  font-size: 0.96rem;
}

.meetings-page .meetings-divider {
  margin: 18px 0 22px;
  border-color: #dbe7f2;
  opacity: 1;
}

.meetings-page .card {
  overflow: hidden;
  border: 1px solid #d8e6f2 !important;
  border-radius: 9px;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.07) !important;
}

.meetings-page .meeting-card-header {
  min-height: 60px;
  display: flex;
  align-items: center;
  padding: 12px 17px;
  border: 0;
  color: #fff !important;
  background: #092b59 !important;
  font-size: 0.96rem;
}

.meetings-page .card-body {
  padding: 18px;
  background: #fff;
}

.meetings-page .meeting-schedule-card .card-body {
  padding: 20px;
}

.meetings-page .form-label {
  margin-bottom: 7px;
  color: #28486c;
  font-size: 0.9rem;
}

.meetings-page .form-control,
.meetings-page .form-select {
  min-height: 42px;
  color: #244260;
  border: 1px solid #cbdcea;
  border-radius: 6px;
  font-size: 0.9rem;
}

.meetings-page .form-control:focus,
.meetings-page .form-select:focus {
  border-color: #70b5f5;
  box-shadow: 0 0 0 0.18rem rgba(8, 120, 249, 0.12);
}

.meetings-page #billsContainer {
  max-height: 200px;
  padding: 10px !important;
  overflow-y: auto;
  background: #f4f8fc !important;
  border: 1px solid #d5e3ef !important;
  border-radius: 7px !important;
}

.meetings-page .bill-checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 5px !important;
  padding: 8px 9px;
  border: 1px solid #e1ebf3;
  border-radius: 5px;
  background: #fff;
  overflow: hidden;
}

.meetings-page .bill-checkbox-item:last-child {
  margin-bottom: 0 !important;
}

.meetings-page .bill-checkbox-item label {
  min-width: 0;
  margin: 0;
  color: #385575;
  font-size: 0.86rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.meetings-page .bill-checkbox-item .form-check-input,
.meetings-page .bill-checkbox-item input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin: 0.18rem 0 0;
}

.meetings-page #billsContainer .badge,
.meetings-page .server-badge {
  padding: 0.42em 0.7em;
  color: #0877c9 !important;
  background: #cfefff !important;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
}

.meetings-page .meeting-schedule-card small {
  display: block;
  margin-top: 7px;
  color: #7b8da7 !important;
  font-size: 0.8rem;
}

.meetings-page .meeting-schedule-card .btn-success {
  min-height: 42px;
  padding: 9px 16px;
  border: 0;
  border-radius: 6px;
  background: #159761;
  font-size: 0.9rem;
}

.meetings-page .meeting-schedule-card .btn-success:hover {
  background: #117f50;
}

.meetings-page .meetings-filters {
  margin: 0 0 18px !important;
  padding: 7px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.06);
}

.meetings-page .meeting-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.meetings-page .meeting-filter-buttons .filter-btn {
  min-height: 38px;
  margin: 0 !important;
  padding: 8px 14px;
  color: #506b89;
  background: #f7fbff;
  border: 1px solid #d7e5f0 !important;
  border-radius: 6px !important;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(20, 70, 120, 0.04);
}

.meetings-page .meeting-filter-buttons .filter-btn:hover {
  color: #0878f9;
  background: #edf6ff;
  border-color: #9bcaf2 !important;
}

.meetings-page .meeting-filter-buttons .filter-btn.active,
.meetings-page .meeting-filter-buttons .filter-btn.btn-dark {
  color: #fff;
  background: #0878f9;
  border-color: #0878f9 !important;
  box-shadow: 0 4px 10px rgba(8, 120, 249, 0.2);
}

.meetings-page .meeting-schedule-card button[type="submit"] {
  min-width: 190px;
  min-height: 42px;
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 0.9rem;
}

.meetings-page .meetings-list-card .card-body {
  padding: 14px;
}

.meetings-page .meeting-list-item {
  margin-bottom: 9px;
  padding: 14px 15px;
  color: #2e4c6c;
  background: #fff;
  border: 1px solid #dce8f2 !important;
  border-radius: 7px !important;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.meetings-page .meeting-list-item:last-child {
  margin-bottom: 0;
}

.meetings-page .meeting-list-item:hover {
  z-index: 1;
  border-color: #8ec7f7 !important;
  box-shadow: 0 5px 15px rgba(8, 120, 249, 0.1);
  transform: translateY(-1px);
}

.meetings-page .meeting-list-item h5 {
  margin-bottom: 6px !important;
  color: #183d66;
  font-size: 1rem;
}

.meetings-page .meeting-list-item p {
  color: #7b8da7 !important;
  font-size: 0.84rem;
}

.meetings-page .meeting-room-btn {
  min-width: 135px;
  padding: 8px 12px;
  color: #0878f9;
  border: 1px solid #0878f9;
  border-radius: 6px;
  font-size: 0.82rem;
}

.meetings-page .meeting-room-btn:hover {
  color: #fff;
  background: #0878f9;
}

@media (max-width: 767px) {
  .meetings-page .meeting-list-item {
    align-items: flex-start !important;
    flex-direction: column;
    gap: 12px;
  }

  .meetings-page .meeting-list-item > div:last-child,
  .meetings-page .meeting-room-btn {
    width: 100%;
  }

  .meetings-page .meeting-filter-buttons .filter-btn {
    flex: 1 1 auto;
  }
}

/* ==========================================================
   PROFILE — ЕДИНАЯ СЕТКА И СДЕРЖАННАЯ ЦВЕТОВАЯ СИСТЕМА
   ========================================================== */
.profile-page {
  max-width: 1160px;
  margin: 0 auto;
  padding-bottom: 30px;
}

.profile-page > .row {
  --bs-gutter-x: 0;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}

.profile-page > .row > .col-md-8,
.profile-page > .row > .card,
.profile-page > .row > .row {
  width: 100%;
  max-width: none;
  margin-right: 0;
  margin-left: 0;
  padding-right: 0;
  padding-left: 0;
}

.profile-page .cabinet-page-header {
  padding: 4px 0 18px;
}

.profile-page .card {
  overflow: hidden;
  margin: 0 0 18px !important;
  border: 1px solid #d8e6f2 !important;
  border-radius: 9px !important;
  background: #fff;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.07) !important;
}

.profile-page .card-header,
.profile-page .card-header.bg-dark,
.profile-page .card-header.bg-secondary,
.profile-page .card-header.bg-primary,
.profile-page .card-header.bg-success {
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: 13px 18px;
  color: #fff !important;
  background: linear-gradient(110deg, #092b59, #123d69) !important;
  border: 0;
  font-size: 0.9rem;
  font-weight: 800;
}

.profile-page .card-body {
  padding: 20px;
  background: #fff;
}

.profile-page .card-body.row {
  --bs-gutter-x: 18px;
  display: flex;
  flex-wrap: wrap;
  margin: 0;
}

.profile-page .card-body.row > [class*="col-"] {
  padding-right: 9px;
  padding-left: 9px;
}

.profile-page .card-body.row > [class*="col-"]:first-child {
  padding-left: 0;
}

.profile-page .card-body.row > [class*="col-"]:nth-child(2) {
  padding-right: 0;
}

.profile-page .form-label,
.profile-page .form-label.text-primary,
.profile-page .form-label.text-danger,
.profile-page .form-label.text-success,
.profile-page .form-label.text-warning,
.profile-page .form-label.text-info {
  color: #28486c !important;
  font-size: 0.83rem;
  font-weight: 700;
}

.profile-page .form-control,
.profile-page .form-select {
  min-height: 42px;
  border: 1px solid #cbdcea;
  border-radius: 6px;
  color: #244260;
  font-size: 0.86rem;
}

.profile-page .form-control:focus,
.profile-page .form-select:focus {
  border-color: #70b5f5;
  box-shadow: 0 0 0 0.18rem rgba(8, 120, 249, 0.12);
}

.profile-page .row.mt-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0 0 18px;
}

.profile-page .row.mt-2 > [class*="col-"] {
  display: flex;
  min-width: 0;
  padding: 0;
}

.profile-page .row.mt-2 .card {
  width: 100%;
  height: 100%;
  margin-bottom: 0 !important;
}

.profile-page .row.mt-2 .card-body {
  display: flex;
  flex-direction: column;
}

.profile-page .row.mt-2 .card-body form {
  flex: 1 1 auto;
}

.profile-page .btn-primary,
.profile-page .btn-success,
.profile-page .row.mt-2 .btn {
  color: #fff !important;
  background: #0878f9 !important;
  border-color: #0878f9 !important;
}

.profile-page .btn-primary:hover,
.profile-page .btn-success:hover,
.profile-page .row.mt-2 .btn:hover {
  background: #0668db !important;
  border-color: #0668db !important;
}

.profile-page .badge.bg-primary,
.profile-page .badge.bg-info,
.profile-page .badge.bg-secondary {
  color: #31577f !important;
  background: #e8f1fb !important;
  border: 1px solid #cfe0f0;
}

.profile-page .alert {
  border-radius: 7px;
  border-color: #d8e6f2;
}

@media (max-width: 767px) {
  .profile-page {
    padding-bottom: 18px;
  }

  .profile-page .card-body,
  .profile-page .card-body.row {
    padding: 16px;
  }

  .profile-page .card-body.row > [class*="col-"] {
    padding-right: 0;
    padding-left: 0;
  }

  .profile-page .row.mt-2 {
    display: block;
    margin-bottom: 0;
  }

  .profile-page .row.mt-2 > [class*="col-"] {
    margin-bottom: 18px;
  }
}

/* ==========================================================
   ФИНАЛЬНОЕ ВЫРАВНИВАНИЕ КАБИНЕТОВ И СОЦИАЛЬНЫХ КНОПОК
   ========================================================== */
.party-cabinet-page .social-btn,
.my-party-page .social-btn {
  width: auto;
  min-width: 116px;
  height: 40px;
  gap: 8px;
  padding: 0 13px;
  color: #31577f;
  background: #edf6ff;
  border: 1px solid #cfe0f0;
  border-radius: 7px;
  text-decoration: none;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.party-cabinet-page .social-btn:hover,
.my-party-page .social-btn:hover {
  color: #fff;
  background: #0878f9;
  border-color: #0878f9;
  transform: translateY(-1px);
}

.party-cabinet-page .social-btn-discord,
.my-party-page .social-btn-discord {
  color: #514a9b;
  background: #f0efff;
  border-color: #d8d3fa;
}

.party-cabinet-page .social-btn-discord:hover,
.my-party-page .social-btn-discord:hover {
  color: #fff;
  background: #6256bd;
  border-color: #6256bd;
}

.party-cabinet-page .social-btn .svg-icon,
.my-party-page .social-btn .svg-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.social-label {
  font-size: 0.78rem;
  font-weight: 800;
}

.fed-social-links,
.party-social-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.fed-social-links {
  margin: -2px 0 18px;
}

.party-social-actions {
  justify-content: flex-end;
  margin-bottom: 8px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  color: #31577f;
  background: #edf6ff;
  border: 1px solid #cfe0f0;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  transition: all 0.2s ease;
}

.social-link:hover {
  color: #fff;
  background: #0878f9;
  border-color: #0878f9;
}

.social-link-discord {
  color: #514a9b;
  background: #f0efff;
  border-color: #d8d3fa;
}

.social-link-discord:hover {
  color: #fff;
  background: #6256bd;
  border-color: #6256bd;
}

.social-link-icon {
  display: inline-grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 5px;
  background: currentColor;
  color: #fff;
  font-size: 0.62rem;
}

/* Reduce the number of competing colors in all personal and party pages. */
.profile-page .card-header.bg-dark,
.profile-page .card-header.bg-secondary,
.profile-page .card-header.bg-primary,
.profile-page .card-header.bg-success,
.party-cabinet-page .card-header.bg-dark,
.party-cabinet-page .card-header.bg-primary,
.party-cabinet-page .card-header.bg-success,
.party-cabinet-page .card-header.bg-warning,
.fed-cabinet-page .card-header.bg-dark,
.fed-cabinet-page .card-header.bg-secondary,
.fed-cabinet-page .card-header.bg-primary,
.fed-cabinet-page .card-header.bg-success,
.my-party-page .card-header.bg-info,
.my-party-page .card-header.bg-secondary,
.deputy-cabinet-page .card-header.bg-dark,
.deputy-cabinet-page .card-header.bg-primary,
.deputy-cabinet-page .card-header.bg-success {
  color: #fff !important;
  background: linear-gradient(110deg, #092b59, #123d69) !important;
}

.profile-page .card-header.bg-primary,
.party-cabinet-page .card-header.bg-primary,
.fed-cabinet-page .card-header.bg-primary,
.deputy-cabinet-page .card-header.bg-primary {
  background: #0878f9 !important;
}

.profile-page .card-header.bg-success,
.party-cabinet-page .card-header.bg-success,
.fed-cabinet-page .card-header.bg-success,
.deputy-cabinet-page .card-header.bg-success {
  background: #159761 !important;
}

.profile-page .btn-success,
.profile-page .btn-warning,
.profile-page .btn-info,
.party-cabinet-page .btn-warning,
.fed-cabinet-page .btn-warning {
  color: #fff;
  background: #0878f9;
  border-color: #0878f9;
}

.profile-page .btn-success:hover,
.profile-page .btn-warning:hover,
.profile-page .btn-info:hover,
.party-cabinet-page .btn-warning:hover,
.fed-cabinet-page .btn-warning:hover {
  color: #fff;
  background: #0668db;
  border-color: #0668db;
}

/* Status badges use one calm neutral treatment instead of yellow accents. */
.deputy-cabinet-page .table .badge.bg-warning,
.deputy-cabinet-page .table .badge.bg-info,
.my-party-page .table .badge.bg-warning,
.my-party-page .table .badge.bg-info {
  color: #31577f !important;
  background: #e8f1fb !important;
  border: 1px solid #cfe0f0;
}

.deputy-cabinet-page .table .badge.bg-primary,
.my-party-page .table .badge.bg-success {
  color: #fff !important;
  background: #0878f9 !important;
}

/* Give the two federal-party creation blocks enough width and visual weight. */
.fed-cabinet-page > .row {
  gap: 20px;
}

.fed-cabinet-page > .row > [class*="col-"] > .card {
  min-height: 224px;
}

.fed-cabinet-page .fed-add-blocks-row {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: stretch;
  gap: 20px;
  width: 100%;
  margin-right: 0;
  margin-left: 0;
}

.fed-cabinet-page .fed-add-blocks-row > .col-md-6 {
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  padding-right: 0 !important;
  padding-left: 0 !important;
}

.fed-cabinet-page .fed-add-blocks-row > .col-md-6 > .card {
  width: 100% !important;
  min-width: 0;
}

/* Equal-height content inside both add blocks. */
.fed-cabinet-page .fed-add-blocks-row > .col-md-6 > .card {
  display: flex;
  flex-direction: column;
}

.fed-cabinet-page .fed-add-blocks-row > .col-md-6 > .card > .card-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

.fed-cabinet-page .fed-add-blocks-row > .col-md-6 > .card > .card-body > form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

.fed-cabinet-page .fed-add-blocks-row > .col-md-6:first-child form.row {
  display: grid;
  grid-template-columns: 1fr 1.55fr 0.9fr;
  align-content: start;
  gap: 8px;
  margin: 0;
}

.fed-cabinet-page
  .fed-add-blocks-row
  > .col-md-6:first-child
  form.row
  > [class*="col-"] {
  width: 100%;
  padding: 0;
}

.fed-cabinet-page
  .fed-add-blocks-row
  > .col-md-6:first-child
  form.row
  > .col-12 {
  grid-column: 1 / -1;
  margin-top: auto !important;
  padding-top: 14px;
}

.fed-cabinet-page .fed-add-blocks-row > .col-md-6:last-child form > .btn {
  margin-top: auto;
}

/* Party cabinet tables must fit the card; no horizontal scrollbar. */
.cabinet-page .social-btn:hover .svg-icon,
.party-cabinet-page .social-btn:hover .svg-icon {
  fill: #fff !important;
}

.party-cabinet-page .party-deputies-card .card-body,
.party-cabinet-page .party-members-card .card-body {
  overflow: hidden !important;
}

.party-cabinet-page .party-deputies-card .table,
.party-cabinet-page .party-members-card .table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed;
}

.party-cabinet-page .party-deputies-card th,
.party-cabinet-page .party-deputies-card td,
.party-cabinet-page .party-members-card th,
.party-cabinet-page .party-members-card td {
  max-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.party-cabinet-page .party-deputies-card th:first-child,
.party-cabinet-page .party-deputies-card td:first-child {
  width: 18%;
}

.party-cabinet-page .party-deputies-card th:nth-child(2),
.party-cabinet-page .party-deputies-card td:nth-child(2) {
  width: 52%;
}

.party-cabinet-page .party-deputies-card th:last-child,
.party-cabinet-page .party-deputies-card td:last-child {
  width: 30%;
}

.party-cabinet-page .party-members-card th:first-child,
.party-cabinet-page .party-members-card td:first-child {
  width: 14%;
}

.party-cabinet-page .party-members-card th:nth-child(2),
.party-cabinet-page .party-members-card td:nth-child(2) {
  width: 32%;
}

.party-cabinet-page .party-members-card th:nth-child(3),
.party-cabinet-page .party-members-card td:nth-child(3) {
  width: 18%;
}

.party-cabinet-page .party-members-card th:nth-child(4),
.party-cabinet-page .party-members-card td:nth-child(4) {
  width: 20%;
}

.party-cabinet-page .party-members-card th:last-child,
.party-cabinet-page .party-members-card td:last-child {
  width: 16%;
}

.party-cabinet-page .party-deputies-card .badge,
.party-cabinet-page .party-members-card .badge {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  white-space: normal;
  line-height: 1.25;
}

.party-cabinet-page .party-deputies-card .btn,
.party-cabinet-page .party-members-card .btn {
  max-width: 100%;
  white-space: normal;
}

/* One header background for every card in the party cabinet. */
.party-cabinet-page .card-header,
.party-cabinet-page .card-header.bg-dark,
.party-cabinet-page .card-header.bg-primary,
.party-cabinet-page .card-header.bg-secondary,
.party-cabinet-page .card-header.bg-success,
.party-cabinet-page .card-header.bg-warning,
.party-cabinet-page .card-header.bg-info {
  color: #fff !important;
  background: linear-gradient(110deg, #092b59, #123d69) !important;
  border: 0 !important;
}

/* Admin actions and party social links */
.admin-page .btn-warning,
.admin-parties-page .btn-warning {
  color: #fff !important;
  background: linear-gradient(110deg, #092b59, #1264cf) !important;
  border-color: #092b59 !important;
}

.admin-page .btn-warning:hover,
.admin-parties-page .btn-warning:hover {
  color: #fff !important;
  background: linear-gradient(110deg, #061f42, #0d56b5) !important;
}

.admin-page .btn-outline-warning,
.admin-parties-page .btn-outline-warning {
  color: #31577f !important;
  background: #f4f8fc !important;
  border-color: #8eabc4 !important;
}

.admin-page .btn-outline-warning:hover,
.admin-parties-page .btn-outline-warning:hover {
  color: #fff !important;
  background: #31577f !important;
  border-color: #31577f !important;
}

.admin-page .modal-content,
.admin-parties-page .modal-content {
  overflow: hidden;
  border: 1px solid #cbdcea !important;
  border-radius: 10px !important;
  box-shadow: 0 18px 50px rgba(17, 49, 82, 0.2) !important;
}

.admin-page .modal-header,
.admin-parties-page .modal-header {
  color: #fff !important;
  background: linear-gradient(110deg, #092b59, #123d69) !important;
  border: 0 !important;
}

.admin-page .modal-body,
.admin-parties-page .modal-body {
  color: #35516e;
  background: #fff;
}

.admin-page .modal-footer,
.admin-parties-page .modal-footer {
  gap: 8px;
  background: #f6f9fc;
  border-top: 1px solid #dbe7f1;
}

/* Tables inside party edit modals must stay within the modal width. */
.admin-parties-page .modal-dialog.modal-lg {
  width: calc(100% - 1rem);
  max-width: 960px;
}

.admin-parties-page .modal-body {
  min-width: 0;
}

.admin-parties-page .admin-modal-table-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.admin-parties-page .admin-modal-table-wrap > table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.admin-parties-page .admin-modal-table-wrap th,
.admin-parties-page .admin-modal-table-wrap td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-parties-page .admin-modal-table-wrap .form-control,
.admin-parties-page .admin-modal-table-wrap .form-select {
  width: 100%;
  min-width: 0;
}

.admin-parties-page .admin-modal-table-wrap input[type="number"] {
  width: 100% !important;
}

.admin-parties-page .admin-modal-action-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

@media (max-width: 575.98px) {
  .admin-parties-page .modal-dialog.modal-lg {
    width: calc(100% - 0.5rem);
    margin: 0.25rem auto;
  }

  .admin-parties-page .modal-body {
    padding: 14px 10px;
  }

  .admin-parties-page .admin-modal-table-wrap th,
  .admin-parties-page .admin-modal-table-wrap td {
    padding: 6px 5px;
    font-size: 0.75rem;
  }
}

.admin-party-social-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.admin-party-social-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #fff !important;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition:
    transform 0.18s ease,
    filter 0.18s ease,
    box-shadow 0.18s ease;
}

.admin-party-social-btn:hover {
  color: #fff !important;
  transform: translateY(-1px);
  filter: brightness(0.92);
  box-shadow: 0 5px 12px rgba(24, 61, 98, 0.18);
}

.admin-party-social-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  flex: 0 0 17px;
}

.admin-party-social-btn-forum {
  background: #31577f;
  border-color: #31577f;
}

.admin-party-social-btn-discord {
  background: #5865f2;
  border-color: #5865f2;
}

/* Unified administration pages */
.admin-page,
.admin-elections-page,
.admin-parties-page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 4px 0 30px;
  color: var(--ink, #24415e);
}

.admin-page > .d-flex:first-child,
.admin-parties-page > .d-flex:first-child,
.admin-elections-page > .row:first-child {
  gap: 14px;
  margin-bottom: 20px !important;
}

.admin-page h2,
.admin-elections-page h2,
.admin-parties-page h2 {
  color: #092b59;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.admin-page > hr,
.admin-elections-page > hr,
.admin-parties-page > hr {
  border-color: #d7e4ef;
  opacity: 1;
  margin: 18px 0 24px;
}

.admin-page .card,
.admin-elections-page .card,
.admin-parties-page .card {
  overflow: hidden;
  border: 1px solid #d7e4ef !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 22px rgba(25, 63, 99, 0.08) !important;
}

.admin-page .card-header,
.admin-elections-page .card-header,
.admin-parties-page .card-header,
.admin-page .card-header.bg-info,
.admin-page .card-header.bg-success,
.admin-page .card-header.bg-warning,
.admin-page .card-header.bg-danger,
.admin-page .card-header.bg-dark,
.admin-elections-page .card-header.bg-dark,
.admin-parties-page .card-header.bg-primary,
.admin-parties-page .card-header.bg-info {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 17px;
  color: #fff !important;
  background: linear-gradient(110deg, #092b59, #123d69) !important;
  border: 0 !important;
  font-weight: 800;
}

.admin-page .card-body,
.admin-elections-page .card-body,
.admin-parties-page .card-body {
  padding: 20px;
}

.admin-page .table-responsive,
.admin-elections-page .table-responsive,
.admin-parties-page .table-responsive {
  border: 1px solid #dce8f2;
  border-radius: 8px;
  overflow-x: auto;
}

.admin-page .table,
.admin-elections-page .table,
.admin-parties-page .table {
  margin-bottom: 0;
  color: #35516e;
  font-size: 0.86rem;
  vertical-align: middle;
}

.admin-page .table thead th,
.admin-elections-page .table thead th,
.admin-parties-page .table thead th {
  color: #274b70;
  background: #edf4fb;
  border-bottom: 1px solid #d5e3ef;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.admin-page .table td,
.admin-page .table th,
.admin-elections-page .table td,
.admin-elections-page .table th,
.admin-parties-page .table td,
.admin-parties-page .table th {
  padding: 11px 12px;
  border-color: #e3edf5;
}

.admin-page .table tbody tr:hover,
.admin-elections-page .table tbody tr:hover,
.admin-parties-page .table tbody tr:hover {
  background: #f7fbff;
}

.admin-page .form-control,
.admin-page .form-select,
.admin-elections-page .form-control,
.admin-elections-page .form-select,
.admin-parties-page .form-control,
.admin-parties-page .form-select {
  border-color: #cbddea;
  border-radius: 7px;
  color: #294966;
  box-shadow: none;
}

.admin-page .form-control:focus,
.admin-page .form-select:focus,
.admin-elections-page .form-control:focus,
.admin-elections-page .form-select:focus,
.admin-parties-page .form-control:focus,
.admin-parties-page .form-select:focus {
  border-color: #4f8fc8;
  box-shadow: 0 0 0 0.18rem rgba(31, 111, 180, 0.12);
}

.admin-page .btn,
.admin-elections-page .btn,
.admin-parties-page .btn {
  border-radius: 7px;
  font-weight: 700;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.admin-page .btn:hover,
.admin-elections-page .btn:hover,
.admin-parties-page .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(23, 64, 102, 0.14);
}

.admin-page .badge,
.admin-elections-page .badge,
.admin-parties-page .badge {
  border-radius: 999px;
  padding: 0.42em 0.7em;
  font-weight: 700;
}

.admin-page .admin-user-roles {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  column-gap: 4px;
  row-gap: 10px;
  min-width: 190px;
}

.admin-page .admin-user-roles .badge {
  display: inline-block;
  margin: 0 4px 4px 0;
  vertical-align: middle;
  line-height: 1.25;
}

.admin-page td:nth-child(2) > .badge {
  display: inline-block;
  margin: 0 4px 8px 0 !important;
  vertical-align: middle;
}

.admin-page td.text-end {
  vertical-align: middle !important;
  text-align: right;
  white-space: normal;
}

.admin-page td.text-end .btn {
  margin: 4px 0 4px 6px !important;
  vertical-align: middle;
}

.admin-page .admin-role-list .form-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 9px !important;
  padding: 6px 8px;
  border-radius: 6px;
}

.admin-page .admin-role-list {
  max-height: 200px;
  overflow-y: auto;
}

.admin-page .admin-role-list .form-check:last-child {
  margin-bottom: 0 !important;
}

.admin-page .admin-role-list .form-check-input {
  flex: 0 0 auto;
  margin: 0.2rem 0 0;
}

.admin-page .admin-role-list .form-check-label {
  line-height: 1.35;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(80, 150, 220, .7);
}

.profile-avatar-large {
  width: 96px;
  height: 96px;
  object-fit: contain;
  background: rgba(255, 255, 255, .12);
}

.profile-avatar-placeholder,
.online-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1767b1;
  color: #fff;
  font-weight: 700;
  font-size: 1.6rem;
}

.avatar-file-input {
  max-width: 360px;
}

.avatar-file-input::file-selector-button {
  background: #1767b1;
  color: #fff;
  border: 0;
  padding: .45rem .8rem;
  margin: -0.375rem .8rem -0.375rem -0.75rem;
  cursor: pointer;
}

.online-users-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.online-users-card {
  padding: 12px 16px !important;
}
.online-users-card h2 {
  font-size: 1rem;
  line-height: 1.2;
  margin-bottom: 0 !important;
}

.online-user-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid rgba(80, 150, 220, .35);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}

.online-user-item:hover { border-color: #2188e5; }
.online-user-item img,
.online-user-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.online-user-item span:last-child { display: flex; flex-direction: column; }
.online-user-item small { opacity: .7; }
.submitted-bill-profile-item { padding: 16px 0; border-bottom: 1px solid rgba(128, 160, 190, .35); }
.submitted-bill-profile-item:last-child { border-bottom: 0; }

.profile-name-link {
  color: var(--ink) !important;
  text-decoration: none !important;
}

.profile-name-link:hover {
  color: var(--ink) !important;
  text-decoration: none !important;
}

html.dark-theme body a.profile-name-link,
html.dark-theme body a.profile-name-link:hover,
html.dark-theme body a.profile-name-link:visited {
  color: #e5e7eb !important;
}

.party-color-current {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #35516e;
  font-weight: 700;
}

.party-color-preview {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(25, 55, 90, .3), 0 2px 5px rgba(25, 55, 90, .16);
}

.party-color-2563eb { background-color: #2563eb; }
.party-color-16a34a { background-color: #16a34a; }
.party-color-d97706 { background-color: #d97706; }
.party-color-7c3aed { background-color: #7c3aed; }
.party-color-0891b2 { background-color: #0891b2; }
.party-color-db2777 { background-color: #db2777; }
.party-color-4f46e5 { background-color: #4f46e5; }
.party-color-92400e { background-color: #92400e; }
.party-color-475569 { background-color: #475569; }
.party-color-dc2626 { background-color: #dc2626; }
.party-color-0f766e { background-color: #0f766e; }
.party-color-65a30d { background-color: #65a30d; }
.party-color-ca8a04 { background-color: #ca8a04; }
.party-color-ea580c { background-color: #ea580c; }
.party-color-c2410c { background-color: #c2410c; }
.party-color-be123c { background-color: #be123c; }
.party-color-9f1239 { background-color: #9f1239; }
.party-color-a21caf { background-color: #a21caf; }
.party-color-86198f { background-color: #86198f; }
.party-color-6d28d9 { background-color: #6d28d9; }
.party-color-1d4ed8 { background-color: #1d4ed8; }
.party-color-1e40af { background-color: #1e40af; }
.party-color-0369a1 { background-color: #0369a1; }
.party-color-0e7490 { background-color: #0e7490; }
.party-color-15803d { background-color: #15803d; }
.party-color-166534 { background-color: #166534; }
.party-color-4d7c0f { background-color: #4d7c0f; }
.party-color-57534e { background-color: #57534e; }
.party-color-334155 { background-color: #334155; }
.party-color-111827 { background-color: #111827; }
.party-color-adb5bd { background-color: #adb5bd; }

.admin-parties-page .nav-pills {
  gap: 8px;
  padding: 6px;
  border: 1px solid #d8e5ef;
  border-radius: 9px;
  background: #f4f8fc;
}

.admin-parties-page .nav-pills .nav-link {
  color: #41627f;
  border-radius: 7px;
  font-weight: 700;
}

.admin-parties-page .nav-pills .nav-link.active {
  color: #fff;
  background: linear-gradient(110deg, #092b59, #123d69);
}

.admin-parties-page #partiesContainer > .party-card-item {
  display: flex;
}

.admin-parties-page #partiesContainer > .party-card-item > .card {
  width: 100%;
}

.admin-page .modal-content,
.admin-elections-page .modal-content,
.admin-parties-page .modal-content {
  overflow: hidden;
  border: 1px solid #cadbe9;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(17, 49, 82, 0.2);
}

.admin-page .modal-header,
.admin-elections-page .modal-header,
.admin-parties-page .modal-header {
  color: #fff;
  background: linear-gradient(110deg, #092b59, #123d69) !important;
  border: 0;
}

.admin-page .alert,
.admin-elections-page .alert,
.admin-parties-page .alert {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(25, 63, 99, 0.07);
}

.admin-elections-page .admin-back-button {
  color: #fff !important;
  background: rgba(9, 43, 89, 0.88) !important;
  border: 1px solid rgba(255, 255, 255, 0.42) !important;
  box-shadow: 0 4px 10px rgba(9, 43, 89, 0.2);
  white-space: nowrap;
}

.admin-elections-page .admin-back-button:hover,
.admin-elections-page .admin-back-button:focus {
  color: #fff !important;
  background: rgba(6, 31, 66, 0.96) !important;
  border-color: rgba(255, 255, 255, 0.62) !important;
}

@media (max-width: 767px) {
  .admin-page,
  .admin-elections-page,
  .admin-parties-page {
    padding-top: 0;
  }

  .admin-page > .d-flex:first-child,
  .admin-parties-page > .d-flex:first-child {
    align-items: flex-start !important;
    flex-direction: column;
  }

  .admin-elections-page > .row:first-child .col-md-12 {
    align-items: flex-start !important;
    flex-direction: column;
  }

  .admin-page .card-body,
  .admin-elections-page .card-body,
  .admin-parties-page .card-body {
    padding: 15px;
  }
}

/* Unified member-party cabinet styling. */
.my-party-page .card-header,
.my-party-page .card-header.bg-info,
.my-party-page .card-header.bg-secondary,
.my-party-page .card-header.bg-dark,
.my-party-page .card-header.bg-primary,
.my-party-page .card-header.bg-success {
  color: #fff !important;
  background: linear-gradient(110deg, #092b59, #123d69) !important;
  border: 0 !important;
}

.my-party-page h5.text-warning {
  color: #28486c !important;
  font-size: 1rem;
  font-weight: 800;
}

.my-party-page .social-btn:hover,
.my-party-page .social-btn-forum:hover,
.my-party-page .social-btn-discord:hover {
  color: #fff !important;
  background: #0878f9 !important;
  border-color: #0878f9 !important;
}

.my-party-page .social-btn:hover .svg-icon,
.my-party-page .social-btn-forum:hover .svg-icon,
.my-party-page .social-btn-discord:hover .svg-icon {
  fill: #fff !important;
  color: #fff !important;
}

.my-party-page .social-btn:hover .social-label,
.my-party-page .social-btn-forum:hover .social-label,
.my-party-page .social-btn-discord:hover .social-label {
  color: #fff !important;
}

.my-party-page .card-header {
  background: #092b59 !important;
}

.my-party-page .card-header.bg-info {
  background: #092b59 !important;
}

/* ==========================================================
   GOVERNOR / PRESIDENT / FEDERATION CHAIR CABINETS
   ========================================================== */
.cabinet-page-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 4px 0 28px;
  color: var(--ink);
}

.cabinet-page-shell > .row:first-child {
  margin-right: 0;
  margin-bottom: 22px !important;
  margin-left: 0;
}

.cabinet-page-shell > .row:first-child > [class*="col-"] {
  padding: 0;
}

.cabinet-page-shell > .row:first-child h2 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 800 !important;
  letter-spacing: -0.025em;
}

.cabinet-page-shell > .row:first-child p {
  margin: 0;
  color: #7b8da7 !important;
  font-size: 0.96rem;
}

.cabinet-page-shell > .row:first-child hr {
  margin: 18px 0 0;
  border-color: #dbe7f2;
  opacity: 1;
}

.cabinet-page-shell .card {
  overflow: hidden;
  margin-bottom: 18px !important;
  border: 1px solid #d8e6f2 !important;
  border-radius: 9px !important;
  background: #fff;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.07) !important;
}

.cabinet-page-shell .card-header,
.cabinet-page-shell .card-header.bg-dark,
.cabinet-page-shell .card-header.bg-primary,
.cabinet-page-shell .card-header.bg-secondary,
.cabinet-page-shell .card-header.bg-success,
.cabinet-page-shell .card-header.bg-warning,
.cabinet-page-shell .card-header.bg-danger,
.cabinet-page-shell .card-header.bg-info {
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: 13px 17px;
  color: #fff !important;
  background: linear-gradient(110deg, #092b59, #123d69) !important;
  border: 0 !important;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.35;
}

.cabinet-page-shell .card-body {
  padding: 18px;
  background: #fff;
}

.cabinet-page-shell .card-body.p-0 {
  padding: 0 !important;
  overflow-x: auto;
}

.cabinet-page-shell .table {
  width: 100%;
  margin-bottom: 0;
  color: #35516e;
  font-size: 0.84rem;
}

.cabinet-page-shell .table thead th {
  padding: 11px 13px;
  color: #233b60;
  background: #edf4fb;
  border: 0;
  font-size: 0.75rem;
  font-weight: 800;
  vertical-align: middle;
}

.cabinet-page-shell .table tbody td {
  padding: 11px 13px;
  border-color: #e1eaf2;
  vertical-align: middle;
}

.cabinet-page-shell .table tbody tr:hover {
  background: #f5faff;
}

.cabinet-page-shell .table-responsive {
  border-radius: 7px;
}

.cabinet-page-shell .form-label {
  margin-bottom: 7px;
  color: #28486c;
  font-size: 0.83rem;
  font-weight: 700;
}

.cabinet-page-shell .form-control,
.cabinet-page-shell .form-select {
  min-height: 41px;
  border-color: #cbdcea;
  border-radius: 6px;
  color: #244260;
  font-size: 0.86rem;
}

.cabinet-page-shell .form-control:focus,
.cabinet-page-shell .form-select:focus {
  border-color: #70b5f5;
  box-shadow: 0 0 0 0.18rem rgba(8, 120, 249, 0.12);
}

.cabinet-page-shell .btn {
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
}

.cabinet-page-shell .btn-primary,
.cabinet-page-shell .btn-success {
  color: #fff !important;
  background: #0878f9 !important;
  border-color: #0878f9 !important;
}

.cabinet-page-shell .btn-primary:hover,
.cabinet-page-shell .btn-success:hover {
  background: #0668db !important;
  border-color: #0668db !important;
}

.cabinet-page-shell .btn-outline-primary,
.cabinet-page-shell .btn-outline-secondary {
  color: #0878f9;
  border-color: #b9d6f4;
}

.cabinet-page-shell .btn-outline-primary:hover,
.cabinet-page-shell .btn-outline-secondary:hover {
  color: #fff;
  background: #0878f9;
  border-color: #0878f9;
}

.cabinet-page-shell .badge {
  padding: 0.45em 0.7em;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: normal;
  line-height: 1.25;
}

.cabinet-page-shell .alert {
  margin-bottom: 16px;
  padding: 11px 14px;
  border-radius: 7px;
  font-size: 0.82rem;
}

.cabinet-page-shell .list-group {
  overflow: hidden;
  border-color: #dce8f2;
  border-radius: 7px;
}

.cabinet-page-shell .list-group-item {
  color: #35516e;
  border-color: #e2ebf3;
}

.cabinet-page-shell .list-group-item:hover {
  background: #f5faff;
}

.cabinet-page-shell .nav-pills {
  gap: 7px;
  padding: 7px;
  margin-bottom: 18px !important;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.06);
}

.cabinet-page-shell .nav-pills .nav-link {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 6px;
  color: #506b89;
  font-size: 0.82rem;
  font-weight: 700;
}

.cabinet-page-shell .nav-pills .nav-link:hover {
  color: #0878f9;
  background: #edf6ff;
}

.cabinet-page-shell .nav-pills .nav-link.active {
  color: #fff;
  background: #0878f9;
  box-shadow: 0 4px 10px rgba(8, 120, 249, 0.2);
}

.cabinet-page-shell .collapse {
  background: #f4f8fc !important;
}

.cabinet-page-shell .collapse > .card {
  margin-bottom: 0 !important;
  border-color: #d7e4ef !important;
  box-shadow: 0 5px 14px rgba(20, 70, 120, 0.05) !important;
}

.psf-cabinet-page h4.text-primary,
.psf-cabinet-page h4.text-success,
.psf-cabinet-page h4.text-danger,
.psf-cabinet-page h5.text-secondary {
  color: #28486c !important;
}

.governor-cabinet-page .table,
.president-cabinet-page .table,
.psf-cabinet-page .table {
  min-width: 0;
}

@media (max-width: 767px) {
  .cabinet-page-shell {
    padding-top: 0;
  }

  .cabinet-page-shell .nav-pills {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .cabinet-page-shell .nav-pills .nav-link {
    white-space: nowrap;
  }

  .cabinet-page-shell .card-body {
    padding: 15px;
  }

  .cabinet-page-shell .list-group-item {
    align-items: flex-start !important;
    flex-wrap: wrap;
    gap: 8px;
  }

  .cabinet-page-shell .list-group-item form {
    width: 100%;
  }

  .cabinet-page-shell .list-group-item form .btn {
    width: 100%;
  }
}

/* Account dropdown in the site navbar. */
.site-navbar .account-menu {
  min-width: 238px;
  padding: 7px;
  border: 1px solid #d8e6f2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(10, 45, 85, 0.16) !important;
}

.site-navbar .account-menu .account-menu-item {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 11px;
  border-radius: 6px;
  color: #28486c !important;
  background: transparent !important;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.25;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.site-navbar .account-menu .account-menu-item:hover,
.site-navbar .account-menu .account-menu-item:focus {
  color: #0878f9 !important;
  background: #edf6ff !important;
  transform: translateX(2px);
}

.site-navbar .account-menu .account-menu-logout {
  color: #b53b4f !important;
}

.site-navbar .account-menu .account-menu-logout:hover,
.site-navbar .account-menu .account-menu-logout:focus {
  color: #c93452 !important;
  background: #fff0f2 !important;
}

.site-navbar .account-menu .dropdown-divider {
  margin: 6px 4px;
  border-color: #dce8f2;
}

.fed-cabinet-page .fed-regional-creation-card {
  margin-top: 20px !important;
}

.fed-cabinet-page > .row > [class*="col-"] > .card .card-body {
  padding: 24px;
}

.fed-cabinet-page > .row > [class*="col-"] > .card .form-control {
  min-height: 45px;
}

.fed-cabinet-page > .row > [class*="col-"] > .card .btn {
  min-height: 43px;
}

@media (max-width: 767px) {
  .party-cabinet-page .social-btn,
  .my-party-page .social-btn {
    min-width: 108px;
  }

  .party-social-actions {
    justify-content: flex-start;
  }

  .fed-cabinet-page > .row > [class*="col-"] > .card {
    min-height: 0;
  }

  .fed-cabinet-page > .row > [class*="col-"] > .card .card-body {
    padding: 18px;
  }
}

/* ==========================================================
   ФИНАЛЬНАЯ КОМПОНОВКА КАБИНЕТОВ
   Все внутренние блоки приведены к одной системе размеров,
   отступов и визуальной иерархии страницы index.
   ========================================================== */
.deputy-cabinet-page,
.fed-cabinet-page,
.my-party-page,
.frozen-party-page,
.profile-page,
.party-cabinet-page {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 4px 0 28px;
}

.deputy-cabinet-page .cabinet-page-header,
.fed-cabinet-page .cabinet-page-header,
.my-party-page .cabinet-page-header,
.profile-page .cabinet-page-header,
.party-cabinet-page .cabinet-page-header {
  padding: 4px 0 16px;
}

.deputy-cabinet-page .card,
.fed-cabinet-page .card,
.my-party-page .card,
.profile-page .card,
.party-cabinet-page .card,
.frozen-party-page .card {
  margin-bottom: 18px !important;
  border: 1px solid #d8e6f2 !important;
  border-radius: 9px;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.07) !important;
}

.deputy-cabinet-page .card-header,
.fed-cabinet-page .card-header,
.my-party-page .card-header,
.profile-page .card-header,
.party-cabinet-page .card-header {
  min-height: 52px;
  padding: 13px 17px;
  border: 0;
  font-size: 0.9rem;
  line-height: 1.35;
}

.deputy-cabinet-page .card-body,
.fed-cabinet-page .card-body,
.my-party-page .card-body,
.profile-page .card-body,
.party-cabinet-page .card-body {
  padding: 18px;
  background: #fff;
}

.deputy-cabinet-page .card-body.p-0,
.fed-cabinet-page .card-body.p-0,
.my-party-page .card-body.p-0,
.party-cabinet-page .card-body.p-0 {
  padding: 0 !important;
  overflow-x: auto;
}

.deputy-cabinet-page .table,
.fed-cabinet-page .table,
.my-party-page .table,
.party-cabinet-page .table {
  width: 100%;
  margin-bottom: 0;
  color: #35516e;
  font-size: 0.84rem;
}

.deputy-cabinet-page .table thead th,
.fed-cabinet-page .table thead th,
.my-party-page .table thead th,
.party-cabinet-page .table thead th {
  padding: 11px 13px;
  color: #233b60;
  background: #edf4fb;
  border: 0;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.deputy-cabinet-page .table tbody td,
.fed-cabinet-page .table tbody td,
.my-party-page .table tbody td,
.party-cabinet-page .table tbody td {
  padding: 11px 13px;
  border-color: #e1eaf2;
  vertical-align: middle;
}

.deputy-cabinet-page .table tbody tr:hover,
.fed-cabinet-page .table tbody tr:hover,
.my-party-page .table tbody tr:hover,
.party-cabinet-page .table tbody tr:hover {
  background: #f5faff;
}

.deputy-cabinet-page .form-control,
.deputy-cabinet-page .form-select,
.fed-cabinet-page .form-control,
.fed-cabinet-page .form-select,
.my-party-page .form-control,
.my-party-page .form-select,
.profile-page .form-control,
.profile-page .form-select,
.party-cabinet-page .form-control,
.party-cabinet-page .form-select {
  min-height: 41px;
  padding: 9px 11px;
  border: 1px solid #cbdcea;
  border-radius: 6px;
  color: #244260;
  background-color: #fff;
  font-size: 0.86rem;
}

.deputy-cabinet-page .form-label,
.fed-cabinet-page .form-label,
.my-party-page .form-label,
.profile-page .form-label,
.party-cabinet-page .form-label {
  margin-bottom: 7px;
  color: #28486c;
  font-size: 0.82rem;
  font-weight: 700;
}

.deputy-cabinet-page .btn,
.fed-cabinet-page .btn,
.my-party-page .btn,
.profile-page .btn,
.party-cabinet-page .btn {
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
}

.deputy-cabinet-page .alert,
.fed-cabinet-page .alert,
.my-party-page .alert,
.profile-page .alert,
.party-cabinet-page .alert {
  margin-bottom: 16px;
  padding: 11px 14px;
  border-radius: 7px;
  font-size: 0.82rem;
}

/* Profile: keep the main form narrow, but make the role and request
   sections full-width instead of letting them become row siblings. */
.profile-page > .row {
  display: block;
  max-width: 1040px;
  margin-right: auto;
  margin-left: auto;
}

.profile-page > .row > .col-md-8,
.profile-page > .row > .card,
.profile-page > .row > .row {
  width: 100%;
  max-width: 100%;
  margin-right: 0;
  margin-left: 0;
}

.profile-page > .row > .col-md-8 {
  padding-right: 0;
  padding-left: 0;
}

.profile-page .card-body.row {
  row-gap: 4px;
  margin: 0;
}

.profile-page .card-body.row > [class*="col-"] {
  padding-right: 9px;
  padding-left: 9px;
}

.profile-page .card-body.row > [class*="col-"]:first-child {
  padding-left: 0;
}

.profile-page .card-body.row > [class*="col-"]:nth-child(2) {
  padding-right: 0;
}

.profile-page .badge,
.party-cabinet-page .badge,
.my-party-page .badge,
.deputy-cabinet-page .badge,
.fed-cabinet-page .badge {
  padding: 0.46em 0.7em;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 700;
}

.profile-page .card-body > .row.g-3,
.profile-page .row.mt-2 {
  margin-right: -8px;
  margin-left: -8px;
}

.profile-page .row.mt-2 > [class*="col-"] {
  padding-right: 8px;
  padding-left: 8px;
}

/* Party cabinet: make its settings and member sections breathe evenly. */
.party-cabinet-page > .row,
.party-cabinet-page #elections {
  margin-right: -8px;
  margin-left: -8px;
}

.party-cabinet-page > .row > [class*="col-"],
.party-cabinet-page #elections > [class*="col-"] {
  padding-right: 8px;
  padding-left: 8px;
}

.party-cabinet-page .member-item {
  border-color: #e1eaf2;
  color: #35516e;
}

.party-cabinet-page .member-item:hover {
  background: #f5faff;
}

.party-cabinet-page .social-btn,
.my-party-page .social-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #edf6ff;
}

.party-cabinet-page .svg-icon,
.my-party-page .svg-icon {
  width: 22px;
  height: 22px;
}

/* Deputy cabinet: server tabs and tables form a clear vertical rhythm. */
.deputy-cabinet-page .nav-pills {
  margin-bottom: 18px !important;
}

.deputy-cabinet-page .tab-pane > .card:last-child,
.deputy-cabinet-page .tab-pane > .alert:last-child {
  margin-bottom: 0 !important;
}

.deputy-cabinet-page .tab-content {
  min-height: 120px;
}

.deputy-cabinet-page .tab-pane .table {
  min-width: 720px;
}

/* Federal cabinet: the two creation/invitation blocks sit in equal columns. */
.fed-cabinet-page > .row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-right: 0;
  margin-left: 0;
}

.fed-cabinet-page > .row > [class*="col-"] {
  display: flex;
  min-width: 0;
  padding-right: 0;
  padding-left: 0;
}

.fed-cabinet-page > .row > [class*="col-"] > .card {
  width: 100%;
}

.fed-cabinet-page .img-thumbnail {
  padding: 5px;
  border-color: #d8e6f2;
  border-radius: 8px;
}

/* Member cabinet: readable two-column information area and a compact list. */
.my-party-page > .card {
  max-width: 100%;
}

.my-party-page > .card > .card-header {
  gap: 14px;
  flex-wrap: wrap;
}

.my-party-page > .card > .card-header > div:last-child {
  margin-left: auto;
}

.my-party-page .card-body > .row {
  row-gap: 20px;
}

.my-party-page .card-body > .row > .border-end {
  border-color: #e1eaf2 !important;
}

.my-party-page .accordion-button {
  min-height: 46px;
  color: #233b60;
  background: #f4f8fc;
  box-shadow: none;
  font-size: 0.86rem;
  font-weight: 800;
}

.my-party-page .accordion-button:not(.collapsed) {
  color: #0878f9;
  background: #edf6ff;
}

/* Frozen page: a focused, compact status panel rather than a generic card. */
.frozen-party-page {
  min-height: 48vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.frozen-party-page > .row {
  width: 100%;
  margin-top: 30px !important;
}

.frozen-party-page .col-md-6 {
  width: min(100%, 620px);
}

.frozen-party-page .frozen-party-card .card-body {
  padding: 44px 40px !important;
  background: linear-gradient(145deg, #fff, #fff8f9);
}

@media (max-width: 767px) {
  .deputy-cabinet-page,
  .fed-cabinet-page,
  .my-party-page,
  .frozen-party-page,
  .profile-page,
  .party-cabinet-page {
    padding-top: 0;
  }

  .profile-page .card-body.row > [class*="col-"] {
    padding-right: 0;
    padding-left: 0;
  }

  .fed-cabinet-page > .row {
    display: block;
  }

  .fed-cabinet-page .fed-add-blocks-row {
    display: block !important;
  }

  .fed-cabinet-page .fed-add-blocks-row > .col-md-6:first-child form.row {
    display: flex;
    gap: 0;
  }

  .fed-cabinet-page
    .fed-add-blocks-row
    > .col-md-6:first-child
    form.row
    > .col-12 {
    margin-top: 0 !important;
    padding-top: 14px;
  }

  .fed-cabinet-page > .row > [class*="col-"] {
    margin-bottom: 0;
  }

  .my-party-page .card-body > .row > .border-end {
    border-right: 0 !important;
    border-bottom: 1px solid #e1eaf2;
    padding-bottom: 18px;
  }

  .my-party-page > .card > .card-header > div:last-child {
    width: 100%;
    margin-left: 0;
  }

  .frozen-party-page > .row {
    margin-top: 14px !important;
  }

  .frozen-party-page .frozen-party-card .card-body {
    padding: 32px 20px !important;
  }
}

/* ==========================================================
   ДЕПУТАТЫ И СЕНАТОРЫ
   ========================================================== */
.deputies-page,
.senators-page {
  color: var(--ink);
}
.deputies-header,
.senators-header {
  padding: 4px 0 18px;
}
.deputies-header h2,
.senators-header h2 {
  margin: 0 0 5px;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}
.deputies-header p,
.senators-header p {
  margin: 0;
  color: #7b8da7;
  font-size: 0.96rem;
}
.deputies-tabs {
  gap: 7px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.06);
}
.deputies-tabs .nav-item {
  flex: 0 0 auto;
}
.deputies-tabs .nav-link {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 6px;
  color: #506b89;
  font-size: 0.82rem;
  font-weight: 700;
}
.deputies-tabs .nav-link:hover {
  color: #0878f9;
  background: #edf6ff;
}
.deputies-tabs .nav-link.active {
  color: #fff;
  background: #0878f9;
  box-shadow: 0 4px 10px rgba(8, 120, 249, 0.2);
}
.deputies-card,
.senators-leadership-card,
.senators-roster-card {
  overflow: hidden;
  border: 1px solid #d8e6f2 !important;
  border-radius: 9px;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.07) !important;
}
.deputies-card-header,
.senators-card-header {
  min-height: 56px;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: #fff !important;
  background: #092b59 !important;
  border: 0;
  font-size: 0.92rem;
}
.senators-card-header-danger {
  background: #c93452 !important;
}
.deputies-card-body,
.senators-table-body,
.senators-roster-card > .card-body {
  background: #fff;
}
.deputies-card .table,
.senators-table-body .table {
  margin-bottom: 0;
  color: #35516e;
  font-size: 0.84rem;
}
.deputies-card .table th,
.senators-table-body .table th {
  padding: 10px 12px;
  color: #233b60;
  background: #edf4fb;
  border-color: #d6e3ee;
  font-size: 0.76rem;
}
.deputies-card .table td,
.senators-table-body .table td {
  padding: 11px 12px;
  border-color: #dce7f0;
  vertical-align: middle;
}
.deputies-card .table tbody tr:hover,
.senators-table-body .table tbody tr:hover {
  background: #f5faff;
}

.deputies-party-group {
  border-bottom: 1px solid #d9e5f0;
}

.deputies-party-group:last-child {
  border-bottom: 0;
}

.deputies-party-group-title {
  padding: 12px 16px;
  color: #233b60;
  background: #edf4fb;
  border-bottom: 1px solid #c4d3e0;
  font-weight: 700;
}

.deputies-party-members-table {
  margin-bottom: 0 !important;
}
.deputy-party-badge,
.senator-party-badge {
  color: #536a83 !important;
  background: #eef3f7 !important;
  border: 1px solid #d3e0ea !important;
  border-radius: 5px;
  font-size: 0.7rem;
}
.deputy-role-chair {
  color: #6256bd !important;
  background: #e9e6ff !important;
}
.deputy-role-deputy-chair {
  color: #0877c9 !important;
  background: #cfefff !important;
}
.deputy-role-member {
  color: #1264cf !important;
  background: #cfe0ff !important;
}
.deputy-role-chair,
.deputy-role-deputy-chair,
.deputy-role-member {
  padding: 0.45em 0.7em;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 700;
}
.senators-roster-card > .card-body {
  padding: 18px;
}
.senators-section-title {
  margin-top: 0;
  color: #233b60;
  font-size: 1.05rem;
  font-weight: 800;
}
.senators-section-governor {
  color: #0878f9;
}
.senators-section-assembly {
  color: #159761;
}
.senators-section-president {
  color: #c93452;
}
.senators-server-title {
  color: #506783;
  font-size: 0.88rem;
  font-weight: 800;
}
.senators-list {
  overflow: hidden;
  border: 1px solid #dce8f2;
  border-radius: 7px;
}
.senators-list .list-group-item {
  min-height: 48px;
  padding: 9px 11px;
  color: #35516e;
  border-color: #e2ebf3;
}
.senators-list .list-group-item:hover {
  background: #f5faff;
}
.senators-number {
  width: 20px;
  flex: 0 0 20px;
  color: #71839b;
  text-align: center;
}
.senators-list code {
  color: #6256bd;
  font-size: 0.75rem;
}

.senators-district-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding-bottom: 10px;
  color: #163c6a;
  border-bottom: 1px solid #dce8f2;
  font-size: 1.25rem;
  font-weight: 800;
}
.senators-district-title img {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: contain;
  border-radius: 50%;
}
.senator-party-name {
  display: inline-block;
  max-width: 42%;
  margin-right: 7px;
  overflow: hidden;
  color: #71839a;
  font-size: 0.88em;
  font-weight: 500;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}
.senator-game-id {
  margin-left: 8px;
  color: #294f7c;
  font-size: 0.94em;
  font-weight: 700;
  white-space: nowrap;
}
.senator-game-id code {
  color: inherit !important;
  font-size: 1em !important;
  font-weight: 800;
}
html.dark-theme .senators-district-title {
  color: #f2f7ff;
  border-color: rgba(157, 190, 226, 0.28);
}
html.dark-theme .senators-roster-card > .card-body,
html.dark-theme .senators-list .list-group-item {
  color: #edf5ff;
  background: rgba(22, 39, 65, 0.92);
  border-color: rgba(157, 190, 226, 0.26);
}
html.dark-theme .senator-game-id,
html.dark-theme .senators-list .text-muted {
  color: #dbeafe !important;
}
html.dark-theme .senator-party-name {
  color: #9fb3cc;
}

.parliament-card {
  overflow: hidden;
  border: 1px solid #d8e6f2;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.07);
}

.parliament-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
  background: #092b59;
}

.parliament-card-body {
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}

.parliament-seat-map {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 480px;
  margin: 0 auto 18px;
  padding: 20px 16px;
  border: 1px solid #d9e5f0;
  border-radius: 50% 50% 12px 12px / 30% 30% 12px 12px;
  background: #edf4fb;
  overflow: hidden;
}

.parliament-seat-row {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.parliament-seat,
.parliament-legend-dot {
  display: inline-block;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, .95);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(25, 55, 90, .28), 0 2px 5px rgba(25, 55, 90, .18);
}

.parliament-seat {
  width: 28px;
  height: 28px;
}

.parliament-seat-empty {
  opacity: .75;
}

.parliament-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
}

.parliament-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #334155;
  font-size: .82rem;
  font-weight: 700;
}

.parliament-legend-dot {
  width: 13px;
  height: 13px;
  border-width: 1px;
}

@media (max-width: 575px) {
  .parliament-card-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .parliament-seat-row { gap: 7px; }
  .parliament-seat { width: 22px; height: 22px; }
}
.senators-roster-card hr {
  border-color: #dce7f0;
  opacity: 1;
}
@media (max-width: 767px) {
  .deputies-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .deputies-tabs .nav-link {
    white-space: nowrap;
  }
  .senators-roster-card > .card-body {
    padding: 14px;
  }
  .senators-list .list-group-item {
    align-items: flex-start !important;
  }
}

/* ==========================================================
   ЕДИНЫЕ КНОПКИ ЗАСЕДАНИЙ И ЗАЛ ЗАСЕДАНИЯ
   ========================================================== */
.meetings-page .btn,
.meeting-room-page .btn {
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.25;
  transition:
    color 0.16s ease,
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.meetings-page .btn:active,
.meeting-room-page .btn:active {
  transform: translateY(1px);
}

.meetings-page .btn-primary,
.meeting-room-page .btn-primary {
  color: #fff;
  background: #0878f9;
  border-color: #0878f9;
}

.meetings-page .btn-primary:hover,
.meeting-room-page .btn-primary:hover {
  background: #0668da;
  border-color: #0668da;
  box-shadow: 0 4px 10px rgba(8, 120, 249, 0.2);
}

.meetings-page .btn-success,
.meeting-room-page .btn-success {
  color: #fff;
  background: #159761;
  border-color: #159761;
}

.meetings-page .btn-success:hover,
.meeting-room-page .btn-success:hover {
  background: #117f50;
  border-color: #117f50;
}

.meetings-page .btn-outline-primary,
.meeting-room-page .btn-outline-primary {
  color: #0878f9;
  border-color: #0878f9;
  background: #fff;
}

.meetings-page .btn-outline-primary:hover,
.meeting-room-page .btn-outline-primary:hover {
  color: #fff;
  background: #0878f9;
  border-color: #0878f9;
}

.meeting-room-page {
  color: var(--ink);
}

.meeting-room-page .meeting-room-header {
  margin-bottom: 22px !important;
  padding-top: 0;
}

.meeting-room-page .meeting-room-header h2 {
  margin: 0 0 9px;
  color: #12365f;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 800 !important;
  letter-spacing: -0.025em;
}

.meeting-room-page > hr {
  margin: 18px 0 22px;
  border-color: #dbe7f2;
  opacity: 1;
}

.meeting-room-page .meeting-room-header .badge,
.meeting-room-page .server-badge,
.meeting-room-page .meeting-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0.42em 0.7em;
  border: 0;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
}

.meeting-room-page .server-badge {
  color: #0877c9 !important;
  background: #cfefff !important;
}

.meeting-room-page .meeting-status-badge.bg-primary {
  color: #0878f9 !important;
  background: #dceeff !important;
}

.meeting-room-page .meeting-status-badge.bg-success {
  color: #168152 !important;
  background: #d9f4e6 !important;
}

.meeting-room-page .meeting-status-badge.bg-warning {
  color: #6256bd !important;
  background: #e9e6ff !important;
}

.meeting-room-page .meeting-status-badge.bg-secondary {
  color: #536a83 !important;
  background: #e8edf3 !important;
}

.meeting-room-page .meeting-status-badge.bg-danger {
  color: #c93452 !important;
  background: #ffe1e7 !important;
}

.meeting-room-page .meeting-room-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px !important;
}

.meeting-room-page .meeting-room-actions .btn-outline-warning,
.meeting-room-page .btn-warning {
  color: #6256bd;
  background: #fff;
  border-color: #8d84d8;
}

.meeting-room-page .meeting-room-actions .btn-outline-warning:hover,
.meeting-room-page .btn-warning:hover {
  color: #fff;
  background: #6256bd;
  border-color: #6256bd;
}

.meeting-room-page .btn-outline-danger {
  color: #c93452;
  background: #fff;
  border-color: #df7184;
}

.meeting-room-page .btn-outline-danger:hover {
  color: #fff;
  background: #c93452;
  border-color: #c93452;
}

.meeting-room-page .btn-outline-secondary,
.meeting-room-page .btn-outline-dark {
  color: #536a83;
  background: #fff;
  border-color: #b9cbd9;
}

.meeting-room-page .btn-outline-secondary:hover,
.meeting-room-page .btn-outline-dark:hover {
  color: #fff;
  background: #536a83;
  border-color: #536a83;
}

.meeting-room-page .meeting-room-card,
.meeting-room-page .card {
  overflow: hidden;
  border: 1px solid #d8e6f2 !important;
  border-radius: 9px;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.07) !important;
}

.meeting-room-page .card-header {
  min-height: 56px;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border: 0;
  color: #fff !important;
  background: #092b59 !important;
  font-size: 0.92rem;
}

.meeting-room-page .card-header.bg-warning {
  background: #6256bd !important;
}

.meeting-room-page .card-header.bg-danger {
  background: #c93452 !important;
}

.meeting-room-page .card-body {
  padding: 18px;
  background: #fff;
}

.meeting-room-page .meeting-agenda-journal {
  min-width: 0;
  overflow: hidden;
}

.meeting-room-page .meeting-agenda-journal-body {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.meeting-room-page .meeting-agenda-journal .meeting-agenda-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
}

.meeting-room-page .meeting-agenda-journal .meeting-agenda-table th,
.meeting-room-page .meeting-agenda-journal .meeting-agenda-table td {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.meeting-room-page .meeting-agenda-journal .collapse,
.meeting-room-page .meeting-agenda-journal .collapse .card-body {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.meeting-room-page .meeting-agenda-journal .collapse .card-body > * {
  max-width: 100%;
}

.meeting-room-page .meeting-agenda-journal .collapse .table-responsive {
  max-width: 100%;
  overflow-x: auto;
}

.meeting-room-page .meeting-agenda-journal .collapse table {
  max-width: 100%;
  table-layout: fixed;
}

.meeting-room-page .meeting-agenda-journal .collapse td,
.meeting-room-page .meeting-agenda-journal .collapse th {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.meeting-room-page .meeting-vote-results-table {
  border: 1px solid #829ab0 !important;
  border-collapse: collapse;
}

.meeting-room-page .meeting-vote-results-table > :not(caption) > * > * {
  border: 1px solid #829ab0 !important;
}

.meeting-room-page .meeting-agenda-journal .card-header .badge {
  color: #fff !important;
}

.meeting-vote-parliament-card {
  overflow: hidden;
  border: 1px solid #d8e6f2 !important;
  border-radius: 9px;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.07) !important;
}

.meeting-vote-parliament-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 12px 16px;
  color: #fff;
  background: #092b59;
}

.meeting-vote-parliament-header .badge {
  max-width: 65%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meeting-vote-bill-title {
  color: #fff !important;
  background: rgba(255, 255, 255, .16) !important;
}

.meeting-vote-parliament-body {
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}

.meeting-vote-parliament-map {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 480px;
  margin: 0 auto 18px;
  padding: 20px 16px;
  border: 1px solid #d9e5f0;
  border-radius: 50% 50% 12px 12px / 30% 30% 12px 12px;
  background: #edf4fb;
  overflow: hidden;
}

.meeting-vote-parliament-row {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.meeting-vote-seat,
.meeting-vote-legend-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, .95);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(25, 55, 90, .3), 0 2px 5px rgba(25, 55, 90, .18);
}

.meeting-vote-seat {
  position: relative;
  width: 48px;
  height: 48px;
  overflow: hidden;
}

.meeting-vote-seat img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  opacity: .95;
}

.meeting-vote-for { background-color: rgba(25, 135, 84, .62); }
.meeting-vote-against { background-color: rgba(220, 53, 69, .62); }
.meeting-vote-abstain { background-color: rgba(108, 117, 125, .62); }
.meeting-vote-empty { background-color: #e5e7eb; opacity: .75; }

/* Цвет результата накладывается поверх логотипа, чтобы он был виден на любом фоне. */
.meeting-vote-seat.meeting-vote-for::after,
.meeting-vote-seat.meeting-vote-against::after,
.meeting-vote-seat.meeting-vote-abstain::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

.meeting-vote-seat.meeting-vote-for::after {
  background: rgba(25, 135, 84, .48);
}

.meeting-vote-seat.meeting-vote-against::after {
  background: rgba(220, 53, 69, .48);
}

.meeting-vote-seat.meeting-vote-abstain::after {
  background: rgba(108, 117, 125, .48);
}

.meeting-vote-parliament-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  color: #334155;
  font-size: .82rem;
  font-weight: 700;
}

.meeting-vote-parliament-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.meeting-vote-legend-dot {
  width: 14px;
  height: 14px;
  border-width: 1px;
}

@media (max-width: 575px) {
  .meeting-vote-parliament-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .meeting-vote-parliament-header .badge {
    max-width: 100%;
  }

  .meeting-vote-parliament-row {
    gap: 7px;
  }

  .meeting-vote-seat {
    width: 38px;
    height: 38px;
  }
}

.meeting-room-page .card-body p,
.meeting-room-page .card-body li {
  color: #506783;
  font-size: 0.9rem;
}

.meeting-room-page .card-body strong,
.meeting-room-page .card-body h6 {
  color: #233b60;
}

.meeting-room-page .list-group {
  overflow: hidden;
  border: 1px solid #dce8f2;
  border-radius: 7px;
}

.meeting-room-page .list-group-item {
  padding: 9px 10px;
  color: #506783;
  border-color: #e2ebf3;
}

.meeting-room-page .list-group-item .badge {
  padding: 0.4em 0.62em;
  border-radius: 5px;
  font-size: 0.68rem;
}

.meeting-room-page .alert {
  border-radius: 6px;
  border-width: 1px;
}

.meeting-room-page .alert-warning {
  color: #6256bd;
  background: #f0eeff;
  border-color: #d7d1ff;
}

.meeting-room-page .alert-info {
  color: #0877c9;
  background: #e8f7ff;
  border-color: #c5e9fb;
}

.meeting-room-page .table {
  margin-bottom: 0;
  color: #35516e;
  font-size: 0.84rem;
}

.meeting-room-page .table th {
  padding: 10px 9px;
  color: #233b60;
  background: #edf4fb;
  border-color: #d6e3ee;
  font-size: 0.76rem;
}

.meeting-room-page .table td {
  padding: 10px 9px;
  border-color: #dce7f0;
  vertical-align: middle;
}

.meeting-room-page .table-bordered > :not(caption) > * > * {
  border-width: 1px;
}

.meeting-room-page .table-bordered th + th,
.meeting-room-page .table-bordered td + td {
  border-left: 2px solid #b9cbd9 !important;
}

.meeting-room-page .collapse {
  background: #f5f8fb !important;
  border-top: 1px solid #dce7f0;
}

.meeting-room-page .modal-content {
  overflow: hidden;
  border: 1px solid #cbdcea;
  border-radius: 9px;
  box-shadow: 0 18px 45px rgba(20, 55, 95, 0.2);
}

.meeting-room-page .modal-header {
  padding: 14px 18px;
  color: #fff;
  background: #092b59 !important;
  border: 0;
}

.meeting-room-page .modal-header.bg-warning {
  background: #6256bd !important;
}

.meeting-room-page .modal-header.bg-danger {
  background: #c93452 !important;
}

.meeting-room-page .modal-body,
.meeting-room-page .modal-footer {
  background: #fff;
  border-color: #e0eaf2;
}

.meeting-room-page .modal-body {
  padding: 20px 18px;
}

.meeting-room-page .modal-footer {
  padding: 12px 18px;
}

.meeting-room-page .modal .form-control {
  min-height: 42px;
  border-color: #cbdcea;
  border-radius: 6px;
}

.meeting-room-page .modal .btn-secondary {
  color: #536a83;
  background: #eef3f7;
  border-color: #d3e0ea;
}

.meeting-room-page .modal .btn-danger,
.meeting-room-page .btn-danger {
  color: #fff;
  background: #c93452;
  border-color: #c93452;
}

.meeting-room-page .modal .btn-danger:hover,
.meeting-room-page .btn-danger:hover {
  background: #ae2944;
  border-color: #ae2944;
}

@media (max-width: 767px) {
  .meeting-room-page .meeting-room-header {
    gap: 14px;
  }

  .meeting-room-page .meeting-room-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .meeting-room-page .meeting-room-actions .btn {
    flex: 1 1 auto;
  }
}

/* Финальная полировка интерфейса заседаний: все состояния кнопок
   используют ту же спокойную палитру, что и остальные разделы сайта. */
.meetings-page .btn,
.meeting-room-page .btn {
  border-width: 1px;
  box-shadow: none;
}

.meetings-page .btn:hover,
.meeting-room-page .btn:hover {
  transform: translateY(-1px);
}

.meetings-page .btn:focus-visible,
.meeting-room-page .btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(8, 120, 249, 0.16);
}

.meetings-page .btn-secondary,
.meeting-room-page .btn-secondary {
  color: #536a83;
  background: #eef3f7;
  border-color: #d3e0ea;
}

.meetings-page .btn-secondary:hover,
.meeting-room-page .btn-secondary:hover {
  color: #fff;
  background: #536a83;
  border-color: #536a83;
}

.meetings-page .btn-dark,
.meeting-room-page .btn-dark {
  color: #fff;
  background: #092b59;
  border-color: #092b59;
}

.meetings-page .btn-dark:hover,
.meeting-room-page .btn-dark:hover {
  color: #fff;
  background: #123d69;
  border-color: #123d69;
  box-shadow: 0 4px 10px rgba(9, 43, 89, 0.18);
}

.meetings-page .btn-warning,
.meeting-room-page .btn-warning {
  color: #6256bd;
  background: #e9e6ff;
  border-color: #c9c1f2;
}

.meetings-page .btn-warning:hover,
.meeting-room-page .btn-warning:hover {
  color: #fff;
  background: #6256bd;
  border-color: #6256bd;
}

.meetings-page .btn-danger,
.meeting-room-page .btn-danger {
  color: #fff;
  background: #c93452;
  border-color: #c93452;
}

.meetings-page .btn-danger:hover,
.meeting-room-page .btn-danger:hover {
  color: #fff;
  background: #ae2944;
  border-color: #ae2944;
  box-shadow: 0 4px 10px rgba(201, 52, 82, 0.18);
}

.meetings-page .btn-outline-secondary,
.meeting-room-page .btn-outline-secondary {
  color: #536a83;
  background: #fff;
  border-color: #b9cbd9;
}

.meetings-page .btn-outline-secondary:hover,
.meeting-room-page .btn-outline-secondary:hover {
  color: #fff;
  background: #536a83;
  border-color: #536a83;
}

.meetings-page .btn-outline-dark,
.meeting-room-page .btn-outline-dark {
  color: #536a83;
  background: #fff;
  border-color: #b9cbd9;
}

.meetings-page .btn-outline-dark:hover,
.meeting-room-page .btn-outline-dark:hover {
  color: #fff;
  background: #536a83;
  border-color: #536a83;
}

.meeting-room-page .meeting-room-layout > [class*="col-"] {
  display: flex;
  flex-direction: column;
}

.meeting-room-page .meeting-voters-table-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: visible;
}

.meeting-room-page #registeredUsersList,
.meeting-room-page #notVotedList {
  max-height: none !important;
  overflow: visible !important;
}

.meeting-room-page .meeting-vote-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.meeting-room-page .meeting-voters-table {
  width: 100%;
  min-width: 0 !important;
  table-layout: fixed;
}

.meeting-room-page .meeting-voters-table th,
.meeting-room-page .meeting-voters-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.meeting-room-page .meeting-voters-table th:first-child,
.meeting-room-page .meeting-voters-table td:first-child {
  width: 68%;
}

.meeting-room-page .meeting-voters-table th:last-child,
.meeting-room-page .meeting-voters-table td:last-child {
  width: 32%;
}

.meeting-room-page .card-header .badge {
  color: #fff;
  background: rgba(255, 255, 255, 0.16) !important;
}

.meeting-room-page .card.bg-light {
  color: #506783;
  background: #f4f8fc !important;
  border-color: #dce8f2 !important;
  border-radius: 8px;
}

@media (max-width: 575px) {
  .meetings-page .meeting-schedule-card .card-body,
  .meeting-room-page .card-body {
    padding: 14px;
  }

  .meetings-page .meeting-filter-buttons .filter-btn {
    flex: 1 1 calc(50% - 7px);
  }

  .meeting-room-page .meeting-room-actions .btn {
    width: 100%;
  }

  .meeting-room-page .d-flex.gap-2:has(> .flex-grow-1) {
    flex-wrap: wrap;
  }

  .meeting-room-page .d-flex.gap-2:has(> .flex-grow-1) > .btn,
  .meeting-room-page .d-flex.gap-2:has(> .flex-grow-1) > form {
    flex: 1 1 100%;
  }
}

/* ==========================================================
   ЕДИНЫЙ ВИЗУАЛЬНЫЙ СТИЛЬ ДЛЯ КАБИНЕТОВ И ПРОФИЛЯ
   ========================================================== */
.deputy-cabinet-page,
.fed-cabinet-page,
.my-party-page,
.frozen-party-page,
.profile-page,
.party-cabinet-page {
  padding: 4px 0 18px;
}

.deputy-cabinet-page .cabinet-page-header,
.fed-cabinet-page .cabinet-page-header,
.my-party-page .cabinet-page-header,
.profile-page .cabinet-page-header,
.party-cabinet-page .cabinet-page-header {
  margin-bottom: 4px !important;
}

.deputy-cabinet-page .card,
.fed-cabinet-page .card,
.my-party-page .card,
.profile-page .card,
.party-cabinet-page .card,
.frozen-party-page .card {
  background: rgba(255, 255, 255, 0.96);
}

/* Bootstrap utility colors are retained semantically, but visually
   aligned with the dark-blue headers and blue accents of index. */
.deputy-cabinet-page .card-header.bg-dark,
.fed-cabinet-page .card-header.bg-dark,
.profile-page .card-header.bg-dark,
.party-cabinet-page .card-header.bg-dark {
  color: #fff !important;
  background: linear-gradient(110deg, #092b59, #123d69) !important;
}

.deputy-cabinet-page .card-header.bg-primary,
.fed-cabinet-page .card-header.bg-primary,
.party-cabinet-page .card-header.bg-primary {
  color: #fff !important;
  background: #0878f9 !important;
}

.deputy-cabinet-page .card-header.bg-success,
.fed-cabinet-page .card-header.bg-success {
  color: #fff !important;
  background: #159761 !important;
}

.my-party-page .card-header.bg-info {
  color: #fff !important;
  background: linear-gradient(110deg, #092b59, #2d4058) !important;
}

.fed-cabinet-page .card-header.bg-secondary,
.my-party-page .card-header.bg-secondary,
.party-cabinet-page .card-header.bg-secondary {
  color: #fff !important;
  background: #536a83 !important;
}

.deputy-cabinet-page .btn-primary,
.fed-cabinet-page .btn-primary,
.my-party-page .btn-primary,
.profile-page .btn-primary,
.party-cabinet-page .btn-primary {
  background: #0878f9;
  border-color: #0878f9;
}

.deputy-cabinet-page .btn-primary:hover,
.fed-cabinet-page .btn-primary:hover,
.my-party-page .btn-primary:hover,
.profile-page .btn-primary:hover,
.party-cabinet-page .btn-primary:hover {
  background: #0668db;
  border-color: #0668db;
}

.deputy-cabinet-page .btn-success,
.fed-cabinet-page .btn-success,
.my-party-page .btn-success,
.profile-page .btn-success,
.party-cabinet-page .btn-success {
  background: #159761;
  border-color: #159761;
}

.deputy-cabinet-page .accordion,
.fed-cabinet-page .accordion,
.my-party-page .accordion,
.party-cabinet-page .accordion {
  overflow: hidden;
  border: 1px solid #dce8f2;
  border-radius: 7px;
}

.deputy-cabinet-page .accordion-button,
.fed-cabinet-page .accordion-button,
.my-party-page .accordion-button,
.party-cabinet-page .accordion-button {
  color: #233b60;
  background: #f4f8fc;
  box-shadow: none;
  font-weight: 700;
}

.deputy-cabinet-page .accordion-button:not(.collapsed),
.fed-cabinet-page .accordion-button:not(.collapsed),
.my-party-page .accordion-button:not(.collapsed),
.party-cabinet-page .accordion-button:not(.collapsed) {
  color: #0878f9;
  background: #edf6ff;
}

.deputy-cabinet-page .table-responsive,
.fed-cabinet-page .table-responsive,
.my-party-page .table-responsive,
.party-cabinet-page .table-responsive {
  border-radius: 7px;
}

.my-party-page .table-responsive {
  overflow-x: hidden;
}

.my-party-page .table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
}

.my-party-page .table th,
.my-party-page .table td {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.party-position-vertical-list {
  padding-left: 1.5rem;
}

.party-position-vertical-list li {
  padding: 4px 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.my-party-candidate-list-wrap {
  width: 100%;
  max-width: 100%;
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* В мобильном слое ниже есть общее правило min-width: 680px.
   Для my_party оно не должно создавать горизонтальный скролл. */
.my-party-page .table,
.my-party-page .my-party-candidate-list-table {
  display: table;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100%;
  table-layout: fixed;
  white-space: normal;
}

.my-party-page .my-party-candidate-list-table th,
.my-party-page .my-party-candidate-list-table td {
  min-width: 0;
  max-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  color: #e7effb;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 6px;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.theme-toggle-btn:hover,
.theme-toggle-btn:focus-visible {
  color: #fff;
  background: #0d6dde;
  outline: none;
}

html.dark-theme { color-scheme: dark; }

html.dark-theme body {
  color: #e5e7eb;
  background-color: #04183A !important;
  background-image: url("../zakbgdark.png");
  background-repeat: no-repeat;
  background-position: right 58px;
  background-size: 54% auto;
}

html.dark-theme .card,
html.dark-theme .modal-content,
html.dark-theme .accordion-item,
html.dark-theme .list-group-item,
html.dark-theme .dropdown-menu {
  color: #e5e7eb;
  background-color: #1f2937;
  border-color: #374151 !important;
}

html.dark-theme .card-body,
html.dark-theme .accordion-body,
html.dark-theme .modal-body,
html.dark-theme .modal-footer {
  background-color: #1f2937;
}

html.dark-theme .card-header,
html.dark-theme .accordion-button,
html.dark-theme .table-light,
html.dark-theme .table-light > th,
html.dark-theme .table-light > td {
  color: #f3f4f6;
  background-color: #273449 !important;
  border-color: #40516a !important;
}

html.dark-theme .accordion-button { color: #e5e7eb; }
html.dark-theme .accordion-button:not(.collapsed) {
  color: #93c5fd;
  background-color: #243b5a !important;
}

html.dark-theme .table {
  --bs-table-bg: #1f2937;
  --bs-table-color: #e5e7eb;
  --bs-table-border-color: #40516a;
  color: #e5e7eb;
  background-color: #1f2937;
}

html.dark-theme .table > :not(caption) > * > * {
  color: #e5e7eb;
  background-color: #1f2937;
  border-color: #40516a;
}

html.dark-theme .table-hover > tbody > tr:hover > * {
  color: #fff;
  background-color: #273b56;
}

html.dark-theme .form-control,
html.dark-theme .form-select,
html.dark-theme textarea,
html.dark-theme input {
  color: #f3f4f6;
  background-color: #111827 !important;
  border-color: #4b5563;
}

html.dark-theme .form-control:focus,
html.dark-theme .form-select:focus,
html.dark-theme textarea:focus,
html.dark-theme input:focus {
  color: #fff;
  background-color: #111827 !important;
  border-color: #60a5fa;
  box-shadow: 0 0 0 .2rem rgba(96, 165, 250, .2);
}

html.dark-theme .form-control::placeholder,
html.dark-theme textarea::placeholder { color: #9ca3af; }

html.dark-theme .form-label,
html.dark-theme .form-text,
html.dark-theme .text-muted,
html.dark-theme .text-secondary { color: #aeb8c7 !important; }

html.dark-theme .text-dark,
html.dark-theme .text-body { color: #e5e7eb !important; }

html.dark-theme .bg-light,
html.dark-theme .bg-white {
  color: #e5e7eb !important;
  background-color: #273449 !important;
}

html.dark-theme .border,
html.dark-theme .border-top,
html.dark-theme .border-end,
html.dark-theme .border-bottom,
html.dark-theme .border-start { border-color: #40516a !important; }

html.dark-theme hr,
html.dark-theme .dropdown-divider {
  border-color: #40516a !important;
  opacity: 1;
}

html.dark-theme .dropdown-item { color: #e5e7eb; }
html.dark-theme .dropdown-item:hover,
html.dark-theme .dropdown-item:focus {
  color: #fff;
  background-color: #2d4666;
}

html.dark-theme .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

html.dark-theme .alert-light,
html.dark-theme .alert-secondary {
  color: #dbeafe;
  background-color: #273449;
  border-color: #40516a;
}

html.dark-theme .pagination .page-link {
  color: #bfdbfe;
  background-color: #1f2937;
  border-color: #40516a;
}

html.dark-theme .pagination .page-item.active .page-link {
  color: #fff;
  background-color: #2563eb;
}

html.dark-theme .parliament-seat-map,
html.dark-theme .meeting-vote-parliament-map,
html.dark-theme .meeting-vote-parliament-body,
html.dark-theme .deputies-card-body,
html.dark-theme .meeting-room-page .meeting-agenda-journal-body {
  background: #172235 !important;
}

/* Финальный контрастный слой после всех стилей страниц. */
html.dark-theme .home-hero,
html.dark-theme .section-card,
html.dark-theme .stats-card,
html.dark-theme .initiatives-card,
html.dark-theme .feature-card,
html.dark-theme .party-tabs,
html.dark-theme .party-card,
html.dark-theme .party-card-body,
html.dark-theme .party-card-body .accordion,
html.dark-theme .party-card-body .accordion-item,
html.dark-theme .party-card-body .accordion-body {
  color: #e5e7eb !important;
  background: rgba(7, 31, 67, .78) !important;
  border-color: rgba(112, 169, 232, .28) !important;
}

html.dark-theme .feature-card,
html.dark-theme .feature-card:hover {
  color: #e5e7eb !important;
  background: linear-gradient(145deg, rgba(15, 48, 91, .86), rgba(7, 31, 67, .74)) !important;
}

html.dark-theme .hero-copy h1,
html.dark-theme .parties-registry-page h1,
html.dark-theme .parties-registry-page h2,
html.dark-theme .parties-registry-page h3,
html.dark-theme .parties-registry-page h4,
html.dark-theme .parties-registry-page h5,
html.dark-theme .parties-registry-page h6,
html.dark-theme .section-card h1,
html.dark-theme .section-card h2,
html.dark-theme .section-card h3,
html.dark-theme .section-card h4,
html.dark-theme .section-card h5,
html.dark-theme .section-card h6,
html.dark-theme .stats-card h1,
html.dark-theme .stats-card h2,
html.dark-theme .stats-card h3,
html.dark-theme .stats-card h4,
html.dark-theme .stats-card h5,
html.dark-theme .stats-card h6,
html.dark-theme .initiatives-card h1,
html.dark-theme .initiatives-card h2,
html.dark-theme .initiatives-card h3,
html.dark-theme .initiatives-card h4,
html.dark-theme .initiatives-card h5,
html.dark-theme .initiatives-card h6,
html.dark-theme .feature-card h1,
html.dark-theme .feature-card h2,
html.dark-theme .feature-card h3,
html.dark-theme .feature-card h4,
html.dark-theme .feature-card h5,
html.dark-theme .feature-card h6,
html.dark-theme .party-card-body p strong,
html.dark-theme .party-card-body h6,
html.dark-theme .party-card-body .accordion-button,
html.dark-theme .party-card-body .accordion-button strong {
  color: #f3f4f6 !important;
}

html.dark-theme .hero-copy p,
html.dark-theme .parties-heading p,
html.dark-theme .section-card p,
html.dark-theme .stats-card p,
html.dark-theme .initiatives-card p,
html.dark-theme .feature-card p,
html.dark-theme .party-card-body p,
html.dark-theme .party-card-body li,
html.dark-theme .party-card-body td,
html.dark-theme .party-card-body label,
html.dark-theme .party-card-body .text-secondary {
  color: #c3cfde !important;
}

html.dark-theme .party-tabs .nav-link {
  color: #c3cfde !important;
}

html.dark-theme .party-tabs .nav-link:hover {
  color: #fff !important;
  background: #2d4666 !important;
}

html.dark-theme .parties-registry-page .text-center.py-5 {
  color: #dbe5f1 !important;
  background: #273449 !important;
  border-color: #40516a !important;
}
/* END_THEME_ANCHOR */

/* Контрастные плашки заявок сенаторов в темной теме. */
html.dark-theme body .deputy-cabinet-page .badge.bg-warning,
html.dark-theme body .governor-cabinet-page .badge.bg-warning,
html.dark-theme body .deputy-cabinet-page .badge.bg-warning.text-dark,
html.dark-theme body .governor-cabinet-page .badge.bg-warning.text-dark {
  color: #fff8df !important;
  background: #765d17 !important;
  border: 1px solid #d2b85d !important;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .2) !important;
  text-shadow: none !important;
}

/* Кнопка «Показать/Скрыть» в формах входа и регистрации. */
.auth-page .auth-password-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 42px;
  padding: .45rem .7rem;
  color: #31577f !important;
  background: #e8f1fb !important;
  border: 1px solid #9fc1df !important;
  border-radius: 0 6px 6px 0;
  font-weight: 700;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}

.auth-page .auth-password-toggle:hover,
.auth-page .auth-password-toggle:focus-visible {
  color: #fff !important;
  background: #1769a8 !important;
  border-color: #1769a8 !important;
  box-shadow: 0 0 0 .18rem rgba(23, 105, 168, .18) !important;
}

html.dark-theme body .auth-page .auth-password-toggle {
  color: #eaf4ff !important;
  background: #17375f !important;
  border-color: #6593c4 !important;
  box-shadow: none !important;
}

html.dark-theme body .auth-page .auth-password-toggle:hover,
html.dark-theme body .auth-page .auth-password-toggle:focus-visible {
  color: #fff !important;
  background: #245488 !important;
  border-color: #8fc5f7 !important;
  box-shadow: 0 0 0 .18rem rgba(101, 169, 221, .22) !important;
}

/* Контраст текста парламентской диаграммы в темной теме. */
html.dark-theme body .deputies-page .parliament-card-header,
html.dark-theme body .deputies-page .parliament-card-header strong,
html.dark-theme body .deputies-page .parliament-card-header span,
html.dark-theme body .deputies-page .parliament-legend,
html.dark-theme body .deputies-page .parliament-legend-item {
  color: #f1f7ff !important;
}

html.dark-theme body .deputies-page .parliament-card-body {
  color: #e8f3ff !important;
  background: #172235 !important;
}

/* Кастомное подтверждение отзыва законопроекта. */
.bills-withdraw-modal .modal-content {
  overflow: hidden;
  border: 1px solid #f0c5cc;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(36, 52, 74, .2);
}

.bills-withdraw-modal .modal-header {
  color: #fff;
  background: #9b3044;
  border-bottom: 0;
}

.bills-withdraw-modal .modal-body {
  color: #263d59;
  background: #fff;
}

.bills-withdraw-modal .withdraw-bill-name {
  color: #9b3044;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.bills-withdraw-modal .modal-footer {
  background: #f5f8fc;
  border-top: 1px solid #dbe7f2;
}

html.dark-theme body .bills-page .bills-withdraw-modal .modal-content {
  color: #eaf4ff !important;
  background: #071f43 !important;
  border-color: #d87583 !important;
}

html.dark-theme body .bills-page .bills-withdraw-modal .modal-header {
  color: #fff5f6 !important;
  background: #8f2438 !important;
}

html.dark-theme body .bills-page .bills-withdraw-modal .modal-body,
html.dark-theme body .bills-page .bills-withdraw-modal .modal-footer {
  color: #eaf4ff !important;
  background: #0b2a54 !important;
  border-color: #5b83ab !important;
}

html.dark-theme body .bills-page .bills-withdraw-modal .withdraw-bill-name {
  color: #ffb6c0 !important;
}

html.dark-theme body .bills-page .bills-withdraw-modal .alert-warning {
  color: #fff8df !important;
  background: #765d17 !important;
  border-color: #d2b85d !important;
}

/* Dev-Blog */
.dev-blog-page {
  max-width: 980px;
  margin: 0 auto;
}

.dev-blog-hero {
  margin-bottom: 24px;
  padding: 30px 32px;
  color: #17375f;
  background: linear-gradient(135deg, #f4f9ff, #e5f1ff);
  border: 1px solid #c6dced;
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(26, 73, 119, .10);
}

.dev-blog-eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: #1769a8;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.dev-blog-hero h1 {
  margin: 0;
  color: #17375f;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 800;
}

.dev-blog-hero p {
  margin: 8px 0 0;
  color: #5e7691;
}

.dev-blog-card {
  margin-bottom: 22px;
  padding: 24px 28px;
  color: #263d59;
  background: rgba(255, 255, 255, .94);
  border: 1px solid #d5e3ef;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(26, 73, 119, .08);
}

.dev-blog-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #dbe7f2;
}

.dev-blog-card-header h2 {
  margin: 0;
  color: #17375f;
  font-size: 1.25rem;
  font-weight: 800;
}

.dev-blog-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  color: #14577e;
  background: #d9efff;
  border: 1px solid #a9d5ee;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 700;
}

.dev-blog-badge-admin {
  color: #7b3f08;
  background: #fff0c9;
  border-color: #e8c46d;
}

.dev-blog-list {
  margin: 0;
  padding-left: 1.35rem;
}

.dev-blog-list li {
  margin: 0 0 9px;
  padding-left: 4px;
  color: #334d69;
  line-height: 1.55;
}

.dev-blog-list li:last-child {
  margin-bottom: 0;
}

html.dark-theme body .dev-blog-page .dev-blog-hero,
html.dark-theme body .dev-blog-page .dev-blog-card {
  color: #eaf4ff !important;
  background: rgba(7, 31, 67, .88) !important;
  border-color: rgba(112, 169, 232, .38) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .22) !important;
}

html.dark-theme body .dev-blog-page .dev-blog-hero {
  background: linear-gradient(135deg, rgba(15, 58, 105, .94), rgba(7, 31, 67, .92)) !important;
}

html.dark-theme body .dev-blog-page .dev-blog-eyebrow,
html.dark-theme body .dev-blog-page .dev-blog-hero h1,
html.dark-theme body .dev-blog-page .dev-blog-card-header h2 {
  color: #f1f7ff !important;
}

html.dark-theme body .dev-blog-page .dev-blog-hero p,
html.dark-theme body .dev-blog-page .dev-blog-list li {
  color: #d2e2f3 !important;
}

html.dark-theme body .dev-blog-page .dev-blog-card-header {
  border-color: rgba(112, 169, 232, .3) !important;
}

html.dark-theme body .dev-blog-page .dev-blog-badge {
  color: #effaff !important;
  background: #14577e !important;
  border-color: #63a9d0 !important;
}

html.dark-theme body .dev-blog-page .dev-blog-badge-admin {
  color: #fff8e5 !important;
  background: #765d17 !important;
  border-color: #d2b85d !important;
}

@media (max-width: 640px) {
  .dev-blog-hero,
  .dev-blog-card {
    padding: 20px 18px;
  }

  .dev-blog-card-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Статусы законопроектов в журнале meeting_room: темный фон и высокий контраст. */
html.dark-theme body .meeting-room-page .meeting-agenda-journal .badge.status-badge.status-danger,
html.dark-theme body .meeting-room-page .meeting-agenda-table .badge.status-badge.status-danger {
  color: #fff5f6 !important;
  background: #8f2438 !important;
  border: 1px solid #d66b7c !important;
}

html.dark-theme body .meeting-room-page .meeting-agenda-journal .badge.status-badge.status-info,
html.dark-theme body .meeting-room-page .meeting-agenda-table .badge.status-badge.status-info {
  color: #f0f9ff !important;
  background: #14577e !important;
  border: 1px solid #63a9d0 !important;
}

html.dark-theme body .meeting-room-page .meeting-agenda-journal .badge.status-badge.status-warning,
html.dark-theme body .meeting-room-page .meeting-agenda-table .badge.status-badge.status-warning {
  color: #fff9e8 !important;
  background: #765d17 !important;
  border: 1px solid #d2b85d !important;
}

html.dark-theme body .meeting-room-page .meeting-agenda-journal .badge.status-badge.status-success,
html.dark-theme body .meeting-room-page .meeting-agenda-table .badge.status-badge.status-success {
  color: #effff8 !important;
  background: #146047 !important;
  border: 1px solid #59b99a !important;
}

html.dark-theme body .meeting-room-page .meeting-agenda-journal .badge.status-badge.status-primary,
html.dark-theme body .meeting-room-page .meeting-agenda-table .badge.status-badge.status-primary {
  color: #f0f8ff !important;
  background: #1c5f92 !important;
  border: 1px solid #6ca9d5 !important;
}

html.dark-theme body .meeting-room-page .meeting-agenda-journal .badge.status-badge.status-secondary,
html.dark-theme body .meeting-room-page .meeting-agenda-table .badge.status-badge.status-secondary {
  color: #f1f6fc !important;
  background: #3a506a !important;
  border: 1px solid #829ab4 !important;
}

/* Точечная коррекция плохо читаемых элементов в темной теме. */
html.dark-theme body .meeting-room-page .meeting-status-badge.bg-primary,
html.dark-theme body .meeting-room-page .meeting-status-badge.bg-success,
html.dark-theme body .meeting-room-page .meeting-status-badge.bg-warning,
html.dark-theme body .meeting-room-page .meeting-status-badge.bg-secondary,
html.dark-theme body .meeting-room-page .meeting-status-badge.bg-danger {
  display: inline-flex !important;
  align-items: center !important;
  color: #f5f9ff !important;
  border: 1px solid rgba(255, 255, 255, .32) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2) !important;
  filter: none !important;
}

html.dark-theme body .meeting-room-page .meeting-status-badge.bg-primary {
  background: #1769a8 !important;
}

html.dark-theme body .meeting-room-page .meeting-status-badge.bg-success {
  background: #187b5a !important;
}

html.dark-theme body .meeting-room-page .meeting-status-badge.bg-warning {
  background: #936c18 !important;
}

html.dark-theme body .meeting-room-page .meeting-status-badge.bg-secondary {
  background: #536b83 !important;
}

html.dark-theme body .meeting-room-page .meeting-status-badge.bg-danger {
  background: #9b3044 !important;
}

html.dark-theme body .profile-page .card-body .badge,
html.dark-theme body .profile-page .card-body .badge.bg-primary,
html.dark-theme body .profile-page .card-body .badge.bg-info,
html.dark-theme body .profile-page .card-body .badge.bg-secondary,
html.dark-theme body .profile-page .card-body .badge.bg-warning,
html.dark-theme body .profile-page .card-body .badge.bg-danger {
  display: inline-flex !important;
  align-items: center !important;
  max-width: 100% !important;
  min-height: 27px !important;
  margin: 3px 4px 3px 0 !important;
  padding: .42rem .68rem !important;
  color: #f1f7ff !important;
  background: #245488 !important;
  border: 1px solid #78acd8 !important;
  border-radius: 7px !important;
  line-height: 1.2 !important;
  white-space: normal !important;
  vertical-align: middle !important;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .18) !important;
}

html.dark-theme body .profile-page .card-body .badge.bg-info {
  background: #176898 !important;
  border-color: #66b2dc !important;
}

html.dark-theme body .profile-page .card-body .badge.bg-warning {
  background: #936c18 !important;
  border-color: #d5b55f !important;
}

html.dark-theme body .profile-page .card-body .badge.bg-danger {
  background: #9b3044 !important;
  border-color: #d87583 !important;
}

html.dark-theme body .admin-page .btn.btn-outline-warning,
html.dark-theme body .admin-page .btn.btn-outline-success,
html.dark-theme body .admin-page .btn.btn-outline-primary,
html.dark-theme body .admin-page .btn.btn-outline-danger,
html.dark-theme body .admin-parties-page .btn.btn-outline-warning,
html.dark-theme body .admin-parties-page .btn.btn-outline-success,
html.dark-theme body .admin-parties-page .btn.btn-outline-secondary,
html.dark-theme body .admin-parties-page .btn.btn-outline-danger {
  color: #f4f8ff !important;
  border-width: 1px !important;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .2) !important;
}

html.dark-theme body .admin-page .btn.btn-outline-warning,
html.dark-theme body .admin-parties-page .btn.btn-outline-warning {
  background: #936c18 !important;
  border-color: #d5b55f !important;
}

html.dark-theme body .admin-page .btn.btn-outline-success,
html.dark-theme body .admin-parties-page .btn.btn-outline-success {
  background: #187b5a !important;
  border-color: #56b997 !important;
}

html.dark-theme body .admin-page .btn.btn-outline-primary {
  background: #1769a8 !important;
  border-color: #65a9dd !important;
}

html.dark-theme body .admin-page .btn.btn-outline-danger,
html.dark-theme body .admin-parties-page .btn.btn-outline-danger {
  background: #9b3044 !important;
  border-color: #d87583 !important;
}

html.dark-theme body .party-cabinet-page .party-deputies-card .badge,
html.dark-theme body .party-cabinet-page .party-members-card .badge,
html.dark-theme body .party-cabinet-page .card-body .badge {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 25px !important;
  margin: 3px 4px 3px 0 !important;
  padding: .38rem .62rem !important;
  color: #f1f7ff !important;
  background: #315f87 !important;
  border: 1px solid #75a4c9 !important;
  border-radius: 6px !important;
  line-height: 1.2 !important;
  white-space: normal !important;
}

html.dark-theme body .party-cabinet-page .party-deputies-card .badge.bg-warning,
html.dark-theme body .party-cabinet-page .party-members-card .badge.bg-warning,
html.dark-theme body .party-cabinet-page .card-body .badge.bg-warning {
  color: #fff8df !important;
  background: #936c18 !important;
  border-color: #d5b55f !important;
}

html.dark-theme body .party-cabinet-page .party-deputies-card .badge.bg-info,
html.dark-theme body .party-cabinet-page .party-members-card .badge.bg-info,
html.dark-theme body .party-cabinet-page .card-body .badge.bg-info {
  color: #effbff !important;
  background: #176b8d !important;
  border-color: #61b4d3 !important;
}

/* Заголовки групп партий в списке депутатов. */
html.dark-theme body .deputies-page .deputies-party-group,
html.dark-theme body .deputies-page .deputies-party-group-title {
  color: #f1f7ff !important;
  background: #0b2a54 !important;
  border-color: #5b83ab !important;
}

html.dark-theme .party-members-table thead th {
  color: #f3f4f6 !important;
  background: #273449 !important;
  border-color: #40516a !important;
}

html.dark-theme .party-members-table tbody td {
  color: #e5e7eb !important;
  border-color: #40516a !important;
}

html.dark-theme .admin-edit-party-modal .modal-header.admin-edit-modal-header h5.modal-title,
html.dark-theme .admin-edit-party-modal .modal-header.admin-edit-modal-header .modal-title,
body.dark-theme .admin-edit-party-modal .modal-header.admin-edit-modal-header h5.modal-title,
body.dark-theme .admin-edit-party-modal .modal-header.admin-edit-modal-header .modal-title {
  color: #fff !important;
}

.meeting-agenda-bill-picker {
  max-height: 52vh;
  overflow-y: auto;
  display: grid;
  gap: .65rem;
}

.meeting-agenda-bill-option {
  padding: .75rem;
  border: 1px solid #cbd5e1;
  border-radius: .6rem;
  background: #f8fafc;
}

.meeting-agenda-bill-option .agenda-bill-choice {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  min-width: 1.15rem;
  margin-top: .2rem;
  cursor: pointer;
}

.meeting-agenda-bill-option:hover {
  border-color: #0d6efd;
}

.meeting-agenda-bill-details {
  padding: .75rem;
  border-radius: .45rem;
  background: #fff;
  border: 1px solid #d7dee8;
  overflow-wrap: anywhere;
}

.meeting-agenda-bill-details .bill-rich-content {
  overflow-x: auto;
  color: #111827;
}

html.dark-theme .meeting-agenda-bill-option,
body.dark-theme .meeting-agenda-bill-option {
  background: #17263c;
  border-color: #4d6685;
  color: #f3f4f6;
}

html.dark-theme .meeting-agenda-bill-option .text-muted,
body.dark-theme .meeting-agenda-bill-option .text-muted {
  color: #b7c6d9 !important;
}

html.dark-theme .meeting-agenda-bill-details,
body.dark-theme .meeting-agenda-bill-details {
  background: #202f45;
  border-color: #506783;
  color: #f3f4f6;
}

html.dark-theme .meeting-agenda-bill-details .bill-rich-content,
body.dark-theme .meeting-agenda-bill-details .bill-rich-content {
  color: #f3f4f6;
}

.meeting-room-modal .modal-content {
  position: relative;
}

.agenda-add-confirm {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border-radius: inherit;
  background: rgba(4, 24, 58, .74);
}

.agenda-add-confirm-card {
  width: min(100%, 470px);
  padding: 1.25rem;
  border: 1px solid rgba(13, 110, 253, .4);
  border-radius: .75rem;
  background: #fff;
  color: #172033;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, .3);
}

html.dark-theme .agenda-add-confirm-card,
body.dark-theme .agenda-add-confirm-card {
  background: #1d2a3d;
  color: #f3f4f6;
  border-color: #4d78ae;
}

.party-discipline-panel {
  padding: .75rem;
  border: 1px solid #d7dee8;
  border-radius: .6rem;
  background: rgba(13, 110, 253, .04);
}

.party-discipline-title {
  font-weight: 700;
  margin-bottom: .45rem;
}

.party-discipline-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-bottom: .5rem;
}

.party-discipline-action-row:last-of-type {
  margin-bottom: 0;
}

.fed-regional-discipline {
  min-width: 190px;
}

.fed-regional-discipline .party-discipline-history summary {
  font-size: .85rem;
}

.fed-regional-discipline .table {
  min-width: 560px;
  font-size: .8rem;
}

.party-discipline-cabinet-card .table {
  font-size: .9rem;
}

.party-warning-count,
.party-reprimand-count {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: .35rem .65rem;
  font-weight: 700;
}

.party-warning-count {
  color: #fff !important;
  background: #b77900 !important;
}

.party-reprimand-count {
  color: #fff !important;
  background: #b02a37 !important;
}

.party-discipline-history summary {
  cursor: pointer;
  font-weight: 600;
  color: #0d6efd;
}

.discipline-modal .modal-content {
  position: relative;
}

.discipline-confirm {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border-radius: inherit;
  background: rgba(4, 24, 58, .72);
}

.discipline-confirm-card {
  width: min(100%, 430px);
  padding: 1.25rem;
  border: 1px solid rgba(13, 110, 253, .4);
  border-radius: .75rem;
  background: #fff;
  color: #172033;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, .3);
}

html.dark-theme .party-discipline-panel,
body.dark-theme .party-discipline-panel {
  border-color: #40516a;
  background: rgba(39, 52, 73, .75);
}

html.dark-theme .party-discipline-title,
body.dark-theme .party-discipline-title {
  color: #f3f4f6 !important;
}

html.dark-theme .party-discipline-action-row .btn-warning,
body.dark-theme .party-discipline-action-row .btn-warning {
  color: #fff !important;
  background: #a66b00 !important;
  border-color: #d9a441 !important;
}

html.dark-theme .party-discipline-action-row .btn-outline-warning,
body.dark-theme .party-discipline-action-row .btn-outline-warning {
  color: #ffd166 !important;
  border-color: #d9a441 !important;
}

html.dark-theme .party-discipline-action-row .btn-danger,
body.dark-theme .party-discipline-action-row .btn-danger {
  color: #fff !important;
  background: #a52b39 !important;
  border-color: #e06a75 !important;
}

html.dark-theme .party-discipline-action-row .btn-outline-danger,
body.dark-theme .party-discipline-action-row .btn-outline-danger {
  color: #ff9da6 !important;
  border-color: #e06a75 !important;
}

html.dark-theme .party-discipline-action-row .btn:disabled,
body.dark-theme .party-discipline-action-row .btn:disabled {
  color: #aebbd0 !important;
  background: #34445c !important;
  border-color: #536983 !important;
  opacity: 1;
}

html.dark-theme .party-discipline-history summary,
body.dark-theme .party-discipline-history summary {
  color: #8ec5ff;
}

html.dark-theme .discipline-confirm-card,
body.dark-theme .discipline-confirm-card {
  background: #1d2a3d;
  color: #f3f4f6;
  border-color: #4d78ae;
}

.admin-edit-party-modal .modal-content {
  position: relative;
}

.admin-edit-modal-header .modal-title {
  color: #212529;
}

.admin-position-list {
  max-height: 240px;
  overflow-y: auto;
}

.admin-position-row {
  min-width: 0;
}

.admin-position-number {
  flex: 0 0 2rem;
  text-align: right;
  font-weight: 700;
}

.admin-edit-confirm {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border-radius: inherit;
  background: rgba(4, 24, 58, .72);
}

.admin-edit-confirm-card {
  width: min(100%, 430px);
  padding: 1.25rem;
  border: 1px solid rgba(13, 110, 253, .4);
  border-radius: .75rem;
  background: #fff;
  color: #172033;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, .3);
}

html.dark-theme .admin-edit-party-modal .modal-content,
html.dark-theme .admin-edit-party-modal .card.bg-light {
  background: #1d2a3d !important;
  color: #f3f4f6;
}

html.dark-theme .admin-edit-modal-header .modal-title,
html.dark-theme .admin-edit-party-modal h6,
html.dark-theme .admin-edit-party-modal label {
  color: #fff !important;
}

html.dark-theme .admin-edit-confirm-card {
  background: #1d2a3d;
  color: #f3f4f6;
  border-color: #4d78ae;
}

/* Редактор должностей региональной партии в fed_cabinet */
.fed-positions-editor-modal .modal-content {
  position: relative;
}

.regional-positions-list {
  max-height: 52vh;
  overflow-y: auto;
  padding-right: .25rem;
}

.regional-position-row {
  min-width: 0;
}

.regional-position-row .regional-position-number {
  width: 2rem;
  flex: 0 0 2rem;
  text-align: right;
  font-weight: 700;
}

.regional-position-row .regional-position-name {
  min-width: 0;
}

.regional-position-row .badge {
  white-space: nowrap;
}

.regional-position-confirm {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(4, 24, 58, .72);
  border-radius: inherit;
}

.regional-position-confirm-card {
  width: min(100%, 430px);
  padding: 1.25rem;
  border: 1px solid rgba(13, 110, 253, .4);
  border-radius: .75rem;
  background: #fff;
  color: #172033;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, .3);
}

html.dark-theme .regional-position-confirm-card {
  background: #1d2a3d;
  color: #f3f4f6;
  border-color: #4d78ae;
}

/* Заголовки модальных окон редактирования партий должны оставаться читаемыми
   поверх желтого заголовка в темной теме. Этот селектор расположен в финальном
   слое, чтобы перекрыть общие правила .bg-warning.text-dark. */
html.dark-theme .admin-edit-party-modal .modal-header.admin-edit-modal-header h5.modal-title,
html.dark-theme .admin-edit-party-modal .modal-header.admin-edit-modal-header .modal-title {
  color: #fff !important;
}

@media (max-width: 576px) {
  .regional-position-row {
    flex-wrap: wrap;
  }

  .regional-position-row .regional-position-name {
    flex: 1 1 calc(100% - 2.5rem);
  }
}

/* Последний приоритет: эти правила должны оставаться в самом низу файла. */
html.dark-theme body [class*="-page"] .btn-light:not(.btn-close),
html.dark-theme body [class*="-page"] .btn-white:not(.btn-close),
html.dark-theme body [class*="-page"] .btn-outline-light:not(.btn-close),
html.dark-theme body [class*="-page"] .btn-outline-secondary:not(.btn-close),
html.dark-theme body [class*="-page"] .btn-outline-dark:not(.btn-close),
html.dark-theme body [class*="-page"] .btn-outline-primary:not(.btn-close),
html.dark-theme body [class*="-page"] .btn-outline-info:not(.btn-close) {
  color: #eaf4ff !important;
  background: #17375f !important;
  border-color: #6593c4 !important;
}

html.dark-theme body [class*="-page"] .btn-secondary,
html.dark-theme body [class*="-page"] .btn-dark {
  color: #f0f6ff !important;
  background: #3c526e !important;
  border-color: #718ba8 !important;
}

html.dark-theme body .meetings-page .server-badge,
html.dark-theme body .meetings-page #billsContainer .badge,
html.dark-theme body .meetings-page .meeting-list-item .badge,
html.dark-theme body .meeting-room-page .server-badge,
html.dark-theme body .meeting-room-page .meeting-status-badge {
  color: #eaf7ff !important;
  background: #176898 !important;
  border: 1px solid rgba(255, 255, 255, .24) !important;
  filter: none !important;
  opacity: 1 !important;
}

html.dark-theme body .meetings-page .meeting-room-btn,
html.dark-theme body .meetings-page a.meeting-room-btn,
html.dark-theme body .meeting-room-page .toggle-detail-btn,
html.dark-theme body .meeting-room-page a[href="/meetings"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #f2f8ff !important;
  background: #1769a8 !important;
  border: 1px solid #65a9dd !important;
}

html.dark-theme body .meeting-room-page .card.bg-light,
html.dark-theme body .meeting-room-page .card.bg-white,
html.dark-theme body .meeting-room-page .card-body.bg-light,
html.dark-theme body .meeting-room-page .card-body.bg-white,
html.dark-theme body .meeting-room-page .meeting-agenda-journal .collapse .card,
html.dark-theme body .meeting-room-page .meeting-agenda-journal .collapse .card-body,
html.dark-theme body .governor-cabinet-page .collapse .bg-white,
html.dark-theme body .governor-cabinet-page .collapse .bg-light {
  color: #e8f3ff !important;
  background: #0b2a54 !important;
  border-color: #5b83ab !important;
}

html.dark-theme body .meeting-room-page .card.bg-light *:not([style*="color"]):not([color]),
html.dark-theme body .meeting-room-page .card.bg-white *:not([style*="color"]):not([color]),
html.dark-theme body .meeting-room-page .card-body.bg-light *:not([style*="color"]):not([color]),
html.dark-theme body .meeting-room-page .card-body.bg-white *:not([style*="color"]):not([color]),
html.dark-theme body .meeting-room-page .meeting-agenda-journal .collapse .card *:not([style*="color"]):not([color]),
html.dark-theme body .governor-cabinet-page .collapse .bg-white *:not([style*="color"]):not([color]),
html.dark-theme body .governor-cabinet-page .collapse .bg-light *:not([style*="color"]):not([color]) {
  color: #e8f3ff !important;
}

html.dark-theme body .meeting-room-page .meeting-agenda-journal table,
html.dark-theme body .meeting-room-page .meeting-agenda-journal table td,
html.dark-theme body .meeting-room-page .meeting-agenda-journal table th {
  color: #e8f3ff !important;
  background: #092243 !important;
  border-color: #5b83ab !important;
}

html.dark-theme body .elections-page .elections-tabs,
html.dark-theme body .elections-page .election-item-button,
html.dark-theme body .deputies-page .nav-pills,
html.dark-theme body .deputy-cabinet-page .nav-pills,
html.dark-theme body .governor-cabinet-page .nav-pills,
html.dark-theme body .admin-parties-page .nav-pills,
html.dark-theme body .elections-page .form-select,
html.dark-theme body .deputies-page .form-select,
html.dark-theme body .deputy-cabinet-page .form-select,
html.dark-theme body .governor-cabinet-page .form-select,
html.dark-theme body .admin-parties-page .form-select {
  color: #e8f3ff !important;
  background-color: #0b2a54 !important;
  border-color: #5b83ab !important;
}

html.dark-theme body .elections-page .elections-tabs .nav-link,
html.dark-theme body .deputies-page .nav-pills .nav-link,
html.dark-theme body .deputy-cabinet-page .nav-pills .nav-link,
html.dark-theme body .governor-cabinet-page .nav-pills .nav-link,
html.dark-theme body .admin-parties-page .nav-pills .nav-link {
  color: #dbeafe !important;
  background: #17375f !important;
}

html.dark-theme body .elections-page .elections-tabs .nav-link.active,
html.dark-theme body .deputies-page .nav-pills .nav-link.active,
html.dark-theme body .deputy-cabinet-page .nav-pills .nav-link.active,
html.dark-theme body .governor-cabinet-page .nav-pills .nav-link.active,
html.dark-theme body .admin-parties-page .nav-pills .nav-link.active {
  color: #fff !important;
  background: #1769a8 !important;
}

html.dark-theme body .deputies-page .parliament-card,
html.dark-theme body .deputies-page .parliament-card-header,
html.dark-theme body .deputies-page .party-parliament-group,
html.dark-theme body .deputies-page .party-name,
html.dark-theme body .deputies-page .party-title {
  color: #f1f7ff !important;
  background: #0b2a54 !important;
  border-color: #5b83ab !important;
}

html.dark-theme body .profile-page .badge,
html.dark-theme body .admin-page .badge,
html.dark-theme body .admin-parties-page .badge,
html.dark-theme body .party-cabinet-page .badge,
html.dark-theme body .deputy-cabinet-page .badge,
html.dark-theme body .governor-cabinet-page .badge,
html.dark-theme body .psf-cabinet-page .badge {
  color: #eff7ff !important;
  border: 1px solid rgba(255, 255, 255, .25) !important;
  opacity: 1 !important;
  filter: none !important;
}

html.dark-theme body .profile-page .badge.bg-light,
html.dark-theme body .profile-page .badge.bg-secondary,
html.dark-theme body .admin-page .badge.bg-light,
html.dark-theme body .admin-page .badge.bg-secondary,
html.dark-theme body .admin-parties-page .badge.bg-light,
html.dark-theme body .admin-parties-page .badge.bg-secondary,
html.dark-theme body .party-cabinet-page .badge.bg-secondary,
html.dark-theme body .deputy-cabinet-page .badge.bg-secondary,
html.dark-theme body .governor-cabinet-page .badge.bg-secondary,
html.dark-theme body .psf-cabinet-page .badge.bg-secondary {
  color: #e7f1ff !important;
  background: #3c526e !important;
}

html.dark-theme body .profile-page .badge.bg-info,
html.dark-theme body .admin-page .badge.bg-info,
html.dark-theme body .admin-parties-page .badge.bg-info,
html.dark-theme body .party-cabinet-page .badge.bg-info,
html.dark-theme body .deputy-cabinet-page .badge.bg-info,
html.dark-theme body .governor-cabinet-page .badge.bg-info,
html.dark-theme body .psf-cabinet-page .badge.bg-info {
  color: #eaf7ff !important;
  background: #176898 !important;
}

/* ==========================================================
   ФИНАЛЬНЫЙ КОНТРАСТНЫЙ СЛОЙ ДЛЯ ТЕМНОЙ ТЕМЫ
   ========================================================== */
html.dark-theme body [class*="-page"] .btn:not(.btn-close),
html.dark-theme body .btn:not(.btn-close) {
  color: #edf6ff !important;
  border-width: 1px !important;
  text-shadow: none !important;
}

html.dark-theme body [class*="-page"] .btn-light,
html.dark-theme body [class*="-page"] .btn-white,
html.dark-theme body [class*="-page"] .btn-outline-light,
html.dark-theme body [class*="-page"] .btn-outline-secondary,
html.dark-theme body [class*="-page"] .btn-outline-dark,
html.dark-theme body [class*="-page"] .btn-outline-primary,
html.dark-theme body [class*="-page"] .btn-outline-info {
  color: #eaf4ff !important;
  background: #17375f !important;
  border-color: #6593c4 !important;
}

html.dark-theme body [class*="-page"] .btn-light:hover,
html.dark-theme body [class*="-page"] .btn-white:hover,
html.dark-theme body [class*="-page"] .btn-outline-light:hover,
html.dark-theme body [class*="-page"] .btn-outline-secondary:hover,
html.dark-theme body [class*="-page"] .btn-outline-dark:hover,
html.dark-theme body [class*="-page"] .btn-outline-primary:hover,
html.dark-theme body [class*="-page"] .btn-outline-info:hover,
html.dark-theme body [class*="-page"] .btn-light:focus,
html.dark-theme body [class*="-page"] .btn-outline-secondary:focus,
html.dark-theme body [class*="-page"] .btn-outline-dark:focus {
  color: #fff !important;
  background: #245488 !important;
  border-color: #8fc5f7 !important;
}

html.dark-theme body [class*="-page"] .btn-secondary,
html.dark-theme body [class*="-page"] .btn-dark {
  color: #f0f6ff !important;
  background: #3c526e !important;
  border-color: #718ba8 !important;
}

html.dark-theme body [class*="-page"] .btn-primary {
  color: #fff !important;
  background: #1769aa !important;
  border-color: #4d9bd2 !important;
}

html.dark-theme body [class*="-page"] .btn-success {
  color: #f1fff8 !important;
  background: #187b5a !important;
  border-color: #56b997 !important;
}

html.dark-theme body [class*="-page"] .btn-danger {
  color: #fff1f3 !important;
  background: #9b3044 !important;
  border-color: #d87583 !important;
}

html.dark-theme body [class*="-page"] .btn-warning {
  color: #fff8df !important;
  background: #936c18 !important;
  border-color: #d5b55f !important;
}

html.dark-theme body [class*="-page"] .btn-info {
  color: #effbff !important;
  background: #176b8d !important;
  border-color: #61b4d3 !important;
}

/* Активные заседания: сервер, карточка и кнопка перехода в зал. */
html.dark-theme body .meetings-page .server-badge,
html.dark-theme body .meetings-page #billsContainer .badge,
html.dark-theme body .meetings-page .meeting-list-item .badge {
  color: #eaf7ff !important;
  background: #176898 !important;
  border: 1px solid rgba(255, 255, 255, .24) !important;
  opacity: 1 !important;
  filter: none !important;
}

html.dark-theme body .meetings-page .meeting-room-btn,
html.dark-theme body .meetings-page a.meeting-room-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #f2f8ff !important;
  background: #1769a8 !important;
  border: 1px solid #65a9dd !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .22) !important;
}

html.dark-theme body .meetings-page .meeting-room-btn:hover,
html.dark-theme body .meetings-page a.meeting-room-btn:hover {
  color: #fff !important;
  background: #2a82c7 !important;
  border-color: #a8d9ff !important;
}

/* Зал заседания: раскрытие, возврат к списку и управляющие кнопки. */
html.dark-theme body .meeting-room-page .toggle-detail-btn,
html.dark-theme body .meeting-room-page .btn-outline-secondary,
html.dark-theme body .meeting-room-page .btn-outline-dark,
html.dark-theme body .meeting-room-page .btn-outline-primary,
html.dark-theme body .meeting-room-page .btn-outline-warning,
html.dark-theme body .meeting-room-page .btn-outline-danger,
html.dark-theme body .meeting-room-page a[href="/meetings"] {
  color: #eaf4ff !important;
  background: #17375f !important;
  border-color: #6593c4 !important;
}

html.dark-theme body .meeting-room-page .toggle-detail-btn:hover,
html.dark-theme body .meeting-room-page .btn-outline-secondary:hover,
html.dark-theme body .meeting-room-page a[href="/meetings"]:hover {
  color: #fff !important;
  background: #245488 !important;
  border-color: #8fc5f7 !important;
}

html.dark-theme body .meeting-room-page .card.bg-light,
html.dark-theme body .meeting-room-page .card.bg-white,
html.dark-theme body .meeting-room-page .card-body.bg-light,
html.dark-theme body .meeting-room-page .card-body.bg-white,
html.dark-theme body .meeting-room-page .meeting-agenda-journal .collapse .card,
html.dark-theme body .meeting-room-page .meeting-agenda-journal .collapse .card-body {
  color: #e8f3ff !important;
  background: #0b2a54 !important;
  border-color: #5b83ab !important;
}

html.dark-theme body .meeting-room-page .card.bg-light *:not([style*="color"]):not([color]),
html.dark-theme body .meeting-room-page .card.bg-white *:not([style*="color"]):not([color]),
html.dark-theme body .meeting-room-page .card-body.bg-light *:not([style*="color"]):not([color]),
html.dark-theme body .meeting-room-page .card-body.bg-white *:not([style*="color"]):not([color]),
html.dark-theme body .meeting-room-page .meeting-agenda-journal .collapse .card *:not([style*="color"]):not([color]) {
  color: #e8f3ff !important;
}

html.dark-theme body .meeting-room-page .text-dark,
html.dark-theme body .meeting-room-page .text-body,
html.dark-theme body .meeting-room-page .text-secondary,
html.dark-theme body .meeting-room-page .text-muted,
html.dark-theme body .meeting-room-page .meeting-agenda-journal .badge,
html.dark-theme body .meeting-room-page .meeting-agenda-journal .server-badge,
html.dark-theme body .meeting-room-page .meeting-agenda-journal .type-badge,
html.dark-theme body .meeting-room-page .meeting-agenda-journal .status-badge {
  color: #dbeafe !important;
}

html.dark-theme body .meeting-room-page .meeting-agenda-journal .badge.bg-secondary,
html.dark-theme body .meeting-room-page .meeting-agenda-journal .badge.bg-light,
html.dark-theme body .meeting-room-page .meeting-agenda-journal .badge.bg-info {
  color: #eaf7ff !important;
  background: #315f87 !important;
  border: 1px solid #75a4c9 !important;
}

html.dark-theme body .meeting-room-page .meeting-agenda-journal table,
html.dark-theme body .meeting-room-page .meeting-agenda-journal table td,
html.dark-theme body .meeting-room-page .meeting-agenda-journal table th {
  color: #e8f3ff !important;
  background: #092243 !important;
  border-color: #5b83ab !important;
}

/* Неактивные поля выбора и вкладки серверов. */
html.dark-theme body .elections-page .elections-tabs,
html.dark-theme body .elections-page .election-item-button,
html.dark-theme body .deputies-page .nav-pills,
html.dark-theme body .deputy-cabinet-page .nav-pills,
html.dark-theme body .governor-cabinet-page .nav-pills,
html.dark-theme body .admin-parties-page .nav-pills,
html.dark-theme body .elections-page .form-select,
html.dark-theme body .deputies-page .form-select,
html.dark-theme body .deputy-cabinet-page .form-select,
html.dark-theme body .governor-cabinet-page .form-select,
html.dark-theme body .admin-parties-page .form-select {
  color: #e8f3ff !important;
  background-color: #0b2a54 !important;
  border-color: #5b83ab !important;
}

html.dark-theme body .elections-page .elections-tabs .nav-link,
html.dark-theme body .deputies-page .nav-pills .nav-link,
html.dark-theme body .deputy-cabinet-page .nav-pills .nav-link,
html.dark-theme body .governor-cabinet-page .nav-pills .nav-link,
html.dark-theme body .admin-parties-page .nav-pills .nav-link {
  color: #dbeafe !important;
  background: #17375f !important;
}

html.dark-theme body .elections-page .elections-tabs .nav-link.active,
html.dark-theme body .deputies-page .nav-pills .nav-link.active,
html.dark-theme body .deputy-cabinet-page .nav-pills .nav-link.active,
html.dark-theme body .governor-cabinet-page .nav-pills .nav-link.active,
html.dark-theme body .admin-parties-page .nav-pills .nav-link.active {
  color: #fff !important;
  background: #1769a8 !important;
}

/* Заголовки партий в парламентском блоке. */
html.dark-theme body .deputies-page .parliament-card,
html.dark-theme body .deputies-page .parliament-card-header,
html.dark-theme body .deputies-page .party-parliament-group,
html.dark-theme body .deputies-page .party-name,
html.dark-theme body .deputies-page .party-title {
  color: #f1f7ff !important;
  background: #0b2a54 !important;
  border-color: #5b83ab !important;
}

/* Роли, серверы и действия в профиле, админке и кабинетах. */
html.dark-theme body .profile-page .badge,
html.dark-theme body .admin-page .badge,
html.dark-theme body .admin-parties-page .badge,
html.dark-theme body .party-cabinet-page .badge,
html.dark-theme body .deputy-cabinet-page .badge,
html.dark-theme body .governor-cabinet-page .badge,
html.dark-theme body .psf-cabinet-page .badge {
  color: #eff7ff !important;
  border: 1px solid rgba(255, 255, 255, .25) !important;
  opacity: 1 !important;
  filter: none !important;
}

html.dark-theme body .profile-page .badge.bg-light,
html.dark-theme body .profile-page .badge.bg-secondary,
html.dark-theme body .admin-page .badge.bg-light,
html.dark-theme body .admin-page .badge.bg-secondary,
html.dark-theme body .admin-parties-page .badge.bg-light,
html.dark-theme body .admin-parties-page .badge.bg-secondary,
html.dark-theme body .party-cabinet-page .badge.bg-secondary,
html.dark-theme body .deputy-cabinet-page .badge.bg-secondary,
html.dark-theme body .governor-cabinet-page .badge.bg-secondary,
html.dark-theme body .psf-cabinet-page .badge.bg-secondary {
  color: #e7f1ff !important;
  background: #3c526e !important;
}

html.dark-theme body .profile-page .badge.bg-info,
html.dark-theme body .admin-page .badge.bg-info,
html.dark-theme body .admin-parties-page .badge.bg-info,
html.dark-theme body .party-cabinet-page .badge.bg-info,
html.dark-theme body .deputy-cabinet-page .badge.bg-info,
html.dark-theme body .governor-cabinet-page .badge.bg-info,
html.dark-theme body .psf-cabinet-page .badge.bg-info {
  color: #eaf7ff !important;
  background: #176898 !important;
}

html.dark-theme body .admin-page .btn,
html.dark-theme body .admin-parties-page .btn,
html.dark-theme body .party-cabinet-page .btn,
html.dark-theme body .deputy-cabinet-page .btn,
html.dark-theme body .governor-cabinet-page .btn,
html.dark-theme body .psf-cabinet-page .btn {
  box-shadow: 0 2px 7px rgba(0, 0, 0, .18) !important;
}

html.dark-theme body .governor-cabinet-page .collapse .bg-white,
html.dark-theme body .governor-cabinet-page .collapse .bg-light,
html.dark-theme body .governor-cabinet-page .bill-content-text,
html.dark-theme body .governor-cabinet-page .text-secondary.small,
html.dark-theme body .governor-cabinet-page .card-body {
  color: #e8f3ff !important;
}

html.dark-theme body .governor-cabinet-page .collapse .bg-white,
html.dark-theme body .governor-cabinet-page .collapse .bg-light {
  background: #0b2a54 !important;
  border-color: #5b83ab !important;
}

html.dark-theme body .governor-cabinet-page .collapse .bg-white *,
html.dark-theme body .governor-cabinet-page .collapse .bg-light * {
  color: #e8f3ff !important;
}

html.dark-theme body .psf-cabinet-page .badge.bg-warning,
html.dark-theme body .psf-cabinet-page .badge.bg-success,
html.dark-theme body .psf-cabinet-page .badge.bg-danger,
html.dark-theme body .psf-cabinet-page .badge.bg-info {
  color: #f4f8ff !important;
}

html.dark-theme body .psf-cabinet-page .badge.bg-warning {
  background: #936c18 !important;
}

html.dark-theme body .psf-cabinet-page .badge.bg-success {
  background: #187b5a !important;
}

html.dark-theme body .psf-cabinet-page .badge.bg-danger {
  background: #9b3044 !important;
}

/* Финальная читаемость плашек законопроектов. */
html.dark-theme body .initiatives-card .badge,
html.dark-theme body .initiatives-card .server-badge,
html.dark-theme body .initiatives-card .type-badge,
html.dark-theme body .initiatives-card .status-badge {
  filter: none !important;
  opacity: 1 !important;
  color: #f3f8ff !important;
  text-shadow: none !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22) !important;
}

html.dark-theme body .initiatives-card .server-badge,
html.dark-theme body .initiatives-card .status-primary,
html.dark-theme body .initiatives-card .status-info {
  background: #176898 !important;
}

html.dark-theme body .initiatives-card .type-amendment,
html.dark-theme body .initiatives-card .status-secondary {
  background: #536b83 !important;
}

html.dark-theme body .initiatives-card .type-new {
  background: #315f9a !important;
}

html.dark-theme body .initiatives-card .type-resolution,
html.dark-theme body .initiatives-card .status-success {
  background: #187b5a !important;
}

html.dark-theme body .initiatives-card .type-extension,
html.dark-theme body .initiatives-card .status-warning {
  background: #5c4aa2 !important;
}

html.dark-theme body .initiatives-card .status-danger {
  background: #9b2f42 !important;
}

html.dark-theme body .bills-page .bills-filters {
  background: rgba(7, 31, 67, .82) !important;
  border-color: rgba(112, 169, 232, .34) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18) !important;
}

html.dark-theme body .bills-page .bills-filters .form-control,
html.dark-theme body .bills-page .bills-filters .form-select {
  color: #f3f8ff !important;
  background: rgba(3, 18, 43, .88) !important;
  border-color: rgba(112, 169, 232, .45) !important;
}

html.dark-theme body .bills-page .bills-filters .filter-btn {
  color: #eaf4ff !important;
  background: rgba(15, 48, 91, .84) !important;
  border-color: rgba(112, 169, 232, .42) !important;
}

html.dark-theme body .bills-page .bills-filters .filter-btn.active,
html.dark-theme body .bills-page .bills-filters .filter-btn:hover {
  color: #fff !important;
  background: #176898 !important;
  border-color: #6fa9e8 !important;
}

html.dark-theme body .bills-page .action-btn {
  color: #eaf4ff !important;
  background: rgba(15, 48, 91, .9) !important;
  border-color: rgba(112, 169, 232, .5) !important;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .18) !important;
}

html.dark-theme body .bills-page .action-btn-view {
  color: #bfe3ff !important;
}

html.dark-theme body .bills-page .action-btn-edit {
  color: #e1d9ff !important;
}

html.dark-theme body .bills-page .action-btn-delete {
  color: #ffd1d7 !important;
}

html.dark-theme body .bills-page .action-btn-withdraw {
  color: #ffe7ae !important;
  background: rgba(126, 83, 0, .78) !important;
  border-color: #d7a83d !important;
}

html.dark-theme body .bills-page .action-btn-view:hover,
html.dark-theme body .bills-page .action-btn-edit:hover,
html.dark-theme body .bills-page .action-btn-delete:hover,
html.dark-theme body .bills-page .action-btn-withdraw:hover {
  color: #fff !important;
}

html.dark-theme body .parties-registry-page .party-card-header .bg-light,
html.dark-theme body .parties-registry-page .party-card-header .bg-info {
  color: #eaf7ff !important;
  background: #176898 !important;
  border: 1px solid rgba(255, 255, 255, .18) !important;
}

html.dark-theme body .parties-registry-page .party-card-header > div:last-child .badge {
  color: #eaf4ff !important;
  background: rgba(3, 18, 43, .62) !important;
  border: 1px solid rgba(112, 169, 232, .35) !important;
}

/* Плашки bills и parties в едином стиле с index. */
html.dark-theme body .bills-page .server-badge,
html.dark-theme body .bills-page .status-badge,
html.dark-theme body .bills-page .type-badge,
html.dark-theme body .parties-registry-page .party-card-header .badge {
  filter: none !important;
  opacity: 1 !important;
  text-shadow: none !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2) !important;
}

html.dark-theme body .bills-page .server-badge {
  color: #eaf7ff !important;
  background: #176898 !important;
}

html.dark-theme body .bills-page .type-amendment,
html.dark-theme body .bills-page .status-secondary {
  color: #f4f8ff !important;
  background: #536b83 !important;
}

html.dark-theme body .bills-page .type-new {
  color: #eaf3ff !important;
  background: #315f9a !important;
}

html.dark-theme body .bills-page .type-resolution,
html.dark-theme body .bills-page .status-success {
  color: #edfff6 !important;
  background: #187b5a !important;
}

html.dark-theme body .bills-page .type-extension,
html.dark-theme body .bills-page .status-warning {
  color: #f7f2ff !important;
  background: #5c4aa2 !important;
}

html.dark-theme body .bills-page .status-primary,
html.dark-theme body .bills-page .status-info {
  color: #eaf7ff !important;
  background: #176898 !important;
}

html.dark-theme body .bills-page .status-danger {
  color: #fff0f2 !important;
  background: #9b2f42 !important;
}

html.dark-theme body .parties-registry-page .party-card-header .bg-success {
  color: #edfff6 !important;
  background: #187b5a !important;
}

html.dark-theme body .parties-registry-page .party-card-header .bg-danger {
  color: #fff0f2 !important;
  background: #9b2f42 !important;
}

html.dark-theme body .parties-registry-page .party-card-header .bg-secondary {
  color: #f1f5fa !important;
  background: #536b83 !important;
}

html.dark-theme body .meetings-page .meeting-schedule-card,
html.dark-theme body .meetings-page .meeting-schedule-card .card-body,
html.dark-theme body .meetings-page #billsContainer,
html.dark-theme body .meetings-page .bill-checkbox-item,
html.dark-theme body .meetings-page .meetings-filters,
html.dark-theme body .meetings-page .meetings-list-card,
html.dark-theme body .meetings-page .meetings-list-card .card-body {
  color: #e5f1ff !important;
  background: rgba(7, 31, 67, .78) !important;
  border-color: rgba(112, 169, 232, .3) !important;
}

html.dark-theme body .meetings-page #billsContainer .bill-checkbox-item label {
  color: #dbeafe !important;
}

html.dark-theme body .meetings-page .meeting-filter-buttons,
html.dark-theme body .archive-page .archive-toolbar {
  background: rgba(7, 31, 67, .78) !important;
  border-color: rgba(112, 169, 232, .34) !important;
}

html.dark-theme body .meetings-page .meeting-filter-buttons .filter-btn,
html.dark-theme body .archive-page .archive-toolbar .filter-btn {
  color: #eaf4ff !important;
  background: rgba(15, 48, 91, .84) !important;
  border-color: rgba(112, 169, 232, .42) !important;
}

html.dark-theme body .meetings-page .meeting-filter-buttons .filter-btn.active,
html.dark-theme body .meetings-page .meeting-filter-buttons .filter-btn:hover,
html.dark-theme body .archive-page .archive-toolbar .filter-btn.active,
html.dark-theme body .archive-page .archive-toolbar .filter-btn:hover {
  color: #fff !important;
  background: #176898 !important;
  border-color: #6fa9e8 !important;
}

html.dark-theme body .archive-page .archive-toolbar .form-control {
  color: #f3f8ff !important;
  background: rgba(3, 18, 43, .88) !important;
  border-color: rgba(112, 169, 232, .45) !important;
}

html.dark-theme body .archive-page .archive-card,
html.dark-theme body .archive-page .archive-card-body {
  color: #dbeafe !important;
  background: rgba(7, 31, 67, .78) !important;
  border-color: rgba(112, 169, 232, .3) !important;
}

html.dark-theme body .archive-page .archive-card-header {
  color: #f3f8ff !important;
  background: rgba(15, 48, 91, .88) !important;
  border-color: rgba(112, 169, 232, .32) !important;
}

html.dark-theme body .archive-page .server-badge,
html.dark-theme body .archive-page .archive-card-header .badge.bg-info,
html.dark-theme body .archive-page .archive-complete-badge {
  color: #eaf7ff !important;
  background: #176898 !important;
  border: 1px solid rgba(255, 255, 255, .2) !important;
  filter: none !important;
}

html.dark-theme body .archive-page .archive-card .btn-outline-danger {
  color: #ffd1d7 !important;
  background: rgba(126, 36, 55, .68) !important;
  border-color: #c85a6b !important;
}

html.dark-theme body .archive-page .archive-card .toggle-protocol-btn,
html.dark-theme body .archive-page .archive-back-btn {
  color: #eaf4ff !important;
  background: rgba(15, 48, 91, .82) !important;
  border-color: rgba(112, 169, 232, .5) !important;
}

html.dark-theme body .meeting-room-page .server-badge,
html.dark-theme body .meeting-room-page .meeting-status-badge,
html.dark-theme body .meeting-room-page .card-header .badge {
  color: #eaf7ff !important;
  background: #176898 !important;
  border: 1px solid rgba(255, 255, 255, .2) !important;
  filter: none !important;
}

html.dark-theme body .meeting-room-page .meeting-status-badge.bg-success {
  color: #edfff6 !important;
  background: #187b5a !important;
}

html.dark-theme body .meeting-room-page .meeting-status-badge.bg-warning,
html.dark-theme body .meeting-room-page .meeting-status-badge.bg-secondary {
  color: #f4f8ff !important;
  background: #536b83 !important;
}

html.dark-theme body .meeting-room-page .meeting-status-badge.bg-danger {
  color: #fff0f2 !important;
  background: #9b2f42 !important;
}

html.dark-theme body .meeting-room-page .p-2.bg-light.border.rounded,
html.dark-theme body .meeting-room-page .p-2.bg-light.border.rounded.small,
html.dark-theme body .meeting-room-page .meeting-voters-table-wrap {
  color: #dbeafe !important;
  background: rgba(7, 31, 67, .82) !important;
  border-color: rgba(112, 169, 232, .38) !important;
}

html.dark-theme body .meeting-room-page .p-2.bg-light.border.rounded strong:not([style*="color"]):not([color]),
html.dark-theme body .meeting-room-page .p-2.bg-light.border.rounded h6:not([style*="color"]):not([color]),
html.dark-theme body .meeting-room-page .p-2.bg-light.border.rounded span:not([style*="color"]):not([color]),
html.dark-theme body .meeting-room-page .meeting-voters-table-wrap strong {
  color: #dbeafe !important;
}

html.dark-theme body .meeting-room-page .p-2.bg-light.border.rounded .text-secondary,
html.dark-theme body .meeting-room-page .p-2.bg-light.border.rounded .text-muted {
  color: #b8c7da !important;
}

html.dark-theme body .meeting-room-page .p-2.bg-light.border.rounded table,
html.dark-theme body .meeting-room-page .p-2.bg-light.border.rounded table td,
html.dark-theme body .meeting-room-page .p-2.bg-light.border.rounded table th {
  color: #e5f1ff !important;
  background: rgba(3, 18, 43, .55) !important;
  border-color: rgba(112, 169, 232, .38) !important;
}

html.dark-theme body .meeting-room-page #regCount,
html.dark-theme body .meeting-room-page #totalDepCount,
html.dark-theme body .meeting-room-page .card-body p strong {
  color: #f3f8ff !important;
}

html.dark-theme body .meeting-room-page .meeting-agenda-journal .collapse .card-body p,
html.dark-theme body .meeting-room-page .meeting-agenda-journal .collapse .card-body p span:not([style*="color"]):not([color]) {
  color: #dbeafe !important;
}

html.dark-theme body .meeting-room-page .meeting-agenda-journal .collapse .card-body p strong:not([style*="color"]):not([color]) {
  color: #f3f8ff !important;
}

/* Единый контраст текста во всей темной теме. */
html.dark-theme body,
html.dark-theme body [class*="-page"],
html.dark-theme body [class*="-page"] h1,
html.dark-theme body [class*="-page"] h2,
html.dark-theme body [class*="-page"] h3,
html.dark-theme body [class*="-page"] h4,
html.dark-theme body [class*="-page"] h5,
html.dark-theme body [class*="-page"] h6,
html.dark-theme body [class*="-page"] p,
html.dark-theme body [class*="-page"] li,
html.dark-theme body [class*="-page"] label,
html.dark-theme body [class*="-page"] small,
html.dark-theme body [class*="-page"] dt,
html.dark-theme body [class*="-page"] dd,
html.dark-theme body [class*="-page"] td,
html.dark-theme body [class*="-page"] th,
html.dark-theme body [class*="-page"] .form-text,
html.dark-theme body .bug-report-page h1,
html.dark-theme body .bug-report-page p,
html.dark-theme body .bug-report-page label {
  color: #e5f1ff !important;
}

html.dark-theme body [class*="-page"] .text-muted,
html.dark-theme body [class*="-page"] .text-secondary,
html.dark-theme body [class*="-page"] .text-body,
html.dark-theme body [class*="-page"] .text-dark,
html.dark-theme body [class*="-page"] .form-text,
html.dark-theme body .bug-report-page .text-muted,
html.dark-theme body .bug-report-page .form-text {
  color: #b8cbe0 !important;
}

html.dark-theme body [class*="-page"] a:not(.badge):not(.btn),
html.dark-theme body .bug-report-page a:not(.badge):not(.btn) {
  color: #8ecbff !important;
}

/* Цветные элементы интерфейса сохраняют свои смысловые цвета. */
html.dark-theme body [class*="-page"] .btn,
html.dark-theme body [class*="-page"] .feature-icon,
html.dark-theme body .site-navbar .nav-link,
html.dark-theme body .theme-toggle-btn {
  color: inherit !important;
}

html.dark-theme body [class*="-page"] .badge,
html.dark-theme body [class*="-page"] .status-badge,
html.dark-theme body [class*="-page"] .type-badge,
html.dark-theme body [class*="-page"] .server-badge {
  text-shadow: none !important;
}

html.dark-theme body .home-hero h1,
html.dark-theme body .home-hero p,
html.dark-theme body .feature-title,
html.dark-theme body .feature-card small,
html.dark-theme body .stats-card,
html.dark-theme body .stat-row,
html.dark-theme body .stat-row strong,
html.dark-theme body .initiative-heading h2,
html.dark-theme body .initiative-heading p {
  color: #e5f1ff !important;
}

/* Общий финальный слой для перечисленных страниц. */
html.dark-theme [class*="-page"],
html.dark-theme .bug-report-page {
  color: #e5e7eb !important;
}

html.dark-theme [class*="-page"] h1,
html.dark-theme [class*="-page"] h2,
html.dark-theme [class*="-page"] h3,
html.dark-theme [class*="-page"] h4,
html.dark-theme [class*="-page"] h5,
html.dark-theme [class*="-page"] h6,
html.dark-theme .bug-report-page h1,
html.dark-theme .bug-report-page h2,
html.dark-theme .bug-report-page h3,
html.dark-theme .bug-report-page h4,
html.dark-theme .bug-report-page h5,
html.dark-theme .bug-report-page h6 {
  color: #f3f4f6 !important;
}

html.dark-theme [class*="-page"] p,
html.dark-theme [class*="-page"] li,
html.dark-theme [class*="-page"] label,
html.dark-theme [class*="-page"] dt,
html.dark-theme [class*="-page"] dd,
html.dark-theme .bug-report-page p,
html.dark-theme .bug-report-page label {
  color: #c3cfde !important;
}

html.dark-theme [class*="-page"] .card,
html.dark-theme [class*="-page"] .card-body,
html.dark-theme [class*="-page"] .bg-white,
html.dark-theme [class*="-page"] .bg-light,
html.dark-theme [class*="-page"] .protocol-panel,
html.dark-theme [class*="-page"] .bill-record,
html.dark-theme .bug-report-page .card,
html.dark-theme .bug-report-page .card-body {
  color: #e5e7eb !important;
  background: rgba(7, 31, 67, .78) !important;
  border-color: rgba(112, 169, 232, .28) !important;
}

html.dark-theme [class*="-page"] .card-header:not(.bg-primary):not(.bg-success):not(.bg-danger):not(.bg-warning):not(.bg-info):not(.bg-dark),
html.dark-theme [class*="-page"] .archive-card-header,
html.dark-theme [class*="-page"] .parliament-card-header,
html.dark-theme [class*="-page"] .deputies-card-header {
  color: #f3f4f6 !important;
  background: rgba(15, 48, 91, .88) !important;
  border-color: rgba(112, 169, 232, .32) !important;
}

html.dark-theme [class*="-page"] .table,
html.dark-theme [class*="-page"] .table > :not(caption) > * > *,
html.dark-theme [class*="-page"] .table td,
html.dark-theme [class*="-page"] .table th,
html.dark-theme .bug-report-page .table,
html.dark-theme .bug-report-page .table td,
html.dark-theme .bug-report-page .table th {
  color: #e5e7eb !important;
  background-color: rgba(7, 31, 67, .62) !important;
  border-color: rgba(112, 169, 232, .28) !important;
}

html.dark-theme [class*="-page"] .table thead th,
html.dark-theme [class*="-page"] .table-light > * > *,
html.dark-theme [class*="-page"] .table-dark > * > * {
  color: #f3f4f6 !important;
  background-color: rgba(15, 48, 91, .88) !important;
  border-color: rgba(112, 169, 232, .32) !important;
}

html.dark-theme [class*="-page"] .form-control,
html.dark-theme [class*="-page"] .form-select,
html.dark-theme [class*="-page"] input,
html.dark-theme [class*="-page"] textarea,
html.dark-theme [class*="-page"] .rich-editor,
html.dark-theme .bug-report-page .form-control,
html.dark-theme .bug-report-page input,
html.dark-theme .bug-report-page textarea {
  color: #f3f4f6 !important;
  background-color: #111827 !important;
  border-color: #4b5563 !important;
}

html.dark-theme [class*="-page"] .form-control::placeholder,
html.dark-theme [class*="-page"] textarea::placeholder,
html.dark-theme .bug-report-page textarea::placeholder {
  color: #8fa1b8 !important;
}

html.dark-theme [class*="-page"] .filter-btn:not(.active),
html.dark-theme [class*="-page"] .btn-outline-dark {
  color: #dbe5f1 !important;
  background: rgba(15, 48, 91, .8) !important;
  border-color: rgba(112, 169, 232, .42) !important;
}

html.dark-theme [class*="-page"] .filter-btn:hover,
html.dark-theme [class*="-page"] .btn-outline-dark:hover {
  color: #fff !important;
  background: #2d4666 !important;
  border-color: #6f8bad !important;
}

html.dark-theme [class*="-page"] .text-dark,
html.dark-theme [class*="-page"] .text-body,
html.dark-theme [class*="-page"] .text-secondary,
html.dark-theme [class*="-page"] .text-muted,
html.dark-theme [class*="-page"] .form-text,
html.dark-theme .bug-report-page .text-muted,
html.dark-theme .bug-report-page .form-text {
  color: #b8c7da !important;
}

/* Элементы общего шаблона: навигация, профиль и уведомления. */
html.dark-theme .site-navbar .dropdown-menu,
html.dark-theme .site-navbar .account-menu,
html.dark-theme .site-navbar .dropdown-item,
html.dark-theme .site-navbar .dropdown-header {
  color: #e5e7eb !important;
  background-color: #1f2937 !important;
}

html.dark-theme .site-navbar .dropdown-item:hover,
html.dark-theme .site-navbar .dropdown-item:focus,
html.dark-theme .site-navbar .dropdown-item.bg-light {
  color: #fff !important;
  background-color: #2d4666 !important;
}

html.dark-theme .site-navbar .dropdown-divider {
  border-color: #40516a !important;
}

html.dark-theme .site-navbar .dropdown-menu small,
html.dark-theme .site-navbar .dropdown-menu .text-muted {
  color: #aebbd0 !important;
}

html.dark-theme .site-navbar .navbar-toggler {
  border-color: rgba(255, 255, 255, .35) !important;
}

html.dark-theme .modal-content,
html.dark-theme .modal-content .modal-body,
html.dark-theme .modal-content .modal-footer {
  color: #e5e7eb !important;
  background-color: #1f2937 !important;
  border-color: #374151 !important;
}

html.dark-theme .modal-content .bg-light,
html.dark-theme .modal-content .bg-white {
  color: #e5e7eb !important;
  background-color: #273449 !important;
}

html.dark-theme .bg-warning.text-dark,
html.dark-theme .bg-warning.text-dark h1,
html.dark-theme .bg-warning.text-dark h2,
html.dark-theme .bg-warning.text-dark h3,
html.dark-theme .bg-warning.text-dark h4,
html.dark-theme .bg-warning.text-dark h5,
html.dark-theme .bg-warning.text-dark h6,
html.dark-theme .bg-warning.text-dark p {
  color: #111827 !important;
}

/* Общий финальный слой для всех внутренних страниц в темной теме. */
html.dark-theme [class*="-page"],
html.dark-theme .bug-report-page {
  color: #e5e7eb !important;
}

html.dark-theme [class*="-page"] h1,
html.dark-theme [class*="-page"] h2,
html.dark-theme [class*="-page"] h3,
html.dark-theme [class*="-page"] h4,
html.dark-theme [class*="-page"] h5,
html.dark-theme [class*="-page"] h6,
html.dark-theme .bug-report-page h1,
html.dark-theme .bug-report-page h2,
html.dark-theme .bug-report-page h3,
html.dark-theme .bug-report-page h4,
html.dark-theme .bug-report-page h5,
html.dark-theme .bug-report-page h6 {
  color: #f3f4f6 !important;
}

html.dark-theme [class*="-page"] p,
html.dark-theme [class*="-page"] li,
html.dark-theme [class*="-page"] label,
html.dark-theme [class*="-page"] dt,
html.dark-theme [class*="-page"] dd,
html.dark-theme .bug-report-page p,
html.dark-theme .bug-report-page label {
  color: #c3cfde !important;
}

html.dark-theme [class*="-page"] .card,
html.dark-theme [class*="-page"] .card-body,
html.dark-theme [class*="-page"] .card.card-body,
html.dark-theme [class*="-page"] .bg-white,
html.dark-theme [class*="-page"] .bg-light,
html.dark-theme [class*="-page"] .protocol-panel,
html.dark-theme [class*="-page"] .bill-record,
html.dark-theme .bug-report-page .card,
html.dark-theme .bug-report-page .card-body {
  color: #e5e7eb !important;
  background: #1f2937 !important;
  border-color: #374151 !important;
}

html.dark-theme [class*="-page"] .card-header:not(.bg-primary):not(.bg-success):not(.bg-danger):not(.bg-warning):not(.bg-info):not(.bg-dark),
html.dark-theme [class*="-page"] .archive-card-header,
html.dark-theme [class*="-page"] .parliament-card-header,
html.dark-theme [class*="-page"] .deputies-card-header {
  color: #f3f4f6 !important;
  background: #273449 !important;
  border-color: #374151 !important;
}

html.dark-theme [class*="-page"] .table,
html.dark-theme [class*="-page"] .table > :not(caption) > * > *,
html.dark-theme [class*="-page"] .table tbody,
html.dark-theme [class*="-page"] .table td,
html.dark-theme [class*="-page"] .table th,
html.dark-theme .bug-report-page .table,
html.dark-theme .bug-report-page .table td,
html.dark-theme .bug-report-page .table th {
  color: #e5e7eb !important;
  background-color: #1f2937 !important;
  border-color: #40516a !important;
}

html.dark-theme [class*="-page"] .table thead th,
html.dark-theme [class*="-page"] .table-light > * > *,
html.dark-theme [class*="-page"] .table-dark > * > * {
  color: #f3f4f6 !important;
  background-color: #273449 !important;
  border-color: #40516a !important;
}

html.dark-theme [class*="-page"] .form-control,
html.dark-theme [class*="-page"] .form-select,
html.dark-theme [class*="-page"] input,
html.dark-theme [class*="-page"] textarea,
html.dark-theme [class*="-page"] .rich-editor,
html.dark-theme .bug-report-page .form-control,
html.dark-theme .bug-report-page input,
html.dark-theme .bug-report-page textarea {
  color: #f3f4f6 !important;
  background-color: #111827 !important;
  border-color: #4b5563 !important;
}

html.dark-theme [class*="-page"] .form-control::placeholder,
html.dark-theme [class*="-page"] textarea::placeholder,
html.dark-theme .bug-report-page textarea::placeholder {
  color: #8fa1b8 !important;
}

html.dark-theme [class*="-page"] .filter-btn,
html.dark-theme [class*="-page"] .btn-group,
html.dark-theme [class*="-page"] .bills-filters,
html.dark-theme [class*="-page"] .archive-toolbar,
html.dark-theme [class*="-page"] .server-filter-group {
  border-color: #40516a !important;
}

html.dark-theme [class*="-page"] .filter-btn:not(.active),
html.dark-theme [class*="-page"] .btn-outline-dark {
  color: #dbe5f1 !important;
  background: #273449 !important;
  border-color: #52647d !important;
}

html.dark-theme [class*="-page"] .filter-btn:hover,
html.dark-theme [class*="-page"] .btn-outline-dark:hover {
  color: #fff !important;
  background: #2d4666 !important;
  border-color: #6f8bad !important;
}

html.dark-theme [class*="-page"] .text-dark,
html.dark-theme [class*="-page"] .text-body,
html.dark-theme [class*="-page"] .text-secondary,
html.dark-theme [class*="-page"] .text-muted,
html.dark-theme [class*="-page"] .form-text,
html.dark-theme .bug-report-page .text-muted,
html.dark-theme .bug-report-page .form-text {
  color: #b8c7da !important;
}

html.dark-theme .site-navbar .dropdown-menu,
html.dark-theme .site-navbar .account-menu,
html.dark-theme .site-navbar .dropdown-item,
html.dark-theme .site-navbar .dropdown-header {
  color: #e5e7eb !important;
  background-color: #1f2937 !important;
}

html.dark-theme .site-navbar .dropdown-item:hover,
html.dark-theme .site-navbar .dropdown-item:focus,
html.dark-theme .site-navbar .dropdown-item.bg-light {
  color: #fff !important;
  background-color: #2d4666 !important;
}

html.dark-theme .site-navbar .dropdown-divider {
  border-color: #40516a !important;
}

html.dark-theme .site-navbar .dropdown-menu small,
html.dark-theme .site-navbar .dropdown-menu .text-muted {
  color: #aebbd0 !important;
}

html.dark-theme .site-navbar .navbar-toggler {
  border-color: rgba(255, 255, 255, .35) !important;
}

html.dark-theme .modal-content,
html.dark-theme .modal-content .modal-body,
html.dark-theme .modal-content .modal-footer {
  color: #e5e7eb !important;
  background-color: #1f2937 !important;
  border-color: #374151 !important;
}

html.dark-theme .modal-content .bg-light,
html.dark-theme .modal-content .bg-white {
  color: #e5e7eb !important;
  background-color: #273449 !important;
}

html.dark-theme .bg-warning.text-dark,
html.dark-theme .bg-warning.text-dark h1,
html.dark-theme .bg-warning.text-dark h2,
html.dark-theme .bg-warning.text-dark h3,
html.dark-theme .bg-warning.text-dark h4,
html.dark-theme .bg-warning.text-dark h5,
html.dark-theme .bg-warning.text-dark h6,
html.dark-theme .bg-warning.text-dark p {
  color: #111827 !important;
}

/* Финальный слой темной темы для главной страницы и реестра партий. */
html.dark-theme .home-hero,
html.dark-theme .section-card,
html.dark-theme .stats-card,
html.dark-theme .initiatives-card,
html.dark-theme .feature-card,
html.dark-theme .party-tabs,
html.dark-theme .party-card,
html.dark-theme .party-card-body,
html.dark-theme .party-card-body .accordion,
html.dark-theme .party-card-body .accordion-item,
html.dark-theme .party-card-body .accordion-body {
  color: #e5e7eb !important;
  background: #1f2937 !important;
  border-color: #374151 !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .2) !important;
}

html.dark-theme .feature-card,
html.dark-theme .feature-card:hover {
  color: #e5e7eb !important;
  background: linear-gradient(145deg, #273449, #1f2937) !important;
}

html.dark-theme .hero-copy h1,
html.dark-theme .parties-registry-page h1,
html.dark-theme .parties-registry-page h2,
html.dark-theme .parties-registry-page h3,
html.dark-theme .parties-registry-page h4,
html.dark-theme .parties-registry-page h5,
html.dark-theme .parties-registry-page h6,
html.dark-theme .section-card h1,
html.dark-theme .section-card h2,
html.dark-theme .section-card h3,
html.dark-theme .section-card h4,
html.dark-theme .section-card h5,
html.dark-theme .section-card h6,
html.dark-theme .stats-card h1,
html.dark-theme .stats-card h2,
html.dark-theme .stats-card h3,
html.dark-theme .stats-card h4,
html.dark-theme .stats-card h5,
html.dark-theme .stats-card h6,
html.dark-theme .initiatives-card h1,
html.dark-theme .initiatives-card h2,
html.dark-theme .initiatives-card h3,
html.dark-theme .initiatives-card h4,
html.dark-theme .initiatives-card h5,
html.dark-theme .initiatives-card h6,
html.dark-theme .feature-card h1,
html.dark-theme .feature-card h2,
html.dark-theme .feature-card h3,
html.dark-theme .feature-card h4,
html.dark-theme .feature-card h5,
html.dark-theme .feature-card h6,
html.dark-theme .party-card-body p strong,
html.dark-theme .party-card-body h6,
html.dark-theme .party-card-body .accordion-button,
html.dark-theme .party-card-body .accordion-button strong {
  color: #f3f4f6 !important;
}

html.dark-theme .hero-copy p,
html.dark-theme .parties-heading p,
html.dark-theme .section-card p,
html.dark-theme .stats-card p,
html.dark-theme .initiatives-card p,
html.dark-theme .feature-card p,
html.dark-theme .party-card-body p,
html.dark-theme .party-card-body li,
html.dark-theme .party-card-body td,
html.dark-theme .party-card-body label,
html.dark-theme .party-card-body .text-secondary {
  color: #c3cfde !important;
}

html.dark-theme .party-tabs .nav-link {
  color: #c3cfde !important;
}

html.dark-theme .party-tabs .nav-link:hover {
  color: #fff !important;
  background: #2d4666 !important;
}

html.dark-theme .parties-registry-page .text-center.py-5 {
  color: #dbe5f1 !important;
  background: #273449 !important;
  border-color: #40516a !important;
}

html.dark-theme .party-members-table thead th {
  color: #f3f4f6 !important;
  background: #273449 !important;
  border-color: #40516a !important;
}

html.dark-theme .party-members-table tbody td {
  color: #e5e7eb !important;
  border-color: #40516a !important;
}

/* Дополнительные переопределения для страниц, у которых собственные светлые
   цвета имеют более высокую специфичность. */
html.dark-theme .home-hero,
html.dark-theme .section-card,
html.dark-theme .stats-card,
html.dark-theme .initiatives-card,
html.dark-theme .feature-card {
  color: #e5e7eb !important;
  background: #1f2937 !important;
  border-color: #374151 !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .2) !important;
}

html.dark-theme .feature-card,
html.dark-theme .feature-card:hover {
  color: #e5e7eb !important;
  background: linear-gradient(145deg, #273449, #1f2937) !important;
}

html.dark-theme .hero-copy h1,
html.dark-theme .section-card h1,
html.dark-theme .section-card h2,
html.dark-theme .section-card h3,
html.dark-theme .section-card h4,
html.dark-theme .section-card h5,
html.dark-theme .section-card h6,
html.dark-theme .stats-card h1,
html.dark-theme .stats-card h2,
html.dark-theme .stats-card h3,
html.dark-theme .stats-card h4,
html.dark-theme .stats-card h5,
html.dark-theme .stats-card h6,
html.dark-theme .initiatives-card h1,
html.dark-theme .initiatives-card h2,
html.dark-theme .initiatives-card h3,
html.dark-theme .initiatives-card h4,
html.dark-theme .initiatives-card h5,
html.dark-theme .initiatives-card h6,
html.dark-theme .feature-card h1,
html.dark-theme .feature-card h2,
html.dark-theme .feature-card h3,
html.dark-theme .feature-card h4,
html.dark-theme .feature-card h5,
html.dark-theme .feature-card h6 {
  color: #f3f4f6 !important;
}

html.dark-theme .hero-copy p,
html.dark-theme .section-card p,
html.dark-theme .stats-card p,
html.dark-theme .initiatives-card p,
html.dark-theme .feature-card p,
html.dark-theme .stats-card .text-muted,
html.dark-theme .initiatives-card .text-muted {
  color: #b8c7da !important;
}

html.dark-theme .stats-card .stat-label,
html.dark-theme .stats-card .stat-value,
html.dark-theme .stats-card li,
html.dark-theme .stats-card span,
html.dark-theme .initiatives-card th,
html.dark-theme .initiatives-card td {
  color: #e5e7eb !important;
}

html.dark-theme .parties-registry-page,
html.dark-theme .parties-registry-page h1,
html.dark-theme .parties-registry-page h2,
html.dark-theme .parties-registry-page h3,
html.dark-theme .parties-registry-page h4,
html.dark-theme .parties-registry-page h5,
html.dark-theme .parties-registry-page h6 {
  color: #e5e7eb !important;
}

html.dark-theme .parties-heading p,
html.dark-theme .party-card-body p,
html.dark-theme .party-card-body .text-secondary,
html.dark-theme .party-card-body li,
html.dark-theme .party-card-body td,
html.dark-theme .party-card-body label {
  color: #c3cfde !important;
}

html.dark-theme .party-card-body p strong,
html.dark-theme .party-card-body h6,
html.dark-theme .party-card-body th,
html.dark-theme .party-card-body .accordion-button,
html.dark-theme .party-card-body .accordion-button strong {
  color: #f3f4f6 !important;
}

html.dark-theme .party-tabs {
  background: #273449 !important;
  border-color: #40516a !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .2) !important;
}

html.dark-theme .party-tabs .nav-link {
  color: #c3cfde !important;
}

html.dark-theme .party-tabs .nav-link:hover {
  color: #fff !important;
  background: #2d4666 !important;
}

html.dark-theme .party-card,
html.dark-theme .party-card-body,
html.dark-theme .party-card-body .accordion,
html.dark-theme .party-card-body .accordion-item,
html.dark-theme .party-card-body .accordion-collapse,
html.dark-theme .party-card-body .accordion-body {
  background: #1f2937 !important;
  border-color: #374151 !important;
}

html.dark-theme .parties-registry-page .text-center.py-5 {
  color: #dbe5f1 !important;
  background: #273449 !important;
  border-color: #40516a !important;
}

html.dark-theme .party-members-table thead th {
  color: #f3f4f6 !important;
  background: #273449 !important;
  border-color: #40516a !important;
}

html.dark-theme .party-members-table tbody td {
  color: #e5e7eb !important;
  border-color: #40516a !important;
}

html.dark-theme .party-card-header .bg-light {
  color: #dbeafe !important;
  background: #31577f !important;
}

html.dark-theme .party-card-header .bg-info {
  color: #e0f2fe !important;
  background: #245d7d !important;
}

html.dark-theme .party-card-body .border-end {
  border-color: #40516a !important;
}

html.dark-theme .parliament-seat-empty,
html.dark-theme .meeting-vote-empty { background-color: #4b5563 !important; }

.profile-page .form-text,
.fed-cabinet-page .form-text,
.party-cabinet-page .form-text {
  color: #7b8da7 !important;
}

.frozen-party-page {
  min-height: 48vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.frozen-party-page > .row {
  width: 100%;
  margin-top: 2rem !important;
}

.frozen-party-page .frozen-party-card .card-body {
  padding: 42px 34px !important;
  background: linear-gradient(145deg, #fff, #fff8f9);
}

.frozen-party-page .btn-secondary {
  color: #fff;
  background: #536a83;
  border-color: #536a83;
}

@media (max-width: 767px) {
  .deputy-cabinet-page,
  .fed-cabinet-page,
  .my-party-page,
  .frozen-party-page,
  .profile-page,
  .party-cabinet-page {
    padding-top: 0;
  }

  .frozen-party-page .frozen-party-card .card-body {
    padding: 32px 20px !important;
  }
}

/* ==========================================================
   ЛИЧНЫЕ И ПАРТИЙНЫЕ КАБИНЕТЫ
   ========================================================== */
.deputy-cabinet-page,
.fed-cabinet-page,
.my-party-page,
.frozen-party-page,
.profile-page,
.party-cabinet-page {
  color: var(--ink);
}
.cabinet-page-header {
  padding: 4px 0 18px;
}
.cabinet-page-header h2 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}
.cabinet-page-header h2 span {
  color: #0878f9;
}
.cabinet-page-header h2 small {
  color: #71839b;
  font-size: 0.55em;
  font-weight: 600;
  letter-spacing: 0;
}
.cabinet-page-header p {
  margin: 0;
  color: #7b8da7;
  font-size: 0.96rem;
}
.deputy-cabinet-page .card,
.fed-cabinet-page .card,
.my-party-page .card,
.profile-page .card,
.party-cabinet-page .card {
  overflow: hidden;
  border-color: #d8e6f2 !important;
  border-radius: 9px;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.07) !important;
}
.deputy-cabinet-page .card-header,
.fed-cabinet-page .card-header,
.my-party-page .card-header,
.profile-page .card-header,
.party-cabinet-page .card-header {
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border: 0;
  font-size: 0.9rem;
  font-weight: 800;
}
.deputy-cabinet-page .card-body,
.fed-cabinet-page .card-body,
.my-party-page .card-body,
.profile-page .card-body,
.party-cabinet-page .card-body {
  background: #fff;
}
.deputy-cabinet-page .table,
.fed-cabinet-page .table,
.my-party-page .table,
.party-cabinet-page .table {
  color: #35516e;
  font-size: 0.84rem;
}
.deputy-cabinet-page .table th,
.fed-cabinet-page .table th,
.my-party-page .table th,
.party-cabinet-page .table th {
  padding: 10px 12px;
  color: #233b60;
  background: #edf4fb;
  border-color: #d6e3ee;
  font-size: 0.76rem;
}
.deputy-cabinet-page .table td,
.fed-cabinet-page .table td,
.my-party-page .table td,
.party-cabinet-page .table td {
  padding: 10px 12px;
  border-color: #dce7f0;
  vertical-align: middle;
}
.deputy-cabinet-page .table tbody tr:hover,
.fed-cabinet-page .table tbody tr:hover,
.my-party-page .table tbody tr:hover,
.party-cabinet-page .table tbody tr:hover {
  background: #f5faff;
}
.deputy-cabinet-page .form-label,
.fed-cabinet-page .form-label,
.my-party-page .form-label,
.profile-page .form-label,
.party-cabinet-page .form-label {
  margin-bottom: 7px;
  color: #28486c;
  font-size: 0.84rem;
  font-weight: 700;
}
.deputy-cabinet-page .form-control,
.deputy-cabinet-page .form-select,
.fed-cabinet-page .form-control,
.fed-cabinet-page .form-select,
.my-party-page .form-control,
.my-party-page .form-select,
.profile-page .form-control,
.profile-page .form-select,
.party-cabinet-page .form-control,
.party-cabinet-page .form-select {
  min-height: 40px;
  color: #244260;
  border-color: #cbdcea;
  border-radius: 6px;
  font-size: 0.86rem;
}
.deputy-cabinet-page .form-control:focus,
.deputy-cabinet-page .form-select:focus,
.fed-cabinet-page .form-control:focus,
.fed-cabinet-page .form-select:focus,
.my-party-page .form-control:focus,
.my-party-page .form-select:focus,
.profile-page .form-control:focus,
.profile-page .form-select:focus,
.party-cabinet-page .form-control:focus,
.party-cabinet-page .form-select:focus {
  border-color: #70b5f5;
  box-shadow: 0 0 0 0.18rem rgba(8, 120, 249, 0.12);
}
.deputy-cabinet-page .list-group,
.fed-cabinet-page .list-group,
.my-party-page .list-group,
.party-cabinet-page .list-group {
  overflow: hidden;
  border-color: #dce8f2;
  border-radius: 7px;
}
.deputy-cabinet-page .list-group-item,
.fed-cabinet-page .list-group-item,
.my-party-page .list-group-item,
.party-cabinet-page .list-group-item {
  color: #35516e;
  border-color: #e2ebf3;
}
.deputy-cabinet-page .list-group-item:hover,
.fed-cabinet-page .list-group-item:hover,
.my-party-page .list-group-item:hover,
.party-cabinet-page .list-group-item:hover {
  background: #f5faff;
}
.deputy-cabinet-page .nav-pills {
  gap: 7px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.deputy-cabinet-page .nav-pills .nav-link {
  color: #506b89;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 6px;
}
.deputy-cabinet-page .nav-pills .nav-link.active {
  color: #fff;
  background: #0878f9;
}
.deputy-cabinet-page .modal-content,
.fed-cabinet-page .modal-content,
.my-party-page .modal-content,
.party-cabinet-page .modal-content {
  overflow: hidden;
  border: 1px solid #cbdcea;
  border-radius: 9px;
  box-shadow: 0 18px 45px rgba(20, 55, 95, 0.2);
}
.profile-page .card {
  max-width: 100%;
}
.profile-page .alert,
.deputy-cabinet-page .alert,
.fed-cabinet-page .alert,
.my-party-page .alert,
.party-cabinet-page .alert {
  border-radius: 6px;
  font-size: 0.82rem;
}
.frozen-party-page .frozen-party-card {
  overflow: hidden;
  border: 1px solid #f0b9c0 !important;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(20, 70, 120, 0.09) !important;
}
.frozen-party-page .frozen-party-card h1 {
  color: #c93452 !important;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 800;
}
.frozen-party-page .frozen-party-card h4 {
  color: #233b60;
}
.frozen-party-page .frozen-party-card p {
  color: #71839b;
  line-height: 1.55;
}
.frozen-party-page .frozen-party-card hr {
  border-color: #f0d5d9;
  opacity: 1;
}
@media (max-width: 767px) {
  .deputy-cabinet-page .nav-pills {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .deputy-cabinet-page .nav-pills .nav-link {
    white-space: nowrap;
  }
  .deputy-cabinet-page .table,
  .fed-cabinet-page .table,
  .my-party-page .table,
  .party-cabinet-page .table {
    min-width: 680px;
  }
  .frozen-party-page .row {
    margin-top: 1rem !important;
  }
}

/* ==========================================================
   АРХИВ ЗАВЕРШЕННЫХ ЗАСЕДАНИЙ
   ========================================================== */
.archive-page {
  color: var(--ink);
}
.archive-page .archive-header {
  padding: 4px 0 18px;
}
.archive-page .archive-header h2 {
  margin: 0 0 5px;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}
.archive-page .archive-header p {
  margin: 0;
  color: #7b8da7;
  font-size: 0.96rem;
}
.archive-page .archive-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  color: #536a83;
  background: #fff;
  border: 1px solid #b9cbd9;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
}
.archive-page .archive-back-btn:hover {
  color: #fff;
  background: #536a83;
  border-color: #536a83;
}
.archive-page .archive-toolbar {
  padding: 13px 14px 9px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.06);
}
.archive-page .archive-toolbar .form-control {
  min-height: 40px;
  border-color: #d4e2ef;
  border-radius: 6px;
  color: #304568;
  font-size: 0.88rem;
}
.archive-page .archive-toolbar .form-control:focus {
  border-color: #5ca8f7;
  box-shadow: 0 0 0 0.2rem rgba(8, 120, 249, 0.12);
}
.archive-page .filter-btn {
  color: #536a83;
  background: #fff;
  border-color: #b9cbd9;
  font-size: 0.78rem;
  font-weight: 700;
}
.archive-page .filter-btn:hover,
.archive-page .filter-btn.active,
.archive-page .filter-btn.btn-dark {
  color: #fff;
  background: #092b59;
  border-color: #092b59;
}
.archive-page .archive-card {
  overflow: hidden;
  border: 1px solid #d8e6f2;
  border-radius: 9px;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.07);
}
.archive-page .archive-card-header {
  min-height: 58px;
  padding: 11px 16px;
  color: #fff;
  background: #092b59;
  border: 0;
}
.archive-page .archive-card-header .archive-title {
  font-size: 0.92rem;
}
.archive-page .archive-card-header .archive-meta {
  color: #dbeafe;
  font-size: 0.78rem;
}
.archive-page .archive-card-header .badge {
  padding: 0.45em 0.7em;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 700;
}
.archive-page .archive-card-header .archive-complete-badge {
  color: #c9f5df;
  background: rgba(21, 151, 97, 0.28);
}
.archive-page .archive-card-body {
  padding: 16px;
  background: #fff;
}
.archive-page .archive-date {
  color: #71839b;
  font-size: 0.8rem;
}
.archive-page .protocol-panel {
  padding: 16px;
  background: #f4f8fc !important;
  border: 1px solid #dce8f2 !important;
  border-radius: 8px;
}
.archive-page .protocol-panel hr {
  margin: 14px 0;
  border-color: #dce7f0;
  opacity: 1;
}
.archive-page .protocol-panel h6 {
  color: #233b60;
}
.archive-page .protocol-panel ul {
  padding-left: 18px;
  color: #506783;
}
.archive-page .protocol-panel li {
  margin-bottom: 3px;
}
.archive-page .bill-record {
  overflow: hidden;
  padding: 15px;
  border: 1px solid #d7e4ef !important;
  border-radius: 8px;
  box-shadow: 0 5px 14px rgba(20, 70, 120, 0.05) !important;
}
.archive-page .bill-record h6 {
  color: #0878f9;
  line-height: 1.35;
}
.archive-page .bill-record .bill-info {
  color: #71839b;
  font-size: 0.78rem;
  line-height: 1.55;
}
.archive-page .bill-record p {
  color: #506783;
}
.archive-page .bill-record .table-responsive {
  overflow-x: auto;
}
.archive-page .bill-record .table {
  min-width: 0;
}
.archive-page .bill-record .table th {
  white-space: nowrap;
}
.archive-page .empty-archive {
  padding: 34px 20px;
  color: #71839b;
  background: rgba(255, 255, 255, 0.75);
  border: 1px dashed #cbdbea;
  border-radius: 8px;
}
@media (max-width: 767px) {
  .archive-page .archive-header {
    align-items: flex-start !important;
    flex-direction: column;
    gap: 14px;
  }
  .archive-page .archive-back-btn {
    align-self: stretch;
    justify-content: center;
  }
  .archive-page .archive-card-header {
    align-items: flex-start !important;
    flex-direction: column;
    gap: 10px;
  }
  .archive-page .archive-card-header > div {
    width: 100%;
    justify-content: space-between;
  }
}

/* ==========================================================
   ИСТОРИЯ ВЫБОРОВ
   ========================================================== */
.elections-page {
  color: var(--ink);
}
.elections-page .elections-header {
  padding: 4px 0 18px;
}
.elections-page .elections-header h2 {
  margin: 0 0 5px;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}
.elections-page .elections-header p {
  margin: 0;
  color: #7b8da7;
  font-size: 0.96rem;
}
.elections-page .elections-tabs {
  gap: 7px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.06);
}
.elections-page .elections-tabs .nav-item {
  flex: 0 0 auto;
}
.elections-page .elections-tabs .nav-link {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 6px;
  color: #506b89;
  font-size: 0.82rem;
  font-weight: 700;
}
.elections-page .elections-tabs .nav-link:hover {
  color: #0878f9;
  background: #edf6ff;
}
.elections-page .elections-tabs .nav-link.active {
  color: #fff;
  background: #0878f9;
  box-shadow: 0 4px 10px rgba(8, 120, 249, 0.2);
}
.elections-page .election-countdown {
  overflow: hidden;
  border: 1px solid #cfe5f4;
  border-radius: 8px;
  background: linear-gradient(135deg, #f7fbff, #edf7ff);
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.06);
}
.elections-page .election-countdown h5 {
  margin: 0 0 5px;
  color: #233b60;
  font-size: 1rem;
  font-weight: 800;
}
.elections-page .election-countdown p {
  color: #71839b;
  font-size: 0.8rem;
}
.elections-page .election-countdown-badge {
  padding: 9px 13px;
  color: #1264cf;
  background: #cfe0ff;
  border-radius: 6px;
  font-size: 0.82rem;
}
.elections-page .elections-section-title {
  margin: 0 0 14px;
  color: #233b60;
  font-size: 1.15rem;
  font-weight: 800;
}
.elections-page .elections-accordion {
  overflow: hidden;
}
.elections-page .election-item {
  overflow: hidden;
  border: 1px solid #d8e6f2 !important;
  border-radius: 9px !important;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.07);
}
.elections-page .election-item-button {
  min-height: 58px;
  padding: 12px 16px;
  color: #233b60;
  background: #fff;
  font-size: 0.9rem;
  box-shadow: none;
}
.elections-page .election-item-button:not(.collapsed) {
  color: #0878f9;
  background: #edf6ff;
}
.elections-page .election-item-button::after {
  background-size: 14px;
}
.elections-page .election-date {
  font-weight: 800;
}
.elections-page .election-server-badge {
  color: #0877c9;
  background: #cfefff;
  font-size: 0.7rem;
}
.elections-page .election-item-body {
  padding: 14px;
  background: #f4f8fc;
}
.elections-page .election-result {
  padding: 14px;
  border: 1px solid #d7e4ef !important;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(20, 70, 120, 0.05);
}
.elections-page .election-party-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  object-fit: contain;
  border-radius: 7px;
}
.elections-page .election-party-logo-empty {
  display: grid;
  place-items: center;
  color: #fff;
  background: #71839b;
  font-size: 0.55rem;
  font-weight: 800;
}
.elections-page .election-party {
  color: #233b60;
}
.elections-page .election-result-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #506783;
  font-size: 0.78rem;
}
.elections-page .election-result-summary strong {
  color: #233b60;
}
.elections-page .election-mandates-badge {
  color: #159761;
  background: #d0f5df;
  font-size: 0.82rem;
}
.elections-page .election-candidates-toggle {
  padding: 5px 9px;
  color: #536a83;
  background: #fff;
  border-color: #b9cbd9;
  font-size: 0.72rem;
}
.elections-page .election-candidates-toggle:hover {
  color: #fff;
  background: #536a83;
  border-color: #536a83;
}
.elections-page .election-candidates-panel {
  border: 1px solid #dce8f2 !important;
  border-radius: 6px;
  background: #f4f8fc !important;
}
.elections-page .election-candidates-panel li {
  color: #506783;
  margin-bottom: 3px;
}
.elections-page .empty-elections {
  padding: 34px 20px;
  color: #71839b;
  background: rgba(255, 255, 255, 0.75);
  border: 1px dashed #cbdbea;
  border-radius: 8px;
}
@media (max-width: 767px) {
  .elections-page .elections-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .elections-page .elections-tabs .nav-link {
    white-space: nowrap;
  }
  .elections-page .election-countdown .card-body {
    align-items: flex-start !important;
    flex-direction: column;
    gap: 12px;
  }
  .elections-page .election-result-main {
    align-items: flex-start !important;
    flex-direction: column;
    gap: 12px;
  }
  .elections-page .election-result-summary {
    flex-wrap: wrap;
    gap: 7px 14px;
    text-align: left !important;
  }
}

/* ==========================================================
   АВТОРИЗАЦИЯ И РЕГИСТРАЦИЯ
   ========================================================== */
.auth-page {
  padding: 12px 0 24px;
  color: var(--ink);
}
.auth-page .row {
  margin: 0;
}
.auth-page > .row > [class*="col-"] {
  padding: 0;
}
.auth-card {
  overflow: hidden;
  border: 1px solid #d8e6f2 !important;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(20, 70, 120, 0.09) !important;
}
.auth-card-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  color: #fff;
  background: linear-gradient(110deg, #092b59, #123d69) !important;
  border: 0;
}
.auth-card-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  color: #fff;
  background: rgba(8, 120, 249, 0.8);
  border-radius: 9px;
  font-size: 1.35rem;
  font-weight: 800;
}
.auth-card-header h2 {
  margin: 0 0 3px;
  color: #fff;
  font-size: 1.08rem;
  font-weight: 800;
}
.auth-card-header p {
  margin: 0;
  color: #c9dbef;
  font-size: 0.76rem;
}
.auth-card-body {
  padding: 22px;
  background: #fff;
}
.auth-card-body .form-label {
  margin-bottom: 7px;
  color: #28486c;
  font-size: 0.84rem;
  font-weight: 700;
}
.auth-card-body .form-control {
  min-height: 42px;
  color: #244260;
  border-color: #cbdcea;
  border-radius: 6px;
  font-size: 0.88rem;
}
.auth-card-body .form-control:focus {
  border-color: #70b5f5;
  box-shadow: 0 0 0 0.18rem rgba(8, 120, 249, 0.12);
}
.auth-card-body .input-group .form-control {
  border-right: 0;
}
.auth-password-toggle {
  min-width: 82px;
  color: #536a83;
  background: #eef3f7;
  border: 1px solid #cbdcea;
  font-size: 0.78rem;
  font-weight: 700;
}
.auth-password-toggle:hover {
  color: #fff;
  background: #536a83;
  border-color: #536a83;
}
.auth-submit {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 800;
}
.auth-submit-primary {
  color: #fff;
  background: #0878f9;
}
.auth-submit-primary:hover {
  color: #fff;
  background: #0668da;
}
.auth-submit-success {
  color: #fff;
  background: #159761;
}
.auth-submit-success:hover {
  color: #fff;
  background: #117f50;
}
.auth-card-body .alert {
  border-radius: 6px;
  font-size: 0.82rem;
}
.auth-footer-link {
  margin-top: 16px;
  color: #71839b;
  font-size: 0.82rem;
  text-align: center;
}
.auth-footer-link a,
.auth-card-body > .mt-3 a {
  color: #0878f9;
  font-weight: 700;
  text-decoration: none;
}
.auth-footer-link a:hover,
.auth-card-body > .mt-3 a:hover {
  text-decoration: underline;
}
@media (max-width: 575px) {
  .auth-page {
    padding-top: 0;
  }
  .auth-card-body {
    padding: 18px 15px;
  }
  .auth-card-header {
    padding: 14px 15px;
  }
}

/* Final priority overrides for the cabinet family. */
.profile-page .badge.bg-primary,
.profile-page .badge.bg-info,
.profile-page .badge.bg-secondary,
.party-cabinet-page .badge.bg-info,
.fed-cabinet-page .badge.bg-info,
.my-party-page .badge.bg-info,
.my-party-page .badge.bg-warning,
.my-party-page .badge.bg-secondary {
  color: #31577f !important;
  background: #e8f1fb !important;
  border: 1px solid #cfe0f0;
}

.profile-page .badge.bg-danger,
.party-cabinet-page .badge.bg-danger,
.fed-cabinet-page .badge.bg-danger,
.my-party-page .badge.bg-danger {
  color: #b53b4f !important;
  background: #fff0f2 !important;
  border: 1px solid #f0c5cc;
}

.fed-cabinet-page > .row > [class*="col-"] > .card {
  min-height: 224px;
}

.fed-cabinet-page > .row > [class*="col-"] > .card .card-body {
  padding: 24px;
}

.fed-social-links {
  margin-bottom: 20px;
}

.party-social-actions {
  min-width: 190px;
}

@media (max-width: 767px) {
  .party-social-actions {
    min-width: 0;
  }

  .fed-cabinet-page > .row > [class*="col-"] > .card .card-body {
    padding: 18px;
  }
}

/* Последний слой компоновки кабинетов: имеет приоритет над Bootstrap-
   утилитами и более ранними общими правилами страницы. */
.deputy-cabinet-page,
.fed-cabinet-page,
.my-party-page,
.frozen-party-page,
.profile-page,
.party-cabinet-page {
  max-width: 1240px;
  margin-right: auto;
  margin-left: auto;
}

.deputy-cabinet-page .card,
.fed-cabinet-page .card,
.my-party-page .card,
.profile-page .card,
.party-cabinet-page .card {
  border-radius: 9px !important;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.07) !important;
}

.deputy-cabinet-page .card-body,
.fed-cabinet-page .card-body,
.my-party-page .card-body,
.profile-page .card-body,
.party-cabinet-page .card-body {
  background: #fff;
}

.profile-page > .row {
  display: block;
  max-width: 1040px;
  margin-right: auto;
  margin-left: auto;
}

.profile-page > .row > .col-md-8,
.profile-page > .row > .card,
.profile-page > .row > .row {
  width: 100%;
  max-width: 100%;
}

.profile-page > .row > .col-md-8 {
  padding-right: 0;
  padding-left: 0;
}

.fed-cabinet-page > .row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-right: 0;
  margin-left: 0;
}

.fed-cabinet-page > .row > [class*="col-"] {
  display: flex;
  min-width: 0;
  padding-right: 0;
  padding-left: 0;
}

.fed-cabinet-page > .row > [class*="col-"] > .card {
  width: 100%;
}

.party-cabinet-page .table-responsive,
.deputy-cabinet-page .table-responsive,
.fed-cabinet-page .table-responsive,
.my-party-page .table-responsive {
  border-radius: 7px;
}

.party-cabinet-page .table thead th,
.deputy-cabinet-page .table thead th,
.fed-cabinet-page .table thead th,
.my-party-page .table thead th {
  background: #edf4fb;
  color: #233b60;
  border: 0;
  font-weight: 800;
}

.party-cabinet-page .table tbody td,
.deputy-cabinet-page .table tbody td,
.fed-cabinet-page .table tbody td,
.my-party-page .table tbody td {
  border-color: #e1eaf2;
  vertical-align: middle;
}

.frozen-party-page {
  min-height: 48vh;
  display: flex;
  justify-content: center;
}

.frozen-party-page > .row {
  width: 100%;
  margin-top: 28px !important;
}

.frozen-party-page .col-md-6 {
  width: min(100%, 620px);
}

@media (max-width: 767px) {
  .fed-cabinet-page > .row {
    display: block;
  }

  .fed-cabinet-page > .row > [class*="col-"] {
    margin-bottom: 0;
  }

  .profile-page > .row > .col-md-8,
  .profile-page > .row > .card,
  .profile-page > .row > .row {
    width: 100%;
  }

  .frozen-party-page > .row {
    margin-top: 14px !important;
  }
}

/* Profile layout must win over all earlier generic cabinet rules. */
.profile-page > .row {
  --bs-gutter-x: 0 !important;
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.profile-page > .row > .col-md-8,
.profile-page > .row > .card,
.profile-page > .row > .row {
  width: 100% !important;
  max-width: none !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
  padding-right: 0 !important;
  padding-left: 0 !important;
}

.profile-page .card-header {
  color: #fff !important;
  background: linear-gradient(110deg, #092b59, #123d69) !important;
  border: 0 !important;
}

.profile-page .row.mt-2 {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0 0 18px !important;
}

.profile-page .row.mt-2 > [class*="col-"] {
  display: flex;
  padding: 0 !important;
}

.profile-page .row.mt-2 .card {
  width: 100%;
  height: 100%;
}

.profile-page .btn-primary,
.profile-page .btn-success,
.profile-page .row.mt-2 .btn {
  color: #fff !important;
  background: #0878f9 !important;
  border-color: #0878f9 !important;
}

@media (max-width: 767px) {
  .profile-page .row.mt-2 {
    display: block !important;
  }

  .profile-page .row.mt-2 > [class*="col-"] {
    margin-bottom: 18px;
  }
}

/* Correct the lower profile cards: each grid cell must own the full
   column, otherwise Bootstrap's 50% width is applied twice. */
.profile-page > .row > .col-md-8 {
  margin-bottom: 18px !important;
}

.profile-page .row.mt-2 > .col-md-6 {
  width: 100% !important;
  max-width: none !important;
}

.profile-page .row.mt-2 .card-header.bg-primary,
.profile-page .row.mt-2 .card-header.bg-success,
.profile-page .card-header.bg-dark,
.profile-page .card-header.bg-secondary {
  color: #fff !important;
  background: linear-gradient(110deg, #092b59, #123d69) !important;
}

.profile-page form > .btn[type="submit"],
.profile-page form .btn-primary,
.profile-page form .btn-success {
  color: #fff !important;
  background: #0878f9 !important;
  border-color: #0878f9 !important;
}

.profile-page form > .btn[type="submit"]:hover,
.profile-page form .btn-primary:hover,
.profile-page form .btn-success:hover {
  color: #fff !important;
  background: #0668db !important;
  border-color: #0668db !important;
}

/* ==========================================================
   FEDERAL PARTY CABINET — UNIFIED CARDS AND SVG LINKS
   ========================================================== */
.fed-cabinet-page {
  max-width: 1240px;
  margin-right: auto;
  margin-left: auto;
}

.fed-cabinet-page .card {
  overflow: hidden;
  border: 1px solid #d8e6f2 !important;
  border-radius: 9px !important;
  box-shadow: 0 8px 22px rgba(20, 70, 120, 0.07) !important;
}

.fed-cabinet-page .card-header,
.fed-cabinet-page .card-header.bg-dark,
.fed-cabinet-page .card-header.bg-secondary,
.fed-cabinet-page .card-header.bg-primary,
.fed-cabinet-page .card-header.bg-success,
.fed-cabinet-page .card-header.bg-info {
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: 13px 17px;
  color: #fff !important;
  background: linear-gradient(110deg, #092b59, #123d69) !important;
  border: 0 !important;
  font-size: 0.9rem;
  font-weight: 800;
}

.fed-cabinet-page .card-body {
  padding: 20px;
  background: #fff;
}

.fed-cabinet-page .card-body.p-0 {
  padding: 0 !important;
  overflow-x: auto;
}

.fed-cabinet-page > .row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-right: 0;
  margin-left: 0;
}

.fed-cabinet-page > .row > .col-md-6,
.fed-cabinet-page > .row > [class*="col-"] {
  width: 100% !important;
  max-width: none !important;
  display: flex;
  min-width: 0;
  padding-right: 0;
  padding-left: 0;
}

.fed-cabinet-page > .row > [class*="col-"] > .card {
  width: 100%;
  min-height: 238px;
  margin-bottom: 0 !important;
}

.fed-cabinet-page > .row > [class*="col-"] > .card .card-body {
  padding: 24px;
}

.fed-cabinet-page > .row > [class*="col-"] .form-control,
.fed-cabinet-page > .row > [class*="col-"] .form-select {
  min-height: 45px;
}

.fed-cabinet-page > .row > [class*="col-"] .btn {
  min-height: 43px;
  color: #fff !important;
  background: #0878f9 !important;
  border-color: #0878f9 !important;
}

.fed-cabinet-page > .row > [class*="col-"] .btn:hover {
  background: #0668db !important;
  border-color: #0668db !important;
}

.fed-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0 0 20px;
}

.fed-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 116px;
  min-height: 40px;
  padding: 7px 13px;
  color: #31577f;
  background: #edf6ff;
  border: 1px solid #cfe0f0;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.2s ease;
}

.fed-social-btn:hover {
  color: #fff;
  background: #0878f9;
  border-color: #0878f9;
  transform: translateY(-1px);
}

.fed-social-btn-discord {
  color: #514a9b;
  background: #f0efff;
  border-color: #d8d3fa;
}

.fed-social-btn-discord:hover {
  color: #fff;
  background: #6256bd;
  border-color: #6256bd;
}

.fed-social-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: currentColor;
}

.party-social-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  margin-bottom: 8px;
}

.party-social-actions .fed-social-btn {
  min-width: 92px;
  min-height: 32px;
  padding: 6px 9px;
  font-size: 0.7rem;
}

.party-social-actions .fed-social-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

.fed-cabinet-page .table {
  width: 100%;
  color: #35516e;
  font-size: 0.84rem;
}

.fed-cabinet-page .table thead th {
  padding: 11px 13px;
  color: #233b60;
  background: #edf4fb;
  border: 0;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.fed-cabinet-page .table tbody td {
  padding: 11px 13px;
  border-color: #e1eaf2;
  vertical-align: middle;
}

.fed-cabinet-page .table tbody tr:hover {
  background: #f5faff;
}

.fed-cabinet-page .table .badge.bg-info,
.fed-cabinet-page .table .badge.bg-secondary,
.fed-cabinet-page .table .badge.bg-dark {
  color: #31577f !important;
  background: #e8f1fb !important;
  border: 1px solid #cfe0f0;
}

@media (max-width: 767px) {
  .fed-cabinet-page > .row {
    display: block;
  }

  .fed-cabinet-page > .row > [class*="col-"] {
    margin-bottom: 18px;
  }

  .fed-cabinet-page > .row > [class*="col-"] > .card {
    min-height: 0;
  }

  .fed-cabinet-page > .row > [class*="col-"] > .card .card-body {
    padding: 18px;
  }

  .party-social-actions {
    justify-content: flex-start;
  }
}

/* The party cabinet uses the same header background as “Данные партии”. */
.party-cabinet-page .card-header,
.party-cabinet-page .card-header.bg-dark,
.party-cabinet-page .card-header.bg-primary,
.party-cabinet-page .card-header.bg-secondary,
.party-cabinet-page .card-header.bg-success,
.party-cabinet-page .card-header.bg-warning,
.party-cabinet-page .card-header.bg-info {
  color: #fff !important;
  background: linear-gradient(110deg, #092b59, #123d69) !important;
  border: 0 !important;
}

.admin-page-header {
  gap: 16px;
}

.admin-page-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.admin-page-header-actions .admin-top-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #fff !important;
  font-size: 0.82rem;
  font-weight: 800 !important;
  letter-spacing: 0.01em;
  box-shadow: 0 5px 12px rgba(20, 70, 120, 0.14);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.admin-page-header-actions .admin-top-action:hover {
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(20, 70, 120, 0.2);
}

.admin-page-header-actions .admin-top-action-parties {
  background: linear-gradient(110deg, #092b59, #1264cf);
  border-color: #092b59;
}

.admin-page-header-actions .admin-top-action-parties:hover {
  background: linear-gradient(110deg, #061f42, #0d56b5);
  border-color: #061f42;
}

.admin-page-header-actions .admin-top-action-elections {
  background: linear-gradient(110deg, #c93452, #ed4050);
  border-color: #c93452;
}

.admin-page-header-actions .admin-top-action-elections:hover {
  background: linear-gradient(110deg, #ae2944, #d93647);
  border-color: #ae2944;
}

@media (max-width: 767.98px) {
  .admin-page-header {
    align-items: stretch !important;
  }

  .admin-page-header-actions {
    justify-content: flex-start;
  }

  .admin-page-header-actions .admin-top-action {
    flex: 1 1 220px;
  }
}

/* Финальная раскладка таблицы итогов: grid не позволяет колонкам расширять модальное окно. */
.admin-election-results-modal .admin-election-results-table {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: auto !important;
}

.admin-election-results-modal .admin-election-results-table colgroup {
  display: none;
}

.admin-election-results-modal .admin-election-results-table thead,
.admin-election-results-modal .admin-election-results-table tbody {
  display: block;
  width: 100%;
  min-width: 0;
}

.admin-election-results-modal .admin-election-results-table tr {
  display: grid;
  grid-template-columns: minmax(0, 40%) minmax(0, 30%) minmax(0, 30%);
  width: 100%;
  min-width: 0;
}

.admin-election-results-modal .admin-election-results-table th,
.admin-election-results-modal .admin-election-results-table td {
  display: block;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Общие стили базового шаблона */
html,
body {
  margin: 0 !important;
  padding: 0 !important;
}

.site-navbar {
  flex-direction: column;
  align-items: stretch;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

.site-navbar > .container-fluid {
  width: 100%;
}

.rp-warning {
  width: 100%;
  margin: 0 !important;
  padding: 0.35rem 1rem;
  background: #0b2d56;
  color: #fff;
  font-size: 0.85rem;
  border-radius: 0 !important;
  box-sizing: border-box;
}

.bug-report-link {
  white-space: nowrap;
}

/* Модальное предупреждение для неавторизованных пользователей */
.rp-disclaimer-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(5px);
}

.rp-disclaimer-modal[hidden] {
  display: none;
}

/* Итоги выборов: содержимое всегда помещается в модальное окно без горизонтальной прокрутки. */
.admin-election-results-modal .modal-dialog {
  width: min(96vw, 800px);
  max-width: 800px;
  margin: 1rem auto;
}

.admin-election-results-modal .modal-content,
.admin-election-results-modal .modal-body,
.admin-election-results-modal .modal-footer {
  min-width: 0;
  max-width: 100%;
}

.admin-election-results-modal .modal-body {
  overflow-x: hidden;
}

.admin-election-results-modal .table-responsive {
  max-width: 100%;
  overflow-x: hidden;
}

.admin-election-results-modal .admin-election-results-table {
  display: table;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  margin-bottom: 0;
}

.admin-election-results-modal .admin-election-results-table col:nth-child(1) {
  width: 40%;
}

.admin-election-results-modal .admin-election-results-table col:nth-child(2),
.admin-election-results-modal .admin-election-results-table col:nth-child(3) {
  width: 30%;
}

.admin-election-results-modal .admin-election-results-table th,
.admin-election-results-modal .admin-election-results-table td {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  width: auto !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.admin-election-results-modal .admin-election-results-table th:nth-child(2),
.admin-election-results-modal .admin-election-results-table th:nth-child(3) {
  width: 30%;
}

.admin-election-results-modal .admin-election-party-name {
  min-width: 0;
  max-width: 100%;
}

.admin-election-results-modal .admin-election-party-logo {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  object-fit: contain;
}

.admin-election-results-modal .admin-election-party-label {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-election-results-modal .vote-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (max-width: 767.98px) {
  .admin-election-results-modal .modal-dialog {
    width: calc(100% - 1rem);
    margin: 0.5rem auto;
  }

  .admin-election-results-modal .modal-body,
  .admin-election-results-modal .modal-footer {
    padding: 0.75rem;
  }

  .admin-election-results-modal .admin-election-results-table th,
  .admin-election-results-modal .admin-election-results-table td {
    padding: 0.35rem;
    font-size: 0.82rem;
  }
}

.rp-disclaimer-dialog {
  width: min(100%, 760px);
  padding: clamp(2rem, 5vw, 4rem);
  border: 1px solid rgba(255, 193, 7, 0.5);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.rp-disclaimer-dialog h2 {
  margin-bottom: 1.25rem;
  color: #9a6700;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  font-weight: 700;
}

.rp-disclaimer-dialog p {
  margin: 0 auto 2rem;
  max-width: 620px;
  color: #334155;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.65;
}

.rp-disclaimer-dialog button {
  min-width: 220px;
  padding: 0.85rem 1.5rem;
  border: 0;
  border-radius: 10px;
  background: #9a6700;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.rp-disclaimer-dialog button:hover {
  background: #7c5300;
  transform: translateY(-1px);
}

body.rp-disclaimer-open {
  overflow: hidden;
}

.plain-text-paste {
  white-space: pre-wrap;
}

/* Итоговое переопределение: последним правилом отключаем расширение таблицы Bootstrap. */
.admin-election-results-modal .table-responsive {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

.admin-election-results-modal .admin-election-results-table {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: auto !important;
}

.admin-election-results-modal .admin-election-results-table colgroup {
  display: none !important;
}

.admin-election-results-modal .admin-election-results-table thead,
.admin-election-results-modal .admin-election-results-table tbody {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
}

.admin-election-results-modal .admin-election-results-table tr {
  display: grid !important;
  grid-template-columns: minmax(0, 40%) minmax(0, 30%) minmax(0, 30%) !important;
  width: 100% !important;
  min-width: 0 !important;
}

.admin-election-results-modal .admin-election-results-table th,
.admin-election-results-modal .admin-election-results-table td {
  display: block !important;
  box-sizing: border-box !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  white-space: normal !important;
}

.admin-election-results-modal .admin-election-results-table .vote-input {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.admin-election-results-modal .admin-election-results-grid {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.admin-election-results-modal .admin-election-results-grid > .row {
  width: 100%;
  min-width: 0;
  margin-right: 0;
  margin-left: 0;
}

.admin-election-results-modal .admin-election-results-grid .col-5,
.admin-election-results-modal .admin-election-results-grid .col-3,
.admin-election-results-modal .admin-election-results-grid .col-4 {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.bill-attachment-image {
  width: 220px;
  height: 180px;
  object-fit: contain;
}

.bill-attachment-image-small {
  width: 54px;
  height: 42px;
}

.legacy-comparison-editor {
  display: none;
}

.rich-editor-wrapper {
  display: flex;
  flex-direction: column;
  max-height: min(58vh, 620px);
  border: 1px solid #ced4da;
  border-radius: .375rem;
  background: #fff;
  overflow: hidden;
}

.rich-editor-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  padding: .45rem;
  background: #f8f9fa;
  border-bottom: 1px solid #ced4da;
}

.editor-font-size {
  width: 88px;
  min-width: 88px;
  height: 2rem;
  padding: 0 .35rem;
  border: 1px solid #ced4da;
  border-radius: .25rem;
  background: #fff;
  color: #102b55;
  font-size: .78rem;
  cursor: pointer;
}

.rich-editor-toolbar button {
  min-width: 2rem;
  border: 1px solid #ced4da;
  border-radius: .25rem;
  background: #fff;
  color: #102b55;
  cursor: pointer;
}

.rich-editor-toolbar button:hover {
  background: #e9f2ff;
}

.rich-editor-toolbar button[data-command^="justify"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  min-width: 2.25rem;
  font-size: 0;
}

.rich-editor-toolbar button[data-command^="justify"] svg {
  width: 20px;
  height: 20px;
  fill: #292d32;
  stroke: none;
}

.rich-editor-toolbar button[data-command="justifyCenter"] svg {
  fill: none;
  stroke: #292d32;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rich-editor-toolbar button.color-command,
.rich-editor-toolbar button.highlight-command {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  min-width: 2.25rem;
  padding-bottom: .35rem;
}

.rich-editor-toolbar button.color-command svg,
.rich-editor-toolbar button.highlight-command svg {
  position: static;
  width: 20px;
  height: 20px;
  fill: #292d32;
  flex: 0 0 20px;
  transform: none;
}

.editor-color-letter {
  display: block;
  height: 20px;
  color: #292d32;
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 20px;
}

.editor-color-indicator {
  position: absolute;
  right: 5px;
  bottom: 3px;
  left: 5px;
  height: 3px;
  border-radius: 3px;
  background: #dc3545;
}

.rich-editor-toolbar button.highlight-command { background: #fff !important; }
.highlight-command .editor-color-indicator { background: #fff3cd; }

.editor-color-modal .modal-dialog { max-width: 290px; }
.editor-color-modal .modal-body { overflow: hidden; }
.editor-color-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
}

.editor-color-swatch {
  width: 23px;
  height: 23px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, .16);
  border-radius: 50%;
  cursor: pointer;
}

.editor-color-swatch:hover,
.editor-color-swatch:focus {
  outline: 2px solid #0d6efd;
  outline-offset: 1px;
}

.editor-custom-color {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: .82rem;
  font-weight: 700;
}

.editor-custom-color input {
  width: 34px;
  height: 28px;
  padding: 1px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  cursor: pointer;
}

.editor-clear-highlight {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 5px 8px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.align-mark {
  display: block;
  width: 16px;
  height: 12px;
  background: repeating-linear-gradient(to bottom, #102b55 0 2px, transparent 2px 4px);
}

.align-left { margin-right: auto; }
.align-center { margin-left: auto; margin-right: auto; }
.align-right { margin-left: auto; }

.toolbar-divider {
  width: 1px;
  margin: 0 .2rem;
  background: #ced4da;
}

.rich-editor-toolbar button[data-table-action] {
  color: #8b2d2d;
  font-size: .78rem;
  white-space: nowrap;
}

.editor-color-picker {
  width: 2.25rem;
  min-width: 2.25rem;
  height: 2rem;
  padding: .15rem;
  border: 1px solid #ced4da;
  border-radius: .25rem;
  background: #fff;
  cursor: pointer;
}

.color-command { color: #dc3545 !important; }
.highlight-command { color: #9a6700 !important; background: #fff3cd !important; }

.rich-editor {
  min-height: 180px;
  max-height: calc(58vh - 70px);
  padding: .75rem;
  outline: none;
  overflow-wrap: anywhere;
  overflow-x: hidden;
  overflow-y: auto;
}

#stepTwoAmendmentModal .modal-dialog,
#stepTwoBillNewModal .modal-dialog,
#stepTwoResolutionModal .modal-dialog,
[id^="editBillModal"] .modal-dialog {
  width: 96vw;
  max-width: 1200px;
}

#stepTwoAmendmentModal .modal-content,
#stepTwoBillNewModal .modal-content,
#stepTwoResolutionModal .modal-content,
[id^="editBillModal"] .modal-content {
  max-height: calc(100vh - 1.5rem);
}

#stepTwoAmendmentModal .modal-body,
#stepTwoBillNewModal .modal-body,
#stepTwoResolutionModal .modal-body,
[id^="editBillModal"] .modal-body {
  overflow-y: auto;
}

html.dark-theme .editor-font-size {
  border-color: rgba(157, 190, 226, .36);
  background: #162741;
  color: #edf5ff;
}

/* Длинные формы прокручиваются внутри модального окна, включая нижнюю
   панель с изображениями и кнопками отправки/сохранения. */
#stepTwoAmendmentModal .modal-dialog,
#stepTwoBillNewModal .modal-dialog,
#stepTwoResolutionModal .modal-dialog,
[id^="editBillModal"] .modal-dialog {
  max-height: calc(100vh - 1rem);
  margin-top: .5rem;
  margin-bottom: .5rem;
}

#stepTwoAmendmentModal .modal-content,
#stepTwoBillNewModal .modal-content,
#stepTwoResolutionModal .modal-content,
[id^="editBillModal"] .modal-content {
  max-height: calc(100vh - 1rem);
}

#stepTwoAmendmentModal .modal-body,
#stepTwoBillNewModal .modal-body,
#stepTwoResolutionModal .modal-body,
[id^="editBillModal"] .modal-body {
  max-height: calc(100vh - 9rem);
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

#stepTwoAmendmentModal .modal-footer,
#stepTwoBillNewModal .modal-footer,
#stepTwoResolutionModal .modal-footer,
[id^="editBillModal"] .modal-footer {
  position: relative;
  z-index: 2;
}

@media (max-width: 575.98px) {
  #stepTwoAmendmentModal .modal-dialog,
  #stepTwoBillNewModal .modal-dialog,
  #stepTwoResolutionModal .modal-dialog,
  [id^="editBillModal"] .modal-dialog {
    width: 100%;
    max-height: calc(100vh - .5rem);
    margin: .25rem auto;
  }
}

/* Просмотр законопроектов в темной теме: черный текст из сохраненного HTML
   должен оставаться читаемым на темном фоне. */
html.dark-theme .bills-page .bill-content-text,
html.dark-theme .initiatives-card .bill-content-text {
  color: #ffffff !important;
}

html.dark-theme .bills-page .bill-content-text [style*="color: black"],
html.dark-theme .bills-page .bill-content-text [style*="color:black"],
html.dark-theme .bills-page .bill-content-text [style*="color: rgb(0, 0, 0)"],
html.dark-theme .bills-page .bill-content-text [style*="color:rgb(0,0,0)"],
html.dark-theme .bills-page .bill-content-text [style*="color: #000"],
html.dark-theme .bills-page .bill-content-text [style*="color:#000"],
html.dark-theme .bills-page .bill-content-text [style*="color: #111827"],
html.dark-theme .bills-page .bill-content-text [style*="color:#111827"],
html.dark-theme .bills-page .bill-content-text [color="black"],
html.dark-theme .bills-page .bill-content-text [color="#000"],
html.dark-theme .bills-page .bill-content-text [color="#000000"],
html.dark-theme .initiatives-card .bill-content-text [style*="color: black"],
html.dark-theme .initiatives-card .bill-content-text [style*="color: rgb(0, 0, 0)"],
html.dark-theme .initiatives-card .bill-content-text [style*="color: #000"],
html.dark-theme .initiatives-card .bill-content-text [style*="color: #111827"],
html.dark-theme .initiatives-card .bill-content-text [style*="color:#111827"],
html.dark-theme .initiatives-card .bill-content-text [color="black"],
html.dark-theme .initiatives-card .bill-content-text [color="#000"],
html.dark-theme .initiatives-card .bill-content-text [color="#000000"] {
  color: #ffffff !important;
}

/* Не меняем фон раскрытого законопроекта при наведении. */
html.dark-theme .bills-page .bills-table tbody tr:hover,
html.dark-theme .bills-page .bills-table tbody tr:hover > td,
html.dark-theme .bills-page #billsTable tbody tr:hover,
html.dark-theme .bills-page #billsTable tbody tr:hover > td,
html.dark-theme .initiatives-card .initiative-row:hover,
html.dark-theme .initiatives-card .initiative-row:hover > td {
  background-color: #1f2937 !important;
}

/* Единое переключение черного и белого текста во всех раскрываемых
   законопроектах и связанных с ними блоках. */
html:not(.dark-theme) :is(
  .bills-page .bill-content-text,
  .initiatives-card .bill-content-text,
  .deputy-cabinet-page .collapse .text-secondary.small,
  .deputy-cabinet-page .collapse .p-2.bg-light.border.rounded.small,
  .governor-cabinet-page .collapse .text-secondary.small,
  .president-cabinet-page .collapse .text-secondary.small,
  .meeting-room-page .p-2.bg-light.border.rounded,
  .archive-page .text-secondary.small.p-2.bg-light.border.rounded
) {
  color: #111827 !important;
}

html:not(.dark-theme) :is(
  .bills-page .bill-content-text,
  .initiatives-card .bill-content-text,
  .deputy-cabinet-page .collapse .text-secondary.small,
  .deputy-cabinet-page .collapse .p-2.bg-light.border.rounded.small,
  .governor-cabinet-page .collapse .text-secondary.small,
  .president-cabinet-page .collapse .text-secondary.small,
  .meeting-room-page .p-2.bg-light.border.rounded,
  .archive-page .text-secondary.small.p-2.bg-light.border.rounded
) :is(
  [style*="color: white"], [style*="color:white"],
  [style*="color: rgb(255, 255, 255)"], [style*="color:rgb(255,255,255)"],
  [style*="color: #fff"], [style*="color:#fff"],
  [color="white"], [color="#fff"], [color="#ffffff"]
) {
  color: #000000 !important;
}

html.dark-theme :is(
  .bills-page .bill-content-text,
  .initiatives-card .bill-content-text,
  .deputy-cabinet-page .collapse .text-secondary.small,
  .deputy-cabinet-page .collapse .p-2.bg-light.border.rounded.small,
  .governor-cabinet-page .collapse .text-secondary.small,
  .president-cabinet-page .collapse .text-secondary.small,
  .meeting-room-page .p-2.bg-light.border.rounded,
  .archive-page .text-secondary.small.p-2.bg-light.border.rounded
) {
  color: #ffffff !important;
}

html.dark-theme :is(
  .bills-page .bill-content-text,
  .initiatives-card .bill-content-text,
  .deputy-cabinet-page .collapse .text-secondary.small,
  .deputy-cabinet-page .collapse .p-2.bg-light.border.rounded.small,
  .governor-cabinet-page .collapse .text-secondary.small,
  .president-cabinet-page .collapse .text-secondary.small,
  .meeting-room-page .p-2.bg-light.border.rounded,
  .archive-page .text-secondary.small.p-2.bg-light.border.rounded
) :is(
  [style*="color: black"], [style*="color:black"],
  [style*="color: rgb(0, 0, 0)"], [style*="color:rgb(0,0,0)"],
  [style*="color: #000"], [style*="color:#000"],
  [style*="color: #111827"], [style*="color:#111827"],
  [color="black"], [color="#000"], [color="#000000"]
) {
  color: #ffffff !important;
}

/* Контраст форматированного текста в журнале заседания. */
html.dark-theme .meeting-room-page .p-2.bg-light.border.rounded [style*="color: green"],
html.dark-theme .meeting-room-page .p-2.bg-light.border.rounded [style*="color:green"],
html.dark-theme .meeting-room-page .p-2.bg-light.border.rounded [style*="#008000"],
html.dark-theme .meeting-room-page .p-2.bg-light.border.rounded [style*="rgb(0, 128, 0)"],
html.dark-theme .meeting-room-page .p-2.bg-light.border.rounded [color="green"],
html.dark-theme .meeting-room-page .p-2.bg-light.border.rounded [color="#008000"] {
  color: #86efac !important;
}

html.dark-theme .meeting-room-page .p-2.bg-light.border.rounded [style*="color: red"],
html.dark-theme .meeting-room-page .p-2.bg-light.border.rounded [style*="color:red"],
html.dark-theme .meeting-room-page .p-2.bg-light.border.rounded [style*="#ff0000"],
html.dark-theme .meeting-room-page .p-2.bg-light.border.rounded [style*="rgb(255, 0, 0)"],
html.dark-theme .meeting-room-page .p-2.bg-light.border.rounded [color="red"],
html.dark-theme .meeting-room-page .p-2.bg-light.border.rounded [color="#ff0000"] {
  color: #ff9aa8 !important;
}

html.dark-theme .meeting-room-page .p-2.bg-light.border.rounded [style*="background-color: #f4cccc"],
html.dark-theme .meeting-room-page .p-2.bg-light.border.rounded [style*="background-color:#f4cccc"],
html.dark-theme .meeting-room-page .p-2.bg-light.border.rounded [style*="background-color: rgb(255, 204, 204)"],
html.dark-theme .meeting-room-page .p-2.bg-light.border.rounded [style*="background-color: #fff3cd"],
html.dark-theme .meeting-room-page .p-2.bg-light.border.rounded [style*="background-color:#fff3cd"],
html.dark-theme .meeting-room-page .p-2.bg-light.border.rounded [style*="background-color: yellow"] {
  background-color: #5b3544 !important;
}

html:not(.dark-theme) .meeting-room-page .p-2.bg-light.border.rounded [style*="color: white"],
html:not(.dark-theme) .meeting-room-page .p-2.bg-light.border.rounded [style*="color:white"],
html:not(.dark-theme) .meeting-room-page .p-2.bg-light.border.rounded [style*="#ffffff"],
html:not(.dark-theme) .meeting-room-page .p-2.bg-light.border.rounded [style*="#fff"],
html:not(.dark-theme) .meeting-room-page .p-2.bg-light.border.rounded [color="white"],
html:not(.dark-theme) .meeting-room-page .p-2.bg-light.border.rounded [color="#ffffff"] {
  color: #000000 !important;
}

.rich-editor table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  margin: .75rem 0;
}

.rich-editor td,
.rich-editor th {
  width: 50%;
  max-width: 50%;
  min-width: 0 !important;
  border: 1px solid #6c757d;
  padding: .5rem;
  vertical-align: top !important;
  text-align: left;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

.rich-editor table * {
  max-width: 100%;
  box-sizing: border-box;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

.rich-editor-wrapper,
.rich-editor {
  min-width: 0;
  max-width: 100%;
}

.bill-image-modal-preview {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  margin: 0 auto;
  object-fit: contain;
}

/* Единое отображение содержимого раскрытых инициатив. */
.timeline {
  position: relative;
  padding-left: 25px;
  margin: 10px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background-color: #dee2e6;
}

.timeline-step {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 18px;
}

.timeline-step:last-child { margin-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -25px;
  width: 19px;
  height: 19px;
  border: 3px solid #fff;
  border-radius: 50%;
  background-color: #ced4da;
  box-shadow: 0 0 0 1px #ced4da;
}

.timeline-step.completed .timeline-dot {
  background-color: #198754 !important;
  box-shadow: 0 0 0 1px #198754 !important;
}

.timeline-step.completed .timeline-label {
  color: #198754 !important;
  font-weight: 700;
}

.timeline-step.active .timeline-dot {
  background-color: #0d6efd !important;
  box-shadow: 0 0 0 1px #0d6efd !important;
}

.timeline-step.active .timeline-label {
  color: #0d6efd !important;
  font-weight: 700;
}

.timeline-label {
  color: #495057;
  font-size: .95rem;
  font-weight: 600;
}

.bills-page #billsTable > thead > tr > th:nth-child(1) { width: 5%; }
.bills-page #billsTable > thead > tr > th:nth-child(2) { width: 20%; }
.bills-page #billsTable > thead > tr > th:nth-child(3),
.bills-page #billsTable > thead > tr > th:nth-child(4) { width: 15%; }
.bills-page #billsTable > thead > tr > th:nth-child(5),
.bills-page #billsTable > thead > tr > th:nth-child(6),
.bills-page #billsTable > thead > tr > th:nth-child(7),
.bills-page #billsTable > thead > tr > th:nth-child(8) { width: 10%; }
.bills-page #billsTable > thead > tr > th:nth-child(9) { width: 5%; }

.bills-page .comparison-table th { width: 50%; }
.editor-table-cell {
  min-height: 100px;
  background-color: #fff;
}
.bill-pre-line { white-space: pre-line; }
.inline-form { display: inline; }

.bills-page .bill-content-text,
.initiatives-card .bill-content-text,
.deputy-cabinet-page .collapse .text-secondary.small,
.deputy-cabinet-page .collapse .p-2.bg-light.border.rounded.small,
.governor-cabinet-page .collapse .text-secondary.small,
.president-cabinet-page .collapse .text-secondary.small,
.meeting-room-page .p-2.bg-light.border.rounded,
.archive-page .text-secondary.small.p-2.bg-light.border.rounded {
  color: #111827 !important;
  font-size: 1rem !important;
  line-height: 1.6;
}

.bills-page .bill-content-text table,
.initiatives-card .bill-content-text table,
.deputy-cabinet-page .collapse .text-secondary.small table,
.deputy-cabinet-page .collapse .p-2.bg-light.border.rounded.small table,
.governor-cabinet-page .collapse .text-secondary.small table,
.president-cabinet-page .collapse .text-secondary.small table,
.meeting-room-page .p-2.bg-light.border.rounded table,
.archive-page .text-secondary.small.p-2.bg-light.border.rounded table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #6b7280;
}

.bills-page .bill-content-text table th,
.bills-page .bill-content-text table td,
.initiatives-card .bill-content-text table th,
.initiatives-card .bill-content-text table td,
.deputy-cabinet-page .collapse .text-secondary.small table th,
.deputy-cabinet-page .collapse .text-secondary.small table td,
.deputy-cabinet-page .collapse .p-2.bg-light.border.rounded.small table th,
.deputy-cabinet-page .collapse .p-2.bg-light.border.rounded.small table td,
.governor-cabinet-page .collapse .text-secondary.small table th,
.governor-cabinet-page .collapse .text-secondary.small table td,
.president-cabinet-page .collapse .text-secondary.small table th,
.president-cabinet-page .collapse .text-secondary.small table td,
.meeting-room-page .p-2.bg-light.border.rounded table th,
.meeting-room-page .p-2.bg-light.border.rounded table td,
.archive-page .text-secondary.small.p-2.bg-light.border.rounded table th,
.archive-page .text-secondary.small.p-2.bg-light.border.rounded table td {
  border: 1px solid #6b7280 !important;
  padding: .5rem;
  vertical-align: top;
}

.image-gallery-prev,
.image-gallery-next {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
  transform: translateY(-50%);
}

.image-gallery-prev { left: 1rem; }
.image-gallery-next { right: 1rem; }

.bill-row,
.initiative-row,
.archive-bill-row,
.meeting-bill-row {
  cursor: pointer;
}

/* Финальные переопределения темной темы: стоят после стилевых блоков страниц. */
html.dark-theme body,
html.dark-theme .card,
html.dark-theme .card-body,
html.dark-theme .modal-content,
html.dark-theme .modal-body,
html.dark-theme .modal-footer,
html.dark-theme .accordion-item,
html.dark-theme .list-group-item {
  color: #e5e7eb !important;
  background-color: #1f2937 !important;
  border-color: #374151 !important;
}

html.dark-theme .table,
html.dark-theme .table > :not(caption) > * > *,
html.dark-theme .table tbody,
html.dark-theme .table td {
  color: #e5e7eb !important;
  background-color: #1f2937 !important;
  border-color: #40516a !important;
}

html.dark-theme .table th,
html.dark-theme .table thead > tr > th,
html.dark-theme .table-light > * > * {
  color: #f3f4f6 !important;
  background-color: #273449 !important;
  border-color: #40516a !important;
}

html.dark-theme .form-control,
html.dark-theme .form-select,
html.dark-theme input,
html.dark-theme textarea {
  color: #f3f4f6 !important;
  background-color: #111827 !important;
  border-color: #4b5563 !important;
}

html.dark-theme .bg-light,
html.dark-theme .bg-white,
html.dark-theme .collapse,
html.dark-theme .accordion-body {
  color: #e5e7eb !important;
  background-color: #273449 !important;
}

html.dark-theme .text-dark,
html.dark-theme .text-body,
html.dark-theme .text-secondary,
html.dark-theme .text-muted,
html.dark-theme .form-text { color: #aeb8c7 !important; }

html.dark-theme .dropdown-menu .dropdown-item:hover,
html.dark-theme .dropdown-menu .dropdown-item:focus,
html.dark-theme .accordion-button:not(.collapsed) {
  color: #fff !important;
  background-color: #2d4666 !important;
}

html.dark-theme .parliament-seat-map,
html.dark-theme .meeting-vote-parliament-map,
html.dark-theme .meeting-vote-parliament-body,
html.dark-theme .deputies-card-body,
html.dark-theme .meeting-room-page .meeting-agenda-journal-body {
  background: #172235 !important;
}

/* Последние правила имеют приоритет над стилями конкретных страниц. */
/* EOF_THEME_ANCHOR */

/* Финальный слой темной темы для внутренних страниц и base.html. */
html.dark-theme body {
  background-color: #04183A !important;
  background-image: url("../zakbgdark.png") !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: cover !important;
  background-attachment: fixed !important;
}

html.dark-theme .site-navbar {
  min-height: 58px;
  padding: .35rem 1.35rem;
  background: #062653 !important;
  border-bottom: 1px solid #1f4778 !important;
}

html.dark-theme .site-navbar .container-fluid {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
}

html.dark-theme .site-navbar .navbar-brand {
  flex: 0 0 auto;
  margin-right: 1rem;
}

html.dark-theme .site-navbar .navbar-collapse {
  min-width: 0;
}

html.dark-theme .site-navbar .navbar-nav {
  gap: .12rem;
}

html.dark-theme .site-navbar .nav-link {
  padding: .58rem .55rem !important;
  font-size: .78rem;
}

html.dark-theme .site-navbar .navbar-nav.me-auto {
  min-width: 0;
  flex-wrap: nowrap;
}

html.dark-theme .theme-toggle-btn {
  min-height: 32px;
  padding: 5px 9px;
  background: #263d5b;
  border-color: #527092;
}

html.dark-theme .theme-toggle-btn:hover,
html.dark-theme .theme-toggle-btn:focus-visible {
  background: #0d6dde;
  border-color: #70a9e8;
}
html.dark-theme [class*="-page"],
html.dark-theme .bug-report-page {
  color: #e5e7eb !important;
}

html.dark-theme [class*="-page"] h1,
html.dark-theme [class*="-page"] h2,
html.dark-theme [class*="-page"] h3,
html.dark-theme [class*="-page"] h4,
html.dark-theme [class*="-page"] h5,
html.dark-theme [class*="-page"] h6,
html.dark-theme .bug-report-page h1,
html.dark-theme .bug-report-page h2,
html.dark-theme .bug-report-page h3,
html.dark-theme .bug-report-page h4,
html.dark-theme .bug-report-page h5,
html.dark-theme .bug-report-page h6 {
  color: #f3f4f6 !important;
}

html.dark-theme [class*="-page"] p,
html.dark-theme [class*="-page"] li,
html.dark-theme [class*="-page"] label,
html.dark-theme [class*="-page"] dt,
html.dark-theme [class*="-page"] dd,
html.dark-theme .bug-report-page p,
html.dark-theme .bug-report-page label {
  color: #c3cfde !important;
}

html.dark-theme [class*="-page"] .card,
html.dark-theme [class*="-page"] .card-body,
html.dark-theme [class*="-page"] .bg-white,
html.dark-theme [class*="-page"] .bg-light,
html.dark-theme [class*="-page"] .protocol-panel,
html.dark-theme [class*="-page"] .bill-record,
html.dark-theme .bug-report-page .card,
html.dark-theme .bug-report-page .card-body {
  color: #e5e7eb !important;
  background: #1f2937 !important;
  border-color: #374151 !important;
}

html.dark-theme [class*="-page"] .card-header:not(.bg-primary):not(.bg-success):not(.bg-danger):not(.bg-warning):not(.bg-info):not(.bg-dark),
html.dark-theme [class*="-page"] .archive-card-header,
html.dark-theme [class*="-page"] .parliament-card-header,
html.dark-theme [class*="-page"] .deputies-card-header {
  color: #f3f4f6 !important;
  background: #273449 !important;
  border-color: #374151 !important;
}

html.dark-theme [class*="-page"] .table,
html.dark-theme [class*="-page"] .table > :not(caption) > * > *,
html.dark-theme [class*="-page"] .table td,
html.dark-theme [class*="-page"] .table th,
html.dark-theme .bug-report-page .table,
html.dark-theme .bug-report-page .table td,
html.dark-theme .bug-report-page .table th {
  color: #e5e7eb !important;
  background-color: #1f2937 !important;
  border-color: #40516a !important;
}

html.dark-theme [class*="-page"] .table thead th,
html.dark-theme [class*="-page"] .table-light > * > *,
html.dark-theme [class*="-page"] .table-dark > * > * {
  color: #f3f4f6 !important;
  background-color: #273449 !important;
  border-color: #40516a !important;
}

html.dark-theme [class*="-page"] .form-control,
html.dark-theme [class*="-page"] .form-select,
html.dark-theme [class*="-page"] input,
html.dark-theme [class*="-page"] textarea,
html.dark-theme [class*="-page"] .rich-editor,
html.dark-theme .bug-report-page .form-control,
html.dark-theme .bug-report-page input,
html.dark-theme .bug-report-page textarea {
  color: #f3f4f6 !important;
  background-color: #111827 !important;
  border-color: #4b5563 !important;
}

html.dark-theme [class*="-page"] .form-control::placeholder,
html.dark-theme [class*="-page"] textarea::placeholder,
html.dark-theme .bug-report-page textarea::placeholder {
  color: #8fa1b8 !important;
}

html.dark-theme [class*="-page"] .filter-btn:not(.active),
html.dark-theme [class*="-page"] .btn-outline-dark {
  color: #dbe5f1 !important;
  background: #273449 !important;
  border-color: #52647d !important;
}

html.dark-theme [class*="-page"] .filter-btn:hover,
html.dark-theme [class*="-page"] .btn-outline-dark:hover {
  color: #fff !important;
  background: #2d4666 !important;
  border-color: #6f8bad !important;
}

html.dark-theme [class*="-page"] .text-dark,
html.dark-theme [class*="-page"] .text-body,
html.dark-theme [class*="-page"] .text-secondary,
html.dark-theme [class*="-page"] .text-muted,
html.dark-theme [class*="-page"] .form-text,
html.dark-theme .bug-report-page .text-muted,
html.dark-theme .bug-report-page .form-text {
  color: #b8c7da !important;
}

html.dark-theme .site-navbar .dropdown-menu,
html.dark-theme .site-navbar .account-menu,
html.dark-theme .site-navbar .dropdown-item,
html.dark-theme .site-navbar .dropdown-header {
  color: #e5e7eb !important;
  background-color: #1f2937 !important;
}

html.dark-theme .site-navbar .dropdown-item:hover,
html.dark-theme .site-navbar .dropdown-item:focus,
html.dark-theme .site-navbar .dropdown-item.bg-light {
  color: #fff !important;
  background-color: #2d4666 !important;
}

html.dark-theme .site-navbar .dropdown-divider {
  border-color: #40516a !important;
}

html.dark-theme .site-navbar .dropdown-menu small,
html.dark-theme .site-navbar .dropdown-menu .text-muted {
  color: #aebbd0 !important;
}

html.dark-theme .site-navbar .navbar-toggler {
  border-color: rgba(255, 255, 255, .35) !important;
}

html.dark-theme .modal-content,
html.dark-theme .modal-content .modal-body,
html.dark-theme .modal-content .modal-footer {
  color: #e5e7eb !important;
  background-color: #1f2937 !important;
  border-color: #374151 !important;
}

html.dark-theme .modal-content .bg-light,
html.dark-theme .modal-content .bg-white {
  color: #e5e7eb !important;
  background-color: #273449 !important;
}

html.dark-theme .bg-warning.text-dark,
html.dark-theme .bg-warning.text-dark h1,
html.dark-theme .bg-warning.text-dark h2,
html.dark-theme .bg-warning.text-dark h3,
html.dark-theme .bg-warning.text-dark h4,
html.dark-theme .bg-warning.text-dark h5,
html.dark-theme .bg-warning.text-dark h6,
html.dark-theme .bg-warning.text-dark p {
  color: #111827 !important;
}
html.dark-theme .home-hero {
  background: transparent !important;
}
/* FINAL_HOME_ANCHOR */
/* Контрастные плашки последних инициатив в темной теме. */
html.dark-theme .initiatives-card .badge,
html.dark-theme .initiatives-card .server-badge,
html.dark-theme .initiatives-card .type-badge,
html.dark-theme .initiatives-card .status-badge {
  filter: none !important;
  opacity: 1 !important;
  text-shadow: none !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2) !important;
}

html.dark-theme .initiatives-card .server-badge {
  color: #eaf7ff !important;
  background: #176898 !important;
}

html.dark-theme .initiatives-card .type-amendment {
  color: #f4f8ff !important;
  background: #536b83 !important;
}

html.dark-theme .initiatives-card .type-new {
  color: #eaf3ff !important;
  background: #315f9a !important;
}

html.dark-theme .initiatives-card .type-resolution {
  color: #edfff6 !important;
  background: #187b5a !important;
}

html.dark-theme .initiatives-card .type-extension {
  color: #f7f2ff !important;
  background: #5c4aa2 !important;
}

html.dark-theme .initiatives-card .status-danger {
  color: #fff0f2 !important;
  background: #9b2f42 !important;
}

html.dark-theme .initiatives-card .status-success {
  color: #edfff6 !important;
  background: #187b5a !important;
}

html.dark-theme .initiatives-card .status-primary,
html.dark-theme .initiatives-card .status-info {
  color: #eaf7ff !important;
  background: #176898 !important;
}

html.dark-theme .initiatives-card .status-secondary {
  color: #f1f5fa !important;
  background: #536b83 !important;
}

html.dark-theme .initiatives-card .status-warning {
  color: #f7f2ff !important;
  background: #5c4aa2 !important;
}

/* Точные правки главной страницы в темной теме. */
html.dark-theme .feature-arrow {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  padding: 0 0 4px !important;
  transform: translateY(0) !important;
  background: rgba(224, 240, 255, .95) !important;
  border: 1px solid rgba(112, 169, 232, .65) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

html.dark-theme .stat-row {
  color: #dbeafe !important;
  border-bottom-color: rgba(154, 193, 235, .35) !important;
}

html.dark-theme .stat-row strong,
html.dark-theme .stats-card .stat-value,
html.dark-theme .stats-card .stat-count {
  color: #f8fbff !important;
  text-shadow: 0 0 8px rgba(112, 169, 232, .22);
}

html.dark-theme .table-wrap,
html.dark-theme .initiatives-card {
  background: rgba(7, 31, 67, .72) !important;
  border-color: rgba(112, 169, 232, .32) !important;
}

html.dark-theme .initiatives-card .table-wrap .table,
html.dark-theme .initiatives-card .table-wrap .table tbody,
html.dark-theme .initiatives-card .table-wrap .table td {
  background: rgba(3, 18, 43, .58) !important;
  border-color: rgba(112, 169, 232, .3) !important;
}

html.dark-theme .initiatives-card .table-wrap .table thead th {
  color: #eef6ff !important;
  background: rgba(15, 48, 91, .88) !important;
  border-color: rgba(112, 169, 232, .35) !important;
}

html.dark-theme .initiatives-card .badge,
html.dark-theme .initiatives-card .server-badge,
html.dark-theme .initiatives-card .type-badge,
html.dark-theme .initiatives-card .status-badge {
  filter: saturate(.72) brightness(.84);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}

html.dark-theme .initiatives-card .server-badge,
html.dark-theme .initiatives-card .type-badge,
html.dark-theme .initiatives-card .status-badge {
  color: #e8f4ff !important;
}

html.dark-theme .site-navbar,
html.dark-theme .site-navbar > .container-fluid,
html.dark-theme .site-navbar .navbar-collapse {
  background: #062653 !important;
  box-shadow: none !important;
}

html.dark-theme [class*="-page"] .card,
html.dark-theme [class*="-page"] .card-body,
html.dark-theme [class*="-page"] .bg-white,
html.dark-theme [class*="-page"] .bg-light,
html.dark-theme [class*="-page"] .protocol-panel,
html.dark-theme [class*="-page"] .bill-record,
html.dark-theme .bug-report-page .card,
html.dark-theme .bug-report-page .card-body {
  background: rgba(7, 31, 67, .78) !important;
  border-color: rgba(112, 169, 232, .28) !important;
}

html.dark-theme [class*="-page"] .card-header:not(.bg-primary):not(.bg-success):not(.bg-danger):not(.bg-warning):not(.bg-info):not(.bg-dark),
html.dark-theme [class*="-page"] .archive-card-header,
html.dark-theme [class*="-page"] .parliament-card-header,
html.dark-theme [class*="-page"] .deputies-card-header {
  background: rgba(15, 48, 91, .88) !important;
  border-color: rgba(112, 169, 232, .32) !important;
}

html.dark-theme [class*="-page"] .table,
html.dark-theme [class*="-page"] .table > :not(caption) > * > *,
html.dark-theme [class*="-page"] .table td,
html.dark-theme [class*="-page"] .table th,
html.dark-theme .bug-report-page .table,
html.dark-theme .bug-report-page .table td,
html.dark-theme .bug-report-page .table th {
  background-color: rgba(7, 31, 67, .62) !important;
  border-color: rgba(112, 169, 232, .28) !important;
}

html.dark-theme [class*="-page"] .table thead th,
html.dark-theme [class*="-page"] .table-light > * > *,
html.dark-theme [class*="-page"] .table-dark > * > * {
  background-color: rgba(15, 48, 91, .88) !important;
  border-color: rgba(112, 169, 232, .32) !important;
}

html.dark-theme [class*="-page"] .filter-btn:not(.active),
html.dark-theme [class*="-page"] .btn-outline-dark {
  background: rgba(15, 48, 91, .8) !important;
  border-color: rgba(112, 169, 232, .42) !important;
}

html.dark-theme [class*="-page"] .form-control,
html.dark-theme [class*="-page"] .form-select,
html.dark-theme [class*="-page"] input,
html.dark-theme [class*="-page"] textarea,
html.dark-theme [class*="-page"] .rich-editor,
html.dark-theme .bug-report-page .form-control,
html.dark-theme .bug-report-page input,
html.dark-theme .bug-report-page textarea {
  background-color: rgba(3, 18, 43, .86) !important;
  border-color: rgba(112, 169, 232, .42) !important;
}

html.dark-theme .section-card,
html.dark-theme .stats-card,
html.dark-theme .initiatives-card,
html.dark-theme .feature-card,
html.dark-theme .party-tabs,
html.dark-theme .party-card,
html.dark-theme .party-card-body,
html.dark-theme .party-card-body .accordion,
html.dark-theme .party-card-body .accordion-item,
html.dark-theme .party-card-body .accordion-body {
  color: #e5e7eb !important;
  background: rgba(7, 31, 67, .78) !important;
  border-color: rgba(112, 169, 232, .28) !important;
}

html.dark-theme .feature-card,
html.dark-theme .feature-card:hover {
  color: #e5e7eb !important;
  background: linear-gradient(145deg, rgba(15, 48, 91, .86), rgba(7, 31, 67, .74)) !important;
}

html.dark-theme .hero-copy h1,
html.dark-theme .parties-registry-page h1,
html.dark-theme .parties-registry-page h2,
html.dark-theme .parties-registry-page h3,
html.dark-theme .parties-registry-page h4,
html.dark-theme .parties-registry-page h5,
html.dark-theme .parties-registry-page h6,
html.dark-theme .section-card h1,
html.dark-theme .section-card h2,
html.dark-theme .section-card h3,
html.dark-theme .section-card h4,
html.dark-theme .section-card h5,
html.dark-theme .section-card h6,
html.dark-theme .stats-card h1,
html.dark-theme .stats-card h2,
html.dark-theme .stats-card h3,
html.dark-theme .stats-card h4,
html.dark-theme .stats-card h5,
html.dark-theme .stats-card h6,
html.dark-theme .initiatives-card h1,
html.dark-theme .initiatives-card h2,
html.dark-theme .initiatives-card h3,
html.dark-theme .initiatives-card h4,
html.dark-theme .initiatives-card h5,
html.dark-theme .initiatives-card h6,
html.dark-theme .feature-card h1,
html.dark-theme .feature-card h2,
html.dark-theme .feature-card h3,
html.dark-theme .feature-card h4,
html.dark-theme .feature-card h5,
html.dark-theme .feature-card h6,
html.dark-theme .party-card-body p strong,
html.dark-theme .party-card-body h6,
html.dark-theme .party-card-body .accordion-button,
html.dark-theme .party-card-body .accordion-button strong {
  color: #f3f4f6 !important;
}

html.dark-theme .hero-copy p,
html.dark-theme .parties-heading p,
html.dark-theme .section-card p,
html.dark-theme .stats-card p,
html.dark-theme .initiatives-card p,
html.dark-theme .feature-card p,
html.dark-theme .party-card-body p,
html.dark-theme .party-card-body li,
html.dark-theme .party-card-body td,
html.dark-theme .party-card-body label,
html.dark-theme .party-card-body .text-secondary {
  color: #c3cfde !important;
}

html.dark-theme .party-tabs .nav-link {
  color: #c3cfde !important;
}

html.dark-theme .party-tabs .nav-link:hover {
  color: #fff !important;
  background: #2d4666 !important;
}

html.dark-theme .parties-registry-page .text-center.py-5 {
  color: #dbe5f1 !important;
  background: #273449 !important;
  border-color: #40516a !important;
}

html.dark-theme .party-members-table thead th {
  color: #f3f4f6 !important;
  background: #273449 !important;
  border-color: #40516a !important;
}

html.dark-theme .party-members-table tbody td {
  color: #e5e7eb !important;
  border-color: #40516a !important;
}
/* Система баллов в админ-панели партий */
.point-party-card .card-body {
    min-width: 0;
}
.point-party-card details {
    overflow-x: auto;
}
.point-party-card .table {
    font-size: .88rem;
}
.point-action-modal .modal-content {
    border: 1px solid rgba(13, 110, 253, .35);
}
.point-action-modal textarea {
    resize: vertical;
}
.party-points-balance {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 9rem;
    padding: .45rem .8rem;
    border-radius: .5rem;
    font-weight: 700;
    color: #fff;
}
.party-points-balance.points-positive { background: #198754; }
.party-points-balance.points-zero { background: #6c757d; }
.party-points-balance.points-negative { background: #dc3545; }
.party-points-history { min-width: 0; }
.party-points-history .table { min-width: 620px; }
.fed-regional-points { min-width: 0; }
html.dark-theme .point-party-card,
html.dark-theme .point-party-card .card-body,
html.dark-theme #pane-admin-points .card {
    background: #16243a;
    color: #eef5ff;
    border-color: #3f5875;
}
html.dark-theme #pane-admin-points .form-control,
html.dark-theme #pane-admin-points .input-group-text {
    background: #0b1a31;
    color: #eef5ff;
    border-color: #496584;
}
html.dark-theme #pane-admin-points .form-text,
html.dark-theme #pane-admin-points .text-muted {
    color: #b9cbe0 !important;
}
html.dark-theme #pane-admin-points .table {
    --bs-table-bg: transparent;
    --bs-table-color: #eef5ff;
    --bs-table-border-color: #496584;
}
/* Стили реакций и служебной информации в журнале заседания. */
.meeting-agenda-table .bill-reaction-btn,
.meeting-agenda-journal .bill-reaction-btn {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .55rem !important;
  width: 5.7rem !important;
  min-width: 5.7rem !important;
  min-height: 2.7rem !important;
  padding: .45rem .8rem !important;
  color: #f4f8ff !important;
  background: #6c757d !important;
  border: 1px solid #87919a !important;
  border-radius: .45rem !important;
  line-height: 1 !important;
}

.meeting-agenda-table .bill-reaction-btn:hover,
.meeting-agenda-journal .bill-reaction-btn:hover,
.meeting-agenda-table .bill-reaction-btn:focus,
.meeting-agenda-journal .bill-reaction-btn:focus {
  color: #ffffff !important;
  background: #7d8790 !important;
  border-color: #b9c0c5 !important;
}

.meeting-agenda-table .bill-reaction-icon,
.meeting-agenda-journal .bill-reaction-icon {
  width: 1rem !important;
  height: 1rem !important;
  fill: currentColor !important;
  display: block !important;
}

.meeting-agenda-meta {
  margin-top: .2rem;
  font-size: .78rem;
  font-weight: 400;
  line-height: 1.35;
  color: #6c7d92;
}

html.dark-theme .meeting-agenda-meta {
  color: #b9cbe0 !important;
}

/* Финальное правило: кнопки реакций всегда горизонтальные на всех страницах. */
html body button.bill-reaction-btn,
html body .bill-reaction-btn {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  width: 64px !important;
  min-width: 64px !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 4px 8px !important;
  color: #fff !important;
  background-color: #6c757d !important;
  border: 1px solid #87919a !important;
  border-radius: 5px !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}

html body button.bill-reaction-btn:hover,
html body .bill-reaction-btn:hover {
  color: #fff !important;
  background-color: #7d8790 !important;
}

html body .bill-reaction-btn .bill-reaction-icon,
html body button.bill-reaction-btn svg {
  display: block !important;
  flex: 0 0 16px !important;
  width: 16px !important;
  height: 16px !important;
  margin: 0 !important;
  fill: currentColor !important;
}

/* Иконка текущей реакции пользователя подсвечивается темно-синим. */
html body .bill-interactions[data-current-reaction="LIKE"] form:has(input[name="reaction"][value="LIKE"]) .bill-reaction-icon,
html body .bill-interactions[data-current-reaction="DISLIKE"] form:has(input[name="reaction"][value="DISLIKE"]) .bill-reaction-icon {
  color: #0b2a54 !important;
  fill: #0b2a54 !important;
}

html body .bill-reaction-icon-active {
  color: #0b2a54 !important;
  fill: #0b2a54 !important;
}

html body .bill-reaction-btn > span {
  display: inline-block !important;
  line-height: 1 !important;
}

html body .bill-interactions-inline {
  border-top: 1px solid rgba(130, 150, 175, .35) !important;
  background: transparent !important;
}

.bills-table .bill-title-cell {
  vertical-align: top !important;
}

.initiative-inline-interactions {
  display: block;
  width: 100%;
  margin-top: .75rem;
  font-weight: 400;
}

.initiative-inline-interactions .bill-interactions-inline {
  margin-top: 0 !important;
  padding-top: .65rem !important;
}

html body button.bill-reaction-btn.btn-success {
  background-color: #198754 !important;
  border-color: #198754 !important;
}

html body button.bill-reaction-btn.btn-danger {
  background-color: #dc3545 !important;
  border-color: #dc3545 !important;
}

/* Компактные кнопки реакций без разделительной полосы от заголовка инициативы. */
html body button.bill-reaction-btn,
html body .bill-reaction-btn {
  width: 48px !important;
  min-width: 48px !important;
  height: 27px !important;
  min-height: 27px !important;
  padding: 2px 5px !important;
  gap: 3px !important;
  border-radius: 4px !important;
  font-size: .82rem !important;
}

html body .bill-reaction-btn .bill-reaction-icon,
html body button.bill-reaction-btn svg {
  flex-basis: 13px !important;
  width: 13px !important;
  height: 13px !important;
}

html body .bill-interactions-inline {
  border-top: 0 !important;
  padding-top: 0 !important;
}

.bill-comment-delete {
  padding: .1rem .35rem !important;
  font-size: .7rem !important;
  line-height: 1.1 !important;
}

/* Редактор постановлений губернатора. */
.governor-document-generator .gov-document-preview-wrap {
  overflow-x: auto;
  padding: 1rem;
  background: rgba(108, 117, 125, .12);
  border-radius: .5rem;
}

.gov-document-sheet {
  position: relative;
  box-sizing: border-box;
  width: 794px;
  min-height: 1123px;
  margin: 0 auto;
  padding: 62px 72px 70px;
  color: #111;
  background: #fff;
  border: none;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.gov-document-sheet:focus {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

.gov-document-crest {
  margin-bottom: .4rem;
  color: #b78b24;
  font-size: 3rem;
  line-height: 1;
  text-align: center;
}

.governor-document-template-mono .gov-document-crest {
  color: #222;
  filter: grayscale(1);
}

.gov-document-state,
.gov-document-server {
  font-weight: 700;
  text-align: center;
  letter-spacing: .04em;
}

.gov-document-server {
  margin-top: .2rem;
  font-size: .95rem;
}

.gov-document-sheet h1 {
  margin: 2.8rem 0 .6rem;
  font-size: 1.55rem;
  text-align: center;
}

.gov-document-number-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  font-size: 1rem;
}

.gov-document-sheet h2 {
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
  text-align: center;
}

.gov-document-editable-content {
  min-height: 420px;
  font-size: 1.05rem;
}

.gov-document-editable-content p {
  margin: 0 0 1rem;
}

.gov-document-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 3rem;
  font-size: 1rem;
}

.gov-document-signature-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 180px;
  min-height: 72px;
  text-align: center;
}

.gov-document-signature-placeholder {
  color: #777;
  font-size: .8rem;
}

.gov-document-signature-image {
  display: block;
  max-width: 180px;
  max-height: 90px;
  object-fit: contain;
}

.gov-document-date {
  margin-top: 2rem;
  font-size: .95rem;
  text-align: right;
}

html.dark-theme .governor-document-generator .gov-document-preview-wrap {
  background: rgba(0, 0, 0, .2);
}

@media (max-width: 850px) {
  .gov-document-sheet {
    margin-left: 0;
  }
}

/* Макет указа по DOCX-шаблону Кутузовского округа. */
.gov-document-sheet {
  width: 794px;
  min-height: 1123px;
  padding: 48px 70px 58px;
  font-family: 'Times New Roman', Times, serif;
  font-size: 18px;
  line-height: 1.55;
}

.gov-document-crest {
  height: 150px;
  margin: 0 auto 28px;
  text-align: center;
}

.gov-document-crest img {
  width: 150px;
  height: 150px;
  object-fit: contain;
}

.governor-document-template-mono .gov-document-crest img {
  filter: grayscale(1);
}

/* Печать всегда остается цветной, даже при черно-белом гербе. */
.governor-document-template-mono .gov-document-seal-image {
  filter: none !important;
}

.gov-document-title {
  margin-bottom: 22px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: .28em;
  text-align: center;
}

.gov-document-subtitle {
  margin-bottom: 12px;
  font-size: 21px;
  text-align: center;
  text-transform: uppercase;
}

.gov-document-subtitle-small {
  margin: 0 auto 42px;
  max-width: 690px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.7;
  text-transform: none;
}

.gov-document-editable-content {
  min-height: 430px;
  font-size: 19px;
  text-align: justify;
}

.gov-document-editable-content > p {
  margin: 0 0 24px;
  text-indent: 1.8em;
}

.gov-document-ruling {
  margin: 14px 0 18px;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  letter-spacing: .16em;
}

.gov-document-laws {
  margin: 0 0 10px;
  padding-left: 2.2em;
}

.gov-document-laws li {
  padding-left: .55em;
  margin-bottom: 8px;
}

.gov-document-standard-laws {
  margin-top: 2px;
}

.gov-document-footer {
  display: grid;
  grid-template-columns: 1fr 190px 1fr;
  align-items: end;
  gap: 10px;
  margin-top: 28px;
  font-size: 18px;
}

.gov-document-position,
.gov-document-governor-name {
  white-space: nowrap;
}

.gov-document-governor-name {
  align-self: end;
  text-align: right;
}

.gov-document-signature-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 190px;
  min-height: 110px;
}

.gov-document-seal-image {
  position: absolute;
  z-index: 1;
  width: 125px;
  height: 125px;
  object-fit: contain;
  opacity: .88;
}

.gov-document-signature-image {
  position: relative;
  z-index: 2;
  width: 180px;
  max-width: 180px;
  max-height: 105px;
  object-fit: contain;
}

.gov-document-signature-placeholder {
  position: relative;
  z-index: 2;
  color: #888;
  font-size: 12px;
  text-align: center;
}

.gov-document-requisites {
  margin-top: 24px;
  font-size: 18px;
  line-height: 1.35;
}

/* Позиция печати и загруженной подписи в DOCX-подобном предпросмотре. */
.gov-document-sheet > .gov-document-signature-slot {
  position: absolute;
  left: 390px;
  bottom: 125px;
  z-index: 5;
  width: 190px;
  min-height: 135px;
}

.gov-document-sheet .gov-document-signature-slot .gov-document-seal-image {
  width: 145px;
  height: 145px;
}

/* Документ всегда остаётся чёрным на белом фоне, независимо от темы сайта. */
html.dark-theme .gov-document-sheet,
html.dark-theme .gov-document-sheet * {
  color: #000000 !important;
  background-color: transparent !important;
}

html.dark-theme .gov-document-sheet {
  background: #ffffff !important;
}

.gov-document-sheet,
.gov-document-sheet * {
  color: #000000;
}

.gov-document-sheet {
  height: auto;
  max-height: none;
  overflow: visible;
  page-break-after: auto;
}

.gov-document-sheet > .gov-document-footer {
  position: relative;
  left: auto;
  bottom: auto;
  display: grid;
  grid-template-columns: 260px 210px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 155px;
  margin-top: 38px;
  gap: 16px;
}

.gov-document-sheet > .gov-document-footer .gov-document-position {
  white-space: nowrap;
  text-align: left;
}

.gov-document-sheet > .gov-document-footer .gov-document-governor-name {
  white-space: normal;
  text-align: right;
  align-self: center !important;
}

.gov-document-sheet > .gov-document-signature-slot {
  position: relative;
  left: auto;
  bottom: auto;
  width: 210px;
  min-height: 145px;
}

.gov-document-sheet > .gov-document-requisites {
  margin-top: 12px;
  text-align: left;
}

.gov-document-sheet ol {
  color: #000000 !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
  list-style-position: inside !important;
}

.gov-document-sheet ol > li {
  padding-left: 0 !important;
  text-indent: 1.25cm !important;
}

.gov-document-sheet ol > li > p {
  display: inline !important;
  text-indent: 0 !important;
}

.gov-document-sheet .deputy-main-list {
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 0 !important;
}

.gov-document-sheet .deputy-standard-list {
  margin-top: 0;
}

.gov-document-sheet .deputy-bills-placeholder-list {
  margin-top: 6px;
  margin-left: 0;
}

.gov-document-sheet .deputy-bill-item {
  margin: 0 0 6px;
  padding-left: 0 !important;
  text-indent: 1.25cm !important;
}

/* Красная строка документа: отступается только первая строка, переносы
   остаются на исходной линии текста. */
.gov-document-sheet p,
.gov-document-sheet .deputy-bill-item {
  text-indent: 1.25cm !important;
}

.gov-document-sheet p[align="center"],
.gov-document-sheet p[style*="text-align: center"],
.gov-document-sheet table p,
.gov-document-sheet .gov-document-footer p,
.gov-document-sheet .gov-document-requisites p {
  text-indent: 0 !important;
}

/* DOCX-шаблон ПЗС содержит широкую таблицу подписи. Ограничиваем её
   шириной листа, чтобы ФИО ПЗС не уезжало за правую границу. */
.gov-document-sheet table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed;
}

.gov-document-sheet table td {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}

.gov-document-sheet table td:last-child {
  text-align: right !important;
}

@media (max-width: 700px) {
  .gov-document-sheet > .gov-document-footer {
    grid-template-columns: 1fr 1fr;
  }

  .gov-document-sheet > .gov-document-footer .gov-document-signature-slot {
    grid-column: 1 / -1;
    justify-self: center;
  }
}

.archive-bill-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
  padding: .85rem 1rem;
}

.archive-bill-details > summary::-webkit-details-marker {
  display: none;
}

.archive-bill-details > summary::before {
  content: '▶';
  flex: 0 0 auto;
  margin-right: .35rem;
  color: #6c8fb8;
  font-size: .8rem;
}

.archive-bill-details[open] > summary::before {
  content: '▼';
}

.archive-bill-details > summary h6 {
  flex: 1 1 auto;
}

.archive-bill-details[open] > summary {
  border-bottom: 1px solid #dce8f5;
}

.archive-bill-details > summary.archive-bill-summary {
  display: block;
  position: relative;
}

.archive-bill-details > summary.archive-bill-summary::before {
  position: absolute;
  top: .95rem;
  left: 1rem;
  margin-right: 0;
}

.archive-bill-summary .archive-bill-heading {
  padding-left: 1.35rem;
}

.archive-bill-summary .archive-bill-heading {
  min-width: 0;
}

.archive-bill-summary .archive-bill-heading h6 {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.archive-bill-summary .archive-bill-status {
  flex: 0 0 auto;
  text-align: right;
}

.archive-bill-summary .archive-bill-meta {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.deputy-resolution-details {
  border: 1px solid var(--border-color, #cbd8e8);
  border-radius: .5rem;
  overflow: hidden;
  background: var(--card-bg, #fff);
}

.deputy-resolution-details > summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  cursor: pointer;
  list-style: none;
}

.deputy-resolution-details > summary::-webkit-details-marker {
  display: none;
}

.deputy-resolution-details > summary::before {
  content: '▶';
  flex: 0 0 auto;
  margin-top: .2rem;
  color: #6c8fb8;
  font-size: .8rem;
}

.deputy-resolution-details[open] > summary::before {
  content: '▼';
}

.deputy-resolution-heading {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.deputy-resolution-heading strong,
.deputy-resolution-heading .text-muted {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.deputy-resolution-sign {
  flex: 0 0 auto;
  white-space: nowrap;
}

.deputy-resolution-content {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--border-color, #cbd8e8);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.deputy-resolution-content .resolution-text {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-line;
}

html.dark-theme .deputy-resolution-details {
  background: #102644;
  border-color: #31557e;
}

html.dark-theme .deputy-resolution-content {
  border-color: #31557e;
}

.meeting-room-page #registeredUsersList .badge,
.meeting-room-page .meeting-voters-table .badge,
.meeting-room-page .meeting-vote-results-table .badge {
  display: inline-block;
  max-width: 100%;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.2;
  vertical-align: middle;
}

.meeting-room-page .meeting-voters-table td,
.meeting-room-page .meeting-vote-results-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ФИО остаются обычным текстом, даже когда темная тема задает цвет всем ссылкам внутри карточки. */
html body .bills-page a.profile-name-link,
html body .bills-page a.profile-name-link:hover,
html body .parties-registry-page a.profile-name-link,
html body .parties-registry-page a.profile-name-link:hover,
html body .deputies-page a.profile-name-link,
html body .deputies-page a.profile-name-link:hover,
html body .senators-page a.profile-name-link,
html body .senators-page a.profile-name-link:hover,
html body .meeting-room-page .meeting-agenda-journal a.profile-name-link,
html body .meeting-room-page .meeting-agenda-journal a.profile-name-link:hover {
  color: #000 !important;
  text-decoration: none !important;
}

html.dark-theme body .bills-page a.profile-name-link,
html.dark-theme body .bills-page a.profile-name-link:hover,
html.dark-theme body .parties-registry-page a.profile-name-link,
html.dark-theme body .parties-registry-page a.profile-name-link:hover,
html.dark-theme body .deputies-page a.profile-name-link,
html.dark-theme body .deputies-page a.profile-name-link:hover,
html.dark-theme body .senators-page a.profile-name-link,
html.dark-theme body .senators-page a.profile-name-link:hover,
html.dark-theme body .meeting-room-page .meeting-agenda-journal a.profile-name-link,
html.dark-theme body .meeting-room-page .meeting-agenda-journal a.profile-name-link:hover,
html.dark-theme body .archive-page a.profile-name-link,
html.dark-theme body .archive-page a.profile-name-link:hover {
  color: #fff !important;
  text-decoration: none !important;
}

html body .archive-page a.profile-name-link,
html body .archive-page a.profile-name-link:hover {
  color: #000 !important;
  text-decoration: none !important;
}

/* Bootstrap/theme rule for all links on dark pages must not recolor profile names. */
html.dark-theme body .bills-page a.profile-name-link:not(.badge):not(.btn),
html.dark-theme body .parties-registry-page a.profile-name-link:not(.badge):not(.btn),
html.dark-theme body .archive-page a.profile-name-link:not(.badge):not(.btn),
html.dark-theme body .deputies-page a.profile-name-link:not(.badge):not(.btn),
html.dark-theme body .senators-page a.profile-name-link:not(.badge):not(.btn),
html.dark-theme body .meeting-room-page a.profile-name-link:not(.badge):not(.btn) {
  color: #fff !important;
  text-decoration: none !important;
}

html body .bills-page a.profile-name-link:not(.badge):not(.btn),
html body .parties-registry-page a.profile-name-link:not(.badge):not(.btn),
html body .archive-page a.profile-name-link:not(.badge):not(.btn),
html body .deputies-page a.profile-name-link:not(.badge):not(.btn),
html body .senators-page a.profile-name-link:not(.badge):not(.btn),
html body .meeting-room-page a.profile-name-link:not(.badge):not(.btn) {
  color: #000 !important;
  text-decoration: none !important;
}

/* Кабинеты: имена и логины не должны наследовать голубой цвет ссылок темы. */
html body .admin-page a.profile-name-link:not(.badge):not(.btn),
html body .president-cabinet-page a.profile-name-link:not(.badge):not(.btn),
html body .deputy-cabinet-page a.profile-name-link:not(.badge):not(.btn),
html body .governor-cabinet-page a.profile-name-link:not(.badge):not(.btn),
html body .psf-cabinet-page a.profile-name-link:not(.badge):not(.btn),
html body .sf-cabinet-page a.profile-name-link:not(.badge):not(.btn),
html body .fed-cabinet-page a.profile-name-link:not(.badge):not(.btn),
html body .party-cabinet-page a.profile-name-link:not(.badge):not(.btn),
html body .my-party-page a.profile-name-link:not(.badge):not(.btn) {
  color: #000 !important;
  text-decoration: none !important;
}

html.dark-theme body .admin-page a.profile-name-link:not(.badge):not(.btn),
html.dark-theme body .president-cabinet-page a.profile-name-link:not(.badge):not(.btn),
html.dark-theme body .deputy-cabinet-page a.profile-name-link:not(.badge):not(.btn),
html.dark-theme body .governor-cabinet-page a.profile-name-link:not(.badge):not(.btn),
html.dark-theme body .psf-cabinet-page a.profile-name-link:not(.badge):not(.btn),
html.dark-theme body .sf-cabinet-page a.profile-name-link:not(.badge):not(.btn),
html.dark-theme body .fed-cabinet-page a.profile-name-link:not(.badge):not(.btn),
html.dark-theme body .party-cabinet-page a.profile-name-link:not(.badge):not(.btn),
html.dark-theme body .my-party-page a.profile-name-link:not(.badge):not(.btn) {
  color: #fff !important;
  text-decoration: none !important;
}

/* Загрузка аватара не должна превращаться в белую кнопку при наведении. */
.avatar-file-input {
  padding: .3rem !important;
  color: #102b55 !important;
  background: #fff !important;
  border: 1px solid #6b8db5 !important;
  border-radius: .45rem !important;
}

.avatar-file-input::file-selector-button {
  margin: 0 .75rem 0 0 !important;
  padding: .45rem .8rem !important;
  color: #fff !important;
  background: #1767b1 !important;
  border: 0 !important;
  border-radius: .3rem !important;
  cursor: pointer;
}

.avatar-file-input:hover {
  color: #102b55 !important;
  background: #fff !important;
  border-color: #1767b1 !important;
}

.avatar-file-input:hover::file-selector-button {
  color: #fff !important;
  background: #0f5594 !important;
}

html.dark-theme body .avatar-file-input {
  color: #fff !important;
  background: #071d3d !important;
  border-color: #4f79a7 !important;
}

html.dark-theme body .avatar-file-input:hover {
  color: #fff !important;
  background: #071d3d !important;
}

/* В полном составе партии hover не должен выбеливать строку и терять контраст текста. */
html.dark-theme body .my-party-page .table-hover > tbody > tr:hover > *,
html.dark-theme body .my-party-page .table-hover > tbody > tr:hover,
html.dark-theme body .my-party-page .table-hover > tbody > tr:hover a.profile-name-link {
  color: #fff !important;
  background-color: #273b56 !important;
}

html.dark-theme body .my-party-page .table tbody tr.table-info > *,
html.dark-theme body .my-party-page .table tbody tr.table-info:hover > * {
  color: #fff !important;
  background-color: #273b56 !important;
  border-color: #416486 !important;
}

.public-profile-main {
  padding: 10px;
}

.public-profile-main .profile-avatar-large {
  flex: 0 0 auto;
  margin: 4px;
}

.public-profile-parties .party-card-header img {
  width: 42px !important;
  height: 42px !important;
  object-fit: contain;
  border-radius: 7px !important;
}

.public-party-members,
.public-party-positions {
  border: 1px solid #dce8f2;
  border-radius: 7px;
  overflow: hidden;
}

.public-party-members > summary,
.public-party-positions > summary {
  padding: 11px 14px;
  color: #233b60;
  background: #f4f8fc;
  cursor: pointer;
  font-weight: 700;
}

.public-party-members > summary::marker,
.public-party-positions > summary::marker {
  color: #0878f9;
}

.public-profile-bills-wrap {
  overflow-x: auto;
}

/* Блок законопроектов не должен иметь внешнюю рамку заголовка. */
.public-profile-bills {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.public-profile-bills .bills-table {
  min-width: 980px;
}

html.dark-theme body .public-profile-main,
html.dark-theme body .public-profile-parties,
html.dark-theme body .public-profile-bills {
  color: #fff;
}

html.dark-theme body .public-party-members,
html.dark-theme body .public-party-positions {
  border-color: #31557e;
}

html.dark-theme body .public-party-members > summary,
html.dark-theme body .public-party-positions > summary {
  color: #fff;
  background: #17375f;
}

html.dark-theme body .public-profile-bills .table-wrap {
  background: #0b2a54;
  border-color: #31557e;
}
