.portal-card,
.portal-calendar,
.portal-docs,
.portal-dashboard,
.portal-gate {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 1.1rem 1.15rem 1.2rem;
  margin: 0 0 0.9rem;
}

.portal-card h2,
.portal-calendar h2,
.portal-docs h2,
.portal-dashboard h2,
.portal-gate h2 {
  margin: 0 0 0.4rem;
  font-size: 1.35rem;
}

.portal-card p,
.portal-docs p,
.portal-dashboard > p,
.portal-gate p { margin: 0 0 0.85rem; color: var(--ink-soft); }

.need-access { margin: 0.2rem 0 0; font-weight: 600; }

.portal-metric {
  border-top: 1px solid var(--line);
  margin-top: 0.9rem;
  padding-top: 0.9rem;
}

.portal-metric h3 { margin: 0 0 0.35rem; font-size: 1.12rem; }

.portal-metric h4 { margin: 0.85rem 0 0.35rem; font-size: 0.98rem; }

.portal-metric-label,
.portal-metric-sub,
.portal-dash-note { margin: 0; color: var(--ink-soft); }

.portal-metric-main {
  margin: 0.15rem 0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}

.portal-context {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.portal-people,
.portal-event-roles { list-style: none; margin: 0.4rem 0 0; padding: 0; }

.portal-people li,
.portal-event-roles > li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.portal-person { font-weight: 700; }

.portal-shift-count,
.portal-role-names { color: var(--ink-soft); }

.portal-role-names { display: block; }

.portal-open {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: #f8e6e3;
  color: #6d221c;
  font-size: 0.78rem;
  font-weight: 700;
}

.portal-soon {
  display: inline-block;
  margin: 0 0 0.55rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #e7f2f1;
  color: var(--pine-deep);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 0.85rem;
}

.portal-example-tag {
  display: inline-block;
  margin-left: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dash-toggles { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; align-items: center; margin: 0 0 0.75rem; }
.lens-tabs { display: flex; gap: 0.35rem; margin: 0; }
.lens-tabs button {
  border: 1px solid var(--line);
  background: #fff;
  color: #5c5c5c;
  border-radius: 999px;
  min-height: 44px;
  padding: 0.35rem 0.9rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.lens-tabs button.is-on { background: var(--pine); color: #fff; border-color: var(--pine); }
.lens-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; align-items: start; }
.rank-num { font-weight: 700; color: #8a8a8a; font-variant-numeric: tabular-nums; }
.rank-row .rank-num { width: 1.2rem; }

.exec-band,
.panel {
  background: #fff;
  border-radius: 16px;
  padding: 1.15rem 1.25rem 1.3rem;
  margin: 0 0 0.85rem;
}

.portal-dashboard {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.exec-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: -1.15rem -1.25rem 1rem;
  padding: 0.75rem 1.25rem;
  background: #2d515f;
  color: #fff;
  border-radius: 16px 16px 0 0;
  font-family: var(--serif);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.exec-top {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(11rem, 0.8fr) minmax(9rem, 0.7fr);
  gap: 1rem;
  align-items: center;
  margin-top: 0.8rem;
}

.ring-row { display: flex; gap: 0.35rem; justify-content: space-between; }
.ring-tile { flex: 1; text-align: center; min-width: 0; }
.ring-tile svg { width: 100%; max-width: 8.5rem; height: auto; display: block; margin: 0 auto; }
.ring-label {
  margin: 0.15rem 0 0;
  font-family: var(--serif);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a8a8a;
}
.ring-label span { color: var(--pine); letter-spacing: 0; text-transform: none; }

.panel-kicker,
.top-card .panel-kicker,
.spark-card .panel-kicker {
  margin: 0 0 0.45rem;
  font-family: var(--serif);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8a8a;
}

.action-title { margin: 0 0 0.7rem; font-size: 1.15rem; }

.top-list { list-style: none; margin: 0; padding: 0; }
.top-list li { border-top: 1px solid #f0f0f0; }
.top-list button {
  display: flex;
  justify-content: space-between;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0.45rem 0;
  font: inherit;
  font-weight: 700;
  color: #5c5c5c;
  cursor: pointer;
}
.top-list li:first-child button { color: var(--pine); }
.top-list strong { font-variant-numeric: tabular-nums; }

.spark-card { text-align: left; }
.spark-value {
  margin: 0;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}
.spark-label { margin: 0.15rem 0 0.35rem; color: #8a8a8a; font-size: 0.85rem; }
.spark { width: 100%; height: 36px; display: block; }

.vchart { display: grid; grid-template-columns: minmax(0, 1fr) 10rem; gap: 1rem; align-items: end; }
.vbars { display: flex; align-items: flex-end; gap: 0.55rem; height: 150px; }
.vbar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.vbar-value { font-weight: 700; font-size: 0.85rem; color: #39393a; margin-bottom: 0.2rem; }
.vbar-col {
  width: 100%;
  max-width: 2.6rem;
  background: #e4e4e4;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.vbar-col.is-focus { background: var(--pine); }
.vbar-label { margin-top: 0.3rem; font-size: 0.75rem; color: #8a8a8a; text-align: center; }
.share-chips { display: flex; flex-direction: column; gap: 0.35rem; }
.share-chip {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  border: 0;
  background: #f3f3f3;
  color: #5c5c5c;
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.share-chip.is-focus { background: var(--pine); color: #fff; }
.share-chip strong { font-weight: 700; }

.progress-table { display: flex; flex-direction: column; gap: 0.65rem; }
.rank-row { grid-template-columns: 1.4rem minmax(0, 1.1fr) 4.8rem minmax(0, 1.4fr) auto; }
.progress-row {
  display: grid;
  grid-template-columns: minmax(8rem, 1.1fr) 4.5rem minmax(0, 1.6fr) auto;
  gap: 0.55rem;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  padding: 0;
  cursor: pointer;
}
.progress-title { display: block; font-weight: 700; color: #39393a; }
.progress-sub { display: block; color: #8a8a8a; font-size: 0.82rem; }
.progress-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.progress-track { display: block; height: 1.35rem; background: #ececec; border-radius: 999px; overflow: hidden; }
.progress-fill {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
  background: #d5d5d5;
  color: #39393a;
  font-size: 0.75rem;
  font-weight: 700;
  padding-right: 0.4rem;
  box-sizing: border-box;
}
.progress-fill.is-focus { background: var(--pine); color: #fff; }
.progress-fill:empty { padding: 0; }
.progress-pct { color: #8a8a8a; font-size: 0.75rem; font-weight: 700; }
.rank-row { grid-template-columns: 1.4rem minmax(0, 1.1fr) 4.8rem minmax(0, 1.4fr) auto; }

.portal-headline {
  margin: 0 0 0.45rem;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.portal-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.9rem 0 0.2rem;
}

.portal-kpi { min-width: 0; }

.portal-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  align-items: center;
  margin: 0 0 0.7rem;
  color: var(--ink-soft);
}

.portal-crumbs button {
  border: 0;
  background: transparent;
  color: var(--pine);
  font: inherit;
  font-weight: 700;
  padding: 0.35rem 0;
  cursor: pointer;
}

.shift-months {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
  margin: 0.2rem 0 0.55rem;
}

.shift-month,
.shift-name,
.shift-total,
.shift-seg {
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.shift-month { color: var(--ink-soft); font-weight: 700; padding: 0.2rem 0; }
.shift-month.is-focus { color: var(--pine); }

.shift-chart { display: flex; flex-direction: column; gap: 0.45rem; }

.shift-row {
  display: grid;
  grid-template-columns: minmax(7.5rem, 11rem) minmax(0, 1fr) 2.2rem;
  gap: 0.45rem;
  align-items: center;
}

.shift-name { color: #8a8a8a; font-weight: 700; padding: 0; }
.shift-name.is-focus,
.shift-total.is-focus { color: var(--pine); }

.shift-track {
  display: flex;
  min-height: 1.7rem;
  gap: 2px;
}

.shift-seg {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 1.4rem;
  padding: 0.15rem 0.35rem;
  background: #e4e4e4;
  color: #5c5c5c;
  font-size: 0.78rem;
  font-weight: 700;
}

.shift-seg.is-focus { background: var(--pine); color: #fff; }

.shift-total { font-weight: 700; color: #8a8a8a; text-align: right; padding: 0; }

.portal-chart-note { margin: 0.55rem 0 0; color: var(--ink-soft); font-size: 0.92rem; }

.portal-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.7rem;
  font-size: 0.95rem;
}

.portal-table th {
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  padding: 0.35rem 0.4rem 0.35rem 0;
}

.portal-table td {
  padding: 0.45rem 0.4rem 0.45rem 0;
  border-top: 1px solid #eee;
  vertical-align: top;
}

.portal-table button {
  border: 0;
  background: transparent;
  color: var(--pine-deep);
  font: inherit;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.kpi-num { margin: 0.85rem 0 0.15rem; font-size: 2rem; font-weight: 700; line-height: 1; }
.filter-bar { margin: 0 0 0.85rem; }
.filter-menu { position: relative; }
.filter-open { display: none; }
.filter-menus,
.group-by,
.filter-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.group-by,
.filter-chips { margin-top: 0.55rem; }
.filter-menu summary,
.filter-chip,
.filter-clear,
.filter-open {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.filter-menu summary { list-style: none; }
.filter-menu summary::-webkit-details-marker { display: none; }
.filter-menu-list {
  position: absolute;
  z-index: 4;
  min-width: 12rem;
  max-height: 14rem;
  overflow: auto;
  margin-top: 0.3rem;
  padding: 0.45rem 0.65rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.filter-choice { display: flex; gap: 0.4rem; align-items: flex-start; padding: 0.22rem 0; font-weight: 500; }
.filter-date { display: inline-flex; gap: 0.35rem; align-items: center; font-weight: 700; }
.filter-date input,
.group-slot select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.28rem 0.4rem;
  font: inherit;
  background: #fff;
}
.filter-chip { background: #e7eef1; }
.portal-crumbs { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin: 0 0 0.55rem; }
.portal-crumbs button {
  border: 0;
  background: transparent;
  color: #407589;
  font: inherit;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}
.crumb-sep { color: #8a8a8a; }
.section-external { margin-top: 0.85rem; }

@media (max-width: 800px) {
  .exec-top,
  .vchart,
  .lens-pair { grid-template-columns: 1fr; }
  .ring-tile svg { max-width: 6.5rem; }
  .progress-row { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .progress-count { padding-top: 0.1rem; }
  .rank-row { grid-template-columns: 1.4rem minmax(0, 1fr) auto; }
  .progress-track { grid-column: 1 / -1; }
  .vbars { height: 120px; }
  .portal-table { font-size: 0.9rem; }
  .filter-open { display: inline-flex; }
  .filter-drawer { display: none; }
  .filter-drawer.is-open { display: block; }
  .filter-menu-list { position: static; box-shadow: none; max-height: none; }
}

.portal-gate form { max-width: 28rem; }

.portal-card .btn { text-decoration: none; display: inline-flex; align-items: center; }

.portal-lock {
  margin: 0.7rem 0 0;
}

.portal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
}

.portal-nav h3 {
  margin: 0;
  font-size: 1.15rem;
  text-align: center;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.3rem;
}

.portal-dow {
  font-family: var(--serif);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pine);
  text-align: center;
  padding-bottom: 0.2rem;
}

.portal-day {
  min-height: 4.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.25rem 0.3rem;
  background: #fff;
}

.portal-day.is-empty { border-color: transparent; background: transparent; }

.portal-day.is-today { box-shadow: inset 0 0 0 2px var(--pine); }

.portal-day-num {
  display: block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 0.85rem;
}

.portal-chip {
  display: block;
  margin-top: 0.18rem;
  padding: 0.05rem 0.28rem;
  border-radius: 6px;
  background: #a9d4d1;
  color: #1a333c;
  font-size: 0.68rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-subhead {
  margin: 1.15rem 0 0.35rem;
  font-size: 1.05rem;
}

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

.portal-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.portal-list li:last-child { border-bottom: 0; }

.portal-kicker {
  margin: 0;
  font-family: var(--serif);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pine);
}

.portal-when,
.portal-where { margin: 0.15rem 0 0; }

.portal-where { color: var(--ink); }

.portal-empty { color: var(--ink-soft); }

.portal-docs a {
  color: var(--pine-deep);
  font-family: var(--serif);
  font-weight: 700;
}

.portal-doc-note {
  display: block;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.portal-calendar .banner {
  width: auto;
  margin: 0 0 0.75rem;
}

#portal-calendar-note:empty,
#portal-calendar-note[hidden] { display: none; }

.plain-dash { margin-top: 0.2rem; }
.range-bar { margin: 0 0 0.35rem; }
.date-range { display: flex; flex-wrap: wrap; gap: 0.65rem; margin: 0 0 0.85rem; }
.date-field { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; }
.date-field input {
  min-height: 44px;
  min-width: 11rem;
  font: inherit;
  font-size: 1rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.plain-months { overflow-x: auto; padding-bottom: 0.2rem; }
.pill-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0 0 0.85rem; }
.pill {
  min-height: 44px;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.pill.is-on { border-color: #407589; color: #407589; }
.pill-count { margin-left: 0.4rem; font-weight: 500; color: #757575; }
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin: 0 0 0.9rem; }
.kpi-tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.95rem 1rem 1rem;
  min-width: 0;
}
.kpi-label { margin: 0; font-size: 0.98rem; font-weight: 700; }
.kpi-num { margin: 0.35rem 0 0.2rem; font-size: 2.5rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.kpi-num.is-name { font-size: 1.45rem; letter-spacing: 0; line-height: 1.15; }
.kpi-context, .kpi-pct { margin: 0; color: var(--ink-soft); font-size: 0.95rem; font-weight: 500; }
.kpi-pct { margin-left: 0.35rem; }
.compare-bars { margin: 0 0 2.4rem; }
.compare-metrics { display: flex; flex-wrap: wrap; gap: 3rem 3.5rem; }
.compare-pair { display: flex; align-items: flex-end; gap: 2px; height: 9.5rem; }
.compare-col { display: flex; flex-direction: column; align-items: center; width: 3.1rem; height: 100%; }
.compare-value { font-weight: 700; line-height: 1.2; }
.compare-track { flex: 1; width: 100%; display: flex; align-items: flex-end; margin-top: 0.25rem; }
.compare-bar { width: 100%; background: #d5d5d5; border-radius: 4px 4px 0 0; }
.compare-bar.is-focus { background: #407589; }
.compare-name { margin-top: 0.35rem; font-size: 0.85rem; color: #757575; text-align: center; line-height: 1.2; }
.plain-chart { margin: 0 0 1.2rem; }
.plain-months .vbars { gap: 0.28rem; }
.plain-months .vbar.is-total { margin-left: 1.35rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
.plain-list { margin: 0.2rem 0 0.4rem; }
.plain-row {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  gap: 0.75rem;
  border: 0;
  border-top: 1px solid #eee;
  background: transparent;
  text-align: left;
  font: inherit;
  padding: 0.55rem 0.1rem;
  cursor: pointer;
}
.plain-row.is-static { cursor: default; }
.plain-rank { width: 1.4rem; color: #8a8a8a; font-weight: 700; flex: none; }
.plain-name { flex: 1; min-width: 0; font-weight: 700; }
.plain-sub { display: block; font-weight: 500; color: #757575; }
.plain-count { font-weight: 700; text-align: right; }
.plain-count.is-open { color: #407589; }
.back-link {
  min-height: 48px;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.example-block { margin-top: 1.6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.example-kpis { grid-template-columns: 1fr 1fr; max-width: 28rem; }

@media (max-width: 800px) {
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .kpi-num { font-size: 2.1rem; }
  .plain-months .vbars { height: 150px; gap: 0.15rem; }
  .plain-months .vbar-label {
    display: inline-block;
    transform: rotate(-55deg);
    transform-origin: center top;
    white-space: nowrap;
    font-size: 0.68rem;
    margin-top: 0.55rem;
    height: 2rem;
  }
}

@media (max-width: 740px) {
  .portal-day { min-height: 2.5rem; padding: 0.2rem; }
  .portal-chip { display: none; }
  .portal-day.has-events .portal-day-num::after {
    content: '';
    display: inline-block;
    width: 0.4rem;
    height: 0.4rem;
    margin-left: 0.28rem;
    border-radius: 50%;
    background: var(--pine);
    vertical-align: middle;
  }
  .portal-nav .btn { padding-inline: 0.7rem; }
}
