:root {
  --ink-950: #0a1230;
  --ink-900: #101a3d;
  --ink-800: #1b2850;
  --ink-700: #34415f;
  --ink-600: #52607c;
  --ink-500: #71809a;
  --ink-300: #c5ccda;
  --ink-200: #dfe4ed;
  --ink-100: #edf0f5;
  --surface: #ffffff;
  --surface-subtle: #f7f8fc;
  --canvas: #f2f5fa;
  --brand: #5148d8;
  --brand-dark: #3931ad;
  --brand-soft: #eeedff;
  --teal: #0e9f8e;
  --teal-soft: #e7f8f5;
  --blue: #1976d2;
  --blue-soft: #eaf4ff;
  --green: #238b63;
  --green-soft: #e7f7f0;
  --orange: #d86b1f;
  --orange-soft: #fff1e8;
  --purple: #7b4dcc;
  --purple-soft: #f3edff;
  --cyan: #087f9b;
  --cyan-soft: #e7f7fb;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --shadow-sm: 0 1px 2px rgba(12, 24, 54, 0.05), 0 4px 12px rgba(12, 24, 54, 0.04);
  --shadow-md: 0 14px 40px rgba(15, 27, 61, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --sidebar-width: 238px;
}

.document-action-menu {
    position: relative;
}

.document-action-menu > summary {
    list-style: none;
}

.document-action-menu > summary::-webkit-details-marker {
    display: none;
}

.document-action-panel {
    position: absolute;
    right: 0;
    z-index: 20;
    width: min(25rem, 82vw);
    background: var(--bs-body-bg);
}

html {
  font-size: 15px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink-900);
  background: var(--canvas);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--brand-dark);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--brand);
}

button,
input {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 2000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: #fff;
  background: var(--ink-950);
  border-radius: 8px;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  color: #fff;
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(81, 72, 216, 0.35);
  outline-offset: 2px;
}

.btn {
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.btn-primary {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 7px 18px rgba(81, 72, 216, 0.2);
}

.btn-primary:hover,
.btn-primary:focus {
  color: #fff;
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.btn-outline-primary {
  color: var(--brand-dark);
  border-color: #b8b3ee;
  background: #fff;
}

.btn-outline-primary:hover {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--brand);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow-light {
  color: #a7ddd7;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
}

.brand-link:hover,
.brand-link:focus {
  color: #fff;
}

.brand-link-dark,
.brand-link-dark:hover,
.brand-link-dark:focus {
  color: var(--ink-950);
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(145deg, #6f66ee 0%, #4a43cf 55%, #159e96 130%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(34, 29, 116, 0.26);
  font-size: 1.15rem;
  font-weight: 900;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-copy strong {
  font-size: 1.05rem;
  font-weight: 850;
  letter-spacing: 0.015em;
}

.brand-copy small {
  margin-top: 5px;
  opacity: 0.64;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Authenticated portal shell */

.portal-shell {
  min-height: 100vh;
}

.portal-sidebar {
  position: fixed;
  z-index: 1035;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow-y: auto;
  color: #fff;
  background:
    radial-gradient(circle at 12% 3%, rgba(96, 86, 230, 0.3), transparent 29%),
    linear-gradient(180deg, #111a3d 0%, #0a1230 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  padding: 22px 22px 20px;
}

.sidebar-close {
  display: none;
  width: 38px;
  height: 38px;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-size: 1.6rem;
  line-height: 1;
}

.sidebar-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-context {
  display: flex;
  margin: 10px 17px 26px;
  padding: 14px 15px;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
}

.context-eyebrow,
.nav-section-label {
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.context-host {
  overflow: hidden;
  margin-top: 5px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-nav {
  display: flex;
  padding: 0 14px;
  flex: 1;
  flex-direction: column;
  gap: 7px;
}

.nav-section-label {
  padding: 0 12px 6px;
}

.sidebar-link {
  display: flex;
  min-height: 49px;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  color: rgba(255, 255, 255, 0.68);
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 0.87rem;
  font-weight: 650;
  text-decoration: none;
  transition:
    color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.sidebar-link:hover,
.sidebar-link:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.065);
}

.sidebar-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(93, 83, 226, 0.35), rgba(93, 83, 226, 0.12));
  border-color: rgba(151, 143, 255, 0.18);
}

.nav-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  color: #b9b5ff;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  font-size: 0.6rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.sidebar-link.active .nav-icon {
  color: #fff;
  background: rgba(109, 98, 238, 0.72);
}

.sidebar-footer {
  padding: 18px;
}

.sidebar-security {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(6, 13, 37, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 12px;
}

.security-indicator,
.generated-indicator,
.tenant-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  background: #40d6b2;
  border: 2px solid rgba(64, 214, 178, 0.26);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(64, 214, 178, 0.1);
}

.sidebar-security span:last-child,
.generated-note span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.sidebar-security strong,
.generated-note strong {
  font-size: 0.76rem;
  font-weight: 750;
}

.sidebar-security small,
.generated-note small {
  margin-top: 2px;
  color: inherit;
  opacity: 0.56;
  font-size: 0.68rem;
}

.portal-workspace {
  display: flex;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  flex-direction: column;
}

.portal-topbar {
  position: sticky;
  z-index: 1020;
  top: 0;
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(20px, 3vw, 42px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--ink-200);
  backdrop-filter: blur(14px);
}

.topbar-leading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-leading > div {
  display: flex;
  flex-direction: column;
}

.topbar-eyebrow {
  color: var(--ink-500);
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
}

.topbar-title {
  margin-top: 3px;
  color: var(--ink-900);
  font-size: 1rem;
  font-weight: 750;
}

.sidebar-toggle {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: 10px;
}

.toggle-bars,
.toggle-bars::before,
.toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink-800);
  border-radius: 2px;
}

.toggle-bars {
  position: relative;
}

.toggle-bars::before,
.toggle-bars::after {
  position: absolute;
  left: 0;
  content: "";
}

.toggle-bars::before {
  top: -6px;
}

.toggle-bars::after {
  top: 6px;
}

.account-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-avatar {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--ink-800), var(--brand));
  border-radius: 11px;
  font-size: 0.85rem;
  font-weight: 800;
}

.account-copy {
  display: flex;
  max-width: 180px;
  flex-direction: column;
  line-height: 1.2;
}

.account-copy strong {
  overflow: hidden;
  color: var(--ink-900);
  font-size: 0.79rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy span {
  overflow: hidden;
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 0.67rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu form {
  margin-left: 8px;
}

.signout-button {
  padding: 8px 11px;
  color: var(--ink-600);
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: 9px;
  font-size: 0.73rem;
  font-weight: 750;
}

.signout-button:hover {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #f0c9c5;
}

.portal-main {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 34px clamp(20px, 3vw, 42px) 48px;
  flex: 1;
}

.portal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 3vw, 42px);
  color: var(--ink-500);
  border-top: 1px solid var(--ink-200);
  font-size: 0.72rem;
}

.portal-footer a {
  color: var(--ink-600);
  text-decoration: none;
}

.sidebar-backdrop {
  display: none;
}

/* Dashboard */

.dashboard-page {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.page-heading h1 {
  margin: 0;
  color: var(--ink-950);
  font-size: clamp(1.8rem, 2.5vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.page-heading p {
  max-width: 660px;
  margin: 10px 0 0;
  color: var(--ink-600);
  font-size: 0.88rem;
}

.date-filter {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 9px;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}

.date-filter > div {
  display: flex;
  flex-direction: column;
}

.date-filter label {
  margin: 0 0 3px 3px;
  color: var(--ink-500);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.date-filter input {
  width: 132px;
  min-height: 36px;
  padding: 6px 8px;
  color: var(--ink-800);
  background: var(--surface-subtle);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 650;
}

.date-filter input:focus {
  background: #fff;
  border-color: #aaa4ed;
}

.date-separator {
  align-self: center;
  margin-top: 15px;
  color: var(--ink-300);
}

.btn-filter {
  min-height: 36px;
  padding: 7px 13px;
  color: #fff;
  background: var(--ink-900);
  border-color: var(--ink-900);
  font-size: 0.72rem;
}

.btn-filter:hover {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 152px;
  padding: 20px;
  overflow: hidden;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.kpi-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
  content: "";
}

.kpi-card::after {
  position: absolute;
  top: -36px;
  right: -32px;
  width: 100px;
  height: 100px;
  background: var(--accent-soft);
  border-radius: 50%;
  content: "";
  opacity: 0.78;
}

.kpi-indigo {
  --accent: var(--brand);
  --accent-soft: var(--brand-soft);
}

.kpi-blue {
  --accent: var(--blue);
  --accent-soft: var(--blue-soft);
}

.kpi-green {
  --accent: var(--green);
  --accent-soft: var(--green-soft);
}

.kpi-orange {
  --accent: var(--orange);
  --accent-soft: var(--orange-soft);
}

.kpi-teal {
  --accent: var(--teal);
  --accent-soft: var(--teal-soft);
}

.kpi-purple {
  --accent: var(--purple);
  --accent-soft: var(--purple-soft);
}

.kpi-cyan {
  --accent: var(--cyan);
  --accent-soft: var(--cyan-soft);
}

.kpi-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kpi-label {
  color: var(--ink-600);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.kpi-code {
  display: grid;
  width: 34px;
  height: 27px;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 7px;
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.kpi-value {
  position: relative;
  z-index: 1;
  margin-top: auto;
  overflow-wrap: anywhere;
  color: var(--ink-950);
  font-size: clamp(1.25rem, 1.65vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.kpi-context {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  color: var(--ink-500);
  font-size: 0.65rem;
  line-height: 1.35;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(280px, 0.85fr);
  gap: 16px;
}

.dashboard-card {
  min-width: 0;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.card-heading h2 {
  margin: 0;
  color: var(--ink-950);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.chart-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--ink-600);
  font-size: 0.65rem;
  font-weight: 650;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-purchases {
  background: var(--brand);
}

.dot-sales {
  background: var(--teal);
}

.dot-itc {
  background: var(--orange);
}

.chart-frame {
  position: relative;
  height: 320px;
  margin-top: 22px;
}

.chart-error {
  margin: 16px 0 0;
  color: var(--danger);
  font-size: 0.76rem;
}

.chart-table-disclosure {
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid var(--ink-100);
}

.chart-table-disclosure summary {
  width: fit-content;
  color: var(--brand-dark);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 750;
}

.chart-table-disclosure .table-responsive {
  margin-top: 14px;
}

.trend-table {
  margin-bottom: 0;
  color: var(--ink-700);
  font-size: 0.72rem;
}

.trend-table thead th {
  color: var(--ink-500);
  background: var(--surface-subtle);
  border-bottom-color: var(--ink-200);
  font-size: 0.64rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.trend-table tbody th {
  color: var(--ink-800);
  font-weight: 750;
}

.position-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
}

.position-list {
  margin: 20px 0 0;
}

.position-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--ink-100);
}

.position-list dt {
  color: var(--ink-600);
  font-size: 0.72rem;
  font-weight: 600;
}

.position-list dd {
  margin: 0;
  color: var(--ink-950);
  font-size: 0.92rem;
  font-weight: 800;
  text-align: right;
}

.generated-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding: 16px;
  color: var(--ink-600);
  background: var(--teal-soft);
  border: 1px solid #cbece6;
  border-radius: 12px;
}

.generated-note .generated-indicator {
  background: var(--teal);
  border-color: rgba(14, 159, 142, 0.24);
  box-shadow: 0 0 0 4px rgba(14, 159, 142, 0.1);
}

.empty-chart {
  display: grid;
  min-height: 285px;
  place-content: center;
  color: var(--ink-500);
  text-align: center;
}

.empty-chart > span {
  font-size: 2rem;
}

.empty-chart h3 {
  margin: 8px 0 5px;
  color: var(--ink-800);
  font-size: 0.95rem;
}

.empty-chart p {
  margin: 0;
  font-size: 0.75rem;
}

.availability-panel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 170px;
  padding: 26px;
  background: #fff;
  border: 1px solid #edcfb9;
  border-left: 4px solid var(--orange);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.availability-denied {
  border-color: #edc5c2;
  border-left-color: var(--danger);
}

.availability-icon,
.status-symbol {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--orange);
  background: var(--orange-soft);
  border-radius: 14px;
  font-weight: 900;
}

.availability-denied .availability-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.availability-panel h2 {
  margin: 0;
  color: var(--ink-950);
  font-size: 1.1rem;
  font-weight: 800;
}

.availability-panel p {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--ink-600);
  font-size: 0.79rem;
  line-height: 1.55;
}

.request-reference {
  color: var(--ink-500) !important;
  font-size: 0.68rem !important;
}

.request-reference code {
  color: var(--ink-700);
  word-break: break-all;
}

/* Public and authentication surfaces */

.public-body {
  background:
    radial-gradient(circle at 92% 4%, rgba(81, 72, 216, 0.08), transparent 25%),
    #f8f9fc;
}

.public-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.public-header,
.public-footer {
  display: flex;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
}

.public-header {
  min-height: 82px;
}

.public-header-tagline {
  color: var(--ink-500);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.025em;
}

.public-main {
  display: grid;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  flex: 1;
  place-items: center;
}

.public-footer {
  min-height: 64px;
  color: var(--ink-500);
  border-top: 1px solid var(--ink-200);
  font-size: 0.7rem;
}

.public-footer a {
  color: var(--ink-600);
  text-decoration: none;
}

.login-layout {
  display: grid;
  width: 100%;
  min-height: min(720px, calc(100vh - 170px));
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.login-story {
  position: relative;
  display: flex;
  min-width: 0;
  padding: clamp(38px, 5vw, 70px);
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background:
    radial-gradient(circle at 92% 10%, rgba(36, 197, 177, 0.23), transparent 26%),
    radial-gradient(circle at 20% 92%, rgba(105, 93, 235, 0.3), transparent 34%),
    linear-gradient(145deg, #111b42 0%, #0a1230 67%, #111a3d 100%);
}

.login-story::after {
  position: absolute;
  right: -110px;
  bottom: 82px;
  width: 270px;
  height: 270px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow:
    0 0 0 36px rgba(255, 255, 255, 0.025),
    0 0 0 74px rgba(255, 255, 255, 0.018);
  content: "";
}

.login-story-content {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.login-story h1 {
  max-width: 520px;
  margin: 12px 0 17px;
  color: #fff;
  font-size: clamp(2.2rem, 4vw, 3.7rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.login-story-content > p {
  max-width: 520px;
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.96rem;
  line-height: 1.7;
}

.benefit-list {
  display: flex;
  margin: 44px 0 0;
  padding: 0;
  flex-direction: column;
  gap: 18px;
  list-style: none;
}

.benefit-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.benefit-index {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: #a7ddd7;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  font-size: 0.59rem;
  font-weight: 850;
}

.benefit-list li > span:last-child {
  display: flex;
  color: rgba(255, 255, 255, 0.54);
  flex-direction: column;
  font-size: 0.76rem;
  line-height: 1.45;
}

.benefit-list strong {
  margin-bottom: 3px;
  color: #fff;
  font-size: 0.82rem;
}

.story-footnote {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.68rem;
  font-weight: 650;
}

.login-panel {
  display: grid;
  padding: clamp(36px, 5vw, 68px);
  place-items: center;
  background:
    linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.92)),
    radial-gradient(circle at 100% 0%, var(--brand-soft), transparent 42%);
}

.login-form-wrap {
  width: min(100%, 420px);
}

.tenant-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 11px;
  padding: 9px 13px;
  color: var(--ink-700);
  background: var(--surface-subtle);
  border: 1px solid var(--ink-200);
  border-radius: 11px;
}

.tenant-chip > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.tenant-chip small {
  color: var(--ink-500);
  font-size: 0.59rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tenant-chip strong {
  overflow: hidden;
  margin-top: 2px;
  font-size: 0.76rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-heading {
  margin: 38px 0 27px;
}

.login-heading h2 {
  margin: 0;
  color: var(--ink-950);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.login-heading p {
  margin: 8px 0 0;
  color: var(--ink-600);
  font-size: 0.83rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-label,
.label-row .form-label {
  margin-bottom: 7px;
  color: var(--ink-800);
  font-size: 0.73rem;
  font-weight: 750;
}

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.form-control {
  min-height: 49px;
  color: var(--ink-900);
  background: #fff;
  border: 1px solid var(--ink-300);
  border-radius: 10px;
  font-size: 0.87rem;
}

.form-control:focus {
  border-color: #8881e8;
  box-shadow: 0 0 0 4px rgba(81, 72, 216, 0.1);
}

.password-toggle {
  padding: 0;
  color: var(--brand-dark);
  background: transparent;
  border: 0;
  font-size: 0.68rem;
  font-weight: 750;
}

.field-validation,
.field-validation-error {
  margin-top: 5px;
  color: var(--danger);
  font-size: 0.68rem;
}

.validation-summary:empty,
.validation-summary.valid {
  display: none;
}

.validation-summary {
  padding: 11px 13px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #f1cbc7;
  border-radius: 9px;
  font-size: 0.72rem;
}

.validation-summary ul {
  margin: 0;
  padding-left: 18px;
}

.session-check {
  min-height: 24px;
}

.session-check .form-check-input {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.13rem;
  border-color: var(--ink-300);
}

.session-check .form-check-input:checked {
  background-color: var(--brand);
  border-color: var(--brand);
}

.session-check .form-check-label {
  color: var(--ink-600);
  font-size: 0.72rem;
}

.login-submit {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  padding-inline: 18px;
  font-size: 0.83rem;
}

.login-submit span {
  font-size: 1rem;
}

.login-security-note {
  margin: 25px 0 0;
  padding-top: 19px;
  color: var(--ink-500);
  border-top: 1px solid var(--ink-100);
  font-size: 0.66rem;
  line-height: 1.55;
}

.portal-alert {
  margin: -8px 0 21px;
  padding: 11px 13px;
  color: #22664f;
  background: var(--green-soft);
  border-color: #c8e9da;
  border-radius: 9px;
  font-size: 0.72rem;
}

.simple-page {
  width: min(720px, 100%);
  margin: 40px auto;
  padding: clamp(34px, 6vw, 70px);
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.simple-page h1 {
  margin: 0 0 16px;
  color: var(--ink-950);
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1.06;
}

.simple-page p {
  color: var(--ink-600);
  font-size: 0.9rem;
  line-height: 1.7;
}

.simple-page .btn {
  margin-top: 12px;
}

.legal-page p + p {
  margin-top: 18px;
}

.text-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.78rem;
  font-weight: 750;
}

.error-page {
  text-align: center;
}

.status-symbol {
  width: 60px;
  height: 60px;
  margin: 0 auto 23px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 0.9rem;
}

.status-symbol-error {
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 1.2rem;
}

.error-page .eyebrow {
  text-align: center;
}

.error-page p {
  max-width: 560px;
  margin-inline: auto;
}

.page-actions {
  margin-top: 12px;
}

/* Responsive behavior */

@media (max-width: 1280px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .position-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 28px;
  }

  .generated-note {
    margin-top: 18px;
  }
}

@media (max-width: 991.98px) {
  .portal-sidebar {
    width: min(300px, 86vw);
    box-shadow: 18px 0 50px rgba(6, 12, 32, 0.25);
    transform: translateX(-105%);
    transition: transform 190ms ease;
  }

  .sidebar-open .portal-sidebar {
    transform: translateX(0);
  }

  .sidebar-close,
  .sidebar-toggle {
    display: grid;
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 1030;
    inset: 0;
    display: block;
    visibility: hidden;
    background: rgba(8, 15, 38, 0.42);
    opacity: 0;
    transition:
      opacity 190ms ease,
      visibility 190ms ease;
  }

  .sidebar-open .sidebar-backdrop {
    visibility: visible;
    opacity: 1;
  }

  .sidebar-open {
    overflow: hidden;
  }

  .portal-workspace {
    margin-left: 0;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-layout {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .login-story {
    min-height: 500px;
  }
}

@media (max-width: 767.98px) {
  .portal-topbar {
    min-height: 68px;
    padding-inline: 16px;
  }

  .topbar-eyebrow,
  .account-copy {
    display: none;
  }

  .account-menu form {
    margin-left: 0;
  }

  .portal-main {
    padding: 26px 16px 38px;
  }

  .portal-footer {
    padding-inline: 16px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .date-filter {
    width: 100%;
    align-items: stretch;
    flex-wrap: wrap;
  }

  .date-filter > div {
    min-width: calc(50% - 14px);
    flex: 1;
  }

  .date-filter input {
    width: 100%;
  }

  .btn-filter {
    width: 100%;
  }

  .availability-panel {
    grid-template-columns: auto 1fr;
  }

  .availability-panel .btn {
    grid-column: 1 / -1;
  }

  .card-heading {
    flex-direction: column;
  }

  .chart-frame {
    height: 280px;
  }

  .public-header-tagline {
    display: none;
  }

  .public-main {
    width: min(100% - 24px, 1180px);
  }

  .login-story,
  .login-panel {
    padding: 34px 26px;
  }

  .login-story {
    min-height: 520px;
  }

  .public-footer {
    width: calc(100% - 32px);
  }
}

@media (max-width: 575.98px) {
  .signout-button {
    padding-inline: 9px;
  }

  .account-avatar {
    display: none;
  }

  .portal-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    min-height: 142px;
  }

  .date-separator {
    display: none;
  }

  .date-filter > div {
    min-width: 100%;
  }

  .dashboard-card {
    padding: 20px 17px;
  }

  .position-list {
    grid-template-columns: 1fr;
  }

  .availability-panel {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .chart-frame {
    height: 250px;
  }

  .public-header {
    width: calc(100% - 28px);
  }

  .login-story {
    min-height: 560px;
  }

  .login-story h1 {
    font-size: 2.3rem;
  }

  .benefit-list {
    margin-top: 34px;
  }

  .public-footer {
    align-items: flex-start;
    padding-block: 16px;
    flex-direction: column;
    gap: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  .portal-sidebar,
  .portal-topbar,
  .portal-footer,
  .date-filter,
  .chart-table-disclosure summary {
    display: none !important;
  }

  .portal-workspace {
    margin: 0;
  }

  .portal-main {
    max-width: none;
    padding: 0;
  }

  .kpi-card,
  .dashboard-card {
    break-inside: avoid;
    box-shadow: none;
  }

  .chart-table-disclosure > div {
    display: block !important;
  }
}

.metric-grid,
.feature-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.metric-card,
.feature-card,
.content-card,
.notice-panel,
.empty-state {
  border: 1px solid var(--line, #dce3ec);
  border-radius: 14px;
  background: var(--surface, #fff);
  box-shadow: 0 5px 20px rgb(20 45 72 / 6%);
}

.metric-card,
.feature-card {
  display: grid;
  gap: 6px;
  min-height: 132px;
  padding: 20px;
}

.metric-card p,
.metric-card span,
.feature-card small,
.quota-row small,
.muted {
  color: var(--text-muted, #5b6b7e);
}

.metric-card p {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
}

.metric-card strong {
  font-size: 1.35rem;
}

.content-card,
.notice-panel,
.empty-state {
  margin-top: 24px;
  padding: 24px;
}

.section-heading h2,
.notice-panel h2,
.empty-state h2 {
  margin: 0;
}

.warning-panel {
  border-left: 4px solid #b76f00;
  background: #fffaf0;
}

.warning-panel ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.quota-list {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.quota-row {
  display: grid;
  gap: 7px;
}

.quota-row-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.quota-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eef4;
}

.quota-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f4e78, #2e75b6);
  transition: width 300ms ease-out;
}

.feature-card .status-pill {
  width: max-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e9f1f9;
  color: #1f4e78;
  font-size: 0.8rem;
  font-weight: 700;
}

.settings-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.settings-form {
  margin-top: 0;
}

.form-grid {
  display: grid;
  gap: 15px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin: 20px 0;
}

.form-grid label,
.settings-toggles label {
  display: grid;
  gap: 6px;
  color: var(--text, #1d2a3b);
  font-size: 0.9rem;
  font-weight: 650;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--line, #c9d4e0);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
  padding: 9px 10px;
}

.form-grid textarea {
  resize: vertical;
}

.settings-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.settings-toggles label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-preview {
  display: grid;
  gap: 4px;
  margin: 20px 0;
  padding: 18px;
  border: 3px solid #2e75b6;
  border-radius: 10px;
  color: #fff;
  background: #1f4e78;
}

.success-panel {
  border-left: 4px solid #1c7c45;
  background: #f1fcf5;
}

/* Enterprise density pass
   Keep operational screens information-rich without reducing legibility or
   the 44px touch targets used on public authentication surfaces. */

.sidebar-brand {
  min-height: 72px;
  padding: 16px 17px 14px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1rem;
}

.brand-copy strong {
  font-size: 1rem;
}

.brand-copy small {
  margin-top: 4px;
}

.sidebar-context {
  margin: 5px 13px 16px;
  padding: 10px 12px;
  border-radius: 10px;
}

.sidebar-nav {
  gap: 3px;
  padding: 0 10px;
}

.nav-section-label {
  padding: 10px 9px 4px;
}

.sidebar-link {
  min-height: 41px;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 9px;
  font-size: 0.81rem;
}

.nav-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 0.52rem;
}

.sidebar-footer {
  padding: 12px;
}

.sidebar-security {
  gap: 9px;
  padding: 10px;
  border-radius: 10px;
}

.portal-topbar {
  min-height: 64px;
  gap: 16px;
  padding: 9px clamp(16px, 2.5vw, 32px);
}

.portal-main {
  max-width: 1720px;
  padding: 22px clamp(16px, 2.5vw, 32px) 32px;
}

.portal-footer {
  padding: 13px clamp(16px, 2.5vw, 32px);
}

.account-avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 0.76rem;
}

.account-copy strong {
  font-size: 0.75rem;
}

.account-copy span,
.signout-button {
  font-size: 0.66rem;
}

.signout-button {
  padding: 6px 9px;
}

.dashboard-page {
  gap: 18px;
}

.dashboard-command-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(460px, 1fr);
  gap: 24px;
  align-items: center;
  padding: 20px 22px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 92% 18%, rgba(64, 214, 178, 0.22), transparent 28%),
    linear-gradient(125deg, #111a3d 0%, #182a57 58%, #234171 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 28px rgba(15, 27, 61, 0.15);
}

.command-panel-copy {
  min-width: 0;
}

.command-panel-copy h2 {
  max-width: 510px;
  margin: 2px 0 7px;
  color: #fff;
  font-size: clamp(1.25rem, 1.7vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.command-panel-copy > p {
  max-width: 590px;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  line-height: 1.55;
}

.command-panel-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.command-panel-metrics > div {
  min-width: 0;
  padding: 13px 12px;
  background: rgba(7, 16, 45, 0.2);
}

.command-panel-metrics dt {
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.command-panel-metrics dd {
  margin: 0;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 720;
  line-height: 1.38;
}

.health-status {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
}

.health-status i {
  width: 7px;
  height: 7px;
  margin-top: 0.2rem;
  flex: 0 0 auto;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.09);
}

.health-status-healthy i {
  background: #45d8b3;
}

.health-status-attention i {
  background: #ffb15f;
}

.page-heading {
  gap: 20px;
}

.page-heading h1 {
  font-size: clamp(1.55rem, 2.1vw, 2rem);
}

.page-heading p {
  margin-top: 7px;
  font-size: 0.82rem;
}

.date-filter {
  padding: 7px;
  border-radius: 10px;
}

.date-filter input,
.btn-filter {
  min-height: 34px;
}

.kpi-grid {
  gap: 12px;
}

.kpi-card {
  min-height: 126px;
  padding: 15px 16px;
}

.kpi-card::after {
  top: -42px;
  right: -40px;
  width: 86px;
  height: 86px;
}

.kpi-code {
  width: 30px;
  height: 24px;
}

.kpi-value {
  font-size: clamp(1.14rem, 1.45vw, 1.5rem);
}

.kpi-context {
  margin-top: 5px;
}

.dashboard-grid {
  gap: 12px;
}

.dashboard-card {
  padding: 18px;
}

.chart-frame {
  height: 270px;
  margin-top: 16px;
}

.position-list {
  margin-top: 13px;
}

.position-list > div {
  padding: 11px 0;
}

.generated-note {
  padding: 12px;
}

/* Shared Bootstrap-based operations screens. */
.portal-main .container {
  max-width: 1540px;
  padding-right: 0;
  padding-left: 0;
}

.portal-main .container.py-4,
.portal-main .container.pb-4 {
  padding-top: 0.25rem !important;
  padding-bottom: 1rem !important;
}

.portal-main .d-flex.mb-4,
.portal-main .card.mb-4,
.portal-main .row.mb-4 {
  margin-bottom: 1rem !important;
}

.portal-main .card,
.portal-main .metric-card,
.portal-main .feature-card,
.portal-main .content-card,
.portal-main .notice-panel,
.portal-main .empty-state {
  border-color: var(--ink-200);
  border-radius: 11px;
  box-shadow: 0 3px 14px rgba(20, 45, 72, 0.055);
}

.portal-main .card-header {
  padding: 0.7rem 0.95rem;
  border-bottom-color: var(--ink-100);
}

.portal-main .card-body {
  padding: 0.95rem;
}

.portal-main .card h2.h5,
.portal-main .card-header h2,
.portal-main .section-heading h2,
.portal-main .notice-panel h2,
.portal-main .empty-state h2 {
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.portal-main .page-header,
.portal-main .section-heading {
  margin-bottom: 0.9rem;
}

.portal-main .page-header h1,
.portal-main h1.h3 {
  color: var(--ink-950);
  font-size: 1.35rem;
  font-weight: 780;
  letter-spacing: -0.03em;
}

.portal-main .page-header > p:not(.eyebrow),
.portal-main h1.h3 + p,
.portal-main .text-muted {
  line-height: 1.45;
}

.portal-main .metric-grid,
.portal-main .feature-grid {
  gap: 12px;
}

.portal-main .metric-card,
.portal-main .feature-card {
  min-height: 110px;
  padding: 15px;
}

.portal-main .content-card,
.portal-main .notice-panel,
.portal-main .empty-state {
  margin-top: 16px;
  padding: 17px;
}

.portal-main .quota-list {
  gap: 12px;
  margin-top: 14px;
}

.portal-main .settings-grid {
  gap: 16px;
}

.portal-main .form-grid {
  gap: 11px;
  margin: 14px 0;
}

.portal-main .form-control,
.portal-main .form-select {
  min-height: 37px;
  padding: 0.36rem 0.62rem;
  border-radius: 8px;
  font-size: 0.82rem;
}

.portal-main .form-label,
.portal-main .form-grid label,
.portal-main .settings-toggles label {
  margin-bottom: 0.34rem;
  font-size: 0.78rem;
}

/* Portal forms are rendered on light surfaces. Keep labels legible even when a
   component-level theme has inherited a light foreground colour. */
.portal-main .card .form-label,
.portal-main .card .form-check-label,
.portal-main .card .form-grid label,
.portal-main .modal .form-label,
.portal-main .modal .form-check-label,
.portal-main .modal .form-grid label,
.portal-main .settings-toggles label {
  color: var(--ink-800) !important;
}

/* A number of legacy settings forms use `color: inherit` / `--text`.  In a
   light portal surface that must never resolve to white: a field label, hint,
   value or validation message needs a deterministic readable foreground. */
.portal-main :is(
  label,
  legend,
  .form-label,
  .form-check-label,
  .form-text,
  .input-group-text,
  .invalid-feedback,
  .valid-feedback
) {
  color: var(--ink-800) !important;
}

.portal-main :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea).form-control,
.portal-main :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea).form-select,
.portal-main .form-grid :is(input, select, textarea),
.portal-main .settings-form :is(input, select, textarea) {
  color: var(--ink-900) !important;
  -webkit-text-fill-color: var(--ink-900);
  background-color: #fff;
}

.portal-main :is(input, select, textarea)::placeholder {
  color: var(--ink-500) !important;
  opacity: 1;
}

.portal-main .btn {
  min-height: 36px;
  padding: 0.38rem 0.72rem;
  font-size: 0.78rem;
}

.portal-main .alert {
  margin-bottom: 0.9rem;
  padding: 0.65rem 0.8rem;
  border-radius: 9px;
  font-size: 0.8rem;
}

.portal-main .table {
  margin-bottom: 0;
  color: var(--ink-700);
  font-size: 0.79rem;
}

.portal-main .table > :not(caption) > * > * {
  padding: 0.62rem 0.78rem;
  vertical-align: middle;
}

.portal-main .table thead th {
  color: var(--ink-500);
  background: var(--surface-subtle);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  white-space: nowrap;
}

.portal-main .reconciliation-review-grid .reconciliation-unmatched > * {
  background-color: #fff1f1;
  color: var(--ink-800);
}

.portal-main .reconciliation-review-grid .reconciliation-unmatched {
  box-shadow: inset 4px 0 0 var(--danger);
}

.portal-main .reconciliation-reason {
  min-width: 230px;
  color: var(--danger);
  font-weight: 650;
  line-height: 1.35;
}

.portal-main .reconciliation-review-grid th:last-child,
.portal-main .reconciliation-review-grid td:last-child {
  min-width: 108px;
  white-space: nowrap;
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: -4px 0 8px rgba(15, 23, 42, 0.06);
}

.portal-main .reconciliation-review-grid .reconciliation-unmatched td:last-child {
  background: #fff1f1;
}

.portal-main .table-responsive {
  border-radius: 0 0 11px 11px;
}

.portal-main .badge {
  padding: 0.36em 0.55em;
  font-size: 0.68rem;
  font-weight: 700;
}

/* Status badges must remain legible on every light portal surface even when a
   host/theme override changes Bootstrap's badge foreground variables. */
.portal-main .badge.text-bg-primary,
.portal-main .badge.text-bg-secondary,
.portal-main .badge.text-bg-success,
.portal-main .badge.text-bg-danger {
  display: inline-block;
  color: #fff !important;
  -webkit-text-fill-color: #fff;
}

.portal-main .badge.text-bg-secondary { background-color: #475569 !important; }
.portal-main .badge.text-bg-primary { background-color: #1d4ed8 !important; }
.portal-main .badge.text-bg-success { background-color: #15803d !important; }
.portal-main .badge.text-bg-danger { background-color: #b91c1c !important; }

.portal-main .badge.text-bg-light,
.portal-main .badge.text-bg-warning,
.portal-main .badge.text-bg-info {
  color: var(--ink-900) !important;
  -webkit-text-fill-color: var(--ink-900);
}

.portal-main .badge.text-bg-light { background-color: #eef2f7 !important; }
.portal-main .badge.text-bg-warning { background-color: #fef3c7 !important; }
.portal-main .badge.text-bg-info { background-color: #dff4ff !important; }

.portal-main [data-export-status] .badge {
  min-width: 74px;
}

.authenticator-qr-wrap {
  display: inline-flex;
  padding: 14px;
  border: 1px solid var(--border-200, #d9e1ec);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgb(15 23 42 / 8%);
}

.authenticator-qr {
  display: block;
  width: min(100%, 240px);
  height: auto;
  image-rendering: pixelated;
}

.authenticator-manual-key {
  margin-top: 1.2rem;
}

.authenticator-manual-key summary {
  width: fit-content;
  cursor: pointer;
  color: var(--primary-700, #3730a3);
  font-weight: 650;
}

/* Public pages remain welcoming but no longer consume most of a desktop viewport. */
.public-header,
.public-footer,
.public-main {
  width: min(1240px, calc(100% - 36px));
}

.public-header {
  min-height: 70px;
}

.public-footer {
  min-height: 52px;
}

.login-layout {
  min-height: min(640px, calc(100vh - 132px));
  grid-template-columns: minmax(0, 1fr) minmax(400px, 0.95fr);
}

.login-story {
  padding: clamp(30px, 4vw, 50px);
}

.login-story h1 {
  max-width: 460px;
  margin: 9px 0 13px;
  font-size: clamp(2rem, 3.25vw, 3rem);
  line-height: 1.04;
}

.login-story-content > p {
  max-width: 470px;
  font-size: 0.87rem;
  line-height: 1.58;
}

.benefit-list {
  margin-top: 30px;
  gap: 12px;
}

.benefit-list li {
  gap: 10px;
}

.benefit-index {
  width: 30px;
  height: 30px;
}

.login-panel {
  padding: clamp(28px, 4vw, 50px);
}

.login-form-wrap {
  width: min(100%, 390px);
}

.login-heading {
  margin: 27px 0 19px;
}

.login-heading h2 {
  font-size: 1.72rem;
}

.login-form {
  gap: 14px;
}

.login-panel .form-control {
  min-height: 44px;
  font-size: 0.84rem;
}

.login-submit {
  min-height: 46px;
  padding-inline: 15px;
}

.login-security-note {
  margin-top: 17px;
  padding-top: 13px;
}

@media (max-width: 991.98px) {
  .portal-sidebar {
    width: min(270px, 86vw);
  }

  .login-layout {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .login-story {
    min-height: 420px;
  }

  .dashboard-command-panel {
    grid-template-columns: 1fr;
    gap: 17px;
  }
}

@media (max-width: 767.98px) {
  html {
    font-size: 15px;
  }

  .portal-main {
    padding: 18px 14px 26px;
  }

  .portal-main .container {
    padding-right: 0;
    padding-left: 0;
  }

  .portal-main .card-body,
  .portal-main .content-card,
  .portal-main .notice-panel,
  .portal-main .empty-state {
    padding: 0.82rem;
  }

  .portal-main .table > :not(caption) > * > * {
    padding: 0.55rem 0.62rem;
  }

  .dashboard-command-panel {
    padding: 17px;
  }

  .command-panel-metrics {
    grid-template-columns: 1fr;
  }

  .command-panel-metrics > div {
    padding: 10px 12px;
  }

  .public-header,
  .public-footer,
  .public-main {
    width: min(100% - 24px, 1240px);
  }

  .public-header nav {
    gap: 0.55rem !important;
  }

  .public-header nav .link-secondary {
    display: none;
  }

  .login-story,
  .login-panel {
    padding: 27px 22px;
  }

  .login-story {
    min-height: 390px;
  }
}

@media (max-width: 575.98px) {
  .portal-main .metric-grid,
  .portal-main .feature-grid,
  .portal-main .settings-grid {
    grid-template-columns: 1fr;
  }

  .login-story h1 {
    font-size: 2rem;
  }

  .benefit-list {
    margin-top: 24px;
  }
}
