:root {
  --bg: #f4fbff;
  --surface: #ffffff;
  --surface-soft: #ecfbff;
  --line: #ccebf3;
  --text: #10394a;
  --muted: #5f7884;
  --brand: #19c0d1;
  --brand-deep: #116f8f;
  --brand-light: #48d3e0;
  --brand-sky: #ccecff;
  --brand-mint: #b8ffc7;
  --brand-sun: #ebffa3;
  --brand-rose: #ff99b8;
  --accent: #ff291f;
  --warning: var(--brand-sun);
  --shadow: 0 18px 45px rgba(17, 111, 143, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(180deg, var(--bg) 0%, #fbfff2 100%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.34;
}

a {
  color: inherit;
  text-decoration: none;
}

.sidebar {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  padding: 24px 18px;
  background: linear-gradient(180deg, #ffffff 0%, var(--brand-sky) 72%, #f8ffe7 100%);
  border-right: 1px solid var(--line);
  transition: transform 0.2s ease;
  z-index: 10;
}

.sidebar-toggle,
.sidebar-restore {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--brand-deep);
}

.sidebar-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
}

.sidebar-restore {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 9;
  display: none;
  box-shadow: var(--shadow);
}

.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
}

.sidebar-collapsed .main {
  margin-left: 0;
}

.sidebar-collapsed .sidebar-restore {
  display: inline-flex;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  margin: 14px 48px 30px 0;
  color: var(--brand-deep);
  font-size: 18px;
  font-weight: 700;
}

.sidebar-map-link {
  display: flex;
  align-items: center;
  width: fit-content;
  min-height: 34px;
  margin-right: 48px;
  padding: 0 10px;
  border: 1px solid rgba(25, 192, 209, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand-deep);
  font-size: 14px;
  font-weight: 700;
}

.sidebar-map-link:hover {
  background: rgba(25, 192, 209, 0.14);
}

.brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--brand-deep);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.18;
}

.nav a:hover {
  background: rgba(25, 192, 209, 0.14);
}

.user-box {
  display: grid;
  gap: 6px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
}

.user-box button,
.user-box a {
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-deep);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.user-box .sidebar-about-link {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(25, 192, 209, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.user-box .sidebar-about-link:hover {
  background: rgba(25, 192, 209, 0.14);
}

.main {
  min-height: 100vh;
  margin-left: 248px;
  padding: 32px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.site-map-hero {
  align-items: center;
  min-height: 124px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(25, 192, 209, 0.14), rgba(184, 255, 199, 0.34)),
    var(--surface);
  box-shadow: var(--shadow);
}

.site-map-hero h1 {
  color: var(--brand-deep);
}

.site-map-hero p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.36;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
  line-height: 1.3;
}

.actions,
.action-grid,
.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.actions form {
  margin: 0;
}

.language-switcher {
  display: grid;
  gap: 8px;
}

.sidebar-language {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.language-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.language-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--brand-deep);
  font-size: 13px;
}

.language-button:hover,
.language-button.is-active {
  background: var(--brand-deep);
  color: #ffffff;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--brand-deep);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.button:hover,
button:hover {
  background: #0d5f79;
}

.button.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--brand-deep);
}

.button.secondary:hover {
  background: var(--brand-sky);
}

.button.danger {
  background: var(--accent);
  color: #ffffff;
}

.button.danger:hover {
  background: #d91f17;
}

.blacklist-button {
  background: var(--brand-rose);
  color: #7d1231;
}

.blacklist-button:hover {
  background: #ff7fa6;
}

.edit-button {
  background: var(--brand-light);
  color: #06485d;
}

.edit-button:hover {
  background: var(--brand);
  color: #ffffff;
}

.compact-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.clear-section-button {
  border-color: #d7edf5;
  background: #f7fdff;
  color: var(--brand-deep);
}

.clear-section-button:hover {
  background: var(--brand-sky);
}

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

.stat-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat-card {
  display: grid;
  gap: 10px;
  min-height: 108px;
  padding: 18px;
  border-top: 4px solid var(--brand-light);
}

.stat-card:nth-child(2n) {
  border-top-color: var(--brand-mint);
}

.stat-card:nth-child(3n) {
  border-top-color: var(--brand-sun);
}

.stat-card:nth-child(4n) {
  border-top-color: var(--brand-rose);
}

.stat-card span,
.panel-header span,
.muted {
  color: var(--muted);
}

.stat-card strong {
  color: var(--brand-deep);
  font-size: 34px;
  line-height: 1;
}

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

.vertical-stack {
  display: grid;
  gap: 18px;
}

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

.workflow-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 190px;
  border-top: 4px solid var(--brand-light);
}

.workflow-card .text-block {
  align-content: start;
}

.workflow-card-sky {
  border-top-color: var(--brand-light);
  background: linear-gradient(180deg, #ffffff 0%, #f0fdff 100%);
}

.workflow-card-mint {
  border-top-color: var(--brand-mint);
  background: linear-gradient(180deg, #ffffff 0%, #f2fff5 100%);
}

.workflow-card-sun {
  border-top-color: var(--brand-sun);
  background: linear-gradient(180deg, #ffffff 0%, #fbffe8 100%);
}

.workflow-card-rose {
  border-top-color: var(--brand-rose);
  background: linear-gradient(180deg, #ffffff 0%, #fff4f8 100%);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.panel-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.panel + .panel,
.content-grid + .content-grid,
.content-grid + .panel,
.panel + .content-grid {
  margin-top: 18px;
}

.content-grid > .panel + .panel,
.workflow-grid > .panel + .panel {
  margin-top: 0;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  line-height: 1.18;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.table-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 0;
}

.panel-header .table-tools {
  align-items: center;
}

.column-picker {
  position: relative;
}

.column-picker summary {
  list-style: none;
}

.column-picker summary::-webkit-details-marker {
  display: none;
}

.column-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 12;
  display: grid;
  gap: 8px;
  width: min(280px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.column-picker-actions {
  display: flex;
  gap: 8px;
}

.column-picker label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.18;
  text-transform: none;
}

tbody tr:hover {
  background: var(--surface-soft);
}

.search {
  display: flex;
  gap: 8px;
  width: min(460px, 100%);
}

.search input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
}

.search button {
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.search button:hover {
  background: var(--brand-deep);
}

.search-strip {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px 18px;
  border-color: #d9eef5;
  border-left: 6px solid rgba(72, 211, 224, 0.62);
  background: linear-gradient(90deg, #f7fff0 0%, #effcf8 48%, #eefbff 100%);
  box-shadow: 0 12px 28px rgba(17, 111, 143, 0.11);
}

.search-strip label {
  flex: 1;
  min-width: 0;
}

.search-strip button {
  flex: 0 0 auto;
}

.filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
}

.record-form {
  display: grid;
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 14px;
  padding: 14px 18px 16px;
}

.personal-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.personal-form-grid .personal-field-inn,
.personal-form-grid .personal-field-snils {
  grid-column: 1 / -1;
}

.project-stage-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.project-stage-field {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.project-stage-field strong {
  color: var(--brand-deep);
  font-size: 13px;
}

.project-stage-field.stage-color-1 {
  border-color: var(--brand-light);
  background: #ecfbff;
}

.project-stage-field.stage-color-2 {
  border-color: var(--brand-mint);
  background: #effff2;
}

.project-stage-field.stage-color-3 {
  border-color: var(--brand-sun);
  background: #fbffe3;
}

.project-stage-field.stage-color-4 {
  border-color: var(--brand-rose);
  background: #fff0f5;
}

.project-stage-field.stage-color-5 {
  border-color: var(--accent);
  background: #fff1f0;
}

.compact-form {
  padding: 14px 18px;
}

.compact-form label {
  margin-bottom: 10px;
}

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-transform: none;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(25, 192, 209, 0.18);
  border-color: var(--brand);
}

input,
select {
  height: 36px;
  padding: 0 10px;
}

label:has(input[type="date"]),
label:has(input[type="time"]),
label:has(input[type="datetime-local"]) {
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

input[type="date"],
input[type="time"],
input[type="datetime-local"] {
  width: max-content;
  max-width: none;
}

input[type="date"] {
  min-width: 170px;
}

input[type="time"] {
  min-width: 130px;
}

input[type="datetime-local"] {
  min-width: 230px;
}

textarea {
  min-height: 78px;
  padding: 9px 10px;
  resize: vertical;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-deep);
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
}

.checkbox-line input {
  order: -1;
}

.filter-actions,
.form-actions,
.inline-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-actions {
  align-self: end;
}

.form-actions {
  padding: 0 0 4px;
}

.form-actions a,
.filter-actions a {
  color: var(--brand-deep);
  font-weight: 700;
}

.formset-list {
  display: grid;
  gap: 10px;
  padding: 14px 18px;
}

.formset-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
}

.formset-row.is-deleted {
  display: none;
}

.delete-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.delete-row-button {
  align-self: end;
  border-color: var(--brand-rose);
  color: #9d2018;
}

.delete-row-button:hover {
  background: #fff0f5;
}

.participation-row {
  grid-template-columns: minmax(220px, 1.4fr) minmax(130px, 0.8fr) minmax(150px, 0.8fr) minmax(120px, 0.7fr) minmax(220px, 1.2fr) minmax(100px, 0.4fr);
}

.formset-error {
  padding: 12px 18px 0;
}

.criteria-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.compact-formset-row {
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1fr) minmax(100px, 0.4fr);
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px 18px;
}

.calendar-range-form {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 18px;
}

.calendar-nav,
.calendar-modes {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.calendar-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.7fr);
}

.calendar-grid {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.month-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-month-weeks {
  display: grid;
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.calendar-week {
  position: relative;
  background: var(--line);
}

.calendar-week-days {
  position: relative;
  z-index: 1;
}

.calendar-week .calendar-day-events {
  padding-top: calc(var(--calendar-segment-rows, 0) * 34px);
}

.calendar-week-bars {
  position: absolute;
  top: 36px;
  right: 0;
  left: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: 30px;
  row-gap: 4px;
  pointer-events: none;
}

.calendar-event-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 30px;
  margin: 0 10px;
  padding: 0 10px;
  overflow: hidden;
  border-left: 3px solid var(--brand);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
  line-height: 1.15;
  pointer-events: auto;
}

.calendar-event-bar span {
  flex: 0 0 auto;
  color: var(--brand-deep);
  font-weight: 700;
}

.calendar-event-bar .calendar-event-bar-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event-bar .calendar-event-bar-end {
  margin-left: auto;
}

.calendar-event-bar.continues-before {
  margin-left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.calendar-event-bar.continues-after {
  margin-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.calendar-day {
  display: grid;
  position: relative;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  height: 152px;
  min-height: 0;
  overflow: hidden;
  padding: 10px 10px 36px;
  background: #ffffff;
}

.calendar-day[data-day-open],
.calendar-year-day[data-day-open] {
  cursor: pointer;
}

.calendar-day[data-day-open]:focus,
.calendar-year-day[data-day-open]:focus {
  outline: 3px solid rgba(25, 192, 209, 0.18);
  outline-offset: -3px;
}

.muted-day {
  background: #f5fbfd;
}

.calendar-day-number {
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 700;
}

.calendar-day-events {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  overflow: hidden;
}

.calendar-event-chip {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border-left: 3px solid var(--brand);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
}

.calendar-event-chip span {
  color: var(--brand-deep);
  font-weight: 700;
}

.calendar-event-chip.calendar-project-color-1,
.calendar-event-row.calendar-project-color-1,
.calendar-event-bar.calendar-project-color-1 {
  border-left-color: var(--brand);
  background: #ecfbff;
}

.calendar-event-chip.calendar-project-color-2,
.calendar-event-row.calendar-project-color-2,
.calendar-event-bar.calendar-project-color-2 {
  border-left-color: var(--brand-mint);
  background: #effff2;
}

.calendar-event-chip.calendar-project-color-3,
.calendar-event-row.calendar-project-color-3,
.calendar-event-bar.calendar-project-color-3 {
  border-left-color: var(--brand-sun);
  background: #fbffe3;
}

.calendar-event-chip.calendar-project-color-4,
.calendar-event-row.calendar-project-color-4,
.calendar-event-bar.calendar-project-color-4 {
  border-left-color: var(--brand-rose);
  background: #fff0f5;
}

.calendar-event-chip.calendar-project-color-5,
.calendar-event-row.calendar-project-color-5,
.calendar-event-bar.calendar-project-color-5 {
  border-left-color: var(--accent);
  background: #fff1f0;
}

.calendar-event-chip.calendar-project-color-6,
.calendar-event-row.calendar-project-color-6,
.calendar-event-bar.calendar-project-color-6 {
  border-left-color: var(--brand-deep);
  background: #e9f7ff;
}

.calendar-event-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 28px;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(72, 211, 224, 0.55);
  border-radius: 999px;
  background: var(--brand-deep);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(17, 111, 143, 0.12);
}

.calendar-event-count:hover {
  background: var(--brand);
  color: #ffffff;
}

.calendar-event-count.is-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: var(--muted);
  box-shadow: none;
  opacity: 0.72;
}

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

.calendar-month {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.calendar-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.year-month-weekdays,
.year-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.year-month-weekdays {
  gap: 1px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.year-month-grid {
  gap: 1px;
  background: var(--line);
}

.calendar-year-day {
  display: grid;
  position: relative;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 2px;
  height: 58px;
  min-height: 0;
  overflow: hidden;
  padding: 5px 4px 22px;
  background: #ffffff;
}

.calendar-year-day .calendar-day-number {
  font-size: 10px;
}

.calendar-year-day .calendar-day-events {
  gap: 2px;
}

.calendar-year-day .calendar-event-chip {
  min-height: 16px;
  padding: 2px 4px;
  border-left-width: 2px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.1;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.calendar-year-day .calendar-event-chip span {
  display: none;
}

.calendar-year-day .calendar-event-count {
  right: 3px;
  bottom: 3px;
  min-width: 20px;
  min-height: 18px;
  padding: 0 5px;
  font-size: 10px;
}

.agenda-list {
  display: grid;
  gap: 0;
}

.agenda-day {
  display: grid;
  grid-template-columns: 140px 1fr;
  border-bottom: 1px solid var(--line);
}

.agenda-date {
  padding: 16px 18px;
  color: var(--brand-deep);
  font-weight: 700;
}

.agenda-events {
  display: grid;
  gap: 10px;
  padding: 12px 18px;
}

.calendar-event-row {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  background: #fbfdfe;
  line-height: 1.22;
}

.calendar-event-row p {
  margin: 0;
}

.calendar-day-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 48px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.calendar-day-dialog::backdrop {
  background: rgba(16, 57, 74, 0.34);
}

.calendar-day-dialog-list {
  display: grid;
  gap: 10px;
  max-height: min(620px, calc(100vh - 170px));
  overflow-y: auto;
  padding: 18px;
}

.calendar-event-row.calendar-project-color-1 {
  border-left-color: var(--brand);
}

.calendar-event-row.calendar-project-color-2 {
  border-left-color: var(--brand-mint);
}

.calendar-event-row.calendar-project-color-3 {
  border-left-color: var(--brand-sun);
}

.calendar-event-row.calendar-project-color-4 {
  border-left-color: var(--brand-rose);
}

.calendar-event-row.calendar-project-color-5 {
  border-left-color: var(--accent);
}

.calendar-event-row.calendar-project-color-6 {
  border-left-color: var(--brand-deep);
}

.project-tag.calendar-project-color-1,
.project-tag.calendar-project-color-2,
.project-tag.calendar-project-color-3,
.project-tag.calendar-project-color-4,
.project-tag.calendar-project-color-5,
.project-tag.calendar-project-color-6 {
  border-left: 4px solid var(--brand);
}

.project-tag.calendar-project-color-2 {
  border-left-color: var(--brand-mint);
}

.project-tag.calendar-project-color-3 {
  border-left-color: var(--brand-sun);
}

.project-tag.calendar-project-color-4 {
  border-left-color: var(--brand-rose);
}

.project-tag.calendar-project-color-5 {
  border-left-color: var(--accent);
}

.project-tag.calendar-project-color-6 {
  border-left-color: var(--brand-deep);
}

.pdf-calendar-list {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.pdf-calendar-list iframe {
  width: 100%;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.small-muted {
  font-size: 12px;
}

.field-error {
  color: var(--accent);
  font-size: 12px;
  text-transform: none;
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.message {
  padding: 12px 14px;
  border: 1px solid #83dba0;
  border-radius: 8px;
  background: #eefdf2;
  color: #145d33;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.22;
}

.message.error {
  border-color: var(--brand-rose);
  background: #fff0f0;
  color: #9d2018;
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(140px, 0.45fr) 1fr;
  gap: 0;
  margin: 0;
}

.detail-list dt,
.detail-list dd {
  margin: 0;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  line-height: 1.24;
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.contacts-grid {
  align-items: stretch;
}

.contact-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 260px;
}

.contact-panel-sky {
  border-top: 4px solid var(--brand-light);
  background: linear-gradient(180deg, #ffffff 0%, #f0fdff 100%);
}

.contact-panel-mint {
  border-top: 4px solid var(--brand-mint);
  background: linear-gradient(180deg, #ffffff 0%, #f2fff5 100%);
}

.contact-detail-list {
  align-content: start;
  height: 100%;
}

.contact-detail-list dt,
.contact-detail-list dd {
  border-color: rgba(204, 235, 243, 0.8);
}

.contact-detail-list dd {
  font-weight: 700;
}

.table-link {
  color: var(--brand-deep);
  font-weight: 700;
}

.empty-state,
.text-block,
.feature-list,
.reason-list {
  margin: 0;
  padding: 14px 18px;
}

.text-block {
  display: grid;
  gap: 8px;
  line-height: 1.34;
}

.text-block p {
  margin: 0;
}

.feature-list,
.reason-list {
  display: grid;
  gap: 5px;
  line-height: 1.28;
}

.reason-list {
  padding: 0 0 0 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-fit {
  background: var(--brand-mint);
  color: #145d33;
}

.badge-clarify {
  background: var(--warning);
  color: #5e5b17;
}

.badge-warning {
  background: var(--warning);
  color: #5e5b17;
}

.badge-not_fit {
  background: #fff0f0;
  color: #9d2018;
}

.participation-status {
  border: 1px solid transparent;
}

.participation-status-matched,
.participation-status-included {
  border-color: #83dba0;
  background: var(--brand-mint);
  color: #145d33;
}

.participation-status-clarify {
  border-color: #d8e772;
  background: var(--brand-sun);
  color: #5e5b17;
}

.participation-status-call {
  border-color: #ffb47d;
  background: #fff0df;
  color: #8b3f00;
}

.participation-status-refused,
.participation-status-excluded {
  border-color: #ff9b98;
  background: #fff0f0;
  color: #9d2018;
}

.participation-status-screening {
  border-color: var(--brand-light);
  background: #e7fbff;
  color: #0a6376;
}

.participation-status-randomized {
  border-color: #8bcfff;
  background: #e9f7ff;
  color: var(--brand-deep);
}

.modal {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.modal::backdrop {
  background: rgba(16, 57, 74, 0.34);
}

.modal-panel {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(16, 57, 74, 0.24);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 18px 18px;
}

.analytics-status-grid {
  align-items: stretch;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  grid-auto-rows: 1fr;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.analytics-link {
  justify-content: start;
  width: fit-content;
  min-height: 0;
  padding: 0;
  background: transparent;
  color: var(--brand-deep);
  font-size: 34px;
  line-height: 1;
}

.analytics-link:hover,
.table-value-button:hover {
  background: transparent;
  color: var(--brand);
}

.table-value-button {
  min-height: 0;
  padding: 0;
  background: transparent;
  color: var(--brand-deep);
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.analytics-detail-list {
  display: grid;
  gap: 0;
  max-height: min(620px, calc(100vh - 170px));
  overflow-y: auto;
  padding: 8px 18px 18px;
}

.analytics-detail-row {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.analytics-detail-row span {
  color: var(--muted);
  font-size: 13px;
}

.analytics-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  min-height: 300px;
}

.analytics-panel .table-wrap {
  min-height: 240px;
}

.analytics-status-grid .panel + .panel {
  margin-top: 0;
}

.analytics-volunteer-statuses {
  border-top: 4px solid var(--brand-light);
  background: linear-gradient(180deg, #ffffff 0%, #f0fdff 100%);
}

.analytics-project-statuses {
  border-top: 4px solid var(--brand-light);
  background: linear-gradient(180deg, #ffffff 0%, #f0fdff 100%);
}

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px;
}

.tag-grid span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--brand-sky);
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 700;
}

.site-map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.site-map-intro-panel {
  border-color: rgba(25, 192, 209, 0.38);
  background: linear-gradient(180deg, #ffffff 0%, #f0fdff 100%);
}

.site-map-intro-panel .panel-header {
  border-bottom-color: rgba(25, 192, 209, 0.28);
  background: linear-gradient(90deg, rgba(25, 192, 209, 0.12), rgba(235, 255, 163, 0.24));
}

.site-map-intro-panel h2 {
  color: var(--brand-deep);
}

.site-map-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
  line-height: 1.26;
}

.site-map-card h3,
.site-map-card p {
  margin: 0;
}

.site-map-card h3 {
  color: var(--brand-deep);
  font-size: 15px;
}

.site-map-card.locked {
  border-color: var(--brand-sun);
  background: #fbffe8;
}

.employee-project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 700;
}

.employee-filters {
  grid-template-columns: minmax(260px, 1fr) auto;
}

.login-shell {
  display: grid;
  place-items: start center;
  min-height: calc(100vh - 64px);
  padding-top: 10vh;
}

.login-panel {
  width: min(420px, 100%);
}

.scroll-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  width: 46px;
  min-height: 46px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--brand-deep);
  box-shadow: var(--shadow);
  color: #ffffff;
  font-size: 22px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.scroll-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 920px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 14px 16px;
    transform: none;
  }

  .sidebar-toggle,
  .sidebar-restore {
    display: none;
  }

  .brand {
    margin-bottom: 12px;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav a {
    justify-content: center;
    padding: 0 8px;
  }

  .main {
    margin-left: 0;
    padding: 20px 16px;
  }

  .page-header,
  .content-grid,
  .workflow-grid,
  .calendar-layout,
  .search-strip {
    grid-template-columns: 1fr;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .search-strip {
    align-items: stretch;
    flex-direction: column;
  }

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

  .filters,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-stage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-status-grid {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }

  .site-map-grid,
  .employee-filters {
    grid-template-columns: 1fr;
  }

  .formset-row,
  .criteria-row,
  .compact-formset-row,
  .participation-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .year-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .filters,
  .form-grid,
  .personal-form-grid,
  .project-stage-grid,
  .formset-row,
  .criteria-row,
  .compact-formset-row,
  .participation-row,
  .detail-list {
    grid-template-columns: 1fr;
  }

  .month-grid,
  .year-grid,
  .agenda-day {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 8px 10px;
  }
}
