:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --border: #d9deea;
  --text: #14213d;
  --muted: #64748b;
  --primary: #2563eb;
  --danger: #dc2626;
  --success-bg: #ecfdf3;
  --success-text: #166534;
  --error-bg: #fef2f2;
  --error-text: #b91c1c;
  --warning-bg: #fffbeb;
  --warning-text: #92400e;
  --name-width: 290px;
  --details-width: max-content;
  --day-size: 30px;
  --gap: 6px;
  --row-height: 60px;
  --board-head-height: 88px;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --app-viewport-height: 100dvh;
}


html {
  height: 100%;
  overscroll-behavior: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: none;
}

.page {
  max-width: 1700px;
  margin: 0 auto;
  padding: 18px 28px 28px;
}

.topbar {
  height: 66px;
  min-height: 66px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 18px;
  margin-bottom: 18px;
}

.topbar-brand {
  color: var(--text);
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.menu-shell {
  position: relative;
}

.menu-shell[open] .menu-trigger {
  background: #e8eefc;
  color: var(--primary);
}

.menu-trigger {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  list-style: none;
}

.menu-trigger::-webkit-details-marker {
  display: none;
}

.menu-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 240px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 10px;
  z-index: 20;
}

.menu-link {
  display: block;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.menu-link:hover,
.menu-link.active {
  background: #eef2ff;
  color: var(--primary);
}

.menu-link.danger:hover,
.danger-button:hover {
  background: #fef2f2;
  color: var(--danger);
}

.menu-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.menu-user {
  padding: 4px 12px 0;
  font-size: 13px;
  font-weight: 700;
}

.menu-user-subtext {
  padding: 2px 12px 8px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

.topbar-status-summary {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  flex: 0 1 auto;
  min-width: 0;
}

.topbar-status-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.topbar-status-pill .material-symbols-outlined {
  font-size: 18px;
  line-height: 1;
}

.topbar-status-pill strong {
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.topbar-status-pill--office {
  background: #fff7d6;
  color: #713f12;
}

.topbar-status-pill--home-office {
  background: #ecfdf3;
  color: #166534;
}

.topbar-status-pill--sickness {
  background: #fef2f2;
  color: #991b1b;
}

@media (max-width: 1100px) {
  .topbar-status-summary {
    gap: 6px;
  }

  .topbar-status-pill {
    min-height: 32px;
    padding: 0 8px;
  }

  .topbar-status-label {
    display: none;
  }
}

@media (max-width: 640px) {
  .topbar-status-summary {
    flex: 0 0 auto;
    gap: 4px;
    margin-left: 0;
  }

  .topbar-status-pill {
    min-height: 30px;
    padding: 0 6px;
    gap: 4px;
  }

  .topbar-status-pill .material-symbols-outlined {
    font-size: 17px;
  }

  .topbar-status-pill strong {
    min-width: 18px;
    height: 18px;
    font-size: 11px;
  }
}

.dashboard-month-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 10px 12px;
  margin-bottom: 14px;
}

.dashboard-month-stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dashboard-month-button,
.dashboard-month-arrow {
  min-height: 38px;
  padding: 0 14px;
}

.dashboard-month-arrow {
  min-width: 42px;
  font-size: 18px;
  font-weight: 800;
}

.dashboard-month-label {
  min-width: 150px;
  text-align: center;
  font-weight: 800;
  text-transform: capitalize;
  color: var(--text);
  padding: 0 6px;
}

@media (max-width: 640px) {
  .dashboard-month-toolbar {
    align-items: stretch;
  }

  .dashboard-month-toolbar .dashboard-month-button {
    flex: 1 1 100%;
  }

  .dashboard-month-stepper {
    width: 100%;
    justify-content: space-between;
  }

  .dashboard-month-label {
    min-width: 0;
    flex: 1 1 auto;
  }
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px 18px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

.status-strip strong {
  color: var(--text);
}

.header-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.stat-card,
.legend-panel,
.board-panel,
.admin-card,
.admin-shell {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.stat-card {
  min-width: 170px;
  padding: 14px 16px;
}

.stat-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
}

.legend-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 14px 18px;
  margin-bottom: 20px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.legend-swatch {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.legend-label,
.cell-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.board-panel {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  position: relative;
  display: flex;
  overflow: hidden;
  box-sizing: border-box;
}

/* The board itself is now only the scroll container.
   The visual card/border lives on .board-panel, so no padding/border gap can appear
   between dashboard-scroll and the real scroll area. */
.board {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: auto;
  position: relative;
  isolation: isolate;
  background: var(--panel);
}

.board-grid {
  display: grid;
  gap: 10px 0;
  align-content: start;
  width: max-content;
  min-width: 100%;
}

.board--with-details .board-grid {
  grid-template-columns: var(--name-width) var(--details-width) 1fr;
}

.board--without-details .board-grid {
  grid-template-columns: var(--name-width) 1fr;
}

@media (max-width: 1400px) {
  .board {
    --name-width: 260px;
    --details-width: 320px;
  }
}

@media (max-width: 900px) {
  .board {
    --name-width: 220px;
    --details-width: 300px;
  }
}

.board-head {
  position: sticky;
  top: 0;
  z-index: 120;
  background: var(--panel);
  padding-bottom: 8px;
  isolation: isolate;
}

.board-pinned {
  position: sticky;
  top: var(--board-head-height);
  z-index: 110;
  background: var(--panel);
  isolation: isolate;
  max-height: 38vh;
  max-height: min(38dvh, 360px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  flex: 0 0 auto;
  min-height: 0;
}

.board-pinned::-webkit-scrollbar {
  width: 10px;
}

.board-pinned::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.6);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.board-pinned::-webkit-scrollbar-track {
  background: transparent;
}

.board-pinned[hidden] {
  display: none;
}

.board-pinned:not([hidden]) {
  padding-bottom: 6px;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.board-body {
  position: relative;
  z-index: 1;
}


.person-card[hidden],
.leave-card[hidden],
.board-row[hidden] {
  display: none !important;
}

.sticky-name {
  position: sticky;
  left: 0;
  z-index: 70;
  background: var(--panel);
  background-clip: padding-box;
  isolation: isolate;
  box-shadow: 12px 0 18px -18px rgba(15, 23, 42, 0.35);
}

.board-header {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.board-header-details {
  width: max-content;
  min-width: max-content;
  padding-right: 10px;
  border-bottom: 1px solid var(--border);
}


.board-timeline,
.board-row {
  overflow: visible;
}

.board-timeline {
  background: var(--panel);
}

.board-timeline,
.board-row,
.sticky-name,
.leave-card {
  min-height: var(--row-height);
}

.board-row {
  display: flex;
  align-items: center;
}

.board-timeline,
.day-grid {
  position: relative;
  z-index: 1;
}

.month-grid,
.day-grid {
  display: grid;
  grid-template-columns: repeat(var(--columns), var(--day-size));
  gap: var(--gap);
  min-width: calc(var(--columns) * var(--day-size) + (var(--columns) - 1) * var(--gap));
}

.day-grid {
  align-self: center;
}

.month-grid {
  margin-bottom: 8px;
}

.month-group {
  padding: 10px 10px 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
  color: var(--muted);
}

.day-header,
.day-cell {
  width: var(--day-size);
  height: var(--day-size);
  border-radius: 0;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}

.day-header {
  flex-direction: column;
  background: #eef2f9;
  color: #334155;
  font-size: 11px;
}

.day-header.today,
.day-cell.today {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.day-header.weekend,
.day-header.holiday {
  background: #e5e7eb;
  color: #6b7280;
}

.day-week {
  text-transform: uppercase;
  font-size: 9px;
}

.day-number {
  font-weight: 700;
  font-size: 13px;
}

.person-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px 0 8px;
  min-height: var(--row-height);
}

.pin-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  cursor: pointer;
}

.pin-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pin-toggle-box {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.pin-toggle-box .material-symbols-outlined {
  font-size: 16px;
}

.pin-toggle:hover .pin-toggle-box {
  border-color: #93c5fd;
  color: var(--primary);
}

.pin-toggle-input:checked + .pin-toggle-box {
  background: #dbeafe;
  border-color: #60a5fa;
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.row-pinned {
  background: var(--panel);
}

.board-pinned .person-card,
.board-pinned .leave-card,
.board-pinned .board-row {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.board-pinned .board-row .day-grid,
.board-pinned .leave-card .leave-inline-list,
.board-pinned .person-card {
  background: var(--panel);
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  color: white;
  font-weight: 700;
  font-size: 14px;
  flex: 0 0 auto;
  overflow: visible;
  position: relative;
}

.avatar-image,
.avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.avatar-image {
  display: block;
  object-fit: cover;
}

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.avatar-allowance-badge,
.avatar-carryover-badge {
  position: absolute;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  z-index: 2;
}

.avatar-allowance-badge {
  right: -8px;
  top: -6px;
  background: var(--avatar-allowance-badge-bg, #be4bdb);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.24);
}

.avatar-carryover-badge {
  right: -8px;
  bottom: -6px;
  background: var(--avatar-carryover-badge-bg, #24ebaf);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
}

.person-name {
  font-weight: 600;
}

.person-subtext {
  font-size: 12px;
  color: var(--muted);
}

.person-group-subtext {
  font-size: 12px;
  color: #2563eb;
}

.person-error {
  margin-top: 4px;
  font-size: 12px;
  color: var(--error-text);
}

.leave-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: max-content;
  min-width: max-content;
  padding: 4px 10px 4px 8px;
  border-bottom: 1px solid rgba(217, 222, 234, 0.55);
}


.leave-inline-list {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(3, min-content);
  grid-auto-columns: max-content;
  align-content: center;
  justify-content: start;
  gap: 2px 10px;
  width: max-content;
}


.leave-inline-list.empty {
  opacity: 0.8;
}

.leave-inline-item {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  min-height: 16px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 12px;
  line-height: 1.05;
  white-space: nowrap;
}


.leave-inline-item.empty {
  color: var(--muted) !important;
  background: transparent;
}


.leave-inline-label {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}


.leave-inline-value {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}


.day-cell {
  background: #ffffff;
  border-color: var(--border);
  font-size: 18px;
}

.day-cell.empty {
  background: transparent;
  border-color: transparent;
  color: #475569;
}

.day-cell.empty.weekend,
.day-cell.holiday,
.day-cell.empty.holiday {
  background: #f1f5f9;
  border-color: #e5e7eb;
  color: #94a3b8;
}

.day-cell.matched.weekend,
.day-cell.fallback.weekend {
  box-shadow: inset 0 0 0 2px rgba(107, 114, 128, 0.18);
}

.day-cell.error {
  background: #fee2e2;
  border-color: #fecaca;
  color: var(--error-text);
}

.cell-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
}

.empty-day-number {
  font-size: 14px;
  font-weight: 500;
}

.material-symbols-outlined {
  font-size: 22px;
}

.day-cell-split {
  padding: 0;
  overflow: visible;
}

.day-cell-unified-content {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.day-cell-unified-content .material-symbols-outlined {
  font-size: 16px;
  line-height: 1;
}

.day-cell-halves {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr 1fr;
}

.day-half {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.day-half + .day-half {
  border-top: 1px solid rgba(255, 255, 255, 0.38);
}

.day-half.empty {
  background: #ffffff;
}

.day-half-icon.material-symbols-outlined {
  font-size: 14px;
  line-height: 1;
}

.day-dog-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 15px;
  height: 15px;
  padding: 0 1px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #7c3aed;
  z-index: 4;
  line-height: 1;
  pointer-events: none;
}

.day-dog-glyph {
  display: inline-block;
  font-size: 10px;
  line-height: 1;
  transform: translateY(-0.5px);
}

.period-toggle-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.period-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: #fbfdff;
  cursor: pointer;
}

.period-toggle input {
  accent-color: var(--primary);
}

.calendar-editor-current {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed var(--border);
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.booking-options-settings {
  margin-bottom: 16px;
}

.booking-options-admin {
  display: grid;
  gap: 14px;
}

.booking-option-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(180px, 1fr) minmax(170px, 0.9fr) auto;
  gap: 14px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--border);
  background: #fbfdff;
  border-radius: 16px;
}

.booking-option-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 46px;
}

.booking-option-system-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.form-actions-inline {
  margin-top: 12px;
}

.admin-shell {
  padding: 24px;
}

.admin-heading {
  margin-bottom: 18px;
}

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

h1,
.card-header h2 {
  margin: 0;
}

h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.subtle {
  margin: 0;
  color: var(--muted);
}

.alert {
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
}

.alert.success {
  background: var(--success-bg);
  color: var(--success-text);
}

.alert.error {
  background: var(--error-bg);
  color: var(--error-text);
}

.alert.warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.admin-form {
  display: block;
}

.admin-workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-nav-card {
  position: sticky;
  top: 18px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.admin-nav-header {
  margin-bottom: 14px;
}

.admin-nav-menu {
  display: grid;
  gap: 10px;
}

.admin-nav-button {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfdff;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-align: left;
  padding: 12px 14px;
  cursor: pointer;
}

.admin-nav-button:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: #f3f7ff;
}

.admin-nav-button.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: #eef2ff;
  color: var(--primary);
}

.admin-content-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.admin-section-panel[hidden] {
  display: none !important;
}

.admin-content-actions {
  margin-top: 0;
}

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

.admin-grid-wide {
  align-items: start;
}

.admin-card {
  padding: 20px;
}

.admin-card-span-2 {
  grid-column: span 2;
}

.card-header {
  margin-bottom: 18px;
}

.card-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

.input,
.admin-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: #fbfdff;
}

.input:focus,
.admin-textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.2);
  border-color: var(--primary);
}

.calendar-editor-comment {
  min-height: 82px;
  resize: vertical;
}

.checkbox-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfdff;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.checkbox-help {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}


.middle-fields-admin {
  display: grid;
  gap: 14px;
}

.middle-field-editor {
  border: 1px solid var(--border);
  padding: 14px;
  background: #fbfdff;
}

.middle-field-editor-top {
  margin-bottom: 12px;
}

.middle-field-toggle {
  padding: 0;
  border: 0;
  background: transparent;
}

.middle-field-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 12px;
  align-items: end;
}

.color-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: #ffffff;
}

.color-input {
  width: 44px;
  height: 32px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.color-code {
  font-size: 12px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.admin-textarea {
  min-height: 420px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
}

.admin-textarea-medium {
  min-height: 180px;
}

.code-hint {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
}

.code-hint code {
  display: inline-block;
  margin-top: 4px;
  color: var(--text);
  word-break: break-all;
}

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

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

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

.secondary-button {
  background: var(--panel);
  border-color: var(--border);
  color: var(--text);
}

.danger-button {
  border-color: #fecaca;
  color: var(--danger);
}

.management-layout {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

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

.management-form-span-2 {
  grid-column: span 2;
}

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

.management-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.management-table th,
.management-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.management-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.table-title {
  font-weight: 700;
}

.table-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

.table-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.table-empty {
  color: var(--muted);
  text-align: center;
}

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

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

  .admin-card-span-2 {
    grid-column: span 1;
  }
}

@media (max-width: 900px) {
  .page {
    padding: 14px;
  }

  .topbar-brand {
    font-size: 18px;
  }
}

@media (max-width: 760px) {
  .management-form-grid,
  .middle-field-editor-grid {
    grid-template-columns: 1fr;
  }

  .management-form-span-2 {
    grid-column: span 1;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding-left: 14px;
  }

  .topbar-brand {
    max-width: calc(100% - 56px);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .admin-nav-menu {
    grid-template-columns: 1fr;
  }

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

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

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}

.legend-empty {
  display: inline-block;
  width: 1px;
  height: 1px;
}

.day-cell-button {
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  border: none;
  background: transparent;
  overflow: visible;
}

.day-cell-button:hover {
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.28);
}

.calendar-editor-actions-row {
  justify-content: flex-start;
  align-items: stretch;
  gap: 10px;
  margin-top: 4px;
  padding-top: 10px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, var(--panel) 20%, var(--panel) 100%);
}

.calendar-editor-actions-row .primary-button,
.calendar-editor-actions-row .secondary-button {
  width: auto;
  flex: 1 1 140px;
  min-height: 42px;
  padding: 0 14px;
}

#calendarEditorDelete[hidden] {
  display: none !important;
}

.secondary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.calendar-editor-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 2.5vw, 20px);
  z-index: 1000;
}

.calendar-editor-backdrop[hidden] {
  display: none !important;
}

.calendar-editor-modal {
  width: min(460px, 100%);
  max-height: min(82dvh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px;
  overflow: hidden;
}

.calendar-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex: 0 0 auto;
}

.calendar-editor-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
  line-height: 1.2;
}

.calendar-editor-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.calendar-editor-form {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.calendar-editor-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.calendar-editor-message {
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
}

.calendar-editor-message.success {
  background: var(--success-bg);
  color: var(--success-text);
}

.calendar-editor-message.error {
  background: var(--error-bg);
  color: var(--error-text);
}

.leave-inline-list-masked {
  min-width: 32px;
}

.management-search-card,
.management-editor-card,
.management-empty-card {
  margin-bottom: 18px;
}

.search-inline-form {
  display: block;
}

#managementSearchClear {
  flex: 0 0 auto;
}

.user-search-row {
  display: flex;
  align-items: end;
  gap: 12px;
}

.user-search-input-wrap {
  flex: 1 1 auto;
}

.user-search-help {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.confirm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1100;
}

.confirm-backdrop[hidden] {
  display: none !important;
}

.confirm-modal {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.confirm-title {
  margin: 0 0 10px;
  font-size: 22px;
}

.confirm-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

@media (max-width: 760px) {
  .user-search-row,
  .confirm-actions {
    flex-direction: column;
    align-items: stretch;
  }
}


@media (max-width: 900px) {
  .booking-option-row {
    grid-template-columns: 1fr;
  }

  .booking-option-actions {
    justify-content: flex-start;
  }
}

.topbar-brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-logo {
  width: auto;
  max-width: 42px;
  max-height: 42px;
  object-fit: contain;
  flex: 0 0 auto;
}

.sticky-details {
  position: sticky;
  left: var(--name-width);
  z-index: 65;
  background: var(--panel);
  background-clip: padding-box;
  isolation: isolate;
  box-shadow: 12px 0 18px -18px rgba(15, 23, 42, 0.35);
}

.leave-card.sticky-details {
  z-index: 64;
}

.board-head .sticky-name {
  z-index: 140;
}

.board-head .sticky-details {
  z-index: 139;
}

.board-pinned .sticky-name {
  left: var(--board-scroll-left, 0px);
  z-index: 130;
}

.board-pinned .sticky-details {
  left: calc(var(--board-scroll-left, 0px) + var(--name-width));
  z-index: 129;
}

.board-body .sticky-name {
  z-index: 70;
}

.board-body .sticky-details {
  z-index: 65;
}

.logo-admin-shell {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  align-items: start;
}

.logo-preview-card {
  width: 140px;
  min-height: 140px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  padding: 12px;
}

.logo-preview-image {
  max-width: 100px;
  max-height: 100px;
  object-fit: contain;
}

.logo-preview-empty {
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.year-shell {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.year-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.year-nav-group {
  display: inline-flex;
  gap: 10px;
}

.year-nav-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
  background: #f8fafc;
}

.year-range-title {
  margin: 0 0 4px;
  font-size: 24px;
}

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

.year-month-card {
  min-width: 0;
}

.year-month-title {
  margin: 0 0 10px;
  font-size: 17px;
}

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

.year-weekdays {
  margin-bottom: 6px;
}

.year-weekday {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}

.year-day {
  position: relative;
  min-height: 34px;
  border: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

button.year-day {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
  font: inherit;
  padding: 0;
  cursor: pointer;
}

button.year-day:disabled {
  cursor: default;
}

.year-day-padding {
  border-color: transparent;
  background: transparent;
}

.year-day.weekend {
  background: #f8fafc;
}

.year-day .material-symbols-outlined {
  font-size: 18px;
}

.year-day .day-cell-halves {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 1fr 1fr;
}

.year-day .day-cell-half {
  display: flex;
  align-items: center;
  justify-content: center;
}

.year-day .day-cell-unified-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.year-day .day-dog-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.year-day .day-dog-badge .material-symbols-outlined {
  font-size: 11px;
}

.year-day-number,
.year-day-caption {
  font-size: 12px;
  font-weight: 600;
}

.year-day-caption {
  position: absolute;
  left: 4px;
  bottom: 2px;
  font-size: 10px;
  color: #475569;
}

.year-day.empty .year-day-caption,
.year-day.weekend .year-day-caption {
  color: #94a3b8;
}

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

@media (max-width: 760px) {
  .logo-admin-shell {
    grid-template-columns: 1fr;
  }

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


body.dashboard-page {
  height: var(--app-viewport-height, 100dvh);
  min-height: var(--app-viewport-height, 100dvh);
  overflow: hidden;
  overscroll-behavior: none;
}

.page.dashboard-page-shell {
  height: var(--app-viewport-height, 100dvh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 18px;
}

.topbar-fixed {
  position: sticky;
  top: 0;
  z-index: 40;
  flex: 0 0 auto;
}

.dashboard-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding-right: 0;
  display: flex;
  flex-direction: column;
}

.dashboard-scroll > .board-panel {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.dashboard-scroll > .board-panel > .board {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  overflow: auto;
  box-sizing: border-box;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  overflow-anchor: none;
}

.board-header-workers {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.worker-filter-trigger,
.worker-filter-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.worker-filter-trigger .material-symbols-outlined,
.worker-filter-close .material-symbols-outlined {
  font-size: 18px;
}

.worker-filter-panel {
  position: absolute;
  z-index: 60;
  width: 320px;
  max-height: min(70vh, 640px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px;
}

.worker-filter-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.worker-filter-section {
  margin-bottom: 14px;
}

.worker-filter-section-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.worker-filter-options {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.worker-filter-search {
  margin-bottom: 10px;
}

.worker-filter-row {
  padding: 10px 12px;
}

.worker-filter-empty {
  padding: 10px 12px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--border);
}

.tag-editor-modal {
  width: min(560px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
}

.tag-editor-body {
  display: grid;
  gap: 14px;
}

.tag-editor-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.tag-editor-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.tag-editor-list {
  display: grid;
  gap: 10px;
}

.tag-editor-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: #fbfdff;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  background: #eef2ff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.person-card[data-is-own-row="true"] .person-name {
  cursor: context-menu;
}

@media (max-width: 720px) {
  .tag-editor-input-row {
    grid-template-columns: 1fr;
  }

  .worker-filter-panel {
    width: min(94vw, 320px);
  }
}

/* Management page split layout and editor refinements */
.management-workspace {
  grid-template-columns: 180px minmax(280px, 340px) minmax(0, 1fr);
}

.management-mode-card,
.management-list-card {
  align-self: start;
}

.management-mode-card {
  min-width: 0;
}

.management-mode-menu {
  display: grid;
  gap: 10px;
}

.management-mode-menu .admin-nav-button {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  text-decoration: none;
  overflow: hidden;
}

.management-mode-menu .admin-nav-button:hover,
.management-mode-menu .admin-nav-button:focus,
.management-mode-menu .admin-nav-button:active,
.management-mode-menu .admin-nav-button:visited {
  text-decoration: none;
}

.management-list-card {
  --management-visible-list-rows: 4;
  --management-list-row-height: 66px;
  --management-list-gap: 8px;
  --management-list-max-height: calc((var(--management-visible-list-rows) * var(--management-list-row-height)) + ((var(--management-visible-list-rows) - 1) * var(--management-list-gap)) + 4px);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 150px);
  min-height: 420px;
  min-width: 0;
}

.management-search-field {
  margin-bottom: 14px;
}

.management-user-list {
  display: grid;
  gap: var(--management-list-gap, 8px);
  max-height: var(--management-list-max-height, 292px);
  overflow-y: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.management-user-option {
  display: grid;
  gap: 3px;
  min-height: var(--management-list-row-height, 66px);
  align-content: center;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfdff;
  color: var(--text);
  text-decoration: none;
}


.management-user-option.is-filter-hidden,
.management-user-option[hidden] {
  display: none !important;
}

.management-user-option:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: #f3f7ff;
}

.management-user-option.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: #eef2ff;
  color: var(--primary);
}

.management-user-name {
  font-weight: 700;
}

.management-user-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  word-break: break-all;
}

.management-list-empty {
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.management-editor-stack {
  min-width: 0;
}

.management-editor-stack .admin-card {
  min-width: 0;
}

.management-form-grid {
  grid-template-columns: 1fr;
}

.management-form-stack {
  display: grid;
  gap: 16px;
  max-width: 880px;
}

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

.management-input-plus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.management-increment-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.increment-button {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.increment-button:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: #f3f7ff;
  color: var(--primary);
}

@media (max-width: 1280px) {
  .management-workspace {
    grid-template-columns: 170px minmax(250px, 300px) minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  .management-workspace {
    grid-template-columns: 1fr;
  }

  .management-mode-card,
  .management-list-card {
    position: static;
    max-height: none;
    min-height: 0;
  }

  .management-user-list,
  .management-group-event-list {
    max-height: var(--management-list-max-height, 292px);
  }

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

  .management-mode-menu .admin-nav-button {
    padding: 12px;
  }
}

@media (max-width: 760px) {
  .management-input-plus {
    grid-template-columns: 1fr;
  }

  .management-increment-buttons {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .increment-button {
    padding: 0 8px;
  }
}

@media (max-width: 420px) {
  .management-increment-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.management-user-list,
.management-group-event-list {
  flex: 0 1 auto;
  min-height: 0;
}


.login-page {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  background: #f8fafc;
  color: #0f172a;
}

.login-shell {
  width: min(92vw, 460px);
  padding: 32px 16px;
}

.login-card {
  display: grid;
  gap: 16px;
  justify-items: center;
  padding: 32px;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
  text-align: center;
}

.login-card h1 {
  margin: 0;
  font-size: 1.5rem;
}

.login-card p {
  margin: 0;
  color: #64748b;
  line-height: 1.5;
}

.login-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: #eef2ff;
  color: #4f46e5;
}

.login-icon .material-symbols-outlined {
  font-size: 32px;
}

.login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
}

.login-error {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.92rem;
}

.login-help {
  font-size: 0.88rem;
}

.calendar-editor-form::-webkit-scrollbar {
  width: 10px;
}

.calendar-editor-form::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.55);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.calendar-editor-modal .period-toggle-group {
  gap: 8px;
}

.calendar-editor-modal .period-toggle {
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
}

.calendar-editor-modal .checkbox-row,
.calendar-editor-modal .calendar-editor-current {
  padding: 10px 12px;
}

.calendar-editor-modal .form-label {
  margin-bottom: 6px;
}

.calendar-editor-modal .input {
  padding: 10px 12px;
}

.calendar-editor-modal .calendar-editor-comment {
  min-height: 72px;
}

@media (max-width: 640px) {
  .calendar-editor-backdrop {
    padding: 8px;
    align-items: flex-start;
  }

  .calendar-editor-modal {
    width: 100%;
    max-height: calc(100dvh - 16px);
    border-radius: 16px;
    padding: 14px;
    margin-top: 0;
  }

  .calendar-editor-head h2 {
    font-size: 18px;
  }

  .calendar-editor-head .subtle {
    font-size: 12px;
    line-height: 1.35;
  }

  .calendar-editor-modal .period-toggle-group {
    grid-template-columns: 1fr;
  }

  .calendar-editor-modal .period-toggle {
    padding: 9px 11px;
  }

  .calendar-editor-actions-row {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 8px;
  }

  .calendar-editor-actions-row .primary-button,
  .calendar-editor-actions-row .secondary-button {
    width: auto;
    flex: 1 1 calc(50% - 8px);
    min-height: 40px;
    padding: 0 12px;
  }
}

@media (max-height: 740px) {
  .calendar-editor-modal {
    max-height: calc(100dvh - 16px);
    padding: 14px;
  }

  .calendar-editor-head {
    margin-bottom: 10px;
  }

  .calendar-editor-form {
    gap: 10px;
  }

  .calendar-editor-modal .checkbox-row,
  .calendar-editor-modal .calendar-editor-current,
  .calendar-editor-modal .period-toggle {
    padding-top: 9px;
    padding-bottom: 9px;
  }
}


.admin-subsection {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.admin-subsection h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.admin-subsection-help {
  margin-bottom: 14px;
  font-size: 13px;
}

.admin-subsection-help code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--primary);
}

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

.admin-field-wide {
  grid-column: span 2;
}

.admin-small-textarea {
  min-height: 76px;
  resize: vertical;
}

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

  .admin-field-wide {
    grid-column: span 1;
  }
}

.person-card--carryover-editable {
  cursor: pointer;
}

.person-card--carryover-editable:hover .person-name {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.carryover-add-modal {
  width: min(430px, calc(100vw - 24px));
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.carryover-add-body {
  display: grid;
  gap: 14px;
}

.carryover-add-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.carryover-add-summary > div {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
  padding: 12px;
}

.carryover-add-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.carryover-add-summary strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
}

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

.carryover-add-buttons .secondary-button {
  min-width: 0;
  padding-left: 10px;
  padding-right: 10px;
}

@media (max-width: 520px) {
  .carryover-add-modal {
    padding: 14px;
    border-radius: 16px;
  }

  .carryover-add-summary,
  .carryover-add-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.import-error-list ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.import-error-list li {
  margin: 4px 0;
}

.admin-divider {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.card-header-spaced {
  margin-top: 4px;
}

/* Hungarian public holiday visibility */
.day-header.holiday {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.holiday-header-badge {
  position: absolute;
  right: 2px;
  top: 2px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dc2626;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  z-index: 3;
  pointer-events: none;
}

.holiday-cell-badge,
.year-day-holiday-badge {
  position: absolute;
  right: 2px;
  top: 2px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dc2626;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.16);
}

.day-cell.holiday {
  box-shadow: inset 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.year-day.holiday {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #991b1b;
}

.year-day.holiday .year-day-caption {
  color: #991b1b;
}

/* Configurable weekend / holiday / moved workday appearance */
.day-header.weekend {
  background: var(--weekend-day-bg, #e5e7eb);
  color: var(--weekend-day-fg, #6b7280);
}

.day-header.holiday {
  background: var(--holiday-day-bg, #fee2e2);
  color: var(--holiday-day-fg, #991b1b);
  border-color: color-mix(in srgb, var(--holiday-day-fg, #991b1b) 24%, transparent);
}

.day-header.moved-workday {
  background: var(--moved-day-bg, #dcfce7);
  color: var(--moved-day-fg, #166534);
  border-color: color-mix(in srgb, var(--moved-day-fg, #166534) 24%, transparent);
}

.day-cell.empty.weekend,
.day-cell.empty.weekend:not(.holiday):not(.moved-workday) {
  background: var(--weekend-day-bg, #f1f5f9);
  color: var(--weekend-day-fg, #94a3b8);
}

.day-cell.holiday,
.day-cell.empty.holiday {
  background: var(--holiday-day-bg, #fee2e2);
  color: var(--holiday-day-fg, #991b1b);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--holiday-day-fg, #991b1b) 20%, transparent);
}

.day-cell.moved-workday,
.year-day.moved-workday {
  background: var(--moved-day-bg, #dcfce7);
  color: var(--moved-day-fg, #166534);
  border-color: color-mix(in srgb, var(--moved-day-fg, #166534) 20%, transparent);
}

.year-day.weekend {
  background: var(--weekend-day-bg, #f8fafc);
  color: var(--weekend-day-fg, #94a3b8);
}

.year-day.holiday {
  background: var(--holiday-day-bg, #fff1f2);
  border-color: color-mix(in srgb, var(--holiday-day-fg, #991b1b) 20%, transparent);
  color: var(--holiday-day-fg, #991b1b);
}

.year-day.holiday .year-day-caption {
  color: var(--holiday-day-fg, #991b1b);
}

.year-day.moved-workday .year-day-caption {
  color: var(--moved-day-fg, #166534);
}

.calendar-day-marker,
.holiday-header-badge,
.holiday-cell-badge,
.year-day-holiday-badge,
.weekend-header-badge,
.weekend-cell-badge,
.year-day-weekend-badge,
.moved-workday-header-badge,
.moved-workday-cell-badge,
.year-day-moved-workday-badge {
  position: absolute;
  right: 2px;
  top: 2px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  z-index: 6;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.16);
}

.holiday-header-badge,
.holiday-cell-badge,
.year-day-holiday-badge {
  background: var(--holiday-marker-bg, #dc2626);
  color: var(--holiday-marker-fg, #ffffff);
}

.weekend-header-badge,
.weekend-cell-badge,
.year-day-weekend-badge {
  background: var(--weekend-marker-bg, #64748b);
  color: var(--weekend-marker-fg, #ffffff);
}

.moved-workday-header-badge,
.moved-workday-cell-badge,
.year-day-moved-workday-badge {
  background: var(--moved-marker-bg, #16a34a);
  color: var(--moved-marker-fg, #ffffff);
}

.compact-card-header {
  margin-top: 22px;
  margin-bottom: 12px;
}

.compact-card-header h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.day-appearance-admin {
  display: grid;
  gap: 14px;
}

.day-appearance-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: #ffffff;
}

.day-appearance-card h4 {
  margin: 0 0 12px;
  font-size: 15px;
}

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

@media (max-width: 760px) {
  .day-appearance-grid {
    grid-template-columns: 1fr;
  }
}

/* Compact yearly calendar popup opened from carryover editor */
.carryover-add-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.year-calendar-popup-backdrop {
  z-index: 1250;
  padding: 14px;
}

.year-calendar-popup-modal {
  width: min(980px, calc(100vw - 24px));
  max-height: calc(100dvh - 28px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.year-calendar-popup-head {
  margin-bottom: 10px;
  flex: 0 0 auto;
}

.year-calendar-popup-head h2 {
  font-size: 20px;
}

.year-calendar-popup-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 0 10px;
  flex: 0 0 auto;
}

.year-calendar-popup-toolbar strong {
  min-width: 72px;
  text-align: center;
  font-size: 18px;
}

.year-calendar-popup-nav {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.year-calendar-popup-nav .material-symbols-outlined {
  font-size: 20px;
}

.year-calendar-popup-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
  padding: 0 0 10px;
  flex: 0 0 auto;
}

.year-calendar-popup-summary span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fafc;
  padding: 5px 9px;
}

.year-calendar-popup-summary strong {
  color: var(--text);
}

.year-calendar-popup-content {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 2px 4px 4px 0;
}

.year-calendar-popup-content::-webkit-scrollbar {
  width: 10px;
}

.year-calendar-popup-content::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.55);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.year-popup-month-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  padding: 10px;
}

.year-popup-month-title {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.2;
  text-transform: capitalize;
}

.year-popup-weekdays,
.year-popup-month-days {
  display: grid;
  grid-template-columns: repeat(7, 28px);
  gap: 3px;
  justify-content: center;
}

.year-popup-weekdays {
  margin-bottom: 4px;
}

.year-popup-weekday {
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.year-popup-day {
  width: 28px;
  height: 28px;
  min-height: 28px;
  position: relative;
  border: 1px solid var(--border);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 11px;
  line-height: 1;
}

.year-popup-day-padding {
  border-color: transparent;
  background: transparent;
}

.year-popup-day.today {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.year-popup-day.weekend {
  background: var(--weekend-day-bg, #f8fafc);
  color: var(--weekend-day-fg, #94a3b8);
}

.year-popup-day.holiday {
  background: var(--holiday-day-bg, #fff1f2);
  color: var(--holiday-day-fg, #991b1b);
  border-color: color-mix(in srgb, var(--holiday-day-fg, #991b1b) 20%, transparent);
}

.year-popup-day.moved-workday {
  background: var(--moved-day-bg, #dcfce7);
  color: var(--moved-day-fg, #166534);
  border-color: color-mix(in srgb, var(--moved-day-fg, #166534) 20%, transparent);
}

.year-popup-day .material-symbols-outlined {
  font-size: 15px;
  line-height: 1;
}

.year-popup-day .day-cell-unified-content {
  width: 100%;
  height: 100%;
}

.year-popup-day .day-cell-halves {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 1fr 1fr;
}

.year-popup-day .day-half {
  min-height: 0;
}

.year-popup-day .day-half-icon.material-symbols-outlined {
  font-size: 11px;
}

.year-popup-day .cell-label {
  font-size: 9px;
  font-weight: 800;
}

.year-popup-day-number {
  font-size: 11px;
  font-weight: 700;
}

.year-popup-day-caption {
  position: absolute;
  left: 2px;
  bottom: 1px;
  color: rgba(15, 23, 42, 0.68);
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  z-index: 5;
}

.year-popup-marker {
  position: absolute;
  right: 1px;
  top: 1px;
  min-width: 11px;
  height: 11px;
  padding: 0 2px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: 900;
  line-height: 1;
  z-index: 6;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.16);
}

.year-popup-day .day-dog-badge {
  width: 11px;
  height: 11px;
  min-width: 11px;
  top: 1px;
  right: 1px;
  z-index: 7;
}

.year-popup-day .day-dog-glyph {
  font-size: 7px;
}

@media (max-width: 1100px) {
  .year-calendar-popup-content {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .year-calendar-popup-content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .carryover-add-actions {
    grid-template-columns: 1fr;
  }

  .year-calendar-popup-backdrop {
    padding: 8px;
    align-items: flex-start;
  }

  .year-calendar-popup-modal {
    width: 100%;
    max-height: calc(100dvh - 16px);
    padding: 12px;
    border-radius: 16px;
  }

  .year-calendar-popup-content {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}


@media (max-width: 900px) {
  .board-pinned {
    max-height: 42vh;
    max-height: min(42dvh, 300px);
  }
}

@media (max-height: 700px) {
  .board-pinned {
    max-height: 34vh;
    max-height: min(34dvh, 260px);
  }
}

/* Group calendar events */
.group-event-stack {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  height: 5px;
  display: flex;
  gap: 1px;
  pointer-events: auto;
  z-index: 6;
}

.group-event-band {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.65);
}

.day-cell .group-event-stack + .calendar-day-marker {
  bottom: 8px;
}

.management-side-divider {
  height: 1px;
  margin: 16px 0;
  background: var(--border);
}

.management-group-event-header {
  padding-top: 0;
}

.management-filter-caption {
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.management-group-event-filter {
  display: grid;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
}

.management-group-event-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.management-group-event-filter .form-label {
  font-size: 12px;
  margin-bottom: 5px;
}

.management-filter-input {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 13px;
}

.management-filter-clear {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

.management-group-event-list {
  display: grid;
  gap: var(--management-list-gap, 8px);
  max-height: var(--management-list-max-height, 292px);
  overflow-y: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.management-group-event-create {
  margin-bottom: 8px;
}

.management-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 8px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.management-color-input-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.color-input {
  min-height: 44px;
  padding: 4px;
}

.management-checkbox-row {
  margin-top: 2px;
}

.management-user-list::-webkit-scrollbar,
.management-group-event-list::-webkit-scrollbar {
  width: 10px;
}

.management-user-list::-webkit-scrollbar-thumb,
.management-group-event-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.55);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

@media (max-width: 760px) {
  .management-list-card {
    --management-list-row-height: 62px;
  }

  .management-group-event-filter {
    padding: 8px;
  }

  .management-group-event-filter-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .management-filter-input,
  .management-filter-clear {
    min-height: 34px;
  }
}

.form-actions-danger {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.danger-button {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff1f2;
}

.group-event-editor-card .calendar-editor-current {
  display: grid;
  gap: 4px;
}

/* Dashboard month navigation moved into the fixed topbar */
.topbar {
  gap: 12px;
}

.dashboard-month-toolbar--topbar {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 520px;
  justify-content: center;
  flex-wrap: nowrap;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0 auto;
}

.dashboard-month-toolbar--topbar .dashboard-month-button,
.dashboard-month-toolbar--topbar .dashboard-month-arrow {
  min-height: 34px;
  padding: 0 12px;
  flex: 0 0 auto;
}

.dashboard-month-toolbar--topbar .dashboard-month-arrow {
  min-width: 36px;
  font-size: 16px;
}

.dashboard-month-toolbar--topbar .dashboard-month-label {
  min-width: 132px;
  font-size: 14px;
}

@media (max-width: 900px) {
  .dashboard-month-toolbar--topbar {
    max-width: 430px;
    gap: 8px;
  }

  .dashboard-month-toolbar--topbar .dashboard-month-stepper {
    gap: 6px;
  }

  .dashboard-month-toolbar--topbar .dashboard-month-label {
    min-width: 112px;
    font-size: 13px;
  }

  .dashboard-month-toolbar--topbar .dashboard-month-button,
  .dashboard-month-toolbar--topbar .dashboard-month-arrow {
    min-height: 32px;
    padding: 0 9px;
  }

  .dashboard-month-toolbar--topbar .dashboard-month-arrow {
    min-width: 32px;
  }
}

@media (max-width: 640px) {
  .topbar {
    gap: 8px;
  }

  .topbar-brand {
    max-width: 52px;
  }

  .topbar-brand-wrap span:not(.material-symbols-outlined) {
    display: none;
  }

  .dashboard-month-toolbar--topbar {
    width: auto;
    max-width: none;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .dashboard-month-toolbar--topbar .dashboard-month-button {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 8px;
  }

  .dashboard-month-toolbar--topbar .dashboard-month-stepper {
    width: auto;
    justify-content: center;
    gap: 4px;
    flex: 1 1 auto;
    min-width: 0;
  }

  .dashboard-month-toolbar--topbar .dashboard-month-label {
    min-width: 0;
    flex: 1 1 auto;
    font-size: 12px;
    padding: 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .dashboard-month-toolbar--topbar .dashboard-month-arrow {
    min-width: 30px;
    min-height: 32px;
    padding: 0 7px;
  }
}

/* Compact topbar dashboard month navigation on mobile */
@media (max-width: 640px) {
  .topbar.topbar-fixed {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
  }

  .topbar.topbar-fixed .topbar-brand {
    flex: 0 0 auto;
    max-width: 42px;
    min-width: 36px;
  }

  .topbar.topbar-fixed .topbar-logo {
    max-width: 36px;
    max-height: 36px;
  }

  .topbar.topbar-fixed .menu-shell {
    flex: 0 0 auto;
  }

  .topbar.topbar-fixed .menu-trigger {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .dashboard-month-toolbar--topbar {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    width: auto;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }

  .dashboard-month-toolbar--topbar .secondary-button,
  .dashboard-month-toolbar--topbar .dashboard-month-button,
  .dashboard-month-toolbar--topbar .dashboard-month-arrow {
    width: auto;
    flex: 0 0 auto;
  }

  .dashboard-month-toolbar--topbar .dashboard-month-button {
    min-width: 34px;
    min-height: 30px;
    padding: 0 7px;
    font-size: 12px;
    border-radius: 10px;
  }

  .dashboard-month-toolbar--topbar .dashboard-month-stepper {
    width: auto;
    flex: 0 1 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
  }

  .dashboard-month-toolbar--topbar .dashboard-month-arrow {
    min-width: 28px;
    min-height: 30px;
    padding: 0 6px;
    font-size: 14px;
    border-radius: 10px;
  }

  .dashboard-month-toolbar--topbar .dashboard-month-label {
    flex: 0 1 auto;
    min-width: 72px;
    max-width: 104px;
    font-size: 11px;
    line-height: 1.1;
    padding: 0 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 380px) {
  .topbar.topbar-fixed {
    gap: 4px;
    padding: 0 6px;
  }

  .topbar.topbar-fixed .topbar-brand {
    max-width: 34px;
    min-width: 30px;
  }

  .topbar.topbar-fixed .topbar-logo {
    max-width: 30px;
    max-height: 30px;
  }

  .topbar.topbar-fixed .menu-trigger {
    width: 34px;
    height: 34px;
  }

  .dashboard-month-toolbar--topbar {
    gap: 3px;
  }

  .dashboard-month-toolbar--topbar .dashboard-month-button {
    min-width: 30px;
    padding: 0 5px;
    font-size: 11px;
  }

  .dashboard-month-toolbar--topbar .dashboard-month-arrow {
    min-width: 24px;
    padding: 0 4px;
  }

  .dashboard-month-toolbar--topbar .dashboard-month-label {
    min-width: 60px;
    max-width: 84px;
    font-size: 10px;
  }
}


/* Teams mobile WebView stability: keep the dashboard in a fixed-height app viewport
   and avoid scroll bounce/compositor glitches that can blank sticky grid layers. */
.dashboard-page .board,
.dashboard-page .board-panel,
.dashboard-page .dashboard-scroll {
  -webkit-tap-highlight-color: transparent;
}

.dashboard-page .board.dashboard-mobile-repaint,
.dashboard-page .board.dashboard-mobile-scroll-tick {
  outline: 1px solid transparent;
}

.dashboard-page .board.dashboard-mobile-repaint .board-grid,
.dashboard-page .board.dashboard-mobile-repaint .sticky-name,
.dashboard-page .board.dashboard-mobile-repaint .sticky-details,
.dashboard-page .board.dashboard-mobile-scroll-tick .board-grid,
.dashboard-page .board.dashboard-mobile-scroll-tick .sticky-name,
.dashboard-page .board.dashboard-mobile-scroll-tick .sticky-details {
  outline: 1px solid transparent;
}

@media (max-width: 760px) {
  html,
  body.dashboard-page {
    width: 100%;
    height: var(--app-viewport-height, 100dvh);
    min-height: var(--app-viewport-height, 100dvh);
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.dashboard-page {
    position: fixed;
    inset: 0;
    touch-action: pan-x pan-y;
  }

  .page.dashboard-page-shell {
    width: 100%;
    height: var(--app-viewport-height, 100dvh);
    min-height: 0;
    overflow: hidden;
  }

  .topbar-fixed {
    position: relative;
    top: auto;
    z-index: 300;
  }

  .dashboard-scroll,
  .dashboard-scroll > .board-panel,
  .dashboard-scroll > .board-panel > .board {
    min-height: 0;
    max-height: 100%;
    contain: layout style;
  }

  .dashboard-scroll > .board-panel > .board {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .dashboard-page .board-head,
  .dashboard-page .board-pinned,
  .dashboard-page .sticky-name,
  .dashboard-page .sticky-details {
    contain: layout style;
  }
}

/* Mobile dashboard name layout: keep rows compact and hide email addresses. */
@media (max-width: 640px) {
  .dashboard-page .board {
    --name-width: clamp(136px, 38vw, 190px);
  }

  .dashboard-page .person-card {
    gap: clamp(5px, 1.6vw, 8px);
    padding-left: clamp(5px, 1.4vw, 8px);
    padding-right: clamp(5px, 1.8vw, 8px);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .dashboard-page .person-card > div:last-child {
    min-width: 0;
    flex: 1 1 auto;
    max-width: 100%;
  }

  .dashboard-page .person-name {
    font-size: 12px;
    line-height: 1.12;
    font-weight: 600;
    min-width: 0;
    max-width: 100%;
  }

  .dashboard-page .person-name-part {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .dashboard-page .person-subtext {
    display: none !important;
  }

  .dashboard-page .person-group-subtext {
    display: -webkit-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 2px;
    overflow: hidden;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 11px;
    line-height: 1.12;
  }

  .dashboard-page .person-group-subtext--mobile-hidden {
    display: none !important;
  }
}

@media (max-width: 380px) {
  .dashboard-page .board {
    --name-width: clamp(122px, 40vw, 152px);
  }
}


.management-list-card .management-list-empty {
  margin-top: 10px;
}

@media (max-width: 560px) {
  .management-mode-menu {
    grid-template-columns: 1fr;
  }
}
