:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #64748b;
  --line: #d9e2ec;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --page: #eef3f7;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --danger: #b42318;
  --accent: #c47a13;
  --info: #2563a8;
  --violet: #6d5bd0;
  --rose: #c2416b;
  --success: #0f8a5f;
  --warning: #c47a13;
  --cyan: #0891b2;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 28px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 46px rgba(15, 23, 42, 0.14);
}

.integration-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.integration-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 220px;
  padding: 20px;
}

.integration-card-header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.integration-card h3,
.integration-settings-panel h2 {
  color: #0f172a;
  font-size: 1.02rem;
  font-weight: 800;
  margin: 0;
}

.integration-card p {
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0;
}

.integration-status {
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 5px 9px;
  white-space: nowrap;
}

.integration-status.configured,
.integration-status.success {
  background: #dcfce7;
  color: #166534;
}

.integration-status.not_configured,
.integration-status.skipped {
  background: #f1f5f9;
  color: #475569;
}

.integration-status.paused {
  background: #fef3c7;
  color: #92400e;
}

.integration-status.error,
.integration-status.failed {
  background: #fee2e2;
  color: #991b1b;
}

.integration-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.integration-downloads {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
}

.integration-download-link {
  align-items: center;
  background: #eef6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  color: #1d4ed8;
  display: flex;
  font-size: 0.86rem;
  font-weight: 750;
  justify-content: space-between;
  padding: 11px 12px;
  text-decoration: none;
}

.ai-draft-panel {
  background: #0f172a;
  border-radius: 14px;
  color: #e2e8f0;
  padding: 18px;
}

.ai-draft-panel textarea {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.18);
  border-radius: 12px;
  color: #f8fafc;
  font: inherit;
  line-height: 1.5;
  min-height: 190px;
  padding: 14px;
  resize: vertical;
  width: 100%;
}

.integration-settings-panel {
  background: #fff;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  max-width: 760px;
  padding: 24px;
}

.integration-settings-panel form p {
  display: grid;
  gap: 7px;
  margin: 0 0 16px;
}

.integration-settings-panel label {
  color: #334155;
  font-size: 0.86rem;
  font-weight: 800;
}

.integration-settings-panel input,
.integration-settings-panel select,
.integration-settings-panel textarea {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font: inherit;
  padding: 10px 12px;
}

.integration-settings-panel .helptext {
  color: #64748b;
  font-size: 0.82rem;
}

.onboarding-hero {
  align-items: stretch;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 34%);
  margin-bottom: 18px;
}

.onboarding-hero h2 {
  color: #0f172a;
  font-size: 2.3rem;
  font-weight: 900;
  margin: 4px 0 6px;
}

.onboarding-hero p {
  color: #64748b;
  line-height: 1.5;
  margin: 0;
  max-width: 760px;
}

.onboarding-progress {
  align-self: center;
  background: #e2e8f0;
  border-radius: 999px;
  height: 18px;
  overflow: hidden;
}

.onboarding-progress span {
  background: linear-gradient(90deg, #0f766e, #22c55e);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.onboarding-layout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
}

.onboarding-list {
  display: grid;
  gap: 12px;
}

.onboarding-item {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 13px 14px;
}

.onboarding-item.done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.onboarding-check {
  align-items: center;
  background: #e2e8f0;
  border-radius: 999px;
  color: #334155;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 900;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.onboarding-item.done .onboarding-check {
  background: #16a34a;
  color: #fff;
}

.onboarding-item strong {
  color: #0f172a;
  display: block;
  font-size: 0.95rem;
}

.onboarding-item span {
  color: #64748b;
  display: block;
  font-size: 0.86rem;
  line-height: 1.45;
  margin-top: 3px;
}

.onboarding-side {
  display: grid;
  gap: 14px;
}

.onboarding-tool {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 15px;
}

.onboarding-tool strong {
  color: #0f172a;
  display: block;
  font-weight: 850;
  margin-bottom: 6px;
}

.onboarding-tool p,
.onboarding-tool li {
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.45;
}

.onboarding-tool ol {
  margin: 0;
  padding-left: 18px;
}

.billing-readiness-panel {
  margin-bottom: 18px;
}

.billing-readiness-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.billing-readiness-item {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  padding: 13px 14px;
}

.billing-readiness-item.done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.billing-readiness-item span,
.billing-annual-note {
  color: #64748b;
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
}

.billing-readiness-item strong {
  color: #0f172a;
  display: block;
  font-size: 1rem;
  margin-top: 4px;
}

.billing-readiness-item small {
  color: #64748b;
  display: block;
  font-size: 0.78rem;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.billing-plan-description {
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.45;
  margin: -4px 0 8px;
}

.billing-annual-note {
  line-height: 1.4;
}

.billing-annual-note strong {
  color: #0f766e;
  display: block;
  font-size: 0.84rem;
  margin-top: 2px;
}

@media (max-width: 980px) {
  .onboarding-hero,
  .onboarding-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .onboarding-item {
    align-items: start;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .onboarding-item .button {
    grid-column: 2;
    justify-self: start;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(45, 212, 191, 0.20), transparent 24rem),
    radial-gradient(circle at 90% 8%, rgba(196, 122, 19, 0.16), transparent 26rem),
    linear-gradient(180deg, rgba(37, 99, 168, 0.10), rgba(238, 243, 247, 0) 320px),
    var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--info);
}

.app-header {
  align-items: center;
  background: linear-gradient(135deg, #0f172a 0%, #155e75 36%, #0f766e 70%, #b7791f 120%);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.18);
  color: #fff;
  display: flex;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 28px;
}

.brand {
  align-items: center;
  color: #fff;
  display: inline-flex;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

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

.tenant-name {
  border-left: 1px solid rgba(255, 255, 255, 0.26);
  color: #f8fafc;
  font-size: 0.95rem;
  font-weight: 900;
  max-width: min(42vw, 420px);
  overflow: hidden;
  padding-left: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand::before {
  background: linear-gradient(135deg, #2dd4bf 0%, #60a5fa 42%, #f2b84b 100%);
  border-radius: 8px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.10);
  content: "";
  height: 28px;
  width: 28px;
}

.nav {
  align-items: center;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-item {
  position: relative;
}

.nav a,
.link-button {
  border-radius: 999px;
  color: #e5f3f1;
  font: inherit;
  padding: 9px 12px;
}

.nav a:hover,
.nav-link.active,
.link-button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.nav-link.active,
.nav-utility.active,
.nav-account-trigger.active {
  box-shadow: inset 0 -2px 0 #f2b84b, 0 0 0 1px rgba(255, 255, 255, 0.16);
  font-weight: 900;
}

.nav-link::after {
  color: rgba(229, 243, 241, 0.86);
  content: "▾";
  font-size: 0.68rem;
  margin-left: 7px;
}

.nav-dropdown {
  background: #fff;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  display: none;
  min-width: 300px;
  padding: 10px;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 40;
}

.nav-dropdown::before {
  content: "";
  height: 12px;
  left: 0;
  position: absolute;
  right: 0;
  top: -12px;
}

.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
  display: grid;
  gap: 5px;
}

.nav-menu-label {
  color: #64748b;
  display: block;
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  padding: 8px 10px 4px;
  text-transform: uppercase;
}

.nav-menu-label:not(:first-child) {
  border-top: 1px solid #e2e8f0;
  margin-top: 4px;
  padding-top: 11px;
}

.nav .nav-dropdown a {
  border-radius: 6px;
  color: #0f172a;
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  white-space: normal;
}

.nav .nav-dropdown a strong {
  color: #0f172a;
  font-size: 0.91rem;
  font-weight: 900;
}

.nav .nav-dropdown a span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.35;
}

.nav .nav-dropdown a:hover {
  background: #ecfdf5;
  color: var(--primary-dark);
}

.nav .nav-dropdown a:hover strong {
  color: var(--primary-dark);
}

.nav-utilities {
  align-items: center;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  gap: 5px;
  margin-left: 4px;
  padding-left: 10px;
}

.nav-utility {
  background: rgba(15, 23, 42, 0.16);
  font-size: 0.82rem;
  font-weight: 850;
}

.nav-dropdown-form {
  margin: 0;
}

.nav-dropdown-action {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #0f172a;
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 3px;
  padding: 10px 11px;
  text-align: left;
  width: 100%;
}

.nav-dropdown-action strong {
  color: #0f172a;
  font-size: 0.91rem;
  font-weight: 900;
}

.nav-dropdown-action span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.35;
}

.nav-dropdown-action:hover {
  background: #fee2e2;
}

.account-dropdown {
  min-width: 320px;
}

.user-chip {
  align-items: center;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  display: inline-flex;
  gap: 9px;
  max-width: 260px;
  min-width: 0;
  padding: 6px 11px 6px 7px;
}

.nav-account-trigger {
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.nav-account-trigger:hover {
  background: rgba(255, 255, 255, 0.17);
}

.user-avatar {
  align-items: center;
  background: linear-gradient(135deg, #f2b84b 0%, #2dd4bf 100%);
  border-radius: 999px;
  color: #0f172a;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.user-meta {
  display: grid;
  line-height: 1.1;
  min-width: 0;
}

.user-meta strong,
.user-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta strong {
  color: #fff;
  font-size: 0.86rem;
  font-weight: 900;
}

.user-meta small {
  color: #c7f2ec;
  font-size: 0.72rem;
  font-weight: 700;
}

.link-button {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.page {
  margin: 0 auto;
  max-width: 1240px;
  padding: 38px 22px 72px;
}

.app-footer {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin: 0 auto;
  max-width: 1240px;
  padding: 0 22px 36px;
}

.app-footer a {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

body.has-sidebar {
  background: #f8fafc;
}

body.has-sidebar .app-header {
  align-content: start;
  align-items: stretch;
  background: linear-gradient(180deg, #0f172a 0%, #111827 46%, #064e3b 130%);
  border-right: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 16px 0 42px rgba(15, 23, 42, 0.14);
  display: grid;
  gap: 18px;
  height: 100vh;
  justify-content: stretch;
  left: 0;
  min-height: 100vh;
  overflow-y: auto;
  padding: 22px 16px;
  position: fixed;
  top: 0;
  width: 282px;
  z-index: 35;
}

body.has-sidebar .brand-cluster {
  align-items: flex-start;
  display: grid;
  gap: 8px;
}

body.has-sidebar .brand {
  color: #ffffff;
  font-size: 1.18rem;
}

body.has-sidebar .tenant-name {
  border-left: 0;
  color: #a7f3d0;
  font-size: 0.82rem;
  max-width: 100%;
  padding-left: 0;
}

body.has-sidebar .sidebar-nav {
  align-content: start;
  align-items: stretch;
  display: grid;
  gap: 12px;
  justify-content: stretch;
}

.sidebar-group {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  display: grid;
  gap: 5px;
  padding-top: 12px;
}

.sidebar-group-title {
  color: #94a3b8;
  display: block;
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.11em;
  padding: 0 10px 4px;
  text-transform: uppercase;
}

.sidebar-link {
  align-items: center;
  border-radius: 10px;
  color: #dbeafe;
  display: grid;
  font-size: 0.9rem;
  font-weight: 850;
  gap: 10px;
  grid-template-columns: 28px minmax(0, 1fr);
  line-height: 1.2;
  padding: 10px 11px;
  text-decoration: none;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
}

.sidebar-link.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(37, 99, 235, 0.18));
  box-shadow: inset 3px 0 0 #34d399, 0 0 0 1px rgba(167, 243, 208, 0.18);
  color: #ffffff;
}

.sidebar-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #a7f3d0;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 950;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.sidebar-link.active .sidebar-icon {
  background: #10b981;
  color: #052e2b;
}

.sidebar-utilities {
  margin-top: 4px;
}

.sidebar-account {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding-top: 14px;
}

body.has-sidebar .user-chip {
  border-radius: 12px;
  max-width: 100%;
  width: 100%;
}

.sidebar-logout-form {
  margin: 0;
}

.sidebar-logout {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: 10px;
  color: #fecaca;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 900;
  padding: 9px 11px;
  text-align: center;
  width: 100%;
}

.sidebar-logout:hover {
  background: rgba(248, 113, 113, 0.20);
  color: #ffffff;
}

body.has-sidebar .page {
  margin-left: 282px;
  max-width: none;
  padding: 28px 28px 72px;
}

body.has-sidebar .app-footer {
  margin-left: 282px;
  max-width: none;
  padding: 0 28px 36px;
}

.legal-page {
  line-height: 1.7;
}

.page-heading {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(236, 253, 245, 0.88)),
    linear-gradient(90deg, rgba(15, 118, 110, 0.14), rgba(37, 99, 168, 0.12), rgba(196, 122, 19, 0.10));
  border: 1px solid rgba(217, 226, 236, 0.9);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 28px;
  overflow: hidden;
  padding: 24px;
  position: relative;
}

.page-heading::after {
  background: linear-gradient(90deg, var(--primary), var(--info), var(--violet), var(--accent), var(--rose));
  bottom: 0;
  content: "";
  height: 6px;
  left: 0;
  pointer-events: none;
  position: absolute;
  width: 100%;
}

.page-heading::before {
  background:
    radial-gradient(circle, rgba(37, 99, 168, 0.20), transparent 58%),
    radial-gradient(circle, rgba(196, 122, 19, 0.18), transparent 62%);
  content: "";
  height: 220px;
  pointer-events: none;
  position: absolute;
  right: -70px;
  top: -92px;
  width: 260px;
}

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

h1,
h2 {
  margin: 0 0 8px;
}

h1 {
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1.05;
  position: relative;
  z-index: 1;
}

h2 {
  font-size: 1.15rem;
}

p {
  color: var(--muted);
  position: relative;
  z-index: 1;
}

.actions,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.actions {
  position: relative;
  z-index: 1;
}

.inline-action-group {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar {
  align-items: center;
  margin-bottom: 18px;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  min-height: 42px;
  padding: 9px 10px;
  width: 100%;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--primary) 50%), linear-gradient(135deg, var(--primary) 50%, transparent 50%);
  background-position: calc(100% - 16px) 18px, calc(100% - 11px) 18px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 32px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
  outline: 0;
}

textarea {
  min-height: 86px;
}

.large-text-input {
  min-height: 54px;
}

.large-textarea {
  min-height: 150px;
}

.toolbar input,
.toolbar select {
  max-width: 240px;
}

.button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  min-height: 42px;
  padding: 9px 14px;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.button:not(.primary):not(.danger) {
  background: linear-gradient(180deg, #ffffff, #f5f8fb);
}

.button:hover {
  border-color: #b9c7d6;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.button.primary {
  background: linear-gradient(135deg, var(--primary), var(--info));
  border-color: var(--primary);
  color: #fff;
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button.danger {
  border-color: #fecaca;
  color: var(--danger);
}

.button.danger:hover {
  background: #fff1f2;
}

.button.small {
  font-size: 0.84rem;
  min-height: 34px;
  padding: 7px 10px;
}

.invitation-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.invitation-actions form {
  margin: 0;
}

.muted-action {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.reason-button {
  display: flex;
  margin-top: 7px;
  width: fit-content;
}

.reason-modal-backdrop {
  align-items: center;
  background: rgba(15, 23, 42, 0.48);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 80;
}

.reason-modal-backdrop.open {
  display: flex;
}

.reason-modal {
  background: #fff;
  border: 1px solid rgba(203, 213, 225, 0.92);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 14px;
  max-width: 620px;
  padding: 18px;
  width: min(100%, 620px);
}

.reason-modal header {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.reason-modal header span {
  color: var(--muted);
  display: block;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reason-modal h2 {
  color: #0f172a;
  font-size: 1.1rem;
  margin: 2px 0 0;
}

.reason-modal textarea {
  min-height: 160px;
  resize: vertical;
}

.modal-close {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  font-size: 1.2rem;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  line-height: 1;
  width: 34px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
}

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.table-wrap table tbody tr:nth-child(even),
.budget-table-wrap table tbody tr:nth-child(even) {
  background: #fbf7ef;
}

.table-wrap table tbody tr:nth-child(odd),
.budget-table-wrap table tbody tr:nth-child(odd) {
  background: #fbfdff;
}

table {
  border-collapse: collapse;
  min-width: 880px;
  width: 100%;
}

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

th {
  background: linear-gradient(180deg, #edf7fb, #e7eef6);
  color: #334155;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #f5fbff;
}

.numeric-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  text-align: right;
  white-space: nowrap;
}

.count-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  text-align: center;
}

.status-cell {
  min-width: 132px;
}

td span {
  color: var(--muted);
  display: block;
  font-size: 0.88rem;
  margin-top: 3px;
}

.pill {
  background: linear-gradient(135deg, #e0f7f3, #eaf2ff);
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1;
  padding: 7px 10px;
  white-space: nowrap;
}

.status-not_started {
  background: #eef2ff;
  color: #3730a3;
}

.status-ongoing {
  background: #dbeafe;
  color: #1d4ed8;
}

.neutral-pill {
  background: #f1f5f9;
  color: #475569;
}

.status-completed {
  background: #dcfce7;
  color: #166534;
}

.status-terminated {
  background: #fee2e2;
  color: #991b1b;
}

.status-on_hold {
  background: #fef3c7;
  color: #92400e;
}

.budget-status-pending_approval {
  background: #fef3c7;
  color: #92400e;
}

.budget-status-approved,
.active-state {
  background: #dcfce7;
  color: #166534;
}

.budget-status-rejected {
  background: #fee2e2;
  color: #991b1b;
}

.inactive-state {
  background: #fee2e2;
  color: #991b1b;
}

.report-page-title {
  color: #0f172a;
  font-size: 1.55rem;
  line-height: 1.15;
  margin: 0 0 14px;
}

.project-date-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.project-detail-kicker {
  color: var(--primary-dark);
  display: block;
  font-size: 1.08rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.project-detail-heading-copy h1 {
  font-size: clamp(1.65rem, 2.8vw, 2.25rem);
  line-height: 1.05;
  margin-bottom: 8px;
}

.project-detail-heading-copy p {
  color: #334155;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: 800;
}

.project-date-strip span {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 8px;
  color: #334155;
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: auto auto;
  margin: 0;
  padding: 9px 12px;
}

.project-date-strip strong {
  color: #0f172a;
  font-size: 0.82rem;
}

.project-date-strip time {
  color: #1e293b;
  font-weight: 850;
}

.executive-summary-box {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98)),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 10px;
  margin: -6px 0 24px;
  padding: 18px;
}

.print-report-header {
  display: none;
}

.executive-summary-heading {
  align-items: baseline;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.executive-summary-box label {
  color: #0f172a;
  font-size: 1rem;
  font-weight: 900;
}

.executive-summary-heading span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 750;
}

.executive-summary-toolbar {
  align-items: center;
  display: flex;
  gap: 8px;
}

.summary-tool-button {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #334155;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  min-height: 32px;
  padding: 6px 10px;
}

.summary-tool-button:hover,
.summary-tool-button:focus {
  background: #ecfdf5;
  border-color: #0f766e;
  color: #0f766e;
  outline: none;
}

.executive-summary-editor {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #0f172a;
  font: inherit;
  line-height: 1.55;
  min-height: 118px;
  padding: 14px;
  width: 100%;
}

.executive-summary-editor:empty::before {
  color: #64748b;
  content: attr(data-placeholder);
}

.executive-summary-editor ul,
.executive-summary-print ul {
  list-style: disc outside;
  margin: 8px 0;
  padding-left: 1.4rem;
}

.executive-summary-editor ol,
.executive-summary-print ol {
  list-style: decimal outside;
  margin: 8px 0;
  padding-left: 1.4rem;
}

.executive-summary-editor li,
.executive-summary-print li {
  display: list-item;
  margin: 4px 0;
  padding: 0;
}

.executive-summary-editor p,
.executive-summary-print p {
  margin: 0 0 8px;
}

.executive-summary-field {
  display: none;
}

.executive-summary-editor:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
  outline: none;
}

.executive-summary-print {
  display: none;
}

.executive-summary-actions {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.executive-summary-actions span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.report-project-table table {
  min-width: 760px;
}

.report-financial-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-kpi-card {
  min-height: 118px;
}

.report-kpi-card.variance-good {
  border-left-color: #16a34a;
}

.report-kpi-card.variance-warning {
  border-left-color: #d97706;
}

.report-kpi-card.variance-danger {
  border-left-color: #dc2626;
}

.report-kpi-card.variance-neutral {
  border-left-color: #2563a8;
}

.report-kpi-card.variance-good small {
  color: #166534;
}

.report-kpi-card.variance-warning small {
  color: #92400e;
}

.report-kpi-card.variance-danger small {
  color: #991b1b;
}

.report-analytics-panel {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(240, 253, 244, 0.92), rgba(239, 246, 255, 0.96)),
    #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 8px 0 22px;
  padding: 20px;
}

.report-analytics-copy span {
  color: #0f766e;
  display: block;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.report-analytics-copy h2 {
  color: #0f172a;
  font-size: 1.35rem;
  margin: 4px 0;
}

.report-analytics-copy p {
  color: #475569;
  margin: 0;
  max-width: 560px;
}

.report-donut-wrap {
  align-items: center;
  display: flex;
  gap: 16px;
}

.report-donut {
  align-items: center;
  border-radius: 50%;
  display: grid;
  flex: 0 0 auto;
  height: 126px;
  justify-items: center;
  position: relative;
  width: 126px;
}

.report-donut::after {
  background: #fff;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px #e2e8f0;
  content: "";
  height: 72%;
  position: absolute;
  width: 72%;
}

.report-donut span,
.report-donut small {
  position: relative;
  z-index: 1;
}

.report-donut span {
  color: #0f172a;
  font-size: 1.5rem;
  font-weight: 950;
}

.report-donut small {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  margin-top: -34px;
}

.report-donut-legend {
  display: grid;
  gap: 8px;
  min-width: 170px;
}

.report-donut-legend div {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 10px minmax(80px, 1fr) auto;
}

.report-donut-legend i {
  border-radius: 50%;
  height: 10px;
  width: 10px;
}

.report-donut-legend strong,
.report-donut-legend span {
  color: #334155;
  font-size: 0.82rem;
}

.report-filter-toolbar {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
}

.report-filter-toolbar label {
  display: grid;
  gap: 5px;
}

.report-filter-toolbar label span {
  color: #475569;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.report-detail-header {
  align-items: start;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 253, 250, 0.94)),
    #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 16px;
  overflow: visible;
  padding: 20px;
}

.report-kicker {
  color: #0f766e;
  display: block;
  font-size: 0.75rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.report-detail-header h1 {
  color: #0f172a;
  font-size: clamp(1.65rem, 2.4vw, 2.25rem);
  line-height: 1.1;
  margin: 0 0 14px;
}

.report-detail-header dl {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.report-detail-header dl div {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 11px;
}

.report-detail-header dt {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.report-detail-header dd {
  color: #0f172a;
  font-weight: 850;
  margin: 3px 0 0;
}

.report-export-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.export-menu {
  position: relative;
}

.export-menu summary {
  list-style: none;
}

.export-menu div {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  min-width: 170px;
  overflow: hidden;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 10;
}

.export-menu a,
.export-menu button {
  background: #fff;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 10px 12px;
  text-align: left;
  text-decoration: none;
}

.export-menu button:disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

.detail-kpi-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  margin-bottom: 16px;
}

.detail-kpi-card {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid var(--line);
  border-left: 4px solid #2563a8;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  color: inherit;
  min-height: 106px;
  padding: 14px;
  text-decoration: none;
}

.detail-kpi-card:hover {
  transform: translateY(-1px);
}

.detail-kpi-card span {
  color: #64748b;
  display: block;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.detail-kpi-card strong {
  color: #0f172a;
  display: block;
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
  line-height: 1.15;
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.detail-kpi-card small {
  color: #475569;
  display: block;
  font-weight: 750;
  margin-top: 7px;
}

.detail-kpi-card.state-good {
  border-left-color: #16a34a;
}

.detail-kpi-card.state-danger {
  border-left-color: #dc2626;
}

.report-section-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  min-width: 0;
  padding: 18px;
}

.management-attention-card {
  border-left: 4px solid #0f766e;
}

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

.attention-item {
  align-items: center;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #2563a8;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 110px minmax(0, 1fr);
  padding: 10px 12px;
}

.attention-item strong {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.attention-item.critical {
  background: #fff1f2;
  border-left-color: #dc2626;
}

.attention-item.warning {
  background: #fffbeb;
  border-left-color: #d97706;
}

.attention-item.positive {
  background: #f0fdf4;
  border-left-color: #16a34a;
}

.compact-empty {
  margin-top: 8px;
  padding: 14px;
}

.detail-report-table-wrap {
  overflow-x: auto;
  width: 100%;
}

.detail-report-table {
  min-width: 1120px;
  table-layout: fixed;
}

.detail-report-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.detail-report-table .project-col {
  min-width: 230px;
  width: 24%;
}

.detail-report-table td,
.detail-report-table th {
  padding: 11px 10px;
}

.detail-report-table tbody tr:hover {
  background: #f0fdfa;
}

.project-name-link {
  color: #0f172a;
  display: -webkit-box;
  font-weight: 900;
  line-height: 1.25;
  max-width: 320px;
  overflow: hidden;
  text-decoration: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-name-link:hover {
  color: #0f766e;
  text-decoration: underline;
}

.detail-report-table .project-col span,
.detail-report-table small {
  color: #64748b;
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  margin-top: 3px;
}

.vac-good,
.schedule-good {
  color: #166534;
  font-weight: 900;
}

.vac-danger,
.schedule-danger {
  color: #991b1b;
  font-weight: 900;
}

.vac-neutral,
.schedule-warning,
.schedule-neutral {
  color: #92400e;
  font-weight: 900;
}

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

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

.trend-card {
  grid-column: span 1;
}

.report-detail-grid .trend-card:first-child {
  grid-column: span 2;
}

.performance-list {
  display: grid;
  gap: 9px;
  margin: 0;
}

.performance-list div,
.health-summary-list div,
.commentary-grid div {
  align-items: baseline;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
}

.performance-list dt {
  color: #475569;
  font-size: 0.78rem;
  font-weight: 900;
}

.performance-list dd {
  color: #0f172a;
  font-weight: 950;
  margin: 0;
  text-align: right;
}

.performance-list dd small {
  color: #64748b;
  display: block;
  font-size: 0.72rem;
}

.compact-list {
  margin-top: 14px;
}

.progress-comparison {
  display: grid;
  gap: 14px;
}

.progress-comparison span {
  color: #475569;
  font-size: 0.78rem;
  font-weight: 900;
}

.progress-comparison strong {
  color: #0f172a;
  display: block;
  font-size: 1.4rem;
  margin: 4px 0 8px;
}

.progress-track {
  background: #e2e8f0;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.progress-track i {
  background: linear-gradient(90deg, #94a3b8, #2563a8);
  border-radius: inherit;
  display: block;
  height: 100%;
  max-width: 100%;
}

.progress-track.actual i {
  background: linear-gradient(90deg, #0f766e, #16a34a);
}

.health-summary-list {
  display: grid;
  gap: 9px;
}

.health-summary-list span {
  align-items: center;
  color: #475569;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 900;
  gap: 8px;
}

.health-summary-list strong {
  color: #0f172a;
}

.health-dot {
  background: #94a3b8;
  border-radius: 50%;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.health-dot.on-track {
  background: #16a34a;
}

.health-dot.at-risk {
  background: #d97706;
}

.health-dot.critical {
  background: #dc2626;
}

.health-dot.neutral {
  background: #94a3b8;
}

.detail-trend-chart {
  align-items: end;
  background:
    repeating-linear-gradient(0deg, #eef2f7 0 1px, transparent 1px 42px),
    #fbfdff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  display: grid;
  gap: 10px;
  grid-auto-flow: column;
  min-height: 230px;
  overflow-x: auto;
  padding: 16px 12px 10px;
}

.trend-month {
  align-items: center;
  display: grid;
  gap: 8px;
  justify-items: center;
  min-width: 44px;
}

.trend-bars {
  align-items: end;
  display: flex;
  gap: 4px;
  height: 176px;
}

.trend-bars i {
  border-radius: 5px 5px 0 0;
  display: block;
  min-height: 2px;
  width: 10px;
}

.trend-bars .budget,
.chart-legend .budget {
  background: #2563a8;
}

.trend-bars .actual,
.chart-legend .actual {
  background: #16a34a;
}

.trend-bars .forecast,
.chart-legend .forecast {
  background: #d97706;
}

.trend-month span {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 850;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.chart-legend span {
  align-items: center;
  color: #475569;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 850;
  gap: 6px;
}

.chart-legend i {
  border-radius: 50%;
  height: 9px;
  width: 9px;
}

.progress-trend-card {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: auto minmax(0, 1fr);
}

.progress-ring {
  align-items: center;
  background: conic-gradient(#0f766e var(--actual-progress), #e2e8f0 0);
  border-radius: 50%;
  display: grid;
  height: 132px;
  justify-items: center;
  position: relative;
  width: 132px;
}

.progress-ring::after {
  background: #fff;
  border-radius: 50%;
  content: "";
  height: 76%;
  position: absolute;
  width: 76%;
}

.progress-ring strong,
.progress-ring span {
  position: relative;
  z-index: 1;
}

.progress-ring strong {
  font-size: 1.35rem;
  margin-top: 24px;
}

.progress-ring span {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 900;
  margin-top: -34px;
}

.progress-trend-copy p {
  color: #475569;
  line-height: 1.5;
  margin: 0 0 8px;
}

.mini-metric-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-metric-row a {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: inherit;
  padding: 12px;
  text-align: center;
  text-decoration: none;
}

.mini-metric-row a:hover {
  background: #ecfdf5;
  border-color: #99f6e4;
}

.mini-metric-row strong {
  color: #0f172a;
  display: block;
  font-size: 1.3rem;
  font-weight: 950;
}

.mini-metric-row span {
  color: #64748b;
  display: block;
  font-size: 0.75rem;
  font-weight: 850;
}

.commentary-grid {
  display: grid;
  gap: 9px;
}

.commentary-grid div {
  align-items: flex-start;
  display: grid;
  gap: 4px;
  justify-content: stretch;
}

.commentary-grid strong {
  color: #0f172a;
}

.commentary-grid span {
  color: #475569;
  line-height: 1.45;
}

.schedule-baseline-table-wrap {
  margin-top: 12px;
}

.schedule-baseline-table {
  min-width: 960px;
}

.schedule-baseline-table td:first-child strong,
.schedule-baseline-table td:first-child span {
  display: block;
}

.schedule-baseline-table td:first-child span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 750;
}

.schedule-baseline-table input,
.schedule-baseline-table textarea {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #0f172a;
  font: inherit;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.schedule-baseline-table textarea {
  min-width: 220px;
  resize: vertical;
}

.billing-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 18px 0;
}

.billing-plan-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.billing-plan-card.current {
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 14px 35px rgba(16, 185, 129, 0.12);
}

.billing-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.billing-price strong {
  color: #0f172a;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.billing-price span,
.billing-actions small {
  color: #64748b;
}

.billing-feature-list {
  color: #334155;
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
}

.billing-actions {
  border-top: 1px solid #e2e8f0;
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
}

.billing-actions label {
  color: #475569;
  display: grid;
  font-weight: 700;
  gap: 6px;
}

.report-section-title {
  color: #0f172a;
  font-size: 1.15rem;
  margin: 24px 0 10px;
}

.report-status-summary-table {
  margin-top: 0;
}

.report-status-summary-table table {
  min-width: 620px;
}

.rag-badge {
  align-items: center;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  margin-top: 0;
  padding: 8px 11px;
  white-space: nowrap;
}

.rag-badge.on-track {
  background: #dcfce7;
  color: #166534;
}

.rag-badge.at-risk {
  background: #fef3c7;
  color: #92400e;
}

.rag-badge.critical {
  background: #fee2e2;
  color: #991b1b;
}

.metrics {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 24px;
}

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

.kpi-card,
.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.98)),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.kpi-card {
  display: grid;
  grid-template-rows: auto minmax(2.8rem, auto) auto;
  min-height: 152px;
  overflow: hidden;
  padding: 18px;
  position: relative;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.kpi-card:hover {
  border-color: rgba(37, 99, 168, 0.28);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.kpi-card::after {
  background: linear-gradient(180deg, rgba(37, 99, 168, 0.18), rgba(15, 118, 110, 0));
  content: "";
  height: 72px;
  position: absolute;
  right: -34px;
  top: -34px;
  transform: rotate(35deg);
  width: 96px;
}

.kpi-card:nth-child(1) {
  border-top: 4px solid var(--primary);
  background: linear-gradient(180deg, #ecfdf5, #ffffff 72%);
}

.kpi-card:nth-child(2) {
  border-top: 4px solid var(--info);
  background: linear-gradient(180deg, #eff6ff, #ffffff 72%);
}

.kpi-card:nth-child(3) {
  border-top: 4px solid var(--accent);
  background: linear-gradient(180deg, #fff7ed, #ffffff 72%);
}

.kpi-card:nth-child(4) {
  border-top: 4px solid var(--violet);
  background: linear-gradient(180deg, #f4f0ff, #ffffff 72%);
}

.kpi-card:nth-child(5) {
  border-top: 4px solid var(--success);
  background: linear-gradient(180deg, #f0fdf4, #ffffff 72%);
}

.kpi-card:nth-child(6) {
  border-top: 4px solid var(--rose);
  background: linear-gradient(180deg, #fff1f2, #ffffff 72%);
}

.kpi-card span,
.panel header span,
.status-row span,
.watch-row span,
.watch-row small,
.mini-table span {
  color: var(--muted);
}

.kpi-card span {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 10px;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.kpi-card strong {
  display: block;
  font-size: clamp(1.02rem, 1.45vw, 1.42rem);
  line-height: 1.1;
  margin-bottom: 10px;
  max-width: 100%;
  overflow-wrap: anywhere;
  position: relative;
  z-index: 1;
}

.kpi-card small {
  color: var(--muted);
  display: block;
  position: relative;
  z-index: 1;
}

.kpi-card.warning {
  border-color: #fed7aa;
  box-shadow: inset 4px 0 0 var(--accent);
}

.dashboard-hero .eyebrow {
  color: var(--primary-dark);
  display: block;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

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

.dashboard-filter-toolbar {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(240, 253, 250, 0.92)),
    #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  margin: -4px 0 24px;
  padding: 14px;
}

.dashboard-filter-toolbar label {
  color: #334155;
  font-size: 0.8rem;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dashboard-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1.2fr 1fr;
  margin-bottom: 24px;
}

.dashboard-visual-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(340px, 1.15fr) repeat(2, minmax(260px, 0.85fr));
  margin-bottom: 24px;
}

.dashboard-chart-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.94)),
    #fff;
  overflow: hidden;
}

.donut-layout {
  align-items: center;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(164px, 0.82fr) minmax(0, 1fr);
}

.compact-donut-layout {
  grid-template-columns: minmax(144px, 0.78fr) minmax(0, 1fr);
}

.donut-chart {
  align-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08), 0 18px 34px rgba(15, 23, 42, 0.10);
  display: grid;
  justify-items: center;
  margin: 0 auto;
  max-width: 210px;
  padding: 18px;
  position: relative;
  width: 100%;
}

.donut-chart::before {
  background:
    linear-gradient(180deg, #ffffff, #f8fafc);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px #e2e8f0;
  content: "";
  inset: 6%;
  position: absolute;
}

.donut-chart > div {
  display: grid;
  justify-items: center;
  line-height: 1.1;
  position: relative;
  text-align: center;
  z-index: 1;
}

.donut-chart strong {
  color: #0f172a;
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 950;
}

.donut-chart span {
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.chart-legend {
  display: grid;
  gap: 9px;
}

.chart-legend div {
  align-items: center;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 10px minmax(0, 1fr) max-content;
  padding: 9px 10px;
}

.chart-legend i,
.chart-key i {
  border-radius: 999px;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.chart-legend strong {
  color: #0f172a;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.chart-legend span {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 850;
  white-space: nowrap;
}

.portfolio-summary-grid {
  grid-template-columns: minmax(0, 1fr) minmax(460px, 0.95fr);
}

.department-column-panel {
  min-height: 410px;
}

.column-chart {
  align-items: end;
  border-bottom: 1px solid #cbd5e1;
  display: grid;
  gap: 16px;
  grid-auto-columns: minmax(94px, 1fr);
  grid-auto-flow: column;
  min-height: 290px;
  overflow-x: auto;
  padding: 20px 4px 14px;
}

.column-group {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-rows: minmax(190px, 1fr) auto auto;
  min-width: 94px;
  text-align: center;
}

.column-bars {
  align-items: end;
  display: flex;
  gap: 8px;
  height: 190px;
  justify-content: center;
  width: 100%;
}

.column {
  border-radius: 8px 8px 3px 3px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.13);
  min-height: 4px;
  position: relative;
  width: 30px;
}

.column span {
  background: #0f172a;
  border-radius: 6px;
  bottom: calc(100% + 8px);
  color: #fff;
  display: none;
  font-size: 0.72rem;
  font-weight: 850;
  left: 50%;
  padding: 5px 7px;
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 4;
}

.column:hover span {
  display: block;
}

.budget-column {
  background: linear-gradient(180deg, #60a5fa, #2563a8);
}

.actual-column {
  background: linear-gradient(180deg, #fbbf24, #c47a13);
}

.column-group strong {
  color: #0f172a;
  font-size: 0.82rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.column-group small {
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 800;
}

.chart-key {
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  margin-top: 12px;
}

.chart-key span {
  align-items: center;
  color: #475569;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 850;
  gap: 6px;
}

.budget-key {
  background: #2563a8;
}

.actual-key {
  background: #c47a13;
}

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

.department-budget-panel {
  min-width: 0;
}

.panel {
  padding: 20px;
  position: relative;
}

.panel:nth-of-type(odd) {
  background: linear-gradient(180deg, #ffffff, #f0fdfa);
}

.panel:nth-of-type(even) {
  background: linear-gradient(180deg, #ffffff, #eff6ff);
}

.panel::before {
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.85), rgba(37, 99, 168, 0.7), rgba(196, 122, 19, 0.65));
  border-radius: 10px 10px 0 0;
  content: "";
  height: 4px;
  left: -1px;
  position: absolute;
  right: -1px;
  top: -1px;
}

.panel header {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.panel header h2 {
  font-size: 1.05rem;
  position: relative;
}

.panel header h2::after {
  background: var(--accent);
  border-radius: 999px;
  content: "";
  display: block;
  height: 3px;
  margin-top: 8px;
  width: 34px;
}

.panel-header > div,
.section-heading > div {
  min-width: 0;
}

.section-heading {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  margin: 28px 0 12px;
}

.section-heading h2 {
  color: #0f172a;
  font-size: 1.12rem;
  margin: 0 0 4px;
}

.section-heading h2::after,
.report-section-title::after {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  content: "";
  display: block;
  height: 3px;
  margin-top: 8px;
  width: 42px;
}

.section-heading p {
  color: var(--muted);
  font-weight: 700;
  margin: 0;
}

.empty-state {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(241, 245, 249, 0.92)),
    #f8fafc;
  border: 1px dashed #b8c7d6;
  border-radius: 8px;
  color: #334155;
  display: grid;
  gap: 6px;
  padding: 16px;
  position: relative;
}

.empty-state::before {
  background: linear-gradient(180deg, var(--primary), var(--info));
  border-radius: 999px;
  content: "";
  height: calc(100% - 24px);
  left: 10px;
  opacity: 0.78;
  position: absolute;
  top: 12px;
  width: 4px;
}

.empty-state > * {
  margin-left: 12px;
}

.empty-state strong {
  color: #0f172a;
}

.empty-state span {
  color: var(--muted);
  display: block;
}

.empty-state.compact {
  margin-top: 0;
  padding: 14px;
}

.table-empty-state {
  align-items: start;
  box-shadow: none;
  margin: 4px 0;
}

.table-empty-state .button {
  margin-top: 6px;
  width: fit-content;
}

.utility-heading .eyebrow {
  color: var(--primary-dark);
  display: block;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.utility-search-panel {
  margin-bottom: 22px;
}

.utility-search-form {
  display: grid;
  gap: 10px;
}

.utility-search-form label {
  color: #334155;
  font-size: 0.84rem;
  font-weight: 900;
  text-transform: uppercase;
}

.utility-search-form > div {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.utility-search-form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  padding: 12px 14px;
  width: 100%;
}

.utility-results-grid,
.help-grid,
.account-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.utility-result {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.utility-result:hover {
  border-color: rgba(15, 118, 110, 0.28);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.utility-result strong {
  color: #0f172a;
  overflow-wrap: anywhere;
}

.utility-result span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.help-list {
  color: #334155;
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
}

.help-list li {
  line-height: 1.55;
}

.account-summary-card {
  align-self: start;
}

.account-summary-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.account-summary-list div {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  gap: 3px;
  padding: 12px;
}

.account-summary-list dt {
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.account-summary-list dd {
  color: #0f172a;
  font-weight: 850;
  margin: 0;
  overflow-wrap: anywhere;
}

.project-info-panel {
  margin-bottom: 26px;
}

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

.info-grid div {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(217, 226, 236, 0.9);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
}

.info-grid span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.info-grid strong {
  color: #0f172a;
  overflow-wrap: anywhere;
}

.info-grid .info-grid-wide {
  grid-column: 1 / -1;
}

.status-stack,
.list-stack,
.mini-table {
  display: grid;
  gap: 12px;
}

.status-row {
  display: grid;
  gap: 8px;
}

.status-row > div:first-child,
.mini-table > div:not(.empty-state) {
  align-items: baseline;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.department-budget-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(217, 226, 236, 0.86);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(140px, 1fr) minmax(92px, 0.55fr) minmax(260px, 1.35fr);
  min-width: 0;
  padding: 12px;
}

.department-budget-row strong {
  color: #0f172a;
  min-width: 0;
  overflow-wrap: anywhere;
}

.department-budget-row span:nth-child(2) {
  text-align: center;
}

.department-budget-row span:last-child {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: right;
  white-space: normal;
  word-break: break-word;
}

.department-budget-table .empty-state {
  align-content: center;
  display: grid;
  min-height: 132px;
  text-align: left;
}

.department-budget-table .empty-state strong {
  font-size: 1rem;
}

.department-budget-chart {
  display: grid;
  gap: 14px;
}

.department-chart-row {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(217, 226, 236, 0.86);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(130px, 0.42fr) minmax(0, 1fr);
  padding: 12px;
}

.department-chart-label {
  display: grid;
  gap: 4px;
}

.department-chart-label strong {
  color: #0f172a;
  overflow-wrap: anywhere;
}

.department-chart-label span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.department-chart-bars {
  display: grid;
  gap: 7px;
}

.dashboard-bar {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) max-content;
}

.dashboard-bar span {
  border-radius: 999px;
  display: block;
  height: 12px;
  min-width: 0;
}

.dashboard-bar small {
  color: #475569;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.budget-bar span {
  background: linear-gradient(90deg, var(--info), #60a5fa);
}

.actual-bar span {
  background: linear-gradient(90deg, var(--accent), #f59e0b);
}

.bar {
  background: #e5eaf1;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.bar span {
  background: linear-gradient(90deg, var(--primary), var(--info));
  display: block;
  height: 100%;
  min-width: 4px;
}

.chart-panel {
  min-width: 0;
}

.chart-stack,
.comparison-chart {
  display: grid;
  gap: 14px;
}

.chart-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1.5fr) 48px;
}

.chart-label strong,
.comparison-row strong {
  display: block;
  overflow-wrap: anywhere;
}

.chart-label span,
.comparison-bars small,
.chart-row em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 700;
}

.chart-track,
.comparison-bars div {
  background: #e5eaf1;
  border-radius: 999px;
  min-height: 12px;
  overflow: hidden;
  position: relative;
}

.chart-track span,
.comparison-bars span {
  border-radius: inherit;
  display: block;
  height: 12px;
}

.comparison-row {
  display: grid;
  gap: 8px;
}

.comparison-bars {
  display: grid;
  gap: 7px;
}

.comparison-bars div {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) max-content;
}

.watch-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 4px;
  padding: 12px;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.watch-row:hover {
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.watch-row:nth-child(3n + 1) {
  background: #f0fdfa;
}

.watch-row:nth-child(3n + 2) {
  background: #eff6ff;
}

.watch-row:nth-child(3n + 3) {
  background: #fff7ed;
}

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

.risk-severity-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 8px;
  min-height: 106px;
  padding: 16px;
}

.risk-severity-card span {
  color: #475569;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.risk-severity-card strong {
  color: #0f172a;
  font-size: 2rem;
  line-height: 1;
}

.risk-critical {
  background: linear-gradient(180deg, #fee2e2, #fff);
  border-top: 4px solid #dc2626;
}

.risk-high {
  background: linear-gradient(180deg, #ffedd5, #fff);
  border-top: 4px solid #ea580c;
}

.risk-medium {
  background: linear-gradient(180deg, #fef3c7, #fff);
  border-top: 4px solid #d97706;
}

.risk-low {
  background: linear-gradient(180deg, #dcfce7, #fff);
  border-top: 4px solid #16a34a;
}

.risk-watch-row small {
  color: #334155;
}

.metrics article,
.form-card,
.form-grid,
.auth-panel {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
}

.metrics article {
  padding: 17px;
}

.metrics article:nth-child(1) {
  border-left: 5px solid var(--primary);
}

.metrics article:nth-child(2) {
  border-left: 5px solid var(--rose);
}

.metrics article:nth-child(3) {
  border-left: 5px solid var(--info);
}

.metrics article:nth-child(4) {
  border-left: 5px solid var(--violet);
}

.metrics article:nth-child(5) {
  border-left: 5px solid var(--accent);
}

.metrics article:nth-child(6) {
  border-left: 5px solid var(--cyan);
}

.metrics article.performance-good {
  background: linear-gradient(180deg, #ecfdf5, #ffffff);
  border-left-color: #16a34a;
}

.metrics article.performance-stable {
  background: linear-gradient(180deg, #eff6ff, #ffffff);
  border-left-color: #2563eb;
}

.metrics article.performance-danger {
  background: linear-gradient(180deg, #fef2f2, #ffffff);
  border-left-color: #dc2626;
}

.metrics article.performance-neutral {
  background: linear-gradient(180deg, #f8fafc, #ffffff);
  border-left-color: #94a3b8;
}

.metrics article::before {
  background: linear-gradient(180deg, rgba(8, 145, 178, 0.16), rgba(255, 255, 255, 0));
  content: "";
  height: 60px;
  position: absolute;
  right: -28px;
  top: -28px;
  transform: rotate(36deg);
  width: 90px;
}

.metrics span {
  color: var(--muted);
  display: block;
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.metrics strong {
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  overflow-wrap: anywhere;
}

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

.metrics .report-kpi-card.variance-good {
  border-left-color: #16a34a;
}

.metrics .report-kpi-card.variance-warning {
  border-left-color: #d97706;
}

.metrics .report-kpi-card.variance-danger {
  border-left-color: #dc2626;
}

.metrics .report-kpi-card.variance-neutral {
  border-left-color: #2563a8;
}

.two-column {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 28px;
}

.project-control-stack {
  display: grid;
  gap: 18px;
  margin-bottom: 28px;
}

.project-control-section {
  min-width: 0;
  width: 100%;
}

.form-card,
.form-grid,
.auth-panel {
  padding: 20px;
}

.form-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
}

.project-entry-form fieldset {
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 14px 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 18px 18px 16px;
}

.project-entry-form legend {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 6px 11px;
  text-transform: uppercase;
}

.project-form-heading {
  min-width: 0;
}

.project-form-heading h1 {
  margin-bottom: 6px;
}

.project-form-heading p {
  color: #334155;
  font-size: 1rem;
  font-weight: 850;
  margin: 0;
  overflow-wrap: anywhere;
}

.form-section p {
  min-width: 0;
}

.form-section label {
  color: #475569;
  font-size: 0.82rem;
  font-weight: 850;
}

.section-save {
  grid-column: 1 / -1;
  justify-self: end;
  margin-top: 2px;
}

.project-identity-section {
  align-content: start;
  grid-column: 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-identity-section p:first-of-type {
  grid-column: 1 / -1;
}

.schedule-section {
  align-content: start;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ownership-section {
  align-content: start;
  grid-column: 2;
  grid-template-columns: 1fr;
}

.ownership-section p:first-of-type {
  grid-column: auto;
}

.schedule-section .checkbox-row {
  grid-column: 1 / -1;
}

.budget-section {
  grid-column: 1 / -1;
  grid-template-columns: 1fr;
}

.budget-entry-row {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) max-content;
}

.budget-entry-row p {
  margin: 0;
}

.budget-step-action {
  display: flex;
  justify-content: flex-end;
}

.checkbox-row {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  padding: 10px 12px;
}

.checkbox-row input {
  min-height: auto;
  width: auto;
}

.checkbox-row label {
  margin: 0;
}

.budget-approval-flow {
  background: linear-gradient(135deg, #f8fafc, #eefbf8);
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  display: grid;
  gap: 14px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr);
  padding: 14px;
}

.budget-flow-panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.budget-flow-panel[hidden] {
  display: none;
}

.budget-flow-panel:first-child {
  min-width: 0;
}

.budget-flow-panel h2 {
  color: #0f172a;
  font-size: 1rem;
  margin: 0;
}

.distribution-entry-mode {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.distribution-entry-mode span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.distribution-entry-mode label {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  gap: 7px;
  margin: 0;
  padding: 8px 11px;
}

.distribution-entry-mode input {
  min-height: auto;
  width: auto;
}

.distribution-table-wrap {
  overflow-x: auto;
}

.distribution-table {
  min-width: 520px;
}

.distribution-table th,
.distribution-table td {
  padding: 10px;
}

.distribution-table input {
  min-height: 38px;
  padding: 7px 8px;
}

.distribution-table input[readonly] {
  background: #eef2f7;
  color: #475569;
}

.distribution-total {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  color: #065f46;
  font-weight: 900;
  padding: 10px 12px;
}

.distribution-controls {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(190px, 0.85fr) minmax(260px, 1.15fr);
}

.distribution-controls > label {
  grid-column: 1;
}

.distribution-controls > select {
  grid-column: 1;
}

.distribution-controls .distribution-entry-mode {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.distribution-footer {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) max-content;
}

.distribution-total.invalid {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.distribution-review {
  overflow-x: auto;
}

.approval-table-wrap table {
  min-width: 980px;
}

.approval-table-wrap form {
  margin: 0;
}

.approval-actions {
  display: grid;
  gap: 10px;
  min-width: 260px;
}

.approval-actions .button {
  justify-content: center;
  width: 150px;
}

.approval-reject-form {
  align-items: start;
  display: grid;
  gap: 8px;
}

.approval-reject-form textarea {
  min-height: 76px;
  resize: vertical;
}

.annual-funding-panel {
  margin-bottom: 20px;
}

.funding-year-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.funding-year-card {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  min-height: 148px;
  padding: 14px;
}

.funding-year-card.active {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}

.funding-year-card.released:not(.active) {
  background: #f8fafc;
}

.funding-year-card span,
.funding-year-card small {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 850;
}

.funding-year-card strong {
  color: #0f172a;
  display: block;
  font-size: 1.18rem;
  margin-top: 3px;
}

.funding-state {
  align-self: end;
  display: grid;
  gap: 8px;
}

.funding-state strong {
  font-size: 0.92rem;
}

.funding-release-trigger {
  justify-content: center;
  min-height: 40px;
  width: 100%;
}

.funding-release-message {
  color: #334155;
  font-weight: 750;
  line-height: 1.5;
  margin: 0;
}

.settings-panel {
  max-width: 760px;
}

.settings-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.settings-form p {
  margin: 0;
}

.form-errors {
  grid-column: 1 / -1;
}

.form-grid p,
.form-card p {
  margin: 0 0 12px;
}

.form-grid label,
.form-card label {
  color: #334155;
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.form-actions {
  display: flex;
  gap: 10px;
  grid-column: 1 / -1;
}

.button:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.pagination {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 18px;
}

.pagination span {
  color: var(--muted);
  font-weight: 800;
}

.compact {
  margin-top: 14px;
}

.inline-row {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1.4fr 150px 90px 150px 80px;
  margin-bottom: 10px;
  padding: 10px;
}

.inline-row textarea {
  min-height: 44px;
}

.detail-edit-row {
  align-items: end;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  min-width: 0;
  overflow-x: auto;
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.detail-edit-row label {
  color: #334155;
  display: grid;
  font-size: 0.86rem;
  font-weight: 700;
  gap: 6px;
}

.milestone-edit-row {
  grid-template-columns: minmax(260px, 2fr) 150px 90px 150px 80px;
}

.risk-edit-row {
  grid-template-columns: minmax(180px, 1fr) 120px 130px 110px 170px 76px;
  max-width: 100%;
}

.detail-edit-row textarea {
  min-height: 120px;
}

.risk-edit-row input,
.risk-edit-row select,
.risk-edit-row textarea {
  max-width: 100%;
  min-width: 0;
}

.risk-edit-row textarea {
  max-height: 180px;
  overflow: auto;
  resize: vertical;
  white-space: pre-wrap;
}

.record-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.record-row {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
}

.milestone-records .record-row {
  grid-template-columns: minmax(320px, 1fr) 120px 100px 110px 140px 112px;
}

.milestone-title-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-records .record-row {
  grid-template-columns: minmax(0, 1.8fr) 105px 115px 90px 105px;
}

.record-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.embedded-form-section {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 20px;
}

.section-heading.compact {
  margin-bottom: 12px;
}

.compact-table {
  margin: 0;
}

.compact-table table input[type="text"],
.compact-table table input[type="date"],
.compact-table table input[type="number"],
.compact-table table select {
  min-width: 130px;
  width: 100%;
}

.task-delete-control {
  display: none;
}

.milestone-task-editor [hidden],
.milestone-detail-form > [hidden] {
  display: none !important;
}

.milestone-task-editor:not(.tasks-enhanced) .task-edit-field,
.milestone-task-editor:not(.tasks-enhanced) .task-delete-control {
  display: inline-block;
}

.milestone-task-editor:not(.tasks-enhanced) .task-read-value,
.tasks-enhanced:not(.tasks-editing) .task-actions-cell {
  display: none;
}

.task-weight-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-variant-numeric: tabular-nums;
}

.task-delete-button {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 22px;
}

[data-weight-error] {
  color: #b91c1c;
}

.task-read-row .task-edit-field {
  display: none;
}

.task-read-row.task-editing-row .task-edit-field {
  display: inline-block;
}

.task-editing-row .task-read-value {
  display: none;
}

.task-read-value {
  color: #334155;
  display: inline-block;
  font-weight: 500;
  line-height: 1.35;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.project-updates-section {
  margin-bottom: 28px;
}

.project-update-list {
  display: grid;
  gap: 12px;
}

.note-sort-form {
  align-items: center;
  display: flex;
  gap: 8px;
}

.note-sort-form label {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 850;
  margin: 0;
  text-transform: uppercase;
}

.note-sort-form select {
  background-color: #ffffff;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  color: #334155;
  font-size: 0.86rem;
  font-weight: 800;
  min-height: 38px;
  padding: 8px 32px 8px 12px;
}

.project-update-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

.project-update-card header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.project-update-card header div:first-child {
  display: grid;
  gap: 3px;
}

.project-update-card header strong {
  color: var(--text);
  font-size: 0.95rem;
}

.project-update-card header span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.project-update-card p {
  color: #334155;
  line-height: 1.6;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.record-header {
  background: linear-gradient(180deg, #eefcf8, #eef4ff);
  box-shadow: none;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.record-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.wide-field {
  min-width: 0;
}

.check-field {
  align-content: center;
  min-height: 42px;
}

.check-field input {
  min-height: auto;
  width: auto;
}

.budget-kpis {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.budget-variance-strip {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.budget-table-wrap {
  background:
    linear-gradient(180deg, #ffffff, #f7fbff),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  overflow-x: auto;
  position: relative;
}

.budget-table-wrap::before {
  background: linear-gradient(90deg, var(--primary), var(--cyan), var(--info), var(--violet), var(--accent), var(--rose));
  content: "";
  height: 5px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.budget-table {
  min-width: 1180px;
}

.budget-table td {
  min-width: 150px;
}

.budget-table td:first-child {
  min-width: 150px;
}

.budget-table td:nth-child(5),
.budget-table td:nth-child(6) {
  min-width: 260px;
}

.budget-table input,
.budget-table textarea {
  min-width: 0;
}

.budget-table textarea {
  min-height: 110px;
  resize: vertical;
}

.budget-actions {
  margin-top: 16px;
}

.monthly-variance.positive,
.variance-kpi.positive {
  background: linear-gradient(180deg, #ecfdf5, #dcfce7);
  color: #047857;
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.22);
}

.monthly-variance.negative,
.variance-kpi.negative {
  background: linear-gradient(180deg, #fff1f2, #fee2e2);
  color: #b42318;
  box-shadow: inset 0 0 0 1px rgba(244, 63, 94, 0.22);
}

.monthly-variance.future {
  background: linear-gradient(180deg, #fffbeb, #fef3c7);
  color: #92400e;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.24);
}

.budget-matrix {
  min-width: 1320px;
}

.budget-matrix th:first-child,
.budget-matrix td:first-child {
  min-width: 160px;
  position: sticky;
  left: 0;
  z-index: 1;
}

.budget-matrix th:first-child {
  background: linear-gradient(180deg, #ccfbf1, #dbeafe);
}

.budget-matrix td:first-child {
  background: linear-gradient(180deg, #ffffff, #f0fdfa);
  color: #0f3f3a;
  font-weight: 800;
}

.budget-matrix td,
.budget-matrix th {
  min-width: 116px;
  text-align: center;
}

.budget-matrix th span,
.budget-matrix th small {
  display: block;
}

.budget-matrix th small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 4px;
  white-space: nowrap;
}

.budget-matrix td {
  font-variant-numeric: tabular-nums;
}

.budget-matrix th:first-child,
.budget-matrix td:first-child {
  text-align: left;
}

.budget-matrix input {
  background: linear-gradient(180deg, #ffffff, #f6fbff);
  min-width: 100px;
  padding: 7px 8px;
  text-align: right;
}

.budget-matrix input:disabled {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}

.field-lock-note {
  color: #64748b;
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 4px;
  white-space: nowrap;
}

.budget-matrix thead th:nth-child(4n + 2) {
  background: #e0f2fe;
}

.budget-matrix thead th:nth-child(4n + 3) {
  background: #dcfce7;
}

.budget-matrix thead th:nth-child(4n + 4) {
  background: #fef3c7;
}

.budget-matrix thead th:nth-child(4n + 5) {
  background: #f3e8ff;
}

.monthly-variance {
  border-radius: 0;
  min-width: 140px;
  vertical-align: middle;
}

.monthly-variance strong {
  display: block;
  margin-bottom: 8px;
}

.note-button {
  background: #ffffff;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  color: #1d4ed8;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 2px;
  padding: 7px 10px;
  transition: background 140ms ease, color 140ms ease;
}

.variance-note-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.note-button.danger {
  border-color: #fecaca;
  color: #b91c1c;
}

.note-button:disabled {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
}

.form-card,
.form-grid {
  border-top: 5px solid var(--info);
}

.auth-panel {
  border-top: 5px solid var(--primary);
}

.note-button:hover {
  background: #dbeafe;
  color: #1e3a8a;
}

.note-button.danger:hover:not(:disabled) {
  background: #fee2e2;
  color: #991b1b;
}

.variance-note-form {
  max-width: 780px;
}

.member-row-form {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1fr) 80px;
}

.member-access-form {
  align-items: center;
  display: grid;
  gap: 8px;
  min-width: 210px;
}

.member-access-form input {
  min-height: 34px;
  padding: 7px 9px;
}

.member-access-form .button {
  justify-content: center;
  width: fit-content;
}

.dashboard-chart-card .chart-legend {
  display: grid;
  gap: 9px;
  margin-top: 0;
}

.executive-dashboard {
  display: grid;
  gap: 12px;
}

.dashboard-command {
  align-items: stretch;
  background:
    linear-gradient(135deg, rgba(13, 148, 136, 0.96), rgba(37, 99, 168, 0.95) 48%, rgba(124, 58, 237, 0.92)),
    #0f766e;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 18px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
  color: #ffffff;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.82fr);
  margin-bottom: 2px;
  overflow: hidden;
  padding: clamp(22px, 3vw, 34px);
  position: relative;
}

.dashboard-command::after {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.15) 0 1px, transparent 1px 82px);
  bottom: 0;
  content: "";
  height: 6px;
  left: 0;
  position: absolute;
  right: 0;
}

.dashboard-command-copy,
.dashboard-command-side {
  position: relative;
  z-index: 1;
}

.command-eyebrow {
  color: rgba(255, 255, 255, 0.82);
  display: block;
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.dashboard-command h1 {
  color: #ffffff;
  font-size: clamp(2.1rem, 4vw, 4.35rem);
  line-height: 0.94;
  margin: 0;
  max-width: 720px;
}

.dashboard-command p {
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(0.98rem, 1.5vw, 1.13rem);
  line-height: 1.55;
  margin: 16px 0 0;
  max-width: 760px;
}

.command-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.command-meta span {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 850;
  padding: 8px 11px;
}

.dashboard-command-side {
  align-content: space-between;
  display: grid;
  gap: 18px;
}

.command-stat-grid {
  display: grid;
  gap: 10px;
}

.command-stat {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  display: grid;
  gap: 5px;
  padding: 14px 16px;
}

.command-stat span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.command-stat strong {
  color: #ffffff;
  font-size: clamp(1.1rem, 1.6vw, 1.42rem);
  font-weight: 950;
  overflow-wrap: anywhere;
}

.command-actions {
  justify-content: flex-end;
}

.command-actions .button {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.38);
  color: #ffffff;
}

.command-actions .button.primary {
  background: #ffffff;
  border-color: #ffffff;
  color: #0f766e;
}

.executive-dashboard .dashboard-kpi-grid {
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 0;
}

.executive-dashboard .metric-tile {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 16px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
  gap: 8px;
  grid-template-rows: auto auto minmax(2.55rem, auto) auto;
  min-height: 170px;
  padding: 18px;
}

.executive-dashboard .metric-tile::after {
  border-radius: 999px;
  height: 92px;
  opacity: 0.75;
  right: -48px;
  top: -42px;
  transform: none;
  width: 92px;
}

.metric-icon {
  align-items: center;
  border-radius: 12px;
  color: #ffffff;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 950;
  height: 34px;
  justify-content: center;
  position: relative;
  width: 34px;
  z-index: 1;
}

.executive-dashboard .metric-tile span {
  color: #64748b;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  margin: 0;
}

.executive-dashboard .metric-tile strong {
  color: #0f172a;
  font-size: clamp(1.22rem, 1.8vw, 1.78rem);
  letter-spacing: 0;
  margin: 0;
}

.executive-dashboard .metric-tile small {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 780;
  line-height: 1.35;
}

.metric-blue {
  border-top-color: #2563eb;
}

.metric-blue .metric-icon,
.metric-blue::after {
  background: linear-gradient(135deg, #2563eb, #38bdf8);
}

.metric-green .metric-icon,
.metric-green::after {
  background: linear-gradient(135deg, #16a34a, #22c55e);
}

.metric-violet .metric-icon,
.metric-violet::after {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
}

.metric-gold .metric-icon,
.metric-gold::after {
  background: linear-gradient(135deg, #c47a13, #fbbf24);
}

.metric-teal .metric-icon,
.metric-teal::after {
  background: linear-gradient(135deg, #0f766e, #14b8a6);
}

.metric-cyan .metric-icon,
.metric-cyan::after {
  background: linear-gradient(135deg, #0369a1, #06b6d4);
}

.metric-red .metric-icon,
.metric-red::after {
  background: linear-gradient(135deg, #dc2626, #fb7185);
}

.metric-indigo .metric-icon,
.metric-indigo::after {
  background: linear-gradient(135deg, #4338ca, #818cf8);
}

.executive-dashboard .dashboard-filter-toolbar {
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.07);
  margin: 0;
  padding: 14px 16px;
}

.executive-dashboard .dashboard-visual-grid,
.executive-dashboard .dashboard-grid {
  margin-bottom: 0;
}

.executive-dashboard .panel {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: 16px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  padding: 22px;
}

.executive-dashboard .panel::before {
  background: linear-gradient(90deg, #0f766e, #2563eb, #f59e0b, #7c3aed);
  height: 5px;
}

.executive-dashboard .panel header {
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  margin-bottom: 18px;
  padding-bottom: 14px;
}

.executive-dashboard .panel header h2 {
  color: #0f172a;
  font-size: 1rem;
  letter-spacing: 0;
}

.executive-dashboard .panel header h2::after {
  display: none;
}

.executive-dashboard .panel header span {
  color: #64748b;
  font-weight: 750;
}

.executive-dashboard .dashboard-chart-card {
  background:
    linear-gradient(180deg, #ffffff, #f8fbff),
    #ffffff;
}

.executive-dashboard .donut-chart {
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08), 0 22px 42px rgba(15, 23, 42, 0.12);
  max-width: 224px;
}

.executive-dashboard .chart-legend div {
  background: #ffffff;
  border-color: rgba(226, 232, 240, 0.95);
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.045);
  padding: 10px 12px;
}

.executive-dashboard .portfolio-summary-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
}

.executive-dashboard .column-chart {
  background:
    repeating-linear-gradient(0deg, rgba(226, 232, 240, 0.72) 0 1px, transparent 1px 54px),
    linear-gradient(180deg, #f8fafc, #ffffff);
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 14px;
  min-height: 310px;
  padding: 24px 14px 16px;
}

.executive-dashboard .column {
  border-radius: 10px 10px 4px 4px;
  width: 34px;
}

.executive-dashboard .status-row,
.executive-dashboard .department-chart-row,
.executive-dashboard .watch-row {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.045);
}

.executive-dashboard .status-row {
  padding: 12px;
}

.executive-dashboard .watch-row {
  padding: 13px 14px;
}

.executive-dashboard .watch-row strong {
  color: #0f172a;
}

.executive-dashboard .watch-row:hover {
  border-color: rgba(37, 99, 168, 0.32);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.executive-dashboard .risk-severity-card {
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.07);
}

.executive-dashboard .empty-state {
  border-radius: 12px;
}

.reference-dashboard {
  color: #121a31;
  gap: 12px;
}

.sr-only {
  clip: rect(0 0 0 0);
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.dashboard-topline {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
}

.dashboard-title-block h1 {
  color: #111827;
  font-size: 1.45rem;
  line-height: 1.15;
  margin: 0 0 4px;
}

.dashboard-title-block p {
  color: #64748b;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.4;
  margin: 0;
}

.dashboard-search {
  align-items: center;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.035);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 30px;
  padding: 4px 6px 4px 12px;
}

.dashboard-search input {
  border: 0;
  color: #111827;
  font: inherit;
  min-width: 0;
  outline: 0;
}

.dashboard-search input::placeholder {
  color: #94a3b8;
}

.dashboard-search button {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.92rem;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.dashboard-action-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.dashboard-filter-inline {
  align-items: center;
  display: flex;
  gap: 8px;
}

.dashboard-filter-inline label {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 850;
}

.dashboard-filter-inline select {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  color: #334155;
  font: inherit;
  min-height: 38px;
  padding: 8px 10px;
}

.milestone-period-control {
  margin: 0;
}

.milestone-period-control select {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  color: #334155;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 850;
  min-height: 34px;
  min-width: 148px;
  padding: 7px 30px 7px 10px;
}

.dashboard-filter-inline .button,
.dashboard-view-projects {
  border-radius: 9px;
  min-height: 38px;
  padding: 9px 14px;
}

.dashboard-view-projects span {
  font-size: 1rem;
  line-height: 1;
}

.reference-dashboard .dashboard-kpi-grid {
  gap: 12px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.reference-dashboard .metric-tile {
  align-items: center;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.045);
  display: grid;
  gap: 4px 12px;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  min-height: 102px;
  padding: 15px 16px;
}

.reference-dashboard .metric-tile::after {
  display: none;
}

.reference-dashboard .metric-icon {
  align-self: center;
  border-radius: 50%;
  font-size: 0.92rem;
  grid-row: 1 / 4;
  height: 42px;
  width: 42px;
}

.reference-dashboard .metric-icon svg {
  fill: none;
  height: 21px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.15;
  width: 21px;
}

.reference-dashboard .metric-tile span {
  color: #536179;
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.05em;
}

.reference-dashboard .metric-tile strong {
  color: #101828;
  font-size: clamp(1.28rem, 1.8vw, 1.72rem);
  line-height: 1;
}

.reference-dashboard .metric-tile small {
  color: #536dfe;
  font-size: 0.77rem;
  font-weight: 850;
}

.reference-dashboard .metric-green small {
  color: #16a34a;
}

.reference-dashboard .metric-gold small {
  color: #f59e0b;
}

.reference-dashboard .metric-red small {
  color: #e11d48;
}

.reference-dashboard .metric-violet small {
  color: #7c3aed;
}

.dashboard-analytics-grid {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.15fr) minmax(280px, 0.95fr);
}

.dashboard-work-grid {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.34fr) minmax(360px, 0.82fr);
}

.reference-dashboard .panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  min-width: 0;
  overflow: hidden;
  padding: 16px 18px;
}

.dashboard-analytics-grid > .panel {
  min-height: 286px;
}

.dashboard-work-grid > .panel {
  min-height: 0;
}

.watchlist-card {
  height: auto;
  min-height: 0;
}

.milestones-card {
  height: fit-content;
  min-height: 0;
}

.active-risk-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: auto;
  min-height: 0;
}

.dashboard-milestones-row {
  margin-bottom: 12px;
}

.reference-dashboard .panel::before {
  display: none;
}

.reference-dashboard .panel header {
  align-items: center;
  border-bottom: 0;
  margin-bottom: 14px;
  padding-bottom: 0;
}

.reference-dashboard .panel header h2 {
  color: #101828;
  font-size: 1.02rem;
  font-weight: 950;
  letter-spacing: 0;
}

.reference-dashboard .panel header span,
.reference-dashboard .panel header a {
  color: #536179;
  font-size: 0.76rem;
  font-weight: 850;
  text-decoration: none;
}

.reference-dashboard .panel header a {
  color: #536dfe;
}

.reference-dashboard .donut-layout {
  gap: 18px;
  grid-template-columns: minmax(132px, 0.8fr) minmax(0, 1fr);
}

.reference-dashboard .portfolio-health-card .donut-layout,
.reference-dashboard .budget-performance-card .donut-layout {
  align-items: center;
}

.reference-dashboard .donut-chart {
  box-shadow: none;
  max-width: 154px;
  padding: 0;
}

.reference-dashboard .donut-chart::before {
  background: #ffffff;
  box-shadow: 0 0 0 1px #eef2f7;
  inset: 6%;
}

.reference-dashboard .donut-chart strong {
  color: #111827;
  font-size: 1.3rem;
}

.reference-dashboard .donut-chart span {
  color: #64748b;
  font-size: 0.66rem;
}

.reference-dashboard .chart-legend {
  gap: 7px;
}

.reference-dashboard .chart-legend div {
  background: transparent;
  border: 0;
  box-shadow: none;
  gap: 7px;
  grid-template-columns: 8px minmax(92px, 1fr) max-content;
  padding: 2px 0;
}

.reference-dashboard .chart-legend strong,
.reference-dashboard .chart-legend span {
  font-size: 0.78rem;
  white-space: nowrap;
}

.reference-dashboard .chart-legend i,
.reference-dashboard .chart-key i {
  height: 8px;
  width: 8px;
}

.dashboard-table-card {
  min-height: 0;
}

.dashboard-data-table {
  display: grid;
  gap: 0;
}

.dashboard-table-head,
.dashboard-table-row {
  align-items: center;
  border-bottom: 1px solid #eef2f7;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(120px, 1.1fr) minmax(130px, 1.25fr) minmax(76px, 0.72fr) minmax(76px, 0.64fr);
  padding: 9px 0;
}

.dashboard-table-head {
  color: #69758b;
  font-size: 0.7rem;
  font-weight: 950;
  padding-top: 0;
}

.dashboard-table-row {
  color: #334155;
  font-size: 0.78rem;
  text-decoration: none;
}

.dashboard-table-row:hover {
  background: #f8fafc;
}

.dashboard-table-row strong {
  color: #111827;
  font-size: 0.82rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.dashboard-table-row span {
  color: #475569;
  min-width: 0;
  overflow-wrap: anywhere;
}

.severity-pill,
.status-pill {
  border-radius: 7px;
  display: inline-flex;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  justify-content: center;
  padding: 4px 8px;
  width: fit-content;
}

.severity-pill.critical,
.status-pill.red {
  background: #fee2e2;
  color: #b91c1c;
}

.severity-pill.high {
  background: #ffe4e6;
  color: #e11d48;
}

.severity-pill.medium,
.status-pill.amber {
  background: #fef3c7;
  color: #d97706;
}

.severity-pill.low,
.status-pill.green {
  background: #dcfce7;
  color: #16a34a;
}

.status-pill.muted {
  background: #f1f5f9;
  color: #64748b;
}

.section-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.clickable-card {
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.clickable-card:hover {
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.risk-matrix-card,
.module-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 1rem;
  padding: 1rem;
}

.risk-matrix {
  align-items: center;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: auto 1fr;
}

.matrix-axis {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.probability-axis {
  writing-mode: vertical-rl;
}

.impact-axis {
  grid-column: 2;
  justify-self: center;
}

.matrix-grid {
  display: grid;
  gap: 0.35rem;
  grid-template-columns: 32px repeat(5, minmax(44px, 1fr));
  max-width: 620px;
}

.matrix-row-label,
.matrix-col-label {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.72rem;
  font-weight: 800;
  justify-content: center;
}

.matrix-cell {
  align-items: center;
  border-radius: 7px;
  color: #0f172a;
  display: flex;
  justify-content: space-between;
  min-height: 42px;
  padding: 0.45rem 0.6rem;
  text-decoration: none;
}

.matrix-cell strong {
  font-size: 1rem;
}

.matrix-cell span {
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0.72;
}

.risk-rating-low {
  background: #dcfce7;
}

.risk-rating-medium {
  background: #fef3c7;
}

.risk-rating-high {
  background: #ffe4e6;
}

.risk-rating-critical {
  background: #fee2e2;
}

.risk-edit-form .embedded-form-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1rem;
  padding: 1rem;
}

.wide-field {
  grid-column: 1 / -1;
}

.score-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.score-preview {
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.85rem;
}

.score-preview span,
.risk-narrative-grid span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.score-preview strong {
  font-size: 1.6rem;
}

.risk-overview-grid {
  margin-bottom: 0.85rem;
}

.risk-detail-heading {
  align-items: flex-start;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 52%, #eef7f1 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  padding: 1.15rem 1.25rem;
}

.risk-detail-heading h1 {
  color: #0f172a;
  font-size: clamp(1.35rem, 2vw, 2rem);
  letter-spacing: 0;
  line-height: 1.15;
  margin: 0.2rem 0 0.35rem;
  max-width: 880px;
}

.risk-detail-heading p {
  color: #64748b;
  font-size: 0.92rem;
  margin: 0;
}

.risk-detail-kicker {
  color: #047857;
  display: inline-flex;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.risk-detail-summary {
  align-items: stretch;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.risk-detail-summary .info-card,
.issue-detail-summary .info-card,
.issue-linked-grid .info-card,
.milestone-detail-summary .info-card {
  border-color: #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  min-height: 92px;
  padding: 0.85rem 0.9rem;
}

.risk-detail-summary .info-card span,
.issue-detail-summary .info-card span,
.issue-linked-grid .info-card span,
.milestone-detail-summary .info-card span {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.risk-detail-summary .info-card strong,
.issue-detail-summary .info-card strong,
.issue-linked-grid .info-card strong,
.milestone-detail-summary .info-card strong {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.98rem;
  gap: 0.35rem;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
}

.risk-detail-panel {
  margin-top: 0.85rem;
  padding: 1.05rem;
}

.risk-detail-panel .section-heading {
  margin-bottom: 0.85rem;
}

.risk-detail-panel .section-heading h2 {
  font-size: 1.05rem;
}

.risk-detail-panel .section-heading p {
  max-width: 720px;
}

.risk-narrative-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.risk-detail-narrative {
  gap: 0.75rem;
}

.risk-narrative-grid article {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 118px;
  padding: 0.9rem;
}

.risk-narrative-grid p {
  margin: 0.35rem 0 0;
  overflow-wrap: anywhere;
}

.risk-detail-table-wrap {
  border-radius: 10px;
}

.risk-detail-table {
  min-width: 960px;
}

.risk-detail-table th,
.risk-detail-table td {
  padding: 0.75rem 0.8rem;
  vertical-align: top;
}

.risk-detail-table .wrapped-cell {
  max-width: 360px;
  overflow-wrap: break-word;
  word-break: normal;
}

.module-kpis {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.module-toolbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  padding: 14px;
}

.module-toolbar input {
  flex: 1 1 320px;
  max-width: none;
}

.module-toolbar select {
  flex: 0 1 230px;
}

.module-table {
  margin-top: 18px;
}

.issue-kpis {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.kpi-link {
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.kpi-link:hover {
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.issue-filter-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.3fr) repeat(auto-fit, minmax(150px, 1fr));
}

.issue-filter-toolbar input,
.issue-filter-toolbar select {
  min-width: 0;
  width: 100%;
}

.issue-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.issue-register-table {
  min-width: 1320px;
  table-layout: fixed;
}

.issue-register-table th,
.issue-register-table td {
  line-height: 1.35;
  padding: 11px 10px;
}

.issue-register-table th {
  overflow-wrap: normal;
  white-space: normal;
  word-break: keep-all;
}

.issue-register-table th:nth-child(1),
.issue-register-table td:nth-child(1) {
  width: 96px;
}

.issue-register-table th:nth-child(2),
.issue-register-table td:nth-child(2) {
  width: 285px;
}

.issue-register-table th:nth-child(3),
.issue-register-table td:nth-child(3) {
  width: 170px;
}

.issue-register-table th:nth-child(4),
.issue-register-table td:nth-child(4) {
  width: 150px;
}

.issue-register-table th:nth-child(5),
.issue-register-table td:nth-child(5) {
  width: 110px;
}

.issue-register-table th:nth-child(6),
.issue-register-table td:nth-child(6) {
  width: 120px;
}

.issue-register-table th:nth-child(7),
.issue-register-table td:nth-child(7),
.issue-register-table th:nth-child(8),
.issue-register-table td:nth-child(8) {
  width: 100px;
}

.issue-register-table th:nth-child(9),
.issue-register-table td:nth-child(9) {
  width: 120px;
}

.issue-register-table th:nth-child(10),
.issue-register-table td:nth-child(10) {
  width: 135px;
}

.issue-register-table th:nth-child(11),
.issue-register-table td:nth-child(11) {
  width: 152px;
}

.issue-title-cell a {
  color: #0f172a;
  display: block;
  font-weight: 900;
  line-height: 1.25;
  text-decoration: none;
}

.issue-title-cell small {
  color: #64748b;
  display: block;
  font-size: 0.78rem;
  line-height: 1.35;
  margin-top: 0.25rem;
  overflow-wrap: anywhere;
}

.nowrap-cell {
  white-space: nowrap;
}

.numeric-cell {
  text-align: right;
}

.actions-cell {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.status-in_progress,
.status-monitoring,
.status-pending_closure,
.status-on_hold,
.status-open,
.status-closed,
.issue-escalation-normal,
.issue-escalation-due-soon,
.issue-escalation-overdue,
.issue-escalation-escalate {
  font-style: normal;
}

.status-open {
  background: #e0f2fe;
  color: #0369a1;
}

.status-in_progress,
.status-monitoring {
  background: #dcfce7;
  color: #15803d;
}

.status-pending_closure {
  background: #ede9fe;
  color: #6d28d9;
}

.status-on_hold,
.issue-escalation-due-soon {
  background: #fef3c7;
  color: #b45309;
}

.status-closed,
.issue-escalation-normal {
  background: #f1f5f9;
  color: #475569;
}

.issue-escalation-overdue,
.issue-escalation-escalate {
  background: #fee2e2;
  color: #b91c1c;
}

.issue-form-card .form-section-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.issue-detail-summary,
.issue-linked-grid,
.milestone-detail-summary {
  align-items: stretch;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .issue-detail-summary,
  .issue-linked-grid,
  .milestone-detail-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .billing-plan-grid,
  .issue-detail-summary,
  .issue-linked-grid,
  .milestone-detail-summary {
    grid-template-columns: 1fr;
  }
}

.risk-register-table {
  min-width: 1320px;
  table-layout: fixed;
}

.risk-register-table th,
.risk-register-table td {
  padding: 12px 10px;
}

.risk-register-table th:nth-child(1),
.risk-register-table td:nth-child(1) {
  width: 92px;
}

.risk-register-table th:nth-child(2),
.risk-register-table td:nth-child(2) {
  width: 320px;
}

.risk-register-table th:nth-child(3),
.risk-register-table td:nth-child(3) {
  width: 220px;
}

.risk-register-table th:nth-child(4),
.risk-register-table td:nth-child(4),
.risk-register-table th:nth-child(5),
.risk-register-table td:nth-child(5),
.risk-register-table th:nth-child(10),
.risk-register-table td:nth-child(10),
.risk-register-table th:nth-child(11),
.risk-register-table td:nth-child(11),
.risk-register-table th:nth-child(12),
.risk-register-table td:nth-child(12),
.risk-register-table th:nth-child(13),
.risk-register-table td:nth-child(13) {
  width: 126px;
}

.risk-register-table th:nth-child(6),
.risk-register-table td:nth-child(6),
.risk-register-table th:nth-child(7),
.risk-register-table td:nth-child(7),
.risk-register-table th:nth-child(8),
.risk-register-table td:nth-child(8) {
  width: 76px;
}

.risk-register-table th:nth-child(9),
.risk-register-table td:nth-child(9) {
  width: 106px;
}

.risk-register-table th:nth-child(14),
.risk-register-table td:nth-child(14) {
  width: 150px;
}

.risk-register-table th:nth-child(1),
.risk-register-table td:nth-child(1),
.risk-register-table th:nth-child(2),
.risk-register-table td:nth-child(2) {
  position: sticky;
  z-index: 2;
}

.risk-register-table th:nth-child(1),
.risk-register-table td:nth-child(1) {
  left: 0;
}

.risk-register-table th:nth-child(2),
.risk-register-table td:nth-child(2) {
  left: 92px;
}

.risk-register-table th:nth-child(1),
.risk-register-table th:nth-child(2) {
  background: #eef4ff;
  z-index: 3;
}

.risk-register-table tbody td:nth-child(1),
.risk-register-table tbody td:nth-child(2) {
  background: #ffffff;
  box-shadow: 1px 0 0 var(--line);
}

.risk-id-cell {
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.risk-title-cell {
  line-height: 1.35;
  overflow-wrap: normal;
  white-space: normal;
  word-break: normal;
}

.risk-title-cell strong {
  display: block;
  font-size: 0.94rem;
  line-height: 1.35;
}

.risk-title-cell span {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  line-height: 1.35;
  margin-top: 0.25rem;
}

.risk-project-cell,
.nowrap-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-project-cell a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-cell {
  text-align: center;
  vertical-align: middle;
}

.module-table td strong {
  color: #0f172a;
}

.wrapped-cell {
  line-height: 1.45;
  max-width: 420px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.negative-text {
  color: #b42318;
}

.positive-text {
  color: #0f8a5f;
}

.module-chart-panel {
  margin-bottom: 20px;
  padding: 18px;
}

.forecast-bar-strip {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(12, minmax(44px, 1fr));
  min-height: 220px;
  overflow-x: auto;
  padding: 16px 4px 6px;
}

.forecast-bar-item {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-rows: 160px auto;
  justify-items: center;
  min-width: 46px;
}

.forecast-bar {
  align-self: end;
  background: linear-gradient(180deg, #2563a8, #0f766e);
  border-radius: 8px 8px 3px 3px;
  min-height: 4px;
  position: relative;
  width: 72%;
}

.forecast-bar span {
  background: #0f172a;
  border-radius: 6px;
  bottom: calc(100% + 7px);
  color: #fff;
  display: none;
  font-size: 0.72rem;
  font-weight: 850;
  left: 50%;
  margin: 0;
  padding: 5px 7px;
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 2;
}

.forecast-bar:hover span {
  display: block;
}

.forecast-bar-item strong {
  color: #475569;
  font-size: 0.78rem;
}

.department-budget-card {
  min-height: 286px;
}

.reference-dashboard .column-chart {
  background:
    linear-gradient(to top, #cbd5e1 0 1px, transparent 1px),
    repeating-linear-gradient(0deg, transparent 0 41px, #edf2f7 41px 42px),
    #ffffff;
  border: 0;
  border-radius: 0;
  gap: 14px;
  grid-auto-columns: minmax(66px, 1fr);
  height: 184px;
  min-height: 184px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 12px 8px 0;
}

.reference-dashboard .column-group {
  align-self: stretch;
  gap: 6px;
  grid-template-rows: 132px auto;
  min-width: 66px;
}

.reference-dashboard .column-bars {
  align-self: end;
  border-bottom: 1px solid #cbd5e1;
  gap: 9px;
  height: 132px;
  padding-top: 18px;
}

.reference-dashboard .column {
  border-radius: 4px 4px 1px 1px;
  box-shadow: none;
  max-height: 100%;
  min-height: 0;
  width: 24px;
}

.reference-dashboard .column[style*="height: 0"] {
  min-height: 0;
}

.reference-dashboard .column span {
  bottom: auto;
  font-size: 0.68rem;
  left: 50%;
  max-width: min(150px, 34vw);
  overflow: hidden;
  padding: 4px 6px;
  text-overflow: ellipsis;
  top: -28px;
  white-space: nowrap;
  z-index: 12;
}

.reference-dashboard .column-group:first-child .column span {
  left: 0;
  transform: none;
}

.reference-dashboard .column-group:last-child .column span {
  left: auto;
  right: 0;
  transform: none;
}

.reference-dashboard .budget-column {
  background: linear-gradient(180deg, #5577e8, #3f5fd7);
}

.reference-dashboard .actual-column {
  background: linear-gradient(180deg, #10b981, #059669);
}

.reference-dashboard .budget-key {
  background: #3f5fd7;
}

.reference-dashboard .actual-key {
  background: #059669;
}

.reference-dashboard .column-group strong {
  color: #536179;
  font-size: 0.7rem;
  font-weight: 850;
}

.reference-dashboard .column-group.department-chart-row {
  background: transparent;
  border: 0;
  box-shadow: none;
  grid-template-columns: none;
  padding: 0;
}

.reference-dashboard .chart-key {
  margin-top: 10px;
}

.budget-performance-card .donut-chart::before {
  inset: 6%;
}

.budget-performance-card .donut-chart strong {
  font-size: 1.5rem;
}

.risk-summary-layout {
  align-content: start;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  height: 100%;
}

.reference-dashboard .risk-severity-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reference-dashboard .risk-severity-card {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  display: grid;
  gap: 6px;
  grid-template-columns: 10px minmax(0, 1fr);
  padding: 11px 12px;
}

.reference-dashboard .risk-severity-card::before {
  border-radius: 50%;
  content: "";
  display: block;
  height: 8px;
  width: 8px;
}

.reference-dashboard .risk-critical::before {
  background: #e11d48;
}

.reference-dashboard .risk-high::before {
  background: #fb7185;
}

.reference-dashboard .risk-medium::before {
  background: #f59e0b;
}

.reference-dashboard .risk-low::before {
  background: #22c55e;
}

.reference-dashboard .risk-severity-card span {
  color: #475569;
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.reference-dashboard .risk-severity-card strong {
  color: #111827;
  font-size: 1.22rem;
  grid-column: 2;
  line-height: 1;
}

.reference-dashboard .risk-critical span,
.reference-dashboard .risk-critical strong {
  color: #b91c1c;
}

.reference-dashboard .risk-high span,
.reference-dashboard .risk-high strong {
  color: #e11d48;
}

.reference-dashboard .risk-medium span,
.reference-dashboard .risk-medium strong {
  color: #d97706;
}

.reference-dashboard .risk-low span,
.reference-dashboard .risk-low strong {
  color: #16a34a;
}

.risk-total-badge {
  align-items: center;
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  display: grid;
  gap: 14px;
  grid-template-columns: auto minmax(0, 1fr);
  justify-items: start;
  min-height: 0;
  padding: 14px;
}

.risk-total-badge strong {
  color: #111827;
  font-size: 2.1rem;
  line-height: 1;
}

.risk-total-badge span {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.2;
}

.reference-dashboard .dashboard-risk-row {
  grid-template-columns: 1fr;
  margin-bottom: 12px;
}

.reference-dashboard .watch-row {
  border-radius: 9px;
  padding: 11px 12px;
}

.budget-heading .actions {
  align-items: end;
}

.year-selector {
  align-items: end;
  display: grid;
  gap: 4px;
  grid-template-columns: 110px 120px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(239, 250, 248, 0.92));
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  padding: 10px;
}

.year-selector label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  grid-column: 1 / -1;
  text-transform: uppercase;
}

.year-selector strong {
  border-bottom: 4px solid var(--success);
  color: var(--ink);
  display: inline-flex;
  font-size: 1.2rem;
  justify-content: center;
  padding-bottom: 5px;
}

.budget-narrative {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.budget-narrative-bottom {
  margin-top: 22px;
}

.budget-narrative label {
  color: #334155;
  display: grid;
  font-weight: 700;
  gap: 8px;
}

.budget-narrative textarea {
  min-height: 140px;
}

.messages {
  margin-bottom: 16px;
}

.message {
  background: linear-gradient(135deg, #ecfdf5, #eff6ff);
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  color: #065f46;
  padding: 12px;
}

.message.warning,
.budget-lock-message {
  background: linear-gradient(135deg, #fffbeb, #fff7ed);
  border-color: #fcd34d;
  color: #92400e;
  font-weight: 800;
  margin-bottom: 16px;
}

.auth-panel {
  margin: 8vh auto;
  max-width: 420px;
}

.ops-body {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.82) 210px),
    radial-gradient(circle at 18% 10%, rgba(20, 184, 166, 0.28), transparent 28rem),
    radial-gradient(circle at 82% 0%, rgba(245, 158, 11, 0.22), transparent 24rem),
    #eef3f7;
  color: #142033;
}

.ops-body.ops-impersonating {
  box-shadow: inset 0 0 0 8px #f59e0b;
}

.ops-prod-strip {
  background: #7f1d1d;
  color: #fff7ed;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  padding: 8px 20px;
  position: sticky;
  text-align: center;
  text-transform: uppercase;
  top: 0;
  z-index: 30;
}

.ops-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: calc(100vh - 32px);
}

.ops-sidebar {
  background: rgba(15, 23, 42, 0.94);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 26px 18px;
  position: sticky;
  top: 32px;
  height: calc(100vh - 32px);
}

.ops-brand {
  align-items: center;
  color: #fff;
  display: flex;
  font-size: 20px;
  font-weight: 900;
  gap: 12px;
}

.ops-brand-mark {
  background: linear-gradient(135deg, #14b8a6, #38bdf8 48%, #f59e0b);
  border-radius: 10px;
  display: inline-block;
  height: 34px;
  width: 34px;
}

.ops-nav {
  display: grid;
  gap: 8px;
}

.ops-nav a {
  border-radius: 8px;
  color: #cbd5e1;
  font-weight: 750;
  padding: 12px 14px;
}

.ops-nav a.active,
.ops-nav a:hover {
  background: rgba(20, 184, 166, 0.18);
  color: #fff;
}

.ops-sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding-top: 18px;
  word-break: break-word;
}

.ops-sidebar-footer span,
.ops-muted {
  color: #64748b;
  display: block;
  font-size: 12px;
}

.ops-sidebar-footer a {
  color: #67e8f9;
  font-weight: 800;
  margin-top: 8px;
}

.ops-main {
  padding: 30px;
}

.ops-topbar {
  align-items: center;
  color: #fff;
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
}

.ops-kicker {
  color: #99f6e4;
  display: inline-block;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.ops-kicker.danger {
  color: #fecaca;
}

.ops-topbar h1 {
  color: #fff;
  font-size: 30px;
  line-height: 1.1;
  margin: 0;
}

.ops-topbar-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.ops-pill,
.ops-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 7px 10px;
  white-space: nowrap;
}

.ops-pill {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.ops-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
  padding: 20px;
}

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

.metric-card {
  min-height: 168px;
}

.metric-card span,
.ops-section-title span,
.critical-control p {
  color: #64748b;
  font-size: 13px;
  font-weight: 750;
}

.metric-card strong {
  color: #0f172a;
  display: block;
  font-size: 36px;
  line-height: 1;
  margin: 12px 0;
}

.metric-card em {
  color: #0f766e;
  font-style: normal;
  font-weight: 850;
}

.metric-card.alert strong {
  color: #b42318;
}

.metric-card svg {
  height: 54px;
  width: 100%;
}

.metric-card polyline {
  fill: none;
  stroke: #0f766e;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.ops-progress {
  background: #e2e8f0;
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.ops-progress span {
  background: linear-gradient(90deg, #14b8a6, #f59e0b);
  display: block;
  height: 100%;
}

.ops-content-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
}

.ops-section-title {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.ops-section-title h2,
.critical-control h2,
.ops-modal h2 {
  color: #0f172a;
  font-size: 20px;
  margin: 0;
}

.ops-area-chart {
  background: linear-gradient(180deg, #f8fafc, #eef6f6);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  min-height: 280px;
  width: 100%;
}

.ops-area-chart .axis {
  fill: none;
  stroke: #cbd5e1;
  stroke-width: 2;
}

.ops-area-chart .throughput,
.ops-area-chart .error-rate {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5;
}

.ops-area-chart .throughput {
  stroke: #0f766e;
}

.ops-area-chart .error-rate {
  stroke: #f59e0b;
}

.chart-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}

.swatch {
  border-radius: 999px;
  display: inline-block;
  height: 10px;
  margin-right: 6px;
  width: 10px;
}

.swatch.green {
  background: #0f766e;
}

.swatch.amber {
  background: #f59e0b;
}

.ops-table-wrap {
  overflow-x: auto;
}

.ops-table {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
}

.ops-table th {
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 12px;
  text-align: left;
  text-transform: uppercase;
}

.ops-table td {
  border-top: 1px solid #e2e8f0;
  color: #1e293b;
  padding: 14px 12px;
  vertical-align: top;
}

.ops-table code {
  background: #eaf6f4;
  border: 1px solid #bde9e2;
  border-radius: 6px;
  color: #115e59;
  font-family: "SFMono-Regular", Consolas, monospace;
  padding: 3px 6px;
}

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

.ops-search {
  display: flex;
  flex: 1;
  gap: 10px;
}

.ops-search input,
.critical-control input[type="text"],
.ops-modal input,
.ops-select {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #0f172a;
  min-height: 42px;
  padding: 0 12px;
}

.ops-search input {
  flex: 1;
}

.ops-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  min-height: 40px;
  padding: 0 14px;
}

.ops-button.primary {
  background: #0f766e;
  color: #fff;
}

.ops-button.secondary {
  background: #2563a8;
  color: #fff;
}

.ops-button.danger {
  background: #b42318;
  color: #fff;
}

.ops-critical-warning {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #b42318;
  border-radius: 8px;
  color: #7f1d1d;
  font-weight: 750;
  line-height: 1.45;
  padding: 12px;
}

.ops-button.amber {
  background: #f59e0b;
  color: #1f2937;
}

.ops-button.subtle {
  background: #e2e8f0;
  color: #334155;
}

.ops-button.enabled {
  background: #7f1d1d;
}

.ops-badge.status-active {
  background: #dcfce7;
  color: #166534;
}

.ops-badge.status-suspended {
  background: #fee2e2;
  color: #991b1b;
}

.ops-badge.plan-free {
  background: #e2e8f0;
  color: #334155;
}

.ops-badge.plan-pro,
.ops-badge.plan-starter,
.ops-badge.plan-professional {
  background: #dbeafe;
  color: #1d4ed8;
}

.ops-badge.plan-enterprise {
  background: #ede9fe;
  color: #6d28d9;
}

.ops-menu {
  position: relative;
}

.ops-menu summary {
  background: #0f172a;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  list-style: none;
  padding: 10px 12px;
  text-align: center;
}

.ops-menu[open] summary {
  border-radius: 8px 8px 0 0;
}

.ops-menu div,
.ops-menu button {
  display: block;
}

.ops-menu button {
  background: #fff;
  border: 0;
  border-top: 1px solid #e2e8f0;
  color: #0f172a;
  cursor: pointer;
  min-width: 240px;
  padding: 11px 12px;
  text-align: left;
  width: 100%;
}

.ops-menu button:hover {
  background: #f8fafc;
}

.ops-modal-backdrop {
  align-items: center;
  background: rgba(15, 23, 42, 0.62);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 50;
}

.ops-modal-backdrop.open {
  display: flex;
}

.ops-modal {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.30);
  display: grid;
  gap: 14px;
  max-width: 460px;
  padding: 22px;
  width: 100%;
}

.ops-modal label,
.critical-control label {
  color: #334155;
  display: grid;
  font-weight: 850;
  gap: 8px;
}

.ops-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.critical-control {
  border-color: #fecaca;
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.ops-check {
  align-items: center;
  display: flex !important;
  gap: 10px !important;
}

.switch {
  display: inline-flex;
}

.switch input {
  display: none;
}

.switch span {
  background: #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  height: 28px;
  position: relative;
  width: 52px;
}

.switch span::after {
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.24);
  content: "";
  height: 22px;
  left: 3px;
  position: absolute;
  top: 3px;
  transition: transform 0.18s ease;
  width: 22px;
}

.switch input:checked + span {
  background: #0f766e;
}

.switch input:checked + span::after {
  transform: translateX(24px);
}

.audit-scroll {
  max-height: 560px;
  overflow: auto;
}

.impersonation-overlay {
  align-items: center;
  background: #78350f;
  color: #fff7ed;
  display: none;
  gap: 14px;
  justify-content: center;
  padding: 10px 16px;
  position: sticky;
  top: 32px;
  z-index: 29;
}

.ops-impersonating .impersonation-overlay {
  display: flex;
}

@media (max-width: 980px) {
  .dashboard-command,
  .dashboard-topline,
  .dashboard-analytics-grid,
  .dashboard-work-grid,
  .executive-dashboard .portfolio-summary-grid {
    grid-template-columns: 1fr;
  }

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

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

  .ops-shell {
    grid-template-columns: 1fr;
  }

  .ops-sidebar {
    height: auto;
    position: static;
  }

  .ops-metric-grid,
  .ops-content-grid {
    grid-template-columns: 1fr;
  }

  .report-financial-metrics,
  .report-analytics-panel,
  .report-detail-header,
  .report-detail-grid,
  .report-detail-grid.three {
    grid-template-columns: 1fr;
  }

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

  .report-detail-grid .trend-card:first-child {
    grid-column: auto;
  }

  .report-donut-wrap {
    align-items: flex-start;
    flex-direction: column;
  }

  .ops-topbar,
  .ops-action-header,
  .ops-search {
    align-items: stretch;
    flex-direction: column;
  }

  .budget-approval-flow,
  .budget-entry-row,
  .distribution-controls,
  .distribution-footer {
    grid-template-columns: 1fr;
  }

  .distribution-controls > label,
  .distribution-controls > select,
  .distribution-controls .distribution-entry-mode {
    grid-column: auto;
    grid-row: auto;
  }

  .budget-step-action {
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  .dashboard-command {
    border-radius: 14px;
    padding: 22px 18px;
  }

  .dashboard-command h1 {
    font-size: clamp(2rem, 12vw, 3.1rem);
  }

  .dashboard-command-side,
  .command-actions {
    justify-content: stretch;
  }

  .command-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

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

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

  .report-export-actions,
  .progress-trend-card,
  .attention-item {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .report-export-actions {
    display: grid;
  }

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

  .dashboard-action-row,
  .dashboard-filter-inline {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-filter-inline .button,
  .dashboard-filter-inline select,
  .dashboard-view-projects,
  .dashboard-search {
    width: 100%;
  }

  .dashboard-table-head,
  .dashboard-table-row {
    grid-template-columns: 1fr;
  }

  .watchlist-card,
  .dashboard-analytics-grid > .panel,
  .department-budget-card {
    min-height: auto;
  }

  .risk-summary-layout,
  .reference-dashboard .donut-layout {
    grid-template-columns: 1fr;
  }

  .risk-total-badge {
    border: 1px solid #e5e7eb;
    min-height: 0;
  }

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

  .app-header {
    padding: 16px 18px;
  }

  .nav {
    justify-content: flex-start;
  }

  .nav-utilities {
    border-left: 0;
    flex-wrap: wrap;
    margin-left: 0;
    padding-left: 0;
  }

  .nav-item {
    position: static;
  }

  .nav-dropdown {
    left: 14px;
    max-width: calc(100vw - 28px);
    min-width: min(320px, calc(100vw - 28px));
    right: auto;
  }

  .user-chip {
    max-width: 100%;
  }

  .page {
    padding: 24px 14px 56px;
  }

  body.has-sidebar .app-header {
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 16px 14px;
    position: static;
    width: auto;
  }

  body.has-sidebar .sidebar-nav {
    width: 100%;
  }

  body.has-sidebar .page,
  body.has-sidebar .app-footer {
    margin-left: 0;
  }

  body.has-sidebar .page {
    padding: 24px 14px 56px;
  }

  body.has-sidebar .app-footer {
    padding: 0 14px 28px;
  }

  .metrics,
  .kpi-grid,
  .info-grid,
  .two-column,
  .dashboard-grid,
  .dashboard-visual-grid,
  .form-grid,
  .utility-results-grid,
  .help-grid,
  .account-layout,
  .risk-severity-grid,
  .department-chart-row,
  .donut-layout,
  .utility-search-form > div {
    grid-template-columns: 1fr;
  }

  .column-chart {
    grid-auto-columns: minmax(86px, 44vw);
  }

  .project-entry-form fieldset {
    grid-template-columns: 1fr;
  }

  .ownership-section p:first-of-type,
  .schedule-section .checkbox-row {
    grid-column: auto;
  }

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

  .detail-edit-row,
  .milestone-edit-row,
  .risk-edit-row,
  .milestone-records .record-row,
  .risk-records .record-row,
  .budget-kpis,
  .budget-variance-strip,
  .year-selector {
    grid-template-columns: 1fr;
  }


  .toolbar input,
  .toolbar select,
  .toolbar .button {
    max-width: none;
    width: 100%;
  }

  .kpi-card,
  .panel,
  .metrics article,
  .form-card,
  .form-grid,
  .auth-panel,
  .budget-table-wrap {
    box-shadow: var(--shadow-sm);
  }
}

@media print {
  .app-header,
  .app-footer,
  .nav-dropdown,
  .toolbar,
  .report-page-title,
  .report-filters,
  .snapshot-action-form,
  .executive-summary-toolbar,
  .executive-summary-actions,
  .report-analytics-panel,
  .report-detail-header,
  .report-export-actions,
  .actions,
  .button {
    display: none !important;
  }

  body {
    background: #fff;
    color: #111827;
  }

  .page {
    max-width: none;
    padding: 0;
  }

  .print-report-header {
    border-bottom: 2px solid #0f766e;
    display: block;
    margin-bottom: 16px;
    padding-bottom: 10px;
  }

  .print-report-header h1 {
    color: #0f172a;
    font-size: 18pt;
    margin: 0 0 4px;
  }

  .print-report-header p {
    color: #475569;
    font-size: 10pt;
    margin: 0;
  }

  .page-heading {
    display: none;
    box-shadow: none;
    margin-bottom: 14px;
    padding: 14px;
  }

  .page-heading::before,
  .page-heading::after,
  .panel::before,
  .metrics article::before,
  .kpi-card::before {
    display: none;
  }

  .panel,
  .kpi-card,
  .metrics article,
  .table-wrap,
  .budget-table-wrap,
  .executive-summary-box {
    box-shadow: none;
  }

  .metrics {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 14px;
    page-break-inside: avoid;
  }

  .metrics article {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-left: 4px solid #0f766e;
    border-radius: 6px;
    box-shadow: none;
    break-inside: avoid;
    min-height: 0;
    padding: 9px 10px;
  }

  .metrics article::before {
    display: none;
  }

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

  .project-info-panel,
  .section-heading,
  .report-section-title {
    page-break-inside: avoid;
  }

  .metrics span {
    font-size: 9pt;
    margin-bottom: 3px;
  }

  .metrics strong {
    display: block;
    font-size: 12pt;
    line-height: 1.2;
    white-space: normal;
  }

  .executive-summary-box {
    border: 1px solid #cbd5e1;
    box-shadow: none;
    margin: 0 0 14px;
    padding: 12px;
    page-break-inside: avoid;
  }

  .executive-summary-heading {
    display: block;
  }

  .executive-summary-heading span,
  .executive-summary-editor,
  .executive-summary-field {
    display: none !important;
  }

  .executive-summary-print {
    background: #fff;
    border: 0;
    border-radius: 6px;
    color: #0f172a;
    display: block;
    font-size: 10pt;
    line-height: 1.45;
    min-height: 32px;
    overflow: visible;
    padding: 9px 10px;
    white-space: normal;
    word-break: break-word;
  }

  .executive-summary-print p {
    margin: 0 0 6px;
  }

  .table-wrap {
    border: 1px solid #cbd5e1;
    box-shadow: none;
    overflow: visible !important;
    page-break-inside: avoid;
  }

  .report-project-table table,
  .report-status-summary-table table,
  .detail-report-table,
  table {
    min-width: 0 !important;
    width: 100% !important;
  }

  .report-section-card {
    border: 1px solid #cbd5e1;
    box-shadow: none;
    margin-bottom: 10px;
    padding: 10px;
  }

  .detail-kpi-grid {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .detail-kpi-card {
    border: 1px solid #cbd5e1;
    border-left: 3px solid #0f766e;
    box-shadow: none;
    min-height: 0;
    padding: 8px;
  }

  .detail-kpi-card strong {
    font-size: 11pt;
  }

  .report-detail-grid,
  .report-detail-grid.three {
    display: block;
  }

  .detail-report-table th:nth-child(6),
  .detail-report-table td:nth-child(6),
  .detail-report-table th:nth-child(10),
  .detail-report-table td:nth-child(10),
  .detail-report-table th:nth-child(11),
  .detail-report-table td:nth-child(11),
  .detail-report-table th:nth-child(12),
  .detail-report-table td:nth-child(12) {
    display: none;
  }

  th,
  td {
    padding: 7px 8px;
  }

  th {
    background: #eef2f7 !important;
    color: #1f2937;
    font-size: 8pt;
  }

  td {
    font-size: 9pt;
  }
}
