:root {
  --portal-blue: #01244a;
  --portal-blue-deep: #00142e;
  --portal-blue-accent: #178adc;
  --portal-yellow: #fee023;
  --portal-bg: #f4f8ff;
  --portal-panel: #ffffff;
  --portal-border: #d8e5f3;
  --portal-text: #01244a;
  --portal-text-muted: #4b6685;
  --portal-accent: #178adc;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body.portal-page {
  font-family: 'Fira Sans', 'Roboto', sans-serif;
  color: var(--portal-text);
  background:
    radial-gradient(circle at top left, rgba(23, 138, 220, 0.22), transparent 34%),
    radial-gradient(circle at right top, rgba(254, 224, 35, 0.2), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, #edf4fc 100%);
}

.portal-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
}

.portal-sidebar {
  padding: 28px 22px;
  border-right: 1px solid var(--portal-border);
  background: linear-gradient(180deg, #01244a 0%, #022f5f 62%, #001b39 100%);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.portal-sidebar .portal-brand h1 {
  color: #ffffff;
}

.portal-sidebar .portal-brand__eyebrow {
  color: var(--portal-yellow);
}

.portal-sidebar .portal-brand__desc {
  color: rgba(255, 255, 255, 0.82);
}

.portal-brand img {
  display: block;
  width: 190px;
  height: 85px;
  object-fit: contain;
  margin-bottom: 18px;
}

.portal-brand__eyebrow,
.portal-topbar__eyebrow,
.portal-card__label,
.portal-status-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--portal-accent);
  margin: 0 0 8px;
}

.portal-brand h1,
.portal-topbar h2,
.portal-status-card h3,
.portal-panel h3 {
  margin: 0;
  line-height: 1.15;
}

.portal-brand h1 {
  font-size: clamp(1.7rem, 3vw, 1.4rem);
}

.portal-brand__desc,
.portal-topbar__meta,
.portal-status-card p,
.portal-card p,
.portal-panel p {
  color: var(--portal-text-muted);
  margin: 10px 0 0;
  line-height: 1.6;
}

.portal-nav {
  display: grid;
  gap: 10px;
}

.portal-nav__item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: 180ms ease;
}

.portal-nav__item i {
  width: 20px;
  text-align: center;
}

.portal-nav__item:hover,
.portal-nav__item.is-active {
  color: #ffffff;
  border-color: rgba(254, 224, 35, 0.55);
  background: linear-gradient(90deg, rgba(254, 224, 35, 0.22), rgba(23, 138, 220, 0.22));
}

.portal-main {
  padding: 28px;
}

.portal-topbar,
.portal-status-card,
.portal-panel {
  border: 1px solid var(--portal-border);
  border-radius: 24px;
  background: var(--portal-panel);
  box-shadow: 0 14px 32px rgba(1, 36, 74, 0.1);
}

.portal-topbar {
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.portal-topbar h2 {
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.portal-topbar__meta {
  margin-top: 0;
  text-align: right;
}

.portal-status-card {
  padding: 22px 24px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #01244a 0%, #0f4f88 100%);
}

.portal-status-card h3 {
  color: #ffffff;
}

.portal-status-card p {
  color: rgba(255, 255, 255, 0.86);
}

.portal-status-card__badge {
  color: #01244a;
  background: var(--portal-yellow);
  border: 1px solid rgba(1, 36, 74, 0.12);
  padding: 6px 10px;
  border-radius: 999px;
}

.portal-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.portal-card {
  padding: 22px;
  border-radius: 20px;
  border: 1px solid var(--portal-border);
  background: #ffffff;
}

.portal-card-grid--compact {
  margin-top: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-card--soft {
  background: #f7fbff;
}

.portal-detail-card {
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.portal-detail-card:hover,
.portal-detail-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(23, 138, 220, 0.55);
  box-shadow: 0 10px 22px rgba(1, 36, 74, 0.12);
  outline: none;
}

.portal-card strong {
  display: block;
  font-size: 2rem;
  margin-top: 10px;
}

.portal-status-card__connection {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.portal-workflow-panel {
  margin-top: 18px;
}

.portal-workflow-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.portal-workflow-panel__head h3 {
  color: var(--portal-blue);
}

.portal-workflow-panel__head p {
  max-width: 70ch;
}

.portal-workflow-panel__badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(23, 138, 220, 0.24);
  background: rgba(23, 138, 220, 0.1);
  color: var(--portal-blue);
  font-size: 0.8rem;
  font-weight: 700;
}

.portal-workflow-panel__actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.portal-workflow-action {
  border: 1px solid #bfd5ec;
  border-radius: 16px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f9ff 100%);
  color: var(--portal-blue);
  text-align: left;
  font: inherit;
  font-weight: 700;
  line-height: 1.45;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(1, 36, 74, 0.08);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.portal-workflow-action:hover,
.portal-workflow-action:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(23, 138, 220, 0.65);
  box-shadow: 0 12px 24px rgba(1, 36, 74, 0.12);
  outline: none;
}

.portal-section {
  display: none;
  gap: 18px;
}

.portal-section.is-active {
  display: grid;
}

.portal-main > .portal-section + .portal-section {
  margin-top: 1rem;
}

.portal-main > .portal-section[hidden] {
  display: none !important;
  margin-top: 0;
}

.portal-panel {
  padding: 22px;
}

.portal-records-panel {
  position: relative;
  overflow: hidden;
}

.portal-records-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top right, rgba(23, 138, 220, 0.12), transparent 44%);
}

.portal-records-panel--client::before {
  background: radial-gradient(circle at top right, rgba(254, 224, 35, 0.22), transparent 44%);
}

.portal-records-workspace {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
}

.portal-records-head {
  display: grid;
  gap: 14px;
}

.portal-records-toolbar {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
}

.portal-filter-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-filter-chip {
  border: 1px solid rgba(1, 36, 74, 0.2);
  background: #ffffff;
  color: var(--portal-blue);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.portal-filter-chip.is-active,
.portal-filter-chip:hover {
  border-color: rgba(23, 138, 220, 0.7);
  background: rgba(23, 138, 220, 0.11);
}

.portal-records-select {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--portal-blue);
}

.portal-records-select select {
  min-height: 38px;
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  padding: 7px 30px 7px 10px;
  background: #ffffff;
  color: var(--portal-blue);
  font: inherit;
}

.portal-records-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 14px;
}

.portal-records-stream {
  display: grid;
  gap: 12px;
}

.portal-record-entry {
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  border: 1px solid var(--portal-border);
  border-radius: 16px;
  padding: 10px;
  background: linear-gradient(130deg, #ffffff 0%, #f5faff 100%);
}

.portal-record-image-btn {
  border: 0;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  cursor: zoom-in;
  background: #dceaf8;
}

.portal-record-image-btn img {
  width: 100%;
  height: 100%;
  min-height: 112px;
  object-fit: cover;
  display: block;
}

.portal-record-entry__content h4 {
  margin: 8px 0 0;
  color: var(--portal-blue);
}

.portal-record-entry__content p {
  margin: 8px 0 0;
}

.portal-record-entry__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--portal-text-muted);
}

.portal-records-insight {
  border: 1px solid var(--portal-border);
  border-radius: 16px;
  padding: 14px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(23, 138, 220, 0.08);
}

.portal-records-insight h4 {
  margin: 0;
  color: var(--portal-blue);
}

.portal-records-insight ul {
  margin: 12px 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.portal-records-insight li {
  color: var(--portal-text-muted);
}

.portal-records-insight strong {
  color: var(--portal-blue);
  margin-right: 4px;
}

.portal-client-compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.portal-client-compare label {
  display: grid;
  gap: 6px;
  color: var(--portal-blue);
  font-size: 0.82rem;
  font-weight: 700;
}

.portal-client-compare select {
  min-height: 38px;
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  padding: 7px 10px;
  font: inherit;
  color: var(--portal-blue);
  background: #ffffff;
}

.portal-client-output {
  margin: 0;
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #f9fcff;
  color: var(--portal-blue);
  font-size: 0.92rem;
}

.portal-record-entry--client {
  background: linear-gradient(130deg, #ffffff 0%, #fffdf4 100%);
}

.portal-records-hero {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(23, 138, 220, 0.26);
  background: linear-gradient(120deg, #f4f9ff 0%, #ffffff 100%);
}

.portal-records-hero h3 {
  color: var(--portal-blue);
}

.portal-records-hero--client {
  border-color: rgba(244, 183, 0, 0.32);
  background: linear-gradient(120deg, #fffdf1 0%, #ffffff 100%);
}

.portal-records-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.portal-records-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(1, 36, 74, 0.16);
  background: #ffffff;
  color: var(--portal-blue);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.portal-record-card {
  position: relative;
  padding-bottom: 16px;
}

.portal-record-card::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 0;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f3d6a 0%, #178adc 100%);
  opacity: 0.85;
}

.portal-records-panel--client .portal-record-card::after {
  background: linear-gradient(90deg, #b47a00 0%, #f2c500 100%);
}

.portal-record-card small {
  display: block;
  margin-top: 8px;
  color: var(--portal-text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.portal-calendar-tools {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.portal-primary-btn--ghost {
  background: #ffffff;
  color: var(--portal-blue);
}

.portal-calendar-jump {
  display: inline-grid;
  grid-template-columns: auto minmax(112px, auto) auto minmax(102px, auto);
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--portal-border);
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f3f8ff 100%);
  box-shadow: 0 6px 16px rgba(1, 36, 74, 0.08);
}

.portal-calendar-jump label {
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  color: var(--portal-blue);
}

.portal-calendar-jump select {
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  padding: 8px 34px 8px 12px;
  min-height: 38px;
  font-weight: 600;
  font-size: 0.92rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #0f3d6a 50%), linear-gradient(135deg, #0f3d6a 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 3px), calc(100% - 10px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  background-color: #ffffff;
  color: var(--portal-text);
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.portal-calendar-jump select:hover {
  border-color: rgba(23, 138, 220, 0.55);
}

.portal-calendar-jump select:focus {
  outline: none;
  border-color: rgba(23, 138, 220, 0.8);
  box-shadow: 0 0 0 3px rgba(23, 138, 220, 0.17);
}

.portal-calendar {
  margin-top: 16px;
  border: 1px solid var(--portal-border);
  border-radius: 18px;
  padding: 16px;
  background: #f8fbff;
}

.portal-calendar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.portal-calendar__head h4 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--portal-blue);
}

.portal-calendar__nav {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--portal-border);
  color: var(--portal-blue);
  background: #ffffff;
  cursor: pointer;
}

.portal-calendar__weekdays,
.portal-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.portal-calendar__weekdays span {
  text-align: center;
  font-size: 0.75rem;
  color: var(--portal-text-muted);
  font-weight: 700;
}

.portal-calendar__cell {
  min-height: 54px;
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--portal-blue);
  font-weight: 600;
  cursor: pointer;
  transition: 150ms ease;
  padding: 6px;
}

.portal-calendar__cell.is-empty {
  border-style: dashed;
  background: #f3f8ff;
  cursor: default;
}

.portal-calendar__cell.has-job {
  border-color: rgba(23, 138, 220, 0.5);
  background: rgba(23, 138, 220, 0.08);
}

.portal-calendar__cell.is-today {
  border-color: rgba(244, 179, 0, 0.78);
  box-shadow: inset 0 0 0 1px rgba(244, 179, 0, 0.5);
}

.portal-calendar__cell.is-selected {
  border-color: rgba(1, 36, 74, 0.85);
  background: rgba(1, 36, 74, 0.11);
}

.portal-calendar__cell:hover {
  transform: translateY(-1px);
}

.portal-calendar__cell.has-job i {
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--portal-yellow);
  margin-top: 5px;
  color: var(--portal-blue);
  font-style: normal;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.portal-calendar__legend {
  margin-top: 10px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--portal-text-muted);
  font-size: 0.82rem;
}

.portal-calendar__legend i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
  margin-right: 6px;
  border: 1px solid var(--portal-border);
  vertical-align: middle;
}

.portal-calendar__legend i.is-today {
  background: #ffffff;
  border-color: rgba(244, 179, 0, 0.72);
}

.portal-calendar__legend i.has-job {
  background: rgba(23, 138, 220, 0.15);
  border-color: rgba(23, 138, 220, 0.55);
}

.portal-calendar__legend i.is-selected {
  background: rgba(1, 36, 74, 0.18);
  border-color: rgba(1, 36, 74, 0.85);
}

.portal-day-agenda {
  margin-top: 14px;
  border: 1px solid var(--portal-border);
  border-radius: 16px;
  background: #ffffff;
  padding: 14px;
}

.portal-day-agenda__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.portal-day-agenda__head h4 {
  margin: 0;
  color: var(--portal-blue);
  font-size: 1rem;
}

.portal-day-agenda__head span {
  color: var(--portal-text-muted);
  font-weight: 600;
}

.portal-day-agenda__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.portal-day-agenda__list li {
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  background: #f8fbff;
  padding: 10px;
}

.portal-day-agenda__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.portal-day-agenda__list h5 {
  margin: 8px 0 4px;
  color: var(--portal-blue);
  font-size: 0.98rem;
}

.portal-day-agenda__list p {
  margin: 0;
  display: grid;
  gap: 4px;
}

.portal-day-agenda__list p span {
  color: var(--portal-text-muted);
}

.portal-day-agenda__empty {
  margin: 0;
  color: var(--portal-text-muted);
}

.portal-schedule-filters {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.portal-schedule-filters button {
  border: 1px solid var(--portal-border);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--portal-blue);
  background: #ffffff;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.portal-schedule-filters button.is-active {
  background: rgba(23, 138, 220, 0.14);
  border-color: rgba(23, 138, 220, 0.6);
}

.portal-table-scope {
  margin: 10px 0 0;
  color: var(--portal-text-muted);
  font-size: 0.84rem;
}

.portal-table-wrap {
  margin-top: 18px;
  overflow-x: auto;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.portal-table th,
.portal-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--portal-border);
  text-align: left;
  color: var(--portal-text);
}

.portal-table th {
  color: var(--portal-blue);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.portal-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #c7d9ed;
  background: #eef5ff;
  color: #1a4a76;
  font-size: 0.76rem;
  font-weight: 700;
}

.portal-pill.is-live {
  background: #e8f7ef;
  border-color: #9fd3b5;
  color: #1d7f36;
}

.portal-pill.is-alert {
  background: #fff5e5;
  border-color: #f3d292;
  color: #9b5a00;
}

.portal-pill.is-progress {
  background: #e9f1ff;
  border-color: #a9c5ee;
  color: #1a4a8a;
}

.portal-evidence-grid {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}

.portal-evidence-item {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--portal-border);
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(140deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 10px 20px rgba(1, 36, 74, 0.08);
}

.portal-evidence-item img {
  width: 100%;
  height: 112px;
  object-fit: cover;
  border-radius: 10px;
  cursor: zoom-in;
}

.portal-evidence-item h4 {
  margin: 0;
  color: var(--portal-blue);
  font-size: 1rem;
}

.portal-evidence-item p {
  margin-top: 8px;
}

.portal-evidence-meta {
  display: inline-block;
  margin-top: 8px;
  color: #264e76;
  font-size: 0.82rem;
  font-weight: 600;
}

body.portal-lightbox-open {
  overflow: hidden;
}
body.portal-list-modal-open {
  overflow: hidden;
}

.portal-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(1, 36, 74, 0.76);
  backdrop-filter: blur(8px);
}

.portal-lightbox[hidden] {
  display: none !important;
}

.portal-lightbox__content {
  position: relative;
  width: min(920px, 100%);
  max-height: 92vh;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

.portal-lightbox__content img {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 18px;
  background: #f4f8ff;
}

.portal-lightbox__caption {
  margin: 12px 0 0;
  color: var(--portal-blue);
  font-weight: 600;
}

.portal-lightbox__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--portal-yellow);
  color: var(--portal-blue);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

body.portal-list-modal-open {
  overflow: hidden;
}

.portal-list-modal {
  position: fixed;
  inset: 0;
  z-index: 3100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(1, 36, 74, 0.7);
  backdrop-filter: blur(6px);
}

.portal-list-modal[hidden] {
  display: none !important;
}

.portal-list-modal__content {
  position: relative;
  width: min(760px, 100%);
  max-height: 88vh;
  overflow: auto;
  border-radius: 22px;
  border: 1px solid #c8daed;
  background: #ffffff;
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.28);
  padding: 20px 20px 16px;
}

.portal-list-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: var(--portal-yellow);
  color: var(--portal-blue);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.portal-list-modal__title {
  margin: 0 44px 12px 0;
  color: var(--portal-blue);
  font-size: 1.18rem;
}

.portal-list-modal__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.portal-list-modal__list li {
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  background: #f8fbff;
  padding: 10px 12px;
  color: var(--portal-text);
  line-height: 1.55;
}

.portal-photo-form {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portal-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.portal-photo-input {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--portal-border);
  border-radius: 14px;
  background: #f9fcff;
  font-weight: 600;
}

.portal-photo-input input[type="file"] {
  color: var(--portal-text);
  width: 100%;
  max-width: 100%;
}

.portal-photo-input small {
  font-weight: 400;
  color: var(--portal-text-muted);
}

.portal-photo-input--note textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  padding: 12px;
  color: var(--portal-text);
  font: inherit;
  line-height: 1.55;
  background: #ffffff;
}

.portal-photo-input--note textarea:focus {
  outline: none;
  border-color: rgba(23, 138, 220, 0.8);
  box-shadow: 0 0 0 3px rgba(23, 138, 220, 0.16);
}

.portal-photo-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
}

.portal-photo-thumb {
  margin: 0;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  background: #ffffff;
}

.portal-photo-thumb img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--portal-border);
}

.portal-photo-thumb figcaption {
  display: grid;
  gap: 4px;
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--portal-text-muted);
  word-break: break-word;
}

.portal-photo-thumb figcaption strong {
  color: var(--portal-text);
  font-size: 0.82rem;
}

.portal-photo-form__note {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: var(--portal-text-muted);
}

.portal-photo-form__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-primary-btn {
  border: 1px solid #b4cff0;
  border-radius: 12px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #01244a, #178adc);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

#employeePhotoStatus {
  margin: 0;
  font-size: 0.92rem;
}

#employeePhotoStatus.is-success {
  color: #1c7f35;
}

#employeePhotoStatus.is-error {
  color: #b42318;
}

@media (max-width: 1080px) {
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--portal-border);
  }
}

@media (max-width: 720px) {
  .portal-main {
    padding: 18px;
  }

  .portal-topbar,
  .portal-card-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .portal-topbar__meta {
    text-align: left;
  }

  .portal-photo-grid {
    grid-template-columns: 1fr;
  }

  .portal-card-grid--compact {
    grid-template-columns: 1fr;
  }

  .portal-workflow-panel__head,
  .portal-workflow-panel__actions {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .portal-records-hero {
    flex-direction: column;
  }

  .portal-records-toolbar,
  .portal-records-layout,
  .portal-client-compare {
    grid-template-columns: 1fr;
  }

  .portal-records-tags {
    justify-content: flex-start;
  }

  .portal-record-entry {
    grid-template-columns: 1fr;
  }

  .portal-workflow-action {
    width: 100%;
  }

  .portal-card-grid,
  .portal-photo-grid {
    grid-template-columns: 1fr;
  }

  .portal-evidence-item {
    grid-template-columns: 1fr;
  }

  .portal-calendar-tools,
  .portal-day-agenda__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-calendar-jump {
    width: 100%;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .portal-calendar-jump label {
    min-width: 52px;
  }

  .portal-schedule-filters {
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-lightbox {
    padding: 12px;
  }

  .portal-list-modal {
    padding: 12px;
  }

  .portal-photo-form__actions {
    flex-direction: column;
    align-items: flex-start;
  }
}