@import url("./design-tokens.55a462c9838f.css");

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  --portal-panel-padding: 24px;
  --portal-card-padding: 14px 16px;
  --portal-card-padding-tight: 12px 14px;
  --portal-card-gap: 12px;
  --portal-panel-shadow: 0 8px 22px rgba(5, 5, 5, 0.055);
  --portal-section-gap: 18px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

body.nav-open {
  overflow: hidden;
}

.portal-body--app {
  --app-sidebar-width: 280px;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p {
  margin-top: 0;
  overflow-wrap: anywhere;
}

p {
  color: var(--muted);
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-height);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(223, 227, 232, 0.9);
  backdrop-filter: blur(16px);
  transition:
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.portal-header.is-scrolled {
  border-color: rgba(5, 5, 5, 0.08);
  box-shadow: 0 12px 30px rgba(5, 5, 5, 0.08);
}

.portal-nav {
  width: min(1120px, calc(100% - 40px));
  min-height: var(--header-height);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.portal-body--app .portal-nav {
  width: auto;
  margin-inline: 0;
  padding-inline: 28px;
}

.portal-body--app .portal-nav {
  display: grid;
  grid-template-columns: var(--app-sidebar-width) minmax(240px, 1040px) max-content;
  justify-content: stretch;
}

.portal-brand {
  width: 174px;
  flex: 0 0 auto;
}

.portal-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quick-switcher {
  position: relative;
  width: min(100%, 420px);
}

.quick-switcher__summary {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  list-style: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

.quick-switcher__summary::-webkit-details-marker {
  display: none;
}

.quick-switcher__summary:hover,
.quick-switcher__summary:focus-visible,
.quick-switcher[open] .quick-switcher__summary {
  border-color: rgba(217, 0, 43, 0.32);
  color: var(--ink);
  outline: none;
  box-shadow: 0 0 0 3px rgba(217, 0, 43, 0.08);
}

.quick-switcher__icon,
.quick-switcher__field-icon {
  width: 18px;
  height: 18px;
  background: currentColor;
  display: inline-block;
  flex: 0 0 18px;
  -webkit-mask: url("../vendor/lucide/icons/search.54f938bd05d9.svg") center / contain no-repeat;
  mask: url("../vendor/lucide/icons/search.54f938bd05d9.svg") center / contain no-repeat;
}

.quick-switcher__summary-text {
  min-width: 0;
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 760;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-switcher__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 90;
  width: min(520px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 18px 42px rgba(5, 5, 5, 0.16);
}

.quick-switcher__form {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.quick-switcher__field-icon {
  color: var(--muted);
}

.quick-switcher__form input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 750;
  outline: none;
  padding: 10px 12px;
}

.quick-switcher__form input:focus {
  border-color: rgba(217, 0, 43, 0.38);
  background: var(--paper);
  box-shadow: 0 0 0 3px rgba(217, 0, 43, 0.08);
}

.quick-switcher__results {
  max-height: min(520px, calc(100vh - var(--header-height) - 110px));
  overflow: auto;
  padding: 10px;
}

.quick-switcher__meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.quick-switcher__groups {
  display: grid;
  gap: 10px;
}

.quick-switcher__group {
  display: grid;
  gap: 6px;
}

.quick-switcher__group h2 {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.quick-switcher__list {
  display: grid;
  gap: 4px;
}

.quick-result {
  min-height: 54px;
  border-radius: 8px;
  color: var(--ink-soft);
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
}

.quick-result:hover,
.quick-result:focus-visible {
  background: var(--surface);
  color: var(--brand-red);
  outline: none;
}

.quick-result__type {
  width: 66px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
  padding: 5px 7px;
}

.quick-result__copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.quick-result__copy strong,
.quick-result__copy span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-result__copy strong {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
}

.quick-result__copy span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
}

.quick-switcher__empty {
  display: grid;
  gap: 4px;
  padding: 14px 4px 16px;
}

.quick-switcher__empty strong {
  color: var(--ink);
}

.quick-switcher__empty p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.account-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--brand-red-soft);
  color: var(--brand-red-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 950;
}

.notification-menu,
.account-menu {
  position: relative;
}

.notification-menu__summary,
.account-menu__summary {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 6px;
  list-style: none;
}

.notification-menu__summary {
  position: relative;
  width: 44px;
  justify-content: center;
  gap: 0;
  padding: 0;
}

.notification-menu__summary::-webkit-details-marker,
.account-menu__summary::-webkit-details-marker {
  display: none;
}

.notification-menu__summary:hover,
.notification-menu__summary:focus-visible,
.account-menu__summary:hover,
.account-menu__summary:focus-visible {
  border-color: rgba(217, 0, 43, 0.32);
  outline: none;
}

.notification-menu__icon,
.notification-menu__chevron {
  background: currentColor;
  display: inline-block;
  -webkit-mask: var(--notification-icon) center / contain no-repeat;
  mask: var(--notification-icon) center / contain no-repeat;
}

.notification-menu__icon {
  --notification-icon: url("../vendor/lucide/icons/bell.27a6d7462e97.svg");
  width: 19px;
  height: 19px;
  color: var(--ink-soft);
}

.notification-menu__chevron {
  --notification-icon: url("../vendor/lucide/icons/chevron-down.a19b6e817470.svg");
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 11px;
  height: 11px;
  color: var(--brand-red-dark);
}

.notification-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 17px;
  height: 17px;
  border: 2px solid var(--paper);
  border-radius: 999px;
  background: var(--brand-red);
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.64rem;
  font-weight: 950;
  line-height: 1;
  padding-inline: 3px;
}

.notification-indicator {
  display: contents;
}

.account-menu__copy {
  display: grid;
  gap: 1px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 850;
  line-height: 1.15;
}

.account-menu__copy small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.notification-menu__panel,
.account-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 90;
  width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 18px 42px rgba(5, 5, 5, 0.16);
}

.notification-menu__panel {
  width: min(380px, calc(100vw - 24px));
  display: block;
  overflow: hidden;
}

.notification-panel__body {
  display: grid;
}

.notification-panel__header,
.notification-panel__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.notification-panel__header {
  border-bottom: 1px solid var(--line);
}

.notification-panel__header strong {
  color: var(--ink);
  display: block;
  font-size: 0.95rem;
  line-height: 1.2;
}

.notification-panel__header span {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 750;
}

.notification-panel__header form,
.notification-item__actions form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.notification-panel__footer {
  margin: 0;
}

.notification-panel__header button,
.notification-item__actions button,
.notification-item__actions a,
.notification-panel__footer a {
  border: 0;
  background: transparent;
  color: var(--brand-red-dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  min-height: 20px;
  padding: 0;
  text-align: left;
}

.notification-panel__header button:hover,
.notification-panel__header button:focus-visible,
.notification-item__actions button:hover,
.notification-item__actions button:focus-visible,
.notification-item__actions a:hover,
.notification-item__actions a:focus-visible,
.notification-panel__footer a:hover,
.notification-panel__footer a:focus-visible {
  color: var(--brand-red);
  outline: none;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.notification-list {
  display: grid;
}

.notification-list--page {
  gap: 10px;
}

.notification-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 14px;
}

.notification-list:not(.notification-list--page) .notification-item + .notification-item {
  border-top: 1px solid var(--line);
}

.notification-list--page .notification-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.notification-item.is-unread {
  background: var(--brand-red-soft);
}

.notification-list--page .notification-item.is-unread {
  border-color: rgba(217, 0, 43, 0.22);
}

.notification-item__dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: transparent;
  margin-top: 7px;
}

.notification-item.is-unread .notification-item__dot {
  background: var(--brand-red);
}

.notification-item__body {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.notification-item__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.notification-item__title strong {
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.25;
}

.notification-item__title span {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 0.74rem;
  font-weight: 750;
}

.notification-item p,
.notification-empty p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.notification-item__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  line-height: 1;
}

.notification-empty {
  display: grid;
  gap: 4px;
  padding: 18px 14px;
}

.notification-empty strong {
  color: var(--ink);
}

.notification-panel__footer {
  border-top: 1px solid var(--line);
}

.account-menu__panel {
  display: grid;
  gap: 4px;
  padding: 8px;
}

.account-menu__panel a,
.account-menu__panel button {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 9px 10px;
  font-size: 0.92rem;
  font-weight: 850;
  text-align: left;
}

.account-menu__panel a:hover,
.account-menu__panel a:focus-visible,
.account-menu__panel button:hover,
.account-menu__panel button:focus-visible {
  background: var(--surface);
  color: var(--brand-red);
  outline: none;
}

.account-menu__panel form {
  margin: 0;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle__line {
  width: 20px;
  height: 2px;
  overflow: hidden;
  background: var(--ink);
  border-radius: 999px;
  font-size: 0;
  transition:
    transform 160ms ease,
    opacity 160ms ease;
}

body.nav-open .nav-toggle__line:first-child {
  transform: translateY(7px) rotate(45deg);
}

body.nav-open .nav-toggle__line:nth-child(2) {
  opacity: 0;
}

body.nav-open .nav-toggle__line:last-child {
  transform: translateY(-7px) rotate(-45deg);
}

.portal-nav__links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.portal-nav__links form {
  margin: 0;
}

.portal-link,
.portal-logout {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.15;
  padding: 9px 11px;
  text-align: center;
  transition:
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.portal-link:hover,
.portal-link:focus-visible,
.portal-logout:hover,
.portal-logout:focus-visible {
  background: var(--surface);
  color: var(--brand-red);
  outline: none;
}

.portal-link.is-active {
  background: var(--brand-red-soft);
  color: var(--brand-red-dark);
}

.portal-link--primary {
  background: var(--ink);
  color: var(--paper);
}

.portal-link--primary:hover,
.portal-link--primary:focus-visible,
.portal-link--primary.is-active {
  background: var(--brand-red);
  color: var(--paper);
}

.portal-main {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
  padding: 40px 0 56px;
  flex: 1 0 auto;
}

.portal-main--app {
  width: auto;
  margin-inline: 0;
  padding: 32px 40px 56px calc(var(--app-sidebar-width) + 40px);
}

.app-shell {
  display: block;
}

.app-sidebar {
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  z-index: 45;
  width: var(--app-sidebar-width);
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  box-shadow: none;
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 20px;
}

.app-nav {
  display: grid;
  gap: 4px;
}

.app-nav__link {
  min-height: 42px;
  border-radius: 8px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.94rem;
  font-weight: 850;
  padding: 10px 12px;
}

.app-nav__icon {
  width: 18px;
  height: 18px;
  background: currentColor;
  display: inline-block;
  flex: 0 0 18px;
  -webkit-mask: var(--app-nav-icon) center / contain no-repeat;
  mask: var(--app-nav-icon) center / contain no-repeat;
}

.app-nav__icon--dashboard {
  --app-nav-icon: url("../vendor/lucide/icons/layout-dashboard.dda374fc7c9c.svg");
}

.app-nav__icon--services {
  --app-nav-icon: url("../vendor/lucide/icons/server.6fcc915dffee.svg");
}

.app-nav__icon--invoices {
  --app-nav-icon: url("../vendor/lucide/icons/receipt-text.779fab596c74.svg");
}

.app-nav__icon--support {
  --app-nav-icon: url("../vendor/lucide/icons/life-buoy.097bd0d29fb6.svg");
}

.app-nav__icon--privacy {
  --app-nav-icon: url("../vendor/lucide/icons/file-lock-2.0d2247ae96d4.svg");
}

.app-nav__icon--staff {
  --app-nav-icon: url("../vendor/lucide/icons/users-round.4d3050633c8f.svg");
}

.app-nav__link:hover,
.app-nav__link:focus-visible {
  background: var(--surface);
  color: var(--brand-red);
  outline: none;
}

.app-nav__link.is-active {
  background: var(--brand-red-soft);
  color: var(--brand-red-dark);
}

.app-sidebar__footer {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding-top: 14px;
}

.app-sidebar__footer .button,
.app-sidebar__footer .portal-logout {
  width: 100%;
}

.app-sidebar__footer form {
  margin: 0;
}

.app-content {
  min-width: 0;
  width: min(100%, 1040px);
  margin-inline: auto;
}

.portal-footer {
  flex: 0 0 auto;
  padding: 30px 0;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.portal-footer__inner {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
  color: var(--muted);
  font-size: 0.92rem;
}

.portal-footer__grid {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(220px, 1fr) auto auto;
  gap: 22px;
  align-items: start;
}

.portal-footer__grid p {
  margin: 0;
  font-size: 0.94rem;
}

.portal-footer__brand-block {
  display: grid;
  gap: 12px;
}

.portal-footer__brand {
  width: 190px;
  flex: 0 0 auto;
}

.portal-footer__company {
  display: grid;
  gap: 10px;
  font-size: 0.9rem;
}

.company-address {
  display: grid;
  gap: 2px;
  margin: 0;
  color: var(--muted);
  font-style: normal;
}

.company-address strong {
  color: var(--ink);
}

.company-address a {
  color: var(--brand-red);
  font-weight: 800;
}

.company-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  margin: 0;
}

.company-facts dt {
  color: var(--ink-soft);
  font-weight: 850;
}

.company-facts dd {
  margin: 0;
  color: var(--muted);
}

.portal-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.portal-footer__links a {
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 800;
}

.portal-footer__links a:hover,
.portal-footer__links a:focus-visible,
.company-address a:hover,
.company-address a:focus-visible {
  color: var(--brand-red);
  outline: none;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.portal-footer__meta {
  text-align: right;
}

.portal-footer--compact {
  padding: 18px 0;
}

.portal-footer--compact .portal-footer__inner {
  width: auto;
  margin-inline: 0;
  padding-inline: 40px;
  padding-left: calc(var(--app-sidebar-width) + 40px);
}

.portal-footer--compact .portal-footer__grid {
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px 18px;
  align-items: center;
}

.portal-footer--compact .portal-footer__brand-block {
  display: none;
}

.portal-footer--compact .portal-footer__company {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.portal-footer--compact .company-address {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.portal-footer--compact .company-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.portal-footer--compact .portal-footer__meta {
  font-size: 0.86rem;
}

.hero-panel,
.auth-card,
.content-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--portal-panel-shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.88fr);
  gap: 32px;
  align-items: center;
  padding: 36px;
}

.hero-panel h1 {
  max-width: 11ch;
  margin-bottom: 12px;
  font-size: clamp(2.25rem, 5vw, 3.4rem);
  line-height: 1.04;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.page-header h1 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

.page-header p {
  max-width: 68ch;
  margin-bottom: 0;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--brand-red-dark);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.auth-card h1,
.content-panel h1 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: clamp(1.55rem, 2.4vw, 2.15rem);
  line-height: 1.12;
}

.content-panel h2,
.auth-card h2,
.form-section h2 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: clamp(1.1rem, 1.8vw, 1.32rem);
  line-height: 1.2;
}

.content-panel > p,
.auth-card > p,
.hero-panel p {
  max-width: 68ch;
}

.hero-actions,
.card-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-heading h2,
.panel-heading p {
  margin-bottom: 0;
}

.panel-heading p {
  margin-top: 4px;
}

.panel-heading--compact {
  margin-bottom: 4px;
}

.button {
  min-width: min(100%, 9.5rem);
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.96rem;
  font-weight: 900;
  line-height: 1.15;
  padding: 10px 16px;
  text-align: center;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.button:hover,
.button:focus-visible {
  border-color: var(--brand-red);
  background: var(--brand-red);
  outline: none;
}

.button:active,
.portal-link:active,
.portal-logout:active {
  transform: translateY(1px);
}

.button--secondary {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}

.button--secondary:hover,
.button--secondary:focus-visible {
  border-color: var(--brand-red);
  background: var(--brand-red-soft);
  color: var(--brand-red-dark);
}

.metric-grid,
.dashboard-grid,
.profile-grid {
  display: grid;
  gap: var(--portal-card-gap);
}

.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.dashboard-metrics {
  margin-bottom: 14px;
}

.dashboard-grid + .dashboard-grid {
  margin-top: var(--portal-section-gap);
}

.hero-panel .metric-grid {
  grid-template-columns: 1fr;
}

.dashboard-grid,
.profile-grid {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.45fr);
  align-items: start;
}

.metric,
.status-row,
.form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: var(--portal-card-padding);
}

.metric {
  display: grid;
  min-height: 94px;
  align-content: center;
  gap: 2px;
}

a.metric {
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

a.metric:hover,
a.metric:focus-visible {
  border-color: rgba(217, 0, 43, 0.3);
  background: var(--brand-red-soft);
  outline: none;
  transform: translateY(-1px);
}

.stack {
  display: grid;
  gap: 10px;
}

.stack--compact {
  gap: 8px;
}

.metric strong,
.status-row strong {
  display: block;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.2;
}

.metric strong {
  margin-bottom: 1px;
  font-size: 1.34rem;
  line-height: 1.12;
}

.metric span {
  font-size: 0.9rem;
  line-height: 1.25;
}

.metric small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.25;
}

.metric--success {
  border-left: 4px solid var(--ok);
}

.metric--warning {
  border-left: 4px solid var(--warning);
}

.metric--danger {
  border-left: 4px solid var(--danger);
}

.metric span,
.status-row p {
  color: var(--muted);
}

.status-row p {
  margin-bottom: 3px;
  font-size: 0.94rem;
  line-height: 1.35;
}

.status-row p:last-child,
.content-panel > :last-child,
.auth-card > :last-child {
  margin-bottom: 0;
}

.status-row--split,
.resource-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--portal-card-gap);
}

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

.resource-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: var(--portal-card-padding);
}

.resource-row > div {
  min-width: 0;
}

.resource-row--compact {
  align-items: flex-start;
}

.resource-row__title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-bottom: 6px;
}

.resource-row__title strong {
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.2;
}

.resource-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.resource-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
}

.resource-meta div {
  min-width: 130px;
}

.resource-meta dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.resource-meta dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.94rem;
  font-weight: 800;
}

.resource-section {
  margin-top: var(--portal-section-gap);
}

.credential-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.credential-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: var(--portal-card-padding);
}

.credential-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.credential-list dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.credential-secret {
  display: inline-block;
  max-width: 100%;
  border-radius: 6px;
  background: var(--paper);
  color: var(--brand-red-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  padding: 6px 8px;
  white-space: normal;
}

.status-badge {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1.1;
  padding: 5px 9px;
  white-space: nowrap;
}

.status-badge--success {
  border-color: rgba(29, 141, 112, 0.28);
  background: rgba(29, 141, 112, 0.1);
  color: #0d684f;
}

.status-badge--warning {
  border-color: rgba(157, 107, 0, 0.28);
  background: rgba(157, 107, 0, 0.1);
  color: #6f4b00;
}

.status-badge--danger {
  border-color: rgba(180, 35, 24, 0.28);
  background: rgba(180, 35, 24, 0.1);
  color: var(--danger);
}

.status-badge--neutral {
  background: var(--surface-strong);
  color: var(--muted);
}

.status-check {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 8px;
  padding: var(--portal-card-padding-tight);
}

.status-check .status-dot {
  margin: 7px 0 0;
}

.status-check strong {
  color: var(--ink);
  font-size: 0.96rem;
}

.status-check p {
  margin-bottom: 0;
  font-size: 0.9rem;
  line-height: 1.35;
}

.status-dot--warning {
  background: var(--warning);
}

.action-list {
  display: grid;
  gap: 8px;
}

.action-list a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  display: grid;
  gap: 2px;
  padding: var(--portal-card-padding-tight);
}

.action-list a:hover,
.action-list a:focus-visible {
  border-color: rgba(217, 0, 43, 0.3);
  background: var(--brand-red-soft);
  outline: none;
}

.action-list strong {
  color: var(--ink);
  font-size: 0.96rem;
}

.action-list span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.empty-state {
  border: 1px dashed rgba(100, 112, 125, 0.45);
  border-radius: 8px;
  background: var(--surface);
  display: grid;
  gap: 8px;
  padding: var(--portal-card-padding);
}

.empty-state--center {
  justify-items: center;
  text-align: center;
  padding: 24px;
}

.empty-state strong {
  color: var(--ink);
  font-size: 1.08rem;
}

.empty-state p {
  margin-bottom: 0;
}

.auth-shell {
  width: min(520px, 100%);
  margin-inline: auto;
}

.auth-card,
.content-panel {
  padding: var(--portal-panel-padding);
}

.form-section + .form-section {
  margin-top: 14px;
}

.form-field {
  margin-top: 16px;
}

.form-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-weight: 850;
}

.required-marker {
  color: var(--brand-red);
  margin-left: 2px;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 10px 12px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.form-field--checkbox {
  margin-top: 18px;
}

.form-field--checkbox .checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  color: var(--ink-soft);
  cursor: pointer;
}

.form-field--checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  flex: 0 0 auto;
  accent-color: var(--brand-red);
  cursor: pointer;
  padding: 0;
}

.form-field textarea {
  min-height: 132px;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--brand-red);
  outline: 3px solid rgba(217, 0, 43, 0.14);
}

.form-error,
.form-errors {
  color: var(--brand-red-dark);
  font-weight: 750;
}

.form-error {
  margin: 6px 0 0;
  font-size: 0.92rem;
}

.form-errors {
  border: 1px solid rgba(217, 0, 43, 0.28);
  border-radius: 8px;
  background: var(--brand-red-soft);
  padding: 12px;
}

.form-help {
  margin: 6px 0 0;
  font-size: 0.9rem;
}

.toast-region {
  position: fixed;
  top: calc(var(--header-height) + 16px);
  right: max(20px, calc((100vw - 1120px) / 2));
  z-index: 80;
  width: min(420px, calc(100vw - 40px));
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.toast-region:empty {
  display: none;
}

.toast {
  border: 1px solid var(--line);
  border-left: 4px solid var(--info);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 34px;
  align-items: start;
  gap: 10px;
  padding: 12px 10px 12px 12px;
  pointer-events: auto;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast--success {
  border-left-color: var(--ok);
}

.toast--warning {
  border-left-color: var(--warning);
}

.toast--error {
  border-left-color: var(--danger);
}

.toast--info {
  border-left-color: var(--info);
}

.toast--leaving {
  opacity: 0;
  transform: translateY(-6px);
}

.toast__dot {
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--info);
}

.toast--success .toast__dot {
  background: var(--ok);
}

.toast--warning .toast__dot {
  background: var(--warning);
}

.toast--error .toast__dot {
  background: var(--danger);
}

.toast p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 720;
  line-height: 1.35;
}

.toast__close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}

.toast__close:hover,
.toast__close:focus-visible {
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--ok);
  display: inline-block;
  margin-right: 8px;
}

.muted-link {
  color: var(--brand-red-dark);
  font-weight: 850;
}

.muted-link:hover,
.muted-link:focus-visible,
.status-row a:hover,
.status-row a:focus-visible {
  color: var(--brand-red);
  outline: none;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

@media (max-width: 980px) {
  .portal-body--app {
    --app-sidebar-width: 248px;
  }

  .portal-main--app {
    padding-right: 28px;
    padding-left: calc(var(--app-sidebar-width) + 28px);
  }

  .portal-footer--compact .portal-footer__inner {
    padding-right: 28px;
    padding-left: calc(var(--app-sidebar-width) + 28px);
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-actions {
    justify-content: flex-start;
  }

  .hero-panel,
  .dashboard-grid,
  .profile-grid,
  .portal-footer__grid {
    grid-template-columns: 1fr;
  }

  .portal-footer--compact .portal-footer__grid {
    grid-template-columns: 1fr;
  }

  .portal-footer--compact .portal-footer__links {
    justify-content: flex-start;
  }

  .portal-footer__meta {
    text-align: left;
  }
}

@media (max-width: 880px) {
  body.nav-open::before {
    content: "";
    position: fixed;
    inset: var(--header-height) 0 0;
    z-index: 35;
    background: rgba(5, 5, 5, 0.18);
  }

  .portal-nav {
    position: relative;
  }

  .portal-body--app .portal-nav {
    width: min(1120px, calc(100% - 40px));
    margin-inline: auto;
    padding-inline: 0;
    display: flex;
    justify-content: space-between;
  }

  .quick-switcher {
    width: 44px;
    margin-left: auto;
  }

  .quick-switcher__summary {
    width: 44px;
    justify-content: center;
    padding: 0;
  }

  .quick-switcher__summary-text {
    display: none;
  }

  .quick-switcher__panel {
    position: fixed;
    top: calc(var(--header-height) + 8px);
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - var(--header-height) - 24px);
    overflow: auto;
  }

  .quick-switcher__results {
    max-height: calc(100vh - var(--header-height) - 112px);
  }

  .portal-main--app {
    width: min(1120px, calc(100% - 40px));
    margin-inline: auto;
    padding: 40px 0 56px;
  }

  .nav-toggle {
    display: flex;
  }

  .app-shell {
    display: block;
  }

  .portal-nav__links,
  .app-sidebar {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    z-index: 95;
    display: grid;
    gap: 4px;
    align-items: stretch;
    justify-content: stretch;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: 0 18px 42px rgba(5, 5, 5, 0.16);
    max-height: calc(100vh - var(--header-height) - 24px);
    overflow: auto;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition:
      opacity 160ms ease,
      transform 160ms ease;
  }

  .notification-menu__panel {
    position: fixed;
    top: calc(var(--header-height) + 8px);
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - var(--header-height) - 24px);
    overflow: auto;
  }

  .app-sidebar {
    position: fixed;
    top: calc(var(--header-height) + 8px);
    bottom: auto;
    right: 12px;
    left: 12px;
    width: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(5, 5, 5, 0.16);
  }

  body.nav-open .portal-nav__links,
  body.nav-open .app-sidebar {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .portal-nav__links form {
    width: 100%;
  }

  .app-nav__link,
  .portal-link,
  .portal-logout {
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
    padding: 12px;
    text-align: left;
  }

  .portal-link--primary {
    justify-content: center;
    text-align: center;
  }

  .app-sidebar__footer {
    padding-top: 10px;
  }

  .app-content {
    width: auto;
    margin-inline: 0;
  }

  .portal-footer--compact .portal-footer__inner {
    width: min(1120px, calc(100% - 40px));
    margin-inline: auto;
    padding-inline: 0;
  }
}

@media (max-width: 760px) {
  body {
    --portal-panel-padding: 20px;
    --portal-card-padding: 12px 14px;
    --portal-card-padding-tight: 11px 12px;
    --portal-card-gap: 10px;
    --portal-section-gap: 16px;
  }

  :root {
    --header-height: 68px;
  }

  .portal-nav {
    width: min(100% - 24px, 1120px);
  }

  .portal-brand {
    width: 156px;
  }

  .portal-body--app .portal-nav {
    gap: 6px;
  }

  .portal-body--app .portal-brand {
    width: 124px;
  }

  .quick-switcher,
  .quick-switcher__summary {
    width: 42px;
  }

  .account-menu__copy {
    display: none;
  }

  .account-menu__summary {
    padding-right: 6px;
  }

  .portal-footer__brand {
    width: 160px;
  }

  .portal-link,
  .portal-logout {
    min-height: 44px;
    font-size: 0.95rem;
    padding: 12px;
  }

  .portal-main {
    width: min(100% - 24px, 1120px);
    padding-top: 24px;
  }

  .hero-panel {
    padding: 22px;
  }

  .hero-panel h1 {
    max-width: 12ch;
  }

  .form-actions .button,
  .card-actions .button,
  .page-actions .button,
  .hero-actions .button {
    flex: 1 1 180px;
  }

  .panel-heading,
  .resource-row,
  .status-row--split {
    align-items: stretch;
    flex-direction: column;
  }

  .resource-row .button {
    width: 100%;
  }

  .resource-meta {
    display: grid;
    gap: 8px;
  }

  .toast-region {
    position: static;
    width: 100%;
    margin-bottom: 16px;
  }
}

@media (max-width: 360px) {
  .portal-body--app .quick-switcher {
    display: none;
  }
}
