:root {
  --ink: #111111;
  --muted: #616161;
  --line: #e6ddd4;
  --panel: #ffffff;
  --canvas: #f7f4ef;
  --nav: #111111;
  --nav-soft: #1d1d1d;
  --accent: #fee100;
  --accent-2: #ff7a1a;
  --danger: #c2410c;
  --good: #15803d;
  --blue: #00a4b4;
  --focus: 0 0 0 3px rgba(254, 225, 0, 0.42);
  --shadow: 0 18px 38px rgba(17, 17, 17, 0.09);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Noto Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
a,
input,
select {
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

a[href^="mailto:"] {
  text-transform: lowercase;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[role="button"]:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

body.locked {
  overflow: hidden;
  background: #000000;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(135deg, rgba(254, 225, 0, 0.18), rgba(255, 255, 255, 0) 34%),
    radial-gradient(circle at 92% 8%, rgba(255, 122, 26, 0.12), transparent 28%);
}

button,
input,
select {
  font: inherit;
}

h1,
h2,
h3,
h4,
strong,
b {
  font-weight: 500;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 24px;
  color: #111111;
  background:
    radial-gradient(circle at 12% 2%, rgba(254, 225, 0, 0.42), transparent 26%),
    radial-gradient(circle at 55% 45%, rgba(254, 225, 0, 0.09), transparent 31%),
    linear-gradient(135deg, #171714 0%, #090909 58%, #000000 100%);
}

.login-screen::before {
  position: absolute;
  inset: 0;
  content: "";
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.35;
}

body.unlocked .login-screen {
  display: none;
}

.login-line-field {
  position: absolute;
  right: -90px;
  bottom: -90px;
  width: min(112vw, 1120px);
  height: min(82vh, 760px);
  color: var(--accent);
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  opacity: 0.18;
}

.login-stack {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(100%, 430px);
}

.login-card {
  display: grid;
  gap: 12px;
  padding: 46px 42px 38px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 95px rgba(0, 0, 0, 0.5);
}

.login-brand-block {
  display: grid;
  justify-items: center;
  margin-bottom: 8px;
  padding: 4px 0 8px;
}

.login-logo {
  display: block;
  width: min(100%, 292px);
  height: auto;
  object-fit: contain;
}

.login-copy {
  margin: 0 0 14px;
  color: #3f3f3f;
  text-align: center;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.35;
}

.login-password-label {
  color: #111111;
  font-size: 12px;
  font-weight: 500;
}

.login-password-wrap {
  position: relative;
}

.login-card input {
  width: 100%;
  min-height: 52px;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  padding: 12px 16px;
  color: #111111;
  background: #ffffff;
  outline: none;
  font-size: 14px;
  letter-spacing: 0;
}

.login-password-wrap input {
  padding-right: 54px;
  letter-spacing: 2px;
}

.login-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(254, 225, 0, 0.16);
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 13px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8e8e8e;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.login-submit {
  min-height: 52px;
  margin-top: 16px;
  border: 0;
  border-radius: 8px;
  color: #111111;
  background: var(--accent);
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
}

.login-register-toggle {
  min-height: 34px;
  border: 1px solid rgba(17, 17, 17, 0.14);
  border-radius: 8px;
  color: #111111;
  background: #ffffff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.login-register-toggle:hover,
.login-register-toggle:focus-visible {
  border-color: var(--accent);
  background: rgba(254, 225, 0, 0.2);
}

.register-card[hidden] {
  display: none;
}

.login-error {
  min-height: 14px;
  margin: 0;
  color: #c2410c;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
}

.login-rights {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  text-align: center;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0;
}

.login-rights p {
  margin: 0;
}

.login-rights p + p {
  margin-top: 3px;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 288px minmax(0, 1fr);
}

body.locked .app-shell {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 24px;
  padding: 28px 22px;
  color: #f8fafc;
  background: var(--nav);
  overflow: hidden;
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.sidebar h1,
.topbar h2,
.panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.sidebar h1 {
  margin-top: 6px;
  font-size: 26px;
  line-height: 1.05;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted {
  color: #b6b5ba;
  text-align: center;
  font-size: 10px;
  line-height: 1.45;
}

.sidebar-brand {
  position: relative;
  width: min(100%, 214px);
  margin-top: 8px;
}

.sidebar-logo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.version-badge {
  position: absolute;
  top: -10px;
  right: -7px;
  display: inline-flex;
  align-items: center;
  min-height: 14px;
  padding: 1px 4px;
  border-radius: 999px;
  color: #111111;
  background: var(--accent);
  font-size: 6px;
  font-weight: 700;
}

.nav-tabs {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.nav-tab,
.secondary-action,
.toolbar button,
.source-link {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
}

.nav-tab {
  min-width: 94px;
  min-height: 28px;
  padding: 5px 9px;
  color: #111111;
  background: #ffffff;
  border-color: var(--line);
  font-size: 11px;
  text-align: center;
  font-weight: 500;
}

.nav-tab.active,
.nav-tab:hover {
  color: #111111;
  background: var(--accent);
}

.filter-panel {
  display: grid;
  gap: 14px;
  padding-top: 6px;
}

.filter-panel label {
  display: grid;
  gap: 7px;
  color: #d8e2ec;
  font-size: 9px;
  font-weight: 500;
}

.date-filter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.filter-panel input,
.filter-panel select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #304452;
  border-radius: 7px;
  color: #f8fafc;
  background: #1d1d1d;
  padding: 8px 10px;
}

.filter-panel input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: brightness(0) saturate(100%) invert(82%) sepia(94%) saturate(1129%) hue-rotate(357deg) brightness(104%) contrast(103%);
  opacity: 1;
}

.secondary-action {
  color: #111111;
  background: var(--accent);
  font-weight: 700;
}

.sidebar-footer {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: auto 0 0;
  max-width: 100%;
  color: #ffffff;
  text-align: center;
  font-size: 7px;
  font-weight: 700;
  line-height: 1.35;
}

.sidebar-footer p {
  margin: 0;
}

.footer-symbol {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.main-content {
  min-width: 0;
  padding: 28px;
}

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

.topbar .eyebrow {
  color: #111111;
}

.topbar h2 {
  margin-top: 4px;
  font-size: 20px;
  text-transform: uppercase;
}

.sync-status {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.sync-status[data-mode="working"] {
  color: #b45309;
}

.sync-status[data-mode="ok"] {
  color: var(--good);
}

.sync-status[data-mode="warn"] {
  color: var(--danger);
}

.topbar-controls {
  display: grid;
  gap: 7px;
  justify-items: end;
}

.toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toolbar button,
.source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  color: var(--ink);
  background: #ffffff;
  border-color: var(--line);
  text-decoration: none;
  font-size: 8px;
  font-weight: 500;
}

.toolbar button:first-child {
  background: var(--accent);
  border-color: var(--accent);
}

.toolbar .logout-action {
  color: #ffffff;
  background: #1d1d1d;
  border-color: #1d1d1d;
}

.toolbar button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi {
  min-height: 112px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  border-top: 5px solid var(--accent);
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.kpi strong {
  display: block;
  margin-top: 12px;
  font-size: 20px;
  line-height: 1.08;
}

.kpi .kpi-usd {
  display: inline;
  color: #616161;
  font-size: calc(0.5em + 3px);
  font-weight: inherit;
  text-transform: none;
}

.kpi small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

#portfolio.active {
  display: grid;
  gap: 16px;
}

body:has(#team.active) .kpi-grid {
  display: none;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.overview-alerts {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 16px;
}

.overview-alerts .domain-renewal-highlight,
.overview-alerts .birthday-highlight {
  min-height: 126px;
  margin: 0;
}

.panel {
  min-width: 0;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel.wide {
  grid-column: span 1;
}

.team-billing-panel {
  grid-column: 1 / -1;
}

.portfolio-status-panel {
  grid-column: 1 / -1;
}

.portfolio-aging-panel {
  grid-column: 1 / -1;
}

.clients-panel {
  min-height: calc(100vh - 126px);
}

.clients-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.clients-header h3 {
  margin: 3px 0 0;
  font-size: 22px;
  font-weight: 700;
  text-transform: none;
}

.clients-header-tools {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
}

.clients-search {
  display: grid;
  gap: 4px;
  min-width: 230px;
}

.clients-search span {
  color: var(--muted);
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
}

.clients-search input {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #111111;
  background: #ffffff;
  font: inherit;
  font-size: 9px;
  outline: none;
}

.clients-search input:focus {
  border-color: #111111;
  box-shadow: 0 0 0 2px rgba(254, 225, 0, 0.45);
}

.clients-summary {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.clients-summary > span {
  display: flex;
  min-width: 112px;
  flex-direction: column;
  justify-content: center;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  background: #f6f4ef;
}

.clients-summary small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
}

.clients-summary strong {
  color: #111111;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.client-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 4px solid #111111;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(17, 17, 17, 0.06);
}

.client-card-head {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 15px;
  padding: 14px 14px 12px;
}

.client-avatar {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  overflow: hidden;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #111111;
  background: #ffffff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.client-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.client-avatar:hover,
.client-avatar:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(254, 225, 0, 0.35);
}

.client-card-head h3 {
  margin: 2px 0 3px;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.client-card-head a {
  display: block;
  color: var(--muted);
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-profile {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
  background: #fffdf8;
}

.client-profile > div {
  min-width: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.client-profile > div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.client-profile dt {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 7px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-profile dd {
  margin: 0;
  color: #111111;
  font-size: 9px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.client-profile a {
  color: inherit;
}

.client-profile input,
.client-profile textarea {
  width: 100%;
  border: 1px solid rgba(17, 17, 17, 0.14);
  border-radius: 5px;
  padding: 6px 7px;
  color: #111111;
  background: #ffffff;
  font: inherit;
  font-size: 9px;
  line-height: 1.35;
  outline: none;
}

.client-profile textarea {
  min-height: 54px;
  resize: vertical;
}

.client-profile input:focus,
.client-profile textarea:focus {
  border-color: #111111;
  box-shadow: 0 0 0 2px rgba(254, 225, 0, 0.35);
}

.client-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #faf9f6;
}

.client-metrics > div {
  min-width: 0;
  padding: 10px 12px;
}

.client-metrics > div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.client-metrics > div:nth-child(-n + 2) {
  border-bottom: 1px solid var(--line);
}

.client-metrics small,
.client-metrics strong {
  display: block;
}

.client-metrics small {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
}

.client-metrics strong {
  color: #111111;
  font-size: 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.client-card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 14px;
}

.client-invoices-button {
  min-height: 32px;
  border: 1px solid #111111;
  border-radius: 6px;
  color: #ffffff;
  background: #111111;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.client-email-button {
  min-height: 32px;
  border: 1px solid #111111;
  border-radius: 6px;
  color: #111111;
  background: #ffffff;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.client-save-button {
  min-height: 32px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: #111111;
  background: var(--accent);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.client-invoices-button:hover,
.client-invoices-button:focus-visible,
.client-email-button:hover,
.client-email-button:focus-visible,
.client-save-button:hover,
.client-save-button:focus-visible {
  color: #111111;
  background: var(--accent);
  border-color: var(--accent);
}

.client-documents {
  margin-top: auto;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  background: #fffdf7;
}

.client-documents-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.client-documents-head span {
  color: var(--muted);
  font-size: 7px;
}

.client-document-actions {
  display: flex;
  gap: 6px;
}

.client-upload-button,
.client-document-item button {
  min-height: 26px;
  border: 1px solid #111111;
  border-radius: 5px;
  color: #111111;
  background: #ffffff;
  cursor: pointer;
  font-size: 7px;
  font-weight: 700;
}

.client-upload-button {
  padding: 4px 10px;
}

.client-upload-button:hover,
.client-upload-button:focus-visible,
.client-document-item button:hover,
.client-document-item button:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
}

.client-document-list {
  display: grid;
  gap: 6px;
}

.client-document-item {
  display: grid;
  align-items: center;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 7px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 5px;
  background: #ffffff;
}

.client-document-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 4px;
  color: var(--accent);
  background: #111111;
  font-size: 6px;
  font-weight: 800;
}

.client-document-item strong,
.client-document-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-document-item strong {
  font-size: 8px;
}

.client-document-item small,
.client-document-empty {
  color: var(--muted);
  font-size: 7px;
}

.client-document-item button {
  padding: 3px 7px;
}

.client-document-empty {
  margin: 0;
  padding: 8px 0;
}

.clients-empty {
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
  text-align: center;
}

.clients-empty strong {
  color: #111111;
  font-size: 13px;
}

.clients-empty span {
  font-size: 9px;
}

.client-email-panel {
  width: min(680px, 100%);
  height: auto;
  max-height: min(86vh, 720px);
}

.client-email-form {
  display: grid;
  gap: 14px;
  padding: 22px;
  overflow: auto;
}

.client-email-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-email-form input,
.client-email-form select,
.client-email-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: #111111;
  background: #ffffff;
  font: inherit;
  font-size: 12px;
  outline: none;
  text-transform: none;
}

.client-email-form textarea {
  min-height: 190px;
  resize: vertical;
  line-height: 1.5;
}

.client-email-form input:focus,
.client-email-form select:focus,
.client-email-form textarea:focus {
  border-color: #111111;
  box-shadow: 0 0 0 2px rgba(254, 225, 0, 0.42);
}

.client-email-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.client-email-note span {
  padding: 6px 8px;
  border-left: 3px solid var(--accent);
  color: #111111;
  background: #f6f4ef;
  font-size: 10px;
  font-weight: 700;
}

.users-panel {
  min-height: 560px;
}

.users-board {
  display: grid;
  gap: 10px;
}

.user-card,
.users-access-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.users-access-note {
  grid-template-columns: 1fr;
}

.users-access-note strong {
  font-size: 13px;
}

.users-access-note span {
  color: var(--muted);
  font-size: 10px;
}

.user-card-main {
  display: flex;
  min-width: 0;
  gap: 12px;
  align-items: center;
}

.user-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #111111;
  background: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.user-card h4 {
  margin: 0 0 3px;
  font-size: 13px;
}

.user-card a,
.user-card small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  overflow-wrap: anywhere;
}

.user-status {
  min-width: 82px;
  padding: 5px 8px;
  border-radius: 999px;
  text-align: center;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.user-status-pending {
  color: #6b3f00;
  background: #ffe8ad;
}

.user-status-approved {
  color: #0f5132;
  background: #d1fae5;
}

.user-status-rejected {
  color: #842029;
  background: #f8d7da;
}

.user-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-actions button {
  min-height: 28px;
  border: 1px solid #111111;
  border-radius: 6px;
  color: #111111;
  background: #ffffff;
  cursor: pointer;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.user-actions button:hover:not(:disabled),
.user-actions button:focus-visible:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent);
}

.user-actions button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.infrastructure-panel {
  display: grid;
  gap: 18px;
}

.infrastructure-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.infrastructure-header h3 {
  margin: 3px 0 5px;
  font-size: 24px;
}

.infrastructure-header > div > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.infrastructure-private-badge {
  padding: 7px 11px;
  border-radius: 999px;
  color: #111111;
  background: var(--accent);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.infrastructure-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.infrastructure-toolbar .secondary-action {
  min-height: 34px;
  padding: 0 14px;
}

.infrastructure-search {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f6f1;
}

.infrastructure-search label {
  color: #444444;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.infrastructure-search > input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #d8d5ce;
  border-radius: 8px;
  color: #111111;
  background: #ffffff;
  font: inherit;
  font-size: 11px;
}

.infrastructure-search-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.infrastructure-search-results button {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #111111;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
}

.infrastructure-search-results strong,
.infrastructure-search-results span {
  min-width: 0;
  font-size: 9px;
  overflow-wrap: anywhere;
}

.infrastructure-search-results span {
  color: var(--muted);
}

.infrastructure-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f6f1;
}

.infrastructure-form label {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: #444444;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.infrastructure-form input,
.infrastructure-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #d8d5ce;
  border-radius: 7px;
  color: #111111;
  background: #ffffff;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
}

.infrastructure-form textarea {
  min-height: 92px;
  padding: 10px;
  resize: vertical;
}

.infrastructure-form-notes {
  grid-column: span 2;
}

.infrastructure-form-sites {
  grid-column: 1 / -1;
}

.infrastructure-form-actions {
  display: flex;
  grid-column: span 2;
  align-items: end;
  gap: 8px;
}

.infrastructure-form-actions .login-submit {
  width: auto;
  min-width: 130px;
  min-height: 38px;
  margin: 0;
}

.infrastructure-message {
  min-height: 16px;
  color: #6b5500;
  font-size: 10px;
  font-weight: 700;
}

.infrastructure-message.error {
  color: #9f1d26;
}

.infrastructure-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.infrastructure-title-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.infrastructure-title-brand h3 {
  margin: 0;
}

.infrastructure-title-brand img {
  display: block;
  width: 142px;
  max-width: 36vw;
  height: 25px;
  object-fit: contain;
  object-position: left center;
}

.domains-toolbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.domains-toolbar-brand img {
  display: block;
  width: 105px;
  height: 30px;
  object-fit: contain;
  object-position: left center;
}

.infrastructure-subnav {
  display: inline-flex;
  gap: 6px;
  margin: 0 0 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f5f3ed;
}

.infrastructure-subnav button {
  min-width: 105px;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  color: #555555;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.infrastructure-subnav button.active {
  color: #111111;
  background: var(--accent);
  box-shadow: 0 4px 12px rgba(17, 17, 17, 0.1);
}

.infrastructure-subpanel[hidden] {
  display: none;
}

.domain-renewal-highlight {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 15px;
  overflow: hidden;
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid rgba(254, 225, 0, 0.45);
  border-radius: 10px;
  color: #ffffff;
  background:
    radial-gradient(circle at 92% 12%, rgba(254, 225, 0, 0.24), transparent 28%),
    linear-gradient(135deg, #111111, #28241b);
}

.domain-renewal-highlight::after {
  position: absolute;
  right: -34px;
  bottom: -62px;
  width: 150px;
  height: 150px;
  content: "";
  border: 20px solid rgba(254, 225, 0, 0.16);
  border-radius: 50%;
}

.domain-renewal-mark {
  position: relative;
  z-index: 1;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  color: #111111;
  background: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.domain-renewal-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.domain-renewal-copy .team-role {
  color: var(--accent);
}

.domain-renewal-copy h3 {
  margin: 2px 0 8px;
  font-size: 18px;
}

.domain-renewal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.domain-renewal-list > div {
  display: grid;
  gap: 2px;
  min-width: 220px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.domain-renewal-list strong {
  color: #ffffff;
  font-size: 11px;
}

.domain-renewal-list span {
  color: #e7e7e7;
  font-size: 9px;
}

.domains-overview {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfaf7;
}

.domains-overview > div {
  display: grid;
  gap: 4px;
}

.domains-overview strong {
  font-size: 13px;
}

.domains-overview span {
  color: var(--muted);
  font-size: 9px;
}

.domains-overview label {
  display: grid;
  width: min(320px, 100%);
  gap: 5px;
  color: #444444;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.domains-overview input {
  width: 100%;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  font: inherit;
  text-transform: none;
}

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

.domain-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(170px, 0.7fr) minmax(135px, 0.45fr) auto;
  align-items: center;
  gap: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-left: 4px solid #111111;
  border-radius: 9px;
  background: #ffffff;
}

.domain-row.urgent {
  border-left-color: var(--accent);
  background: #fffdf0;
}

.domain-row.expired {
  border-left-color: #b42318;
  background: #fff7f6;
}

.domain-row > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.domain-row a {
  color: #111111;
  font-size: 11px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.domain-row div > span,
.domain-row small {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.domain-row div > strong {
  font-size: 10px;
}

.domain-countdown {
  min-width: 92px;
  padding: 6px 8px;
  border-radius: 999px;
  color: #333333;
  background: #f1efe9;
  font-size: 8px;
  font-weight: 800;
  text-align: center;
}

.domain-row.urgent .domain-countdown {
  color: #6b5500;
  background: #fff1a6;
}

.domain-row.expired .domain-countdown {
  color: #842029;
  background: #f8d7da;
}

.infrastructure-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 5px solid #111111;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(17, 17, 17, 0.08);
}

.infrastructure-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  list-style: none;
}

.infrastructure-card-head::-webkit-details-marker {
  display: none;
}

.infrastructure-card:not([open]) .infrastructure-card-head {
  border-bottom: 0;
}

.infrastructure-card-summary-meta {
  display: flex;
  align-items: center;
  gap: 9px;
}

.infrastructure-chevron {
  font-size: 20px;
  line-height: 1;
  transition: transform 0.18s ease;
}

.infrastructure-card[open] .infrastructure-chevron {
  transform: rotate(180deg);
}

.infrastructure-card-body {
  display: grid;
}

.infrastructure-card-head h4 {
  margin: 3px 0 4px;
  font-size: 15px;
}

.infrastructure-card-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.infrastructure-title-edit {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid #d5d0c7;
  border-radius: 7px;
  color: #111111;
  background: #ffffff;
  cursor: pointer;
}

.infrastructure-title-edit:hover,
.infrastructure-icon-button:hover {
  border-color: #111111;
  background: #f6f4ee;
}

.infrastructure-card-head a,
.infrastructure-card-head span {
  color: var(--muted);
  font-size: 9px;
  overflow-wrap: anywhere;
}

.infrastructure-status {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  color: #6b5500;
  background: #fff1b8;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.infrastructure-status.online {
  color: #0f5132;
  background: #d1fae5;
}

.infrastructure-status.error {
  color: #842029;
  background: #f8d7da;
}

.infrastructure-credentials {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  padding: 16px;
}

.infrastructure-field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.infrastructure-field > span {
  color: #444444;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.infrastructure-value {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.infrastructure-value input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  color: #111111;
  background: #e2e4e4;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.infrastructure-icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #c8c8c8;
  border-radius: 7px;
  color: #111111;
  background: #ffffff;
  cursor: pointer;
  padding: 0;
}

.infrastructure-button-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.infrastructure-icon-button.copied {
  border-color: #198754;
  color: #0f5132;
  background: #d1fae5;
}

.infrastructure-sites {
  padding: 0 16px 16px;
}

.infrastructure-card-note {
  margin: 0 16px 14px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--muted);
  background: #f5f3ed;
  font-size: 9px;
}

.infrastructure-sites h5 {
  margin: 0 0 9px;
  font-size: 10px;
  text-transform: uppercase;
}

.infrastructure-sites-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 7px;
}

.infrastructure-site {
  display: block;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.infrastructure-site strong,
.infrastructure-site a {
  min-width: 0;
  color: #111111;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.infrastructure-empty {
  padding: 13px;
  border: 1px dashed #cfcac0;
  border-radius: 8px;
  color: var(--muted);
  background: #fbfaf7;
  font-size: 9px;
}

.infrastructure-card-error {
  margin: 0 16px 14px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #842029;
  background: #f8d7da;
  font-size: 9px;
  font-weight: 700;
}

.infrastructure-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.infrastructure-card-actions button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #111111;
  border-radius: 7px;
  color: #111111;
  background: #ffffff;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
}

.infrastructure-card-actions button[data-infrastructure-sync] {
  margin-left: auto;
  border-color: var(--accent);
  background: var(--accent);
}

.infrastructure-card-actions button:disabled {
  opacity: 0.5;
  cursor: progress;
}

@media (max-width: 1000px) {
  .infrastructure-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .infrastructure-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .infrastructure-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .domains-toolbar-brand {
    flex-wrap: wrap;
  }

  .infrastructure-form,
  .infrastructure-credentials {
    grid-template-columns: 1fr;
  }

  .infrastructure-search-results {
    grid-template-columns: 1fr;
  }

  .infrastructure-form-notes,
  .infrastructure-form-sites,
  .infrastructure-form-actions {
    grid-column: auto;
  }

  .infrastructure-subnav {
    display: flex;
  }

  .infrastructure-subnav button {
    flex: 1;
  }

  .domains-overview {
    align-items: stretch;
    flex-direction: column;
  }

  .domains-overview label {
    width: 100%;
  }

  .domain-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .domain-countdown {
    justify-self: start;
  }
}

.monthly-expenses-panel {
  grid-column: 1 / -1;
}

.utility-projection-panel {
  grid-column: 1 / -1;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.panel-header h3 {
  font-size: 12px;
  text-transform: uppercase;
}

.panel-header span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

#portfolioAgingSummary {
  display: inline-flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}

#portfolioAgingSummary strong {
  color: #111111;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

#portfolioAgingSummary small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

#teamBillingSummary {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid rgba(254, 225, 0, 0.38);
  border-radius: 8px;
  color: #ffffff;
  background: #101010;
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.16);
  font-size: 11px;
  line-height: 1.1;
}

#teamBillingSummary span {
  min-width: 0;
  color: #ffffff;
  font-size: inherit;
  font-weight: 500;
  overflow-wrap: anywhere;
}

#teamBillingSummary strong {
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.bar-chart,
.insights {
  display: grid;
  gap: 10px;
}

.billing-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.billing-status-card {
  min-height: 128px;
  padding: 15px;
  border: 1px solid var(--line);
  border-top: 6px solid var(--accent);
  border-radius: 8px;
  background: #fffdf8;
  cursor: pointer;
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.billing-status-card:hover,
.billing-status-card:focus-visible {
  outline: none;
  box-shadow: 0 14px 26px rgba(17, 17, 17, 0.12);
  transform: translateY(-1px);
}

.billing-status-card span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.billing-status-card strong {
  display: block;
  margin-top: 12px;
  font-size: 18px;
  line-height: 1.1;
}

.billing-status-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.billing-status-card.orange {
  border-top-color: var(--accent-2);
}

.billing-status-card.green {
  border-top-color: var(--good);
}

.billing-status-card.red {
  border-top-color: var(--danger);
}

.status-visual {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 8px;
}

.status-pie {
  position: relative;
  display: flex;
  width: 150px;
  height: 150px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--slices));
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.08);
}

.status-pie::after {
  position: absolute;
  inset: 38px;
  content: "";
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 1px var(--line);
}

.status-pie span,
.status-pie small {
  position: relative;
  z-index: 1;
}

.status-pie span {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.status-pie small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-legend,
.status-bars {
  display: grid;
  gap: 9px;
}

.status-legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 10px;
}

.status-legend-row small {
  color: var(--muted);
  font-weight: 700;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color);
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(112px, 160px) 1fr minmax(84px, auto);
  align-items: center;
  gap: 10px;
  font-size: 10px;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  background: #eee8df;
  border-radius: 999px;
}

.bar-fill {
  height: 100%;
  width: var(--width);
  background: var(--color);
}

.team-billing-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.team-billing-card {
  position: relative;
  display: grid;
  overflow: hidden;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(254, 225, 0, 0.34);
  border-top: 4px solid var(--accent);
  border-radius: 8px;
  background:
    radial-gradient(circle at 94% 8%, rgba(254, 225, 0, 0.18), transparent 30%),
    linear-gradient(135deg, #111111, #24211a);
  color: #ffffff;
}

.team-billing-card::after {
  position: absolute;
  right: -30px;
  bottom: -46px;
  width: 112px;
  height: 112px;
  content: "";
  border: 17px solid rgba(254, 225, 0, 0.14);
  border-radius: 50%;
}

.team-billing-card > * {
  position: relative;
  z-index: 1;
}

.team-billing-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.team-billing-head h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.05;
  text-transform: uppercase;
}

.team-billing-head strong {
  min-width: 0;
  text-align: right;
  font-size: 12px;
  line-height: 1.25;
  color: #ffffff;
  overflow-wrap: anywhere;
}

.team-billing-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.team-billing-bar span {
  display: block;
  width: var(--width);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.team-billing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #d8d8d8;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.team-billing-skus {
  display: grid;
  gap: 7px;
}

.team-billing-skus div {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 9px;
}

.team-billing-skus strong {
  font-size: 10px;
}

.team-billing-skus small {
  color: #d8d8d8;
  line-height: 1.25;
}

.team-billing-skus span {
  text-align: right;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.portfolio-status-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.portfolio-status-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-top: 5px solid var(--status-color);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--status-color) 10%, transparent), transparent 42%),
    #ffffff;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.portfolio-status-card:hover,
.portfolio-status-card:focus-visible {
  outline: none;
  box-shadow: 0 14px 26px rgba(17, 17, 17, 0.12);
  transform: translateY(-1px);
}

.portfolio-status-card div:first-child {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.portfolio-status-card strong {
  font-size: 13px;
  line-height: 1.1;
  text-transform: uppercase;
}

.portfolio-status-card small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.portfolio-status-card .money {
  font-size: 11px;
  font-weight: 700;
}

.status-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--status-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--status-color) 14%, transparent);
}

.portfolio-status-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee8df;
}

.portfolio-status-track i {
  display: block;
  width: var(--width);
  height: 100%;
  border-radius: inherit;
  background: var(--status-color);
}

.portfolio-aging-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.portfolio-aging-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-top: 5px solid var(--aging-color);
  border-radius: 8px;
  background:
    radial-gradient(circle at 96% 6%, color-mix(in srgb, var(--aging-color) 16%, transparent), transparent 34%),
    #ffffff;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.portfolio-aging-card:hover,
.portfolio-aging-card:focus-visible {
  outline: none;
  box-shadow: 0 14px 26px rgba(17, 17, 17, 0.12);
  transform: translateY(-1px);
}

.portfolio-aging-card strong {
  display: block;
  font-size: 13px;
  line-height: 1.1;
  text-transform: uppercase;
}

.portfolio-aging-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.portfolio-aging-card .money {
  font-size: 11px;
  font-weight: 700;
}

.portfolio-aging-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee8df;
}

.portfolio-aging-track i {
  display: block;
  width: var(--width);
  height: 100%;
  border-radius: inherit;
  background: var(--aging-color);
}

.portfolio-client-aging-panel {
  margin-top: 14px;
}

.portfolio-client-aging-chart {
  display: grid;
  gap: 11px;
}

.client-aging-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(220px, 1fr);
  gap: 14px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 8px;
  background: #ffffff;
}

.client-aging-meta {
  min-width: 0;
}

.client-aging-meta strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.client-aging-meta small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.client-aging-bar-shell {
  width: var(--row-width);
  min-width: 48px;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee8df;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.04);
}

.client-aging-bar {
  display: flex;
  width: 100%;
  height: 100%;
}

.client-aging-bar span {
  display: block;
  width: var(--segment-width);
  min-width: 5px;
  height: 100%;
  background: var(--segment-color);
}

.modal-open {
  overflow: hidden;
}

.pwa-install-modal[hidden],
.records-modal[hidden] {
  display: none;
}

.invoice-modal[hidden] {
  display: none;
}

.pwa-install-modal,
.records-modal {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  padding: 28px;
  place-items: center;
}

.pwa-install-modal {
  z-index: 90;
  padding: 22px;
}

.invoice-modal {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
}

.pwa-install-backdrop,
.records-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.72);
  backdrop-filter: blur(4px);
}

.pwa-install-backdrop {
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(7px);
}

.pwa-install-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(92vw, 420px);
  overflow: hidden;
  padding: 30px 28px 26px;
  border: 1px solid rgba(254, 225, 0, 0.38);
  border-radius: 18px;
  color: #ffffff;
  background:
    radial-gradient(circle at 100% 0%, rgba(254, 225, 0, 0.2), transparent 30%),
    linear-gradient(145deg, #151515, #050505);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.pwa-install-panel::after {
  position: absolute;
  right: -90px;
  bottom: -110px;
  width: 220px;
  height: 220px;
  content: "";
  border: 32px solid rgba(254, 225, 0, 0.16);
  border-radius: 50%;
  pointer-events: none;
}

.pwa-install-icon {
  width: 62px;
  height: 62px;
  margin-bottom: 18px;
  object-fit: contain;
}

.pwa-install-panel .team-role {
  margin-bottom: 6px;
  color: var(--accent);
}

.pwa-install-panel h3 {
  max-width: 330px;
  margin: 0;
  color: #ffffff;
  font-size: 24px;
  line-height: 1.08;
}

.pwa-install-panel p {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  line-height: 1.45;
}

.pwa-install-steps {
  display: grid;
  gap: 9px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: pwa-step;
}

.pwa-install-steps li {
  position: relative;
  min-height: 36px;
  padding: 9px 10px 9px 46px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.055);
  font-size: 12px;
  line-height: 1.35;
}

.pwa-install-steps li::before {
  position: absolute;
  top: 8px;
  left: 10px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #111111;
  content: counter(pwa-step);
  counter-increment: pwa-step;
  font-size: 11px;
  font-weight: 700;
}

.pwa-install-steps strong {
  color: #ffffff;
  font-weight: 700;
}

.pwa-install-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 22px;
}

.pwa-install-actions .login-submit {
  min-height: 44px;
  margin-top: 0;
}

.pwa-install-actions .secondary-action {
  min-height: 40px;
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 500;
}

.pwa-install-actions .secondary-action:hover,
.pwa-install-actions .secondary-action:focus-visible {
  border-color: var(--accent);
  color: #111111;
  background: var(--accent);
}

.invoice-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.82);
  backdrop-filter: blur(5px);
}

.records-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1080px, 100%);
  height: min(90vh, 820px);
  overflow: hidden;
  border: 1px solid rgba(254, 225, 0, 0.38);
  border-top: 5px solid var(--accent);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.invoice-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1120px, 100%);
  height: min(86vh, 820px);
  overflow: hidden;
  border: 1px solid rgba(254, 225, 0, 0.42);
  border-top: 5px solid var(--accent);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

.records-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(254, 225, 0, 0.2), transparent 42%),
    #ffffff;
}

.invoice-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.records-modal-header h3 {
  margin: 0 0 5px;
  font-size: 16px;
  line-height: 1.05;
  text-transform: uppercase;
}

.invoice-modal-header h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1;
  text-transform: uppercase;
}

.invoice-modal-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.invoice-modal-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #111111;
  border-radius: 7px;
  color: #111111;
  background: var(--accent);
  font-size: 9px;
  font-weight: 600;
  text-decoration: none;
}

.invoice-modal iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.collection-email-panel {
  width: min(860px, 100%);
  height: min(88vh, 840px);
  background: #f4f1ea;
}

.client-logo-preview-panel {
  width: min(820px, 100%);
  height: min(86vh, 760px);
  background: #f4f1ea;
}

.client-logo-preview-stage {
  display: grid;
  min-height: 0;
  padding: 28px;
  place-items: center;
  overflow: auto;
  background:
    linear-gradient(45deg, rgba(17, 17, 17, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(17, 17, 17, 0.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(17, 17, 17, 0.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(17, 17, 17, 0.035) 75%),
    #f7f4ed;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.client-logo-preview-stage img {
  display: block;
  width: min(100%, 620px);
  height: min(100%, 580px);
  object-fit: contain;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(17, 17, 17, 0.16);
}

.records-modal-header span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.records-modal-close {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #111111;
  border-radius: 7px;
  color: #ffffff;
  background: #111111;
  cursor: pointer;
  font-size: 9px;
  font-weight: 500;
}

.records-modal-table {
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.records-modal-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.records-modal-table th,
.records-modal-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.records-modal-table tbody tr:hover {
  background: rgba(254, 225, 0, 0.08);
}

.records-modal-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #111111;
  color: #ffffff;
  font-size: 8px;
  text-transform: uppercase;
}

.records-modal-table td:nth-last-child(2),
.records-modal-table th:nth-last-child(2) {
  text-align: right;
  white-space: nowrap;
}

.records-modal-table .modal-action,
.records-modal-table th:last-child {
  width: 72px;
  text-align: center;
  white-space: nowrap;
}

.records-modal-table td.money {
  font-weight: 700;
}

.collection-button {
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid #111111;
  border-radius: 999px;
  color: #ffffff;
  background: #111111;
  cursor: pointer;
  font-size: 8px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

.records-modal-table .collection-button:hover,
.records-modal-table .collection-button:focus-visible {
  border-color: #fee100 !important;
  background-color: #fee100 !important;
  background: #fee100 !important;
  color: #111111 !important;
}

.modal-sort {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
  text-align: inherit;
  text-transform: inherit;
}

.records-modal-table th:nth-last-child(2) .modal-sort {
  justify-content: flex-end;
}

.modal-sort::after {
  content: "";
  opacity: 0.45;
  font-size: 8px;
}

.modal-sort.active::after {
  content: "↓";
  opacity: 1;
  color: var(--accent);
}

.modal-sort.active[data-direction="asc"]::after {
  content: "↑";
}

.invoice-link {
  color: #111111;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.invoice-link:hover {
  color: #8a7300;
}

.monthly-expenses-board {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 14px;
}

.monthly-expenses-total {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 180px;
  padding: 16px;
  border: 1px solid rgba(254, 225, 0, 0.34);
  border-top: 5px solid var(--accent);
  border-radius: 8px;
  background:
    radial-gradient(circle at 94% 8%, rgba(254, 225, 0, 0.18), transparent 30%),
    linear-gradient(135deg, #111111, #24211a);
  color: #ffffff;
}

.monthly-expenses-total .team-role {
  color: var(--accent);
}

.monthly-expenses-total strong {
  font-size: 22px;
  line-height: 1.05;
}

.monthly-expenses-total small {
  color: #d8d8d8;
  font-size: 10px;
  line-height: 1.35;
}

.monthly-expenses-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.monthly-expense-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.monthly-expense-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.monthly-expense-head strong {
  min-width: 0;
  font-size: 12px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.monthly-expense-head span {
  min-width: 0;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.monthly-expense-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee8df;
}

.monthly-expense-track i {
  display: block;
  width: var(--width);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.monthly-expense-card > small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.monthly-expense-concepts {
  display: grid;
  gap: 6px;
}

.monthly-expense-concepts div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  font-size: 9px;
}

.monthly-expense-concepts span {
  color: var(--muted);
}

.monthly-expense-concepts strong {
  text-align: right;
  overflow-wrap: anywhere;
}

.utility-projection-board {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
}

.utility-hero {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 170px;
  padding: 16px;
  border: 1px solid rgba(254, 225, 0, 0.34);
  border-top: 5px solid var(--accent);
  border-radius: 8px;
  background:
    radial-gradient(circle at 94% 8%, rgba(254, 225, 0, 0.18), transparent 30%),
    linear-gradient(135deg, #111111, #24211a);
  color: #ffffff;
}

.utility-hero.negative {
  border-top-color: var(--danger);
}

.utility-hero .team-role {
  color: var(--accent);
}

.utility-hero.negative .team-role {
  color: #ffb4a2;
}

.utility-hero strong {
  font-size: 22px;
  line-height: 1.05;
}

.utility-hero small {
  color: #d8d8d8;
  font-size: 10px;
  line-height: 1.35;
}

.utility-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.utility-metrics article {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.utility-metrics span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.utility-metrics strong {
  font-size: 16px;
  line-height: 1.1;
}

.utility-metrics small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #0f172a;
  background: #eee8df;
  font-size: 9px;
  font-weight: 700;
}

.pill.danger {
  color: #fff;
  background: var(--danger);
}

.pill.good {
  color: #fff;
  background: var(--good);
}

.pill.warn {
  color: #111827;
  background: var(--accent);
}

.insights {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.insight {
  position: relative;
  overflow: hidden;
  min-height: 142px;
  padding: 14px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 8px;
  background:
    radial-gradient(circle at 100% 0, rgba(254, 225, 0, 0.22), transparent 34%),
    #ffffff;
  box-shadow: 0 14px 28px rgba(17, 17, 17, 0.08);
}

.insight::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  content: "";
  background: var(--insight-color, var(--accent));
}

.insight-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.insight-topline strong {
  font-size: 9px;
  line-height: 1;
  text-transform: uppercase;
}

.insight-topline span {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: #111111;
  background: var(--insight-color, var(--accent));
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
}

.insight p {
  margin: 18px 0 8px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.05;
}

.insight small {
  display: block;
  min-height: 28px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.35;
}

.insight-track {
  height: 8px;
  overflow: hidden;
  margin-top: 14px;
  border-radius: 999px;
  background: #eee8df;
}

.insight-track i {
  display: block;
  width: var(--insight-width);
  height: 100%;
  border-radius: inherit;
  background: var(--insight-color, var(--accent));
}

.insight-accent {
  --insight-color: var(--accent);
}

.insight-dark {
  --insight-color: #111111;
}

.insight-dark .insight-topline span {
  color: #ffffff;
}

.insight-good {
  --insight-color: var(--good);
}

.insight-good .insight-topline span {
  color: #ffffff;
}

.insight-warn {
  --insight-color: var(--accent-2);
}

.team-panel {
  grid-column: 1 / -1;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.team-section-header {
  margin: 2px 0 12px;
}

.documents-section {
  margin-bottom: 18px;
}

.documents-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.document-card {
  position: relative;
  display: grid;
  overflow: hidden;
  gap: 12px;
  min-height: 136px;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 8px;
  background: #fffdf8;
}

.documents-section .document-card {
  border-color: rgba(254, 225, 0, 0.34);
  background:
    radial-gradient(circle at 96% 0%, rgba(254, 225, 0, 0.2), transparent 30%),
    linear-gradient(135deg, #111111, #24211a);
  color: #ffffff;
}

.documents-section .document-card::after {
  position: absolute;
  right: -34px;
  bottom: -46px;
  width: 118px;
  height: 118px;
  content: "";
  border: 18px solid rgba(254, 225, 0, 0.14);
  border-radius: 50%;
}

.documents-section .document-card > * {
  position: relative;
  z-index: 1;
}

.documents-section .document-card .team-role {
  color: var(--accent);
}

.documents-section .document-status {
  color: #d8d8d8;
}

.documents-section .document-actions button {
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.documents-section .document-actions .document-upload {
  color: #111111;
  background: var(--accent);
  border-color: var(--accent);
}

.document-card h4 {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.15;
  text-transform: uppercase;
}

.document-status {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.document-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-self: end;
}

.document-actions button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: #111111;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.document-actions .document-upload {
  background: var(--accent);
  border-color: var(--accent);
}

.document-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.team-document-card {
  min-height: auto;
  margin-top: 12px;
  padding: 10px;
  gap: 9px;
  border-top-width: 3px;
  background: rgba(255, 255, 255, 0.72);
}

.team-document-card h4 {
  font-size: 11px;
}

.team-document-card .document-actions {
  grid-template-columns: 1fr 1fr;
}

.team-document-card .document-actions button {
  min-height: 28px;
  font-size: 8px;
}

.birthday-highlight {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid rgba(254, 225, 0, 0.42);
  border-radius: 8px;
  background:
    radial-gradient(circle at 92% 16%, rgba(254, 225, 0, 0.2), transparent 24%),
    linear-gradient(135deg, #111111, #24211a);
  color: #ffffff;
}

.birthday-highlight::after {
  position: absolute;
  right: -32px;
  bottom: -52px;
  width: 132px;
  height: 132px;
  content: "";
  border: 18px solid rgba(254, 225, 0, 0.18);
  border-radius: 50%;
}

.birthday-mark {
  position: relative;
  z-index: 1;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  color: #111111;
  background: var(--accent);
  font-size: 15px;
  font-weight: 700;
}

.birthday-highlight div:last-child {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.birthday-highlight .team-role {
  color: var(--accent);
}

.birthday-highlight h3 {
  margin: 0 0 5px;
  font-size: 17px;
  line-height: 1.05;
  text-transform: uppercase;
}

.birthday-highlight span {
  color: #e2e2e2;
  font-size: 11px;
  font-weight: 500;
}

.company-account-card {
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(254, 225, 0, 0.18), transparent 34%),
    #111111;
}

.company-account-card::after {
  position: absolute;
  right: -58px;
  bottom: -74px;
  width: 180px;
  height: 180px;
  content: "";
  border: 24px solid rgba(254, 225, 0, 0.24);
  border-radius: 50%;
}

.company-account-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.company-account-header h3 {
  margin: 0;
  color: #ffffff;
  font-size: 23px;
  line-height: 1;
  text-transform: uppercase;
}

.company-account-header .team-role {
  color: var(--accent);
}

.company-account-header span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  color: #111111;
  background: var(--accent);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.company-account-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.company-account-grid section {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(230, 221, 212, 0.9);
  border-radius: 8px;
  background: #ffffff;
}

.company-account-grid h4 {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.15;
  text-transform: uppercase;
}

.team-card {
  position: relative;
  display: block;
  min-height: 248px;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(254, 225, 0, 0.14), transparent 36%),
    #fffdf8;
}

.team-card::after {
  position: absolute;
  right: -42px;
  bottom: -48px;
  width: 118px;
  height: 118px;
  content: "";
  border: 18px solid rgba(254, 225, 0, 0.28);
  border-radius: 50%;
}

.team-avatar {
  position: relative;
  z-index: 1;
  float: left;
  display: grid;
  width: 76px;
  height: 76px;
  margin: 0 14px 12px 0;
  place-items: center;
  border: 3px solid var(--accent);
  border-radius: 50%;
  color: #111111;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.9), transparent 28%),
    linear-gradient(135deg, #fee100, #ffb74d);
  font-size: 19px;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(17, 17, 17, 0.1);
}

.team-card-body {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.team-role {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
}

.team-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.08;
  text-transform: uppercase;
}

.team-details {
  clear: both;
  display: grid;
  gap: 7px;
  margin: 0;
}

.team-details div {
  display: grid;
  gap: 2px;
}

.team-details dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.team-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
}

.team-details a {
  color: inherit;
  text-decoration: none;
}

.line-chart,
.comparison-chart {
  display: grid;
  gap: 10px;
}

.comparison-chart .month-row {
  grid-template-columns: 92px minmax(0, 1fr) 62px;
}

.month-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  font-size: 10px;
}

.month-row.is-current-month {
  font-weight: 700;
}

.month-label {
  line-height: 1.1;
}

.month-bar-line {
  display: grid;
  grid-template-columns: 34px minmax(80px, 1fr) 132px;
  gap: 8px;
  align-items: center;
}

.month-bar-year {
  color: var(--muted);
  font-size: 8px;
  font-weight: inherit;
  line-height: 1;
}

.month-bars {
  display: grid;
  gap: 6px;
}

.month-bar {
  height: 9px;
  border-radius: 999px;
  width: var(--width);
}

.month-bar-label {
  color: #333333;
  font-size: 9px;
  line-height: 1.15;
  white-space: nowrap;
  font-weight: inherit;
}

.month-bar.current {
  background: var(--accent);
}

.month-bar.prior {
  background: #111111;
}

.table-panel {
  grid-column: 1 / -1;
}

.table-wrap {
  max-height: 62vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

th,
td {
  min-width: 88px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #111111;
  color: #ffffff;
  font-size: 8px;
  text-transform: uppercase;
}

td:nth-child(5) {
  min-width: 260px;
}

.money {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .main-content {
    padding: 18px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .overview-alerts {
    grid-template-columns: 1fr;
  }

  .monthly-expenses-board,
  .utility-projection-board {
    grid-template-columns: 1fr;
  }

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

  .topbar-controls {
    width: 100%;
    justify-items: stretch;
  }

  .nav-tabs,
  .toolbar {
    justify-content: flex-start;
  }

  .nav-tabs {
    flex-wrap: wrap;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .billing-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portfolio-status-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .insights {
    grid-template-columns: 1fr;
  }

  .portfolio-aging-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .clients-header-tools {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .clients-search {
    width: 100%;
    min-width: 0;
  }

  .clients-summary {
    width: 100%;
    flex-wrap: wrap;
  }

  .clients-summary > span {
    min-width: 140px;
    flex: 1 1 140px;
  }

  .client-profile,
  .client-card-actions {
    grid-template-columns: 1fr;
  }

  .client-profile > div:nth-child(odd) {
    border-right: 0;
  }

  .user-card {
    grid-template-columns: 1fr;
  }

  .user-actions {
    justify-content: stretch;
  }

  .user-actions button {
    flex: 1 1 90px;
  }

  .client-aging-row {
    grid-template-columns: minmax(160px, 0.4fr) minmax(220px, 1fr);
  }

  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .documents-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .company-account-card {
    background:
      linear-gradient(135deg, rgba(254, 225, 0, 0.18), transparent 34%),
      #fffdf8;
  }

  .company-account-header h3 {
    color: #111111;
  }

  .company-account-header .team-role {
    color: #8a7600;
  }

  .company-account-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .nav-tab {
    flex: 1 1 120px;
  }

  .billing-status-grid {
    grid-template-columns: 1fr;
  }

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

  #portfolioAgingSummary {
    align-items: flex-start;
    text-align: left;
  }

  #teamBillingSummary {
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
  }

  .team-billing-board {
    grid-template-columns: 1fr;
  }

  .team-billing-head {
    flex-direction: column;
  }

  .team-billing-head strong {
    text-align: left;
  }

  .team-billing-skus div {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .team-billing-skus span {
    grid-column: 1 / -1;
    text-align: left;
  }

  .monthly-expenses-groups,
  .utility-metrics {
    grid-template-columns: 1fr;
  }

  .monthly-expense-head,
  .monthly-expense-concepts div {
    align-items: flex-start;
    flex-direction: column;
  }

  .monthly-expense-head span,
  .monthly-expense-concepts strong {
    text-align: left;
  }

  .portfolio-aging-board {
    grid-template-columns: 1fr;
  }

  .clients-grid {
    grid-template-columns: 1fr;
  }

  .clients-summary {
    display: grid;
    grid-template-columns: 1fr;
  }

  .clients-summary > span {
    min-width: 0;
  }

  .portfolio-status-board {
    grid-template-columns: 1fr;
  }

  .portfolio-status-card {
    gap: 10px;
    padding: 14px;
  }

  .portfolio-status-card strong,
  .portfolio-status-card .money {
    overflow-wrap: anywhere;
  }

  .client-aging-row {
    grid-template-columns: 1fr;
  }

  .client-aging-bar-shell {
    width: 100%;
  }

  .bar-row,
  .month-row {
    grid-template-columns: 1fr;
  }

  .status-visual {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .status-legend {
    width: 100%;
  }

  .team-grid,
  .team-card {
    grid-template-columns: 1fr;
  }

  .documents-grid,
  .document-actions {
    grid-template-columns: 1fr;
  }
}

@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;
  }
}
