:root {
  font-family: Montserrat, Avenir, "Segoe UI", Arial, sans-serif;
  color: #1d252c;
  background: #f3f7fa;
  --navy: #003764;
  --blue: #0074c8;
  --sky: #36b4e5;
  --green: #3dae2b;
  --ink: #1d252c;
  --slate: #5b6670;
  --line: #d8e3ea;
  --danger: #b42318;
  --surface: #f3f7fa;
  --card: #ffffff;
  --radius: 8px;
  --shadow: 0 2px 14px rgba(0, 55, 100, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--surface); color: var(--ink); overflow: hidden; }
@media (max-width: 760px) {
  body { overflow: auto; }
}
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.hidden { display: none !important; }
h1, h2, p { margin-top: 0; }
h1, h2 { color: var(--navy); letter-spacing: -0.025em; }
h1 { font-size: clamp(24px, 2.6vw, 34px); margin-bottom: 6px; }
h2 { font-size: 18px; margin-bottom: 8px; }
.muted { color: var(--slate); }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}
.error { color: var(--danger); min-height: 18px; margin: 0; font-size: 13px; font-weight: 600; }

/* Forms */
.field { display: grid; gap: 8px; font-size: 12px; font-weight: 700; color: var(--ink); }
.field-control,
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd8e0;
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: #fff;
}
textarea,
textarea.field-control {
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus,
.field-control:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 116, 200, 0.12);
}
.password-field {
  position: relative;
  display: grid;
}
.password-field input {
  width: 100%;
  padding-right: 78px;
}
.password-field .password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 30px;
  padding: 4px 10px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
}
.password-field .password-toggle:hover,
.password-field .password-toggle:focus-visible {
  background: rgba(0, 116, 200, 0.08);
  text-decoration: underline;
}
input:disabled,
select:disabled,
textarea:disabled,
.field-control:disabled {
  background: #eef3f7;
  color: #8a94a3;
}

/* Buttons */
.btn,
button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  padding: 10px 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.btn:disabled,
button:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--blue); }
.btn-secondary,
.secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
}
.btn-secondary:hover,
.secondary:hover { border-color: var(--blue); color: var(--blue); }
.btn-danger,
.danger {
  background: #fff;
  color: var(--danger);
  border: 1px solid #f0c7c3;
}
.btn-dashed {
  width: 100%;
  background: #fff;
  color: var(--blue);
  border: 1px dashed var(--blue);
}
.btn-sm,
.small { min-height: 32px; padding: 6px 10px; font-size: 12px; }
.link-button { padding: 7px 0; text-align: left; background: none; color: #fff; min-height: auto; }

/* Login */
.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(260px, 42%) minmax(0, 1fr);
  background: #fff;
}
.login-brand-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 64px);
  background: linear-gradient(145deg, #003764 5%, #07548c 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}
.login-brand-mark { width: clamp(64px, 18vw, 112px); height: auto; }
.login-brand-watermark {
  display: none;
  position: absolute;
  right: -18%;
  bottom: -24%;
  width: min(46%, 300px);
  opacity: 0.1;
  pointer-events: none;
}
.login-brand-copy { max-width: 18ch; }
.login-brand-panel p {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 12px;
  color: #9eddf3;
}
.login-brand-panel strong {
  display: block;
  font-size: clamp(28px, 4.4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}
.login-card {
  align-self: center;
  width: min(460px, calc(100% - 48px));
  max-height: calc(100dvh - 24px);
  max-height: calc(100vh - 24px);
  margin: auto;
  padding: clamp(24px, 4vw, 48px);
  overflow: auto;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}
.login-card .muted { margin: 8px 0 0; color: #5b6670; line-height: 1.45; }
.login-card form { display: grid; gap: 18px; margin-top: 28px; min-width: 0; }
.login-card label { display: grid; gap: 8px; font-size: 12px; font-weight: 700; min-width: 0; }
.login-card input,
.login-card .field-control {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.auth-link {
  margin-top: 8px;
  padding: 0;
  min-height: auto;
  background: none;
  color: var(--blue);
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-success { color: #0f7a45; min-height: 18px; font-size: 14px; }
button.secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line, #cbd8e0);
}
.brand-logo { display: block; width: min(190px, 70%); height: auto; margin-bottom: 28px; }

/* App shell */
.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 270px 1fr;
  overflow: hidden;
}
aside {
  background: var(--navy);
  color: #fff;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar-brand img {
  display: block;
  width: 174px;
  max-width: 100%;
  height: auto;
  background: #fff;
  padding: 10px 12px;
}
.sidebar-brand span {
  display: block;
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: #9eddf3;
}
nav { margin-top: 48px; display: grid; gap: 6px; }
nav button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #c9e6f5;
  border-left: 4px solid transparent;
  border-radius: 0 6px 6px 0;
}
nav button:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-active {
  background: #0074c8 !important;
  color: #fff !important;
  border-left: 4px solid var(--green) !important;
}
.user-box { margin-top: auto; display: grid; gap: 7px; }
.user-box small { color: #9eddf3; }
.scope-stack, .scope-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.scope-stack { margin: 4px 0 2px; }
.scope-bar { margin-top: 12px; }
.scope-label {
  width: 100%;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
}
.scope-empty { font-size: 12px; color: var(--slate); }
.scope-stack .scope-empty,
.scope-stack .scope-chip { color: #e8f4fb; }
.scope-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.scope-bar .scope-chip {
  background: #e7f2fa;
  color: var(--navy);
}
.content {
  padding: 28px clamp(20px, 3vw, 48px) 40px;
  overflow: auto;
  height: 100vh;
  min-width: 0;
}
.page-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 18px;
}
.view-back-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -6px 0 14px;
}
.view-back-bar[hidden] { display: none !important; }
.header-actions { display: flex; gap: 8px; flex-shrink: 0; }

.legend-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 12px;
}
.legend-title, .legend-hint {
  font-size: 11px;
  font-weight: 700;
  color: var(--slate);
}
.legend-title { text-transform: uppercase; letter-spacing: 0.06em; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--slate); }
.legend-dot.done { background: #d8e3ea; box-shadow: 0 0 0 1.5px var(--green); }
.legend-sep { width: 1px; height: 14px; background: var(--line); }

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}
.search-box {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
  min-width: min(280px, 100%);
  background: #fff;
}
.clients-toolbar {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}
.clients-search-wrap { max-width: 420px; }
.clients-search { width: 100%; }
.clients-filter-shell,
.clients-filter-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}
.clients-filter-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}
.clients-filter-head strong { color: var(--navy); font-size: 14px; }
.clients-result-count {
  font-size: 12px;
  font-weight: 800;
  color: var(--blue);
  background: #eef6fc;
  border-radius: 999px;
  padding: 4px 10px;
}
.filter-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.filter-chip {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.filter-chip.is-active {
  border-color: rgba(0, 116, 200, 0.45);
  background: #f3f9fd;
  box-shadow: 0 0 0 3px rgba(0, 116, 200, 0.08);
}
.filter-chip-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
}
.filter-chip-select {
  width: 100%;
  min-height: 36px;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  color: var(--navy);
  padding: 0;
}
.clients-filter-actions {
  display: flex;
  justify-content: flex-end;
}
.clients-filter-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.column-picker {
  position: relative;
}
.column-picker-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: min(340px, 88vw);
  max-height: min(420px, 62vh);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0, 55, 100, 0.16);
  padding: 0;
}
.column-picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line);
  background: #f7fbfe;
}
.column-picker-title {
  display: block;
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}
.column-picker-hint {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.35;
}
.column-picker-close {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--slate);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.column-picker-close:hover {
  border-color: var(--blue);
  color: var(--navy);
  background: #eef6fc;
}
.column-picker-list {
  display: grid;
  gap: 2px;
  padding: 8px;
  overflow: auto;
  min-height: 0;
}
.column-picker-divider {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 8px 4px;
}
.column-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.35;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.column-picker-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.column-picker-check {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin: 0;
  border: 1.5px solid #9eb4c4;
  border-radius: 4px;
  background: #fff;
  display: inline-grid;
  place-content: center;
  flex-shrink: 0;
  cursor: pointer;
}
.column-picker-check::before {
  content: "";
  width: 9px;
  height: 9px;
  transform: scale(0);
  background: #fff;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
.column-picker-check:checked {
  background: var(--blue);
  border-color: var(--blue);
}
.column-picker-check:checked::before {
  transform: scale(1);
}
.column-picker-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.column-picker-row.is-visible:hover {
  background: #f7fbfe;
}
.column-picker-row.is-hidden-col {
  opacity: 0.72;
}
.column-picker-row.is-dragging {
  opacity: 0.45;
  background: #eef6fc;
  border-color: #9ec7e8;
}
.column-picker-row.drop-before::before,
.column-picker-row.drop-after::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  border-radius: 99px;
  background: var(--blue);
  box-shadow: 0 0 0 2px rgba(0, 116, 200, 0.18);
  pointer-events: none;
  z-index: 2;
}
.column-picker-row.drop-before::before { top: 1px; }
.column-picker-row.drop-after::after { bottom: 1px; }
.column-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--slate);
  cursor: grab;
  flex-shrink: 0;
  touch-action: none;
  user-select: none;
}
.column-drag-handle:not(.is-disabled):hover {
  border-color: var(--line);
  background: #fff;
  color: var(--navy);
}
.column-drag-handle:not(.is-disabled):active {
  cursor: grabbing;
  background: #eef6fc;
  border-color: #9ec7e8;
}
.column-drag-handle.is-disabled {
  visibility: hidden;
  pointer-events: none;
  cursor: default;
}
.column-drag-grip {
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0;
  user-select: none;
  pointer-events: none;
}
.column-drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 80;
  margin: 0;
  pointer-events: none;
  opacity: 0.92;
  background: #fff;
  border: 1px solid #9ec7e8;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 55, 100, 0.2);
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  will-change: transform;
}
.column-order-btns {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.column-order-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.column-order-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.column-order-btn:not(:disabled):hover {
  border-color: rgba(0, 116, 200, 0.45);
  background: #eef6fc;
}
.filter-chip-wrap {
  position: relative;
  display: grid;
}
.filter-chip-wrap .filter-chip {
  padding-right: 28px;
}
.filter-chip-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--slate);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.filter-chip-remove:hover {
  background: #fee2e2;
  color: #b91c1c;
}
.filter-add {
  position: relative;
  display: flex;
  align-items: end;
}
.filter-add-btn {
  min-height: 42px;
}
.filter-add-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  z-index: 20;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: grid;
  gap: 2px;
}
.filter-add-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 4px 6px 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2px;
}
.filter-add-title {
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
}
.filter-add-item {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}
.filter-add-item:hover {
  background: #eef6fc;
}
.th-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  max-width: 100%;
}
.th-sort-btn:hover,
.th-sort-btn.is-active {
  color: var(--blue);
}
.th-sort-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.th-sort-icons {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-shrink: 0;
  margin-left: 2px;
}
.th-sort-chevron {
  display: block;
  width: 13px;
  height: 9px;
  color: #9aa8b8;
  opacity: 0.55;
}
.th-sort-btn:hover .th-sort-chevron {
  opacity: 0.85;
  color: var(--slate);
}
.th-sort-chevron.is-on {
  color: var(--blue);
  opacity: 1;
}
.th-sort-icons.is-sorted .th-sort-chevron:not(.is-on) {
  opacity: 0.22;
}
.th-sort-btn.is-active .th-sort-chevron.is-on {
  filter: drop-shadow(0 0 0.5px var(--blue));
}
.data-table th.is-sorted {
  color: var(--blue);
}
.data-table th .th-sort-btn {
  width: 100%;
}
.clients-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 3;
}
.clients-pager-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.clients-page-size {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
}
.clients-page-indicator {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  min-width: 3.5rem;
  text-align: center;
}
.clients-pager-meta {
  font-size: 12px;
}
.data-table th,
.data-table td {
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.data-table td:has(.row-actions),
.data-table th:last-child,
.data-table td.board-membership-cell {
  max-width: none;
  overflow: visible;
  white-space: normal;
}

.filters-row { display: flex; flex-wrap: wrap; gap: 8px; margin-right: auto; }
.filtro-select, .act-pop-area {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  font: inherit;
}
.btn-clear {
  background: none;
  color: var(--blue);
  border: 0;
  min-height: auto;
  padding: 8px 4px;
  text-decoration: underline;
  font-size: 12px;
}

.board-shell, .table-shell {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  max-height: min(72vh, calc(100vh - 260px));
  min-height: 220px;
}
.board-scroll, .table-scroll {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.board-header, .board-row {
  display: grid;
  grid-template-columns: 72px 200px 150px repeat(var(--board-months, 12), minmax(84px, 0.55fr));
  min-width: max(980px, calc(422px + var(--board-months, 12) * 84px));
  align-items: stretch;
}
.board-header {
  background: #f3f7fa;
  border-bottom: 2px solid var(--line);
  font-size: 10px;
  font-weight: 800;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 5;
}
.board-header .is-sorted,
.board-header .th-sort-btn.is-active {
  color: var(--blue);
}
.board-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: end;
  justify-content: flex-start;
}
.board-toolbar .board-search-wrap {
  flex: 0 1 auto;
  min-width: min(260px, 100%);
}
.board-toolbar .month-range {
  flex: 1 1 auto;
}
.board-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.month-range {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}
.sticky-col {
  position: sticky;
  z-index: 3;
  background: #fff;
}
.board-header .sticky-col {
  background: #f3f7fa;
  z-index: 6;
}
.sticky-actions { left: 0; box-shadow: 1px 0 0 var(--line); }
.sticky-party { left: 72px; box-shadow: 1px 0 0 var(--line); }
.sticky-contact { left: 272px; box-shadow: 4px 0 10px rgba(15, 23, 42, 0.06); }
.board-row:hover .sticky-col { background: #f7fbfe; }
.board-header > div, .board-row > div, .board-row > button {
  border-right: 1px solid var(--line);
  padding: 10px 12px;
  display: flex;
  align-items: center;
}
.board-header > div:last-child, .board-row > *:last-child { border-right: 0; }
.col-month.current { color: var(--blue); background: rgba(0, 116, 200, 0.08); }
.board-row { border-bottom: 1px solid var(--line); min-height: 58px; background: #fff; }
.board-row:hover { background: rgba(54, 180, 229, 0.04); }
.cell-party { flex-direction: column; align-items: flex-start !important; gap: 2px; }
.cell-party strong { color: var(--navy); font-size: 13px; }
.cell-party small { color: var(--slate); font-size: 11px; }
.cell-contact { color: #3a4557; font-size: 12px; font-weight: 600; }
.cell-actions {
  gap: 4px !important;
  justify-content: center;
  padding: 8px 4px !important;
}
.row-action {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.row-action:hover { border-color: var(--blue); color: var(--blue); }
.row-action.danger { color: #b42318; }
.row-action.danger:hover { border-color: #b42318; background: #fff5f5; }

.month-range-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.month-range-field input {
  width: 88px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
}
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 12px; }

.history-toolbar {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}
.history-date-chip .filter-chip-select {
  color-scheme: light;
}
.filter-chip-input {
  width: 100%;
  min-height: 36px;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  color: var(--navy);
  padding: 0;
}
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 0 24px;
  max-width: 920px;
}
.timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 14px;
  position: relative;
  padding-bottom: 18px;
}
.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.timeline-marker {
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
  z-index: 1;
}
.timeline-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.timeline-card.is-done {
  border-color: #b7e4b0;
  background: linear-gradient(180deg, #f7fff5 0%, #fff 48%);
}
.timeline-card.is-danger {
  border-color: #f0c8c4;
  background: linear-gradient(180deg, #fff8f7 0%, #fff 48%);
}
.timeline-card.is-new {
  border-color: #b9d9f2;
  background: linear-gradient(180deg, #f5fbff 0%, #fff 48%);
}
.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--slate);
  margin-bottom: 8px;
}
.timeline-meta time {
  font-weight: 600;
  color: var(--slate);
}
.timeline-action-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: #e8f1f8;
  color: var(--navy);
}
.timeline-action-pill.is-done {
  background: #e8f6e6;
  color: #1f7a16;
}
.timeline-action-pill.is-danger {
  background: #fdecec;
  color: #b42318;
}
.timeline-action-pill.is-new {
  background: #e7f2fa;
  color: var(--blue);
}
.timeline-meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 99px;
  background: #f3f7fa;
  color: var(--slate);
  font-weight: 600;
}
.timeline-action { color: var(--navy); font-size: 12px; }
.timeline-title {
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 8px;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.timeline-detail {
  margin: 0 0 8px;
  color: #3a4557;
  font-size: 13px;
  line-height: 1.45;
}
.timeline-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin: 0;
  padding-top: 4px;
}
.timeline-fact {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fbfe;
  min-width: 0;
}
.timeline-fact.is-changed {
  border-color: #9ec7e8;
  background: #eef6fc;
}
.timeline-fact dt {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--slate);
}
.timeline-fact dd {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--navy);
  line-height: 1.4;
  word-break: break-word;
}
.cell-month {
  flex-direction: column !important;
  justify-content: center;
  gap: 4px;
  background: transparent;
  color: inherit;
  min-height: 58px;
  border-radius: 0;
  padding: 8px 4px !important;
}
.cell-month:hover { background: rgba(0, 116, 200, 0.06); }
.dots-row { display: flex; gap: 3px; justify-content: center; }
.dot-act { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dot-act.empty { background: #e7eef3; }
.dot-act.done { box-shadow: 0 0 0 1.5px var(--green); }
.mes-count { font-size: 10px; font-weight: 700; color: var(--slate); }
.mes-count.tiene { color: var(--navy); }
.mes-count.completo { color: var(--green); }

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1100px;
  font-size: 13px;
}
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f3f7fa;
}
.data-table tfoot td,
.data-table tfoot th {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: #fff;
  box-shadow: 0 -1px 0 var(--line);
}
.data-table th {
  text-align: left;
  background: #f3f7fa;
  color: var(--slate);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 12px;
  border-bottom: 2px solid var(--line);
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.row-actions { display: flex; gap: 6px; }
.empty-state {
  padding: 36px 16px;
  text-align: center;
  color: var(--slate);
  font-size: 13px;
}

.act-popover {
  position: fixed;
  z-index: 40;
  width: 320px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 55, 100, 0.18);
  padding: 14px;
}
.act-pop-title { font-size: 13px; font-weight: 800; color: var(--navy); }
.act-pop-sub {
  font-size: 10px;
  color: var(--slate);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 2px 0 10px;
}
.act-pop-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
  padding: 8px;
  margin-bottom: 8px;
  display: grid;
  gap: 6px;
}
.act-pop-row.done { border-color: #9ad48d; background: #f3fff0; }
.act-pop-row.locked { opacity: 0.72; }
.act-pop-row-top { display: flex; align-items: center; gap: 6px; }
.act-pop-txt {
  flex: 1;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  min-height: 28px !important;
  padding: 0 !important;
  font-size: 12px;
  font-weight: 700;
  min-width: 0;
}
.act-pop-desc {
  width: 100%;
  min-height: 56px !important;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 11px;
  padding: 6px 8px;
  resize: vertical;
}
.act-pop-check { accent-color: var(--green); width: auto; min-height: auto; }
.proc-dot-mini { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.proc-badge {
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  border-radius: 99px;
  padding: 2px 6px;
  text-transform: uppercase;
}
.act-pop-del, .lock-icon {
  background: none;
  border: 0;
  color: #9aa7b2;
  min-height: auto;
  padding: 0 2px;
  font-size: 14px;
}
.act-pop-close { width: 100%; margin-top: 8px; }
.act-pop-empty, .act-pop-hint {
  font-size: 12px;
  color: var(--slate);
  text-align: center;
  margin: 8px 0;
}
.act-pop-area { width: 100%; margin-bottom: 6px; }

.modal-root {
  position: fixed;
  inset: 0;
  background: rgba(16, 36, 54, 0.45);
  display: grid;
  place-items: center;
  align-content: safe center;
  justify-items: safe center;
  z-index: 50;
  padding: max(12px, env(safe-area-inset-top, 0px))
    max(12px, env(safe-area-inset-right, 0px))
    max(12px, env(safe-area-inset-bottom, 0px))
    max(12px, env(safe-area-inset-left, 0px));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.modal-card {
  width: min(640px, 100%);
  max-width: 100%;
  max-height: calc(100dvh - 24px);
  max-height: calc(100vh - 24px);
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  box-sizing: border-box;
  overflow: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.modal-card > h2 {
  flex-shrink: 0;
  margin: 0 0 4px;
  color: var(--navy);
  font-size: clamp(18px, 4vw, 22px);
}
.modal-card.act-modal {
  width: min(920px, 100%);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 24px);
  max-height: calc(100vh - 24px);
}
.act-modal-head,
.act-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.act-modal-foot {
  border-bottom: 0;
  border-top: 1px solid var(--line);
}
.act-modal-foot-spacer { flex: 1; min-width: 8px; }
.act-modal-head h2 { margin: 4px 0 0; font-size: clamp(16px, 3.5vw, 20px); color: var(--navy); }
.act-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.act-modal-list {
  border-right: 1px solid var(--line);
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f7fafc;
  min-width: 0;
}
.act-modal-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  text-align: left;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid var(--line);
  background: #fff;
  color: inherit;
  border-radius: 10px;
  padding: 10px;
  font-weight: 600;
  cursor: pointer;
}
.act-modal-item.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px rgba(0, 116, 200, 0.2);
}
.act-modal-item.done { opacity: 0.85; }
.act-modal-item-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}
.act-modal-item-copy strong,
.act-modal-item-copy small {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.act-modal-item-copy strong {
  font-size: 13px;
  color: var(--navy);
}
.act-modal-item-copy small { color: var(--slate); font-size: 11px; font-weight: 600; }
.act-modal-chip,
.act-modal-item .lock-icon {
  flex-shrink: 0;
  white-space: nowrap;
}
.act-modal-chip {
  font-size: 10px;
  font-weight: 800;
  color: var(--green);
  text-transform: uppercase;
}
.act-modal-add { width: 100%; }
.act-modal-editor {
  padding: 16px 18px;
  overflow: auto;
  min-height: 0;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}
.act-modal-editor h3 { margin: 0 0 12px; color: var(--navy); }
.act-modal-fields { display: grid; gap: 12px; }
.act-modal-fields label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: var(--slate); }
.act-modal-fields .field-control,
.modal-form .field-control {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.act-modal-fields textarea.field-control,
.modal-form textarea.field-control {
  min-height: 72px;
  resize: vertical;
  max-height: 40vh;
}
.check-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 600 !important;
  color: var(--navy) !important;
}
.types-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.area-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.area-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--navy);
  font-weight: 700;
  font-size: 13px;
}
.area-chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--chip, #5b6670);
}
.area-chip.active {
  border-color: var(--chip, var(--blue));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--chip, var(--blue)) 25%, transparent);
}
.area-chip.readonly { opacity: 0.78; }
.area-chip small {
  font-size: 10px;
  font-weight: 600;
  color: var(--slate);
  text-transform: uppercase;
}
.types-panel-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.types-panel-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.types-panel-head h3 { margin: 0 0 4px; color: var(--navy); }
.types-table { min-width: 640px; }

@media (max-width: 760px) {
  .act-modal-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(140px, 32vh) minmax(0, 1fr);
  }
  .act-modal-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 32vh;
  }
  .sticky-party, .sticky-contact { position: static; box-shadow: none; }
}
.modal-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  min-width: 0;
  flex: 1 1 auto;
}
.modal-form .field {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--slate);
}
.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  position: sticky;
  bottom: 0;
  margin-top: 4px;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 28%);
  z-index: 1;
}
.modal-actions .btn {
  flex: 1 1 auto;
  min-width: min(140px, 100%);
}
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: var(--navy);
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  z-index: 60;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.confirm-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  align-content: safe center;
  justify-items: safe center;
  padding: max(12px, env(safe-area-inset-top, 0px))
    max(12px, env(safe-area-inset-right, 0px))
    max(12px, env(safe-area-inset-bottom, 0px))
    max(12px, env(safe-area-inset-left, 0px));
  background: rgba(15, 23, 42, 0.45);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
}
body.busy-locked {
  overflow: hidden;
}
.busy-card {
  width: min(360px, 100%);
  background: #fff;
  border-radius: 12px;
  padding: 28px 24px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.busy-card h2 {
  margin: 14px 0 6px;
  color: var(--navy);
  font-size: 18px;
  letter-spacing: -0.02em;
}
.busy-message {
  margin: 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.45;
}
.busy-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto;
  border: 3px solid #e2e8f0;
  border-top-color: var(--blue, #0074c8);
  border-radius: 50%;
  animation: busy-spin 0.75s linear infinite;
}
.busy-check {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 50%;
  background: #e8f6e6;
  color: #14532d;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}
.busy-check::before {
  content: "✓";
}
.busy-card-success .busy-message {
  color: #14532d;
}
@keyframes busy-spin {
  to { transform: rotate(360deg); }
}
.confirm-card {
  width: min(420px, 100%);
  max-height: calc(100dvh - 24px);
  max-height: calc(100vh - 24px);
  background: #fff;
  border-radius: 12px;
  padding: 20px 20px 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  box-sizing: border-box;
  overflow: auto;
}
.confirm-card h2 {
  margin: 0;
  font-size: 18px;
}
.confirm-message {
  margin: 0;
  color: #334155;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.board-membership-th {
  width: 72px;
  text-align: center;
}
.board-membership-cell {
  text-align: center;
  vertical-align: middle;
}
.board-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.board-toggle-add {
  background: #e8f6e6;
  color: var(--green);
  border-color: #b7e4b0;
}
.board-toggle-add:hover {
  background: #d6f0d2;
  color: #2f8f22;
  box-shadow: 0 0 0 3px rgba(61, 174, 43, 0.18);
}
.board-toggle-remove {
  background: #fef3f2;
  color: var(--danger);
  border-color: #f0c7c3;
}
.board-toggle-remove:hover {
  background: #fde8e6;
  color: #912018;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.14);
}
.board-row-suggest {
  background: #f8fafc;
  border-bottom: 1px dashed var(--line);
}
.board-suggest-action {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  grid-column: 4 / -1;
}

@media (min-width: 1200px) {
  .login-brand-watermark { display: block; }
}

@media (max-width: 960px) {
  .login-brand-panel strong { font-size: clamp(26px, 5vw, 40px); }
  .modal-grid { grid-template-columns: 1fr; }
}

@media (max-height: 720px) {
  .modal-card,
  .modal-card.act-modal,
  .confirm-card {
    max-height: calc(100dvh - 16px);
    max-height: calc(100vh - 16px);
  }
  .modal-root,
  .confirm-root {
    padding: 8px;
  }
  .act-modal-head,
  .act-modal-foot {
    padding: 10px 12px;
  }
}

@media (max-width: 760px) {
  .login-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .login-brand-panel {
    min-height: 0;
    padding: 24px 20px 20px;
    gap: 16px;
  }
  .login-brand-mark { width: 56px; }
  .login-brand-copy { max-width: none; }
  .login-brand-panel strong { font-size: 28px; }
  .login-card { width: min(460px, calc(100% - 32px)); padding: 28px 12px 40px; }
  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  aside {
    height: auto;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
  }
  .content {
    height: auto;
    overflow: visible;
  }
  nav {
    display: flex;
    gap: 8px;
    margin: 0;
    width: 100%;
    order: 3;
  }
  nav button { width: auto; border-left: 0; border-bottom: 3px solid transparent; border-radius: 6px; }
  nav button.nav-active { border-bottom-color: var(--green); }
  .sidebar-brand img { width: 116px; padding: 7px; }
  .sidebar-brand span { display: none; }
  .user-box { margin: 0 0 0 auto; }
  .page-header { flex-direction: column; }
}

@media (max-height: 640px) and (min-width: 761px) {
  .login-brand-panel { padding: 28px 32px; }
  .login-brand-mark { width: 72px; }
  .login-brand-watermark { display: none; }
  .login-brand-panel strong { font-size: 32px; }
}

/* Teléfono: lo que se abre al tocar no puede salir del área visible. */
@media (max-width: 900px) {
  .modal-root,
  .confirm-root,
  .dialog-backdrop,
  .busy-overlay {
    top: var(--vv-top, 0px);
    height: var(--vvh, 100svh);
    bottom: auto;
    align-content: start;
    justify-items: stretch;
    padding:
      max(8px, env(safe-area-inset-top, 0px))
      max(8px, env(safe-area-inset-right, 0px))
      max(8px, env(safe-area-inset-bottom, 0px))
      max(8px, env(safe-area-inset-left, 0px));
  }
  .modal-card,
  .modal-card.act-modal,
  .confirm-card,
  .dialog,
  .dialog-wide,
  .dialog-alert,
  .dialog-confirm,
  .busy-card,
  .login-card {
    width: 100%;
    max-width: 100%;
    max-height: calc(var(--vvh, 100svh) - 16px);
    margin-top: 0;
    overflow: auto;
    overflow-wrap: anywhere;
  }
  .column-picker-panel,
  .filter-add-menu,
  .act-popover {
    position: fixed;
    left: max(8px, env(safe-area-inset-left, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
    top: auto;
    bottom: calc(100% - var(--vv-top, 0px) - var(--vvh, 100svh) + max(8px, env(safe-area-inset-bottom, 0px)));
    width: auto;
    min-width: 0;
    max-height: min(70svh, calc(var(--vvh, 100svh) - 16px));
    overflow: auto;
    z-index: 80;
  }
  .toast {
    left: max(8px, env(safe-area-inset-left, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
    width: auto;
    max-width: none;
    bottom: calc(100% - var(--vv-top, 0px) - var(--vvh, 100svh) + max(8px, env(safe-area-inset-bottom, 0px)));
    overflow-wrap: anywhere;
  }
}
