@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Open+Sans:wght@400;600;700&display=swap");

:root {
  --app-font: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --app-display-font: "Nunito", "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --app-mono-font: var(--app-font);
  --font: var(--app-font);
  --font-ui: var(--app-font);
  --font-display: var(--app-display-font);
  --ui-bg: #fbf8f1;
  --ui-bg-rgb: 251, 248, 241;
  --ui-surface: #fffdf7;
  --ui-surface-rgb: 255, 253, 247;
  --ui-surface-soft: #f5efe5;
  --ui-border: #ddd6c8;
  --ui-border-strong: #c9bdad;
  --ui-text: #111915;
  --ui-text-soft: #27342f;
  --ui-muted: #697770;
  --ui-primary: #0f7a61;
  --ui-primary-hover: #0a604d;
  --ui-primary-deep: #083f34;
  --ui-primary-black: #071b16;
  --ui-primary-soft: rgba(15, 122, 97, 0.11);
  --ui-accent: #d79a37;
  --ui-accent-soft: rgba(215, 154, 55, 0.16);
  --ui-danger: #a33b2f;
  --ui-warning: #b96a23;
  --ui-success: #0f7a61;
  --ui-focus: #0f7a61;
  --ui-radius: 16px;
  --ui-radius-sm: 12px;
  --ui-radius-lg: 24px;
  --ui-shadow: 0 18px 46px rgba(17, 25, 21, 0.11);
  --ui-shadow-soft: 0 12px 28px rgba(17, 25, 21, 0.08);
  --shell-bg: #fbf8f1;
  --shell-page-bg: #fbf8f1;
  --shell-border: var(--ui-border);
  --shell-text: var(--ui-text);
  --shell-muted: var(--ui-muted);
  --shell-accent: var(--ui-primary);
  --shell-accent-soft: var(--ui-primary-soft);
  --shell-sidebar: rgba(255, 253, 247, 0.94);
  --shell-header: rgba(255, 253, 247, 0.86);
  --workspace-surface: var(--ui-surface);
  --workspace-surface-strong: #ffffff;
  --workspace-border: rgba(201, 189, 173, 0.72);
  --workspace-border-strong: var(--ui-border-strong);
  --workspace-shadow: var(--ui-shadow);
  --workspace-shadow-soft: var(--ui-shadow-soft);
  --workspace-text: var(--ui-text);
  --workspace-muted: var(--ui-muted);
  --workspace-muted-strong: var(--ui-text-soft);
  --workspace-accent: var(--ui-primary);
  --workspace-accent-deep: var(--ui-primary-deep);
  --workspace-accent-soft: var(--ui-primary-soft);
  --fd-accent: var(--ui-primary);
  --fd-accent-deep: var(--ui-primary-deep);
  --fd-text: var(--ui-text);
  --fd-text-soft: var(--ui-muted);
  --fd-border: var(--ui-border);
  --fd-surface: var(--ui-surface);
  --fd-surface-soft: var(--ui-surface-soft);
  --fd-shadow: var(--ui-shadow-soft);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
}

body {
  color-scheme: light;
  font-family: var(--app-font) !important;
  font-weight: 400 !important;
  color: var(--ui-text);
  background:
    radial-gradient(circle at 8% 4%, rgba(215, 154, 55, 0.14), transparent 28rem),
    radial-gradient(circle at 86% 16%, rgba(15, 122, 97, 0.12), transparent 30rem),
    var(--ui-bg) !important;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}

input,
textarea,
select,
button {
  font-family: var(--app-font) !important;
  font-weight: 400 !important;
}

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

[class*="gradient"] {
  background-image: none;
}

h1,
h2,
h3,
h4,
h5,
h6,
strong,
b,
.fw-bold,
[class*="title"],
[class*="heading"] {
  font-weight: 500 !important;
}

a,
button,
.btn,
input,
select,
textarea {
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, opacity 140ms ease;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--ui-focus) !important;
  outline-offset: 2px;
}

button:disabled,
.btn:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed !important;
}

.btn,
button,
.shell-action-primary,
.shell-action-secondary,
.workspace-tab-link,
.ghost-icon {
  border-radius: var(--ui-radius);
  font-weight: 500 !important;
  box-shadow: none !important;
  text-decoration: none;
}

.shell-action-primary,
.btn-primary {
  background: linear-gradient(135deg, var(--ui-primary-deep), var(--ui-primary)) !important;
  border-color: var(--ui-primary) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
}

.shell-action-primary:hover,
.btn-primary:hover {
  background: linear-gradient(135deg, var(--ui-primary-black), var(--ui-primary-hover)) !important;
  border-color: var(--ui-primary-hover) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
}

.shell-action-secondary,
.btn-outline-secondary,
.workspace-tab-link {
  background-color: var(--ui-surface) !important;
  border: 1px solid var(--ui-border) !important;
  color: var(--ui-text) !important;
  -webkit-text-fill-color: var(--ui-text);
}

.form-label {
  display: block;
  margin-bottom: var(--space-1);
  font-weight: 500 !important;
  color: var(--ui-text);
}

.form-control,
.form-select,
textarea {
  border: 1px solid var(--ui-border) !important;
  border-radius: var(--ui-radius) !important;
  min-height: 40px;
  color: var(--ui-text);
  background-color: #ffffff;
}

.form-control::placeholder,
textarea::placeholder {
  color: #7b879d;
}

.table-responsive {
  overflow-x: auto;
}

.table tbody tr:nth-child(even),
.data-table tbody tr:nth-child(even) {
  background-color: #f3f6fb;
}

.table thead th,
.data-table thead th {
  background-color: #eaf0f8;
  color: var(--ui-text);
  font-weight: 500 !important;
}

.workspace-section,
.workspace-table-shell,
.workspace-kpi-card,
.detail-hero,
.modal-content,
.shell-dropdown {
  background-color: var(--ui-surface) !important;
  border: 1px solid var(--ui-border) !important;
  box-shadow: none !important;
}

.workspace-empty,
.empty-state {
  border: 1px dashed var(--ui-border);
  background-color: #f8fbff;
  color: var(--ui-muted);
  border-radius: var(--ui-radius);
  padding: var(--space-5);
}

.alert-danger,
.text-danger,
.invalid-feedback {
  color: #9b1c1c !important;
}

[aria-busy="true"] {
  opacity: 0.72;
  pointer-events: none;
}

[aria-busy="true"]::after {
  content: "Loading...";
  display: inline-block;
  margin-left: var(--space-2);
  color: var(--ui-muted);
  font-size: 0.86rem;
  font-weight: 500;
}

/* Property management system layer: align internal portals with the public portal direction. */
body:not(.public-home) {
  color: var(--ui-text) !important;
}

body:not(.public-home) :is(h1, h2, h3, h4, h5, h6, .page-title, .workspace-page-title, .detail-hero-title, .card-title, .shell-title) {
  font-family: var(--app-display-font) !important;
  font-weight: 500 !important;
  letter-spacing: 0;
  color: var(--ui-text) !important;
}

body:not(.public-home) :is(.section-kicker, .eyebrow, .nav-section-title, .workspace-toolbar label, .detail-hero-eyebrow, .detail-stat-label, .field-label, .meta-label) {
  font-family: var(--app-mono-font) !important;
  font-weight: 500 !important;
  letter-spacing: 0;
}

body:not(.public-home) :is(.shell-header, .workspace-toolbar, .toolbar, .workspace-section, .workspace-table-shell, .workspace-kpi-card, .kpi-card, .stat-pill, .card, .detail-card, .detail-rail-card, .form-help-card, .info-callout, .modal-content, .dropdown-menu, .shell-dropdown) {
  background: rgba(var(--ui-surface-rgb), 0.92) !important;
  border-color: var(--ui-border) !important;
  box-shadow: var(--ui-shadow-soft) !important;
  backdrop-filter: blur(16px);
}

body:not(.public-home) :is(.card, .workspace-section, .workspace-table-shell, .workspace-kpi-card, .kpi-card, .stat-pill, .detail-card, .detail-rail-card, .form-help-card, .info-callout, .modal-content) {
  border-radius: var(--ui-radius-lg) !important;
}

body:not(.public-home) :is(.card-header, .modal-header, .maintenance-notif-modal__header) {
  background: linear-gradient(180deg, rgba(245, 239, 229, 0.72), rgba(var(--ui-surface-rgb), 0.92)) !important;
  border-color: var(--ui-border) !important;
}

body:not(.public-home) :is(.page-subtitle, .workspace-page-subtitle, .shell-subtitle, .text-muted, .form-text, .small, small, .detail-hero-subtitle, .detail-hero-meta, .workspace-kpi-label, .kpi-card .label, .stat-pill .stat-label) {
  color: var(--ui-muted) !important;
}

body:not(.public-home) :is(.btn, button, .shell-action-primary, .shell-action-secondary, .workspace-tab-link, .shortcut-link, .app-fab-action) {
  border-radius: 999px !important;
  font-weight: 500 !important;
}

/* Workspace action cards are information panels, including when rendered as POST buttons. */
body:not(.public-home) .admin-actions-section .admin-action-card {
  border-radius: 8px !important;
}

body:not(.public-home) :is(.btn-primary, .btn-success, .shell-action-primary, .app-fab-trigger, .fab-toggle, .fab-btn, .leasing-fab-trigger) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
  border-color: var(--ui-primary) !important;
  background: linear-gradient(135deg, var(--ui-primary-deep), var(--ui-primary)) !important;
  box-shadow: 0 16px 34px rgba(15, 122, 97, 0.22) !important;
}

body:not(.public-home) :is(.btn-primary, .btn-success, .shell-action-primary, .app-fab-trigger, .fab-toggle, .fab-btn, .leasing-fab-trigger):is(:hover, :focus-visible) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
  border-color: var(--ui-primary-hover) !important;
  background: linear-gradient(135deg, var(--ui-primary-black), var(--ui-primary-hover)) !important;
}

body:not(.public-home) :is(.btn-primary, .btn-success, .shell-action-primary, .app-fab-trigger, .fab-toggle, .fab-btn, .leasing-fab-trigger) i {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
}

body:not(.public-home) :is(.btn-outline-primary, .btn-outline-secondary, .btn-light, .shell-action-secondary, .workspace-tab-link, .shortcut-link, .app-fab-action) {
  color: var(--ui-text) !important;
  -webkit-text-fill-color: var(--ui-text);
  border-color: var(--ui-border) !important;
  background: rgba(var(--ui-surface-rgb), 0.9) !important;
}

body:not(.public-home) :is(.btn-outline-primary, .btn-outline-secondary, .btn-light, .shell-action-secondary, .workspace-tab-link, .shortcut-link, .app-fab-action):is(:hover, :focus-visible) {
  color: var(--ui-primary-deep) !important;
  -webkit-text-fill-color: var(--ui-primary-deep);
  border-color: rgba(15, 122, 97, 0.32) !important;
  background: #ffffff !important;
}

body:not(.public-home) :is(.btn-danger, .btn-outline-danger) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
  border-color: var(--ui-danger) !important;
  background: linear-gradient(135deg, #7f1d1d, var(--ui-danger)) !important;
}

body:not(.public-home) :is(.form-control, .form-select, textarea, input[type="search"], .shell-search) {
  border-color: var(--ui-border) !important;
  border-radius: var(--ui-radius) !important;
  background-color: #ffffff !important;
  color: var(--ui-text) !important;
  box-shadow: none !important;
}

body:not(.public-home) :is(.form-control, .form-select, textarea, input[type="search"]):focus {
  border-color: rgba(15, 122, 97, 0.65) !important;
  box-shadow: 0 0 0 4px rgba(15, 122, 97, 0.12) !important;
}

body:not(.public-home) :is(.table, .data-table) {
  color: var(--ui-text) !important;
  border-color: var(--ui-border) !important;
}

body:not(.public-home) :is(.table thead th, .data-table thead th) {
  background: #f5efe5 !important;
  color: var(--ui-text-soft) !important;
  border-color: var(--ui-border) !important;
  font-family: var(--app-mono-font) !important;
  font-size: 0.74rem !important;
  letter-spacing: 0;
  text-transform: uppercase;
}

body:not(.public-home) :is(.table tbody tr:nth-child(even), .data-table tbody tr:nth-child(even)) {
  background-color: rgba(245, 239, 229, 0.42) !important;
}

body:not(.public-home) :is(.badge, .status-badge, .workspace-status, .chip, .pill) {
  border-radius: 999px !important;
  font-weight: 500 !important;
}

body:not(.public-home) :is(.badge.bg-primary, .badge.text-bg-primary, .status-badge.primary, .workspace-status.primary) {
  background: var(--ui-primary-soft) !important;
  color: var(--ui-primary-deep) !important;
  -webkit-text-fill-color: var(--ui-primary-deep);
}

body:not(.public-home) :is(.alert, .workspace-empty, .empty-state) {
  border-radius: var(--ui-radius-lg) !important;
  border-color: var(--ui-border) !important;
  background: rgba(var(--ui-surface-rgb), 0.88) !important;
  color: var(--ui-text-soft) !important;
  box-shadow: var(--ui-shadow-soft) !important;
}

/* Original PMS workspaces use the existing light palette; supplied dashboards do not load this stylesheet. */
html:has(body.pms-workspace) { scroll-padding-top: 90px; }
body.pms-workspace {
  --card: var(--ui-surface);
  --surface: var(--ui-bg);
  --text-1: var(--ui-text);
  --text-2: var(--ui-text-soft);
  --text-3: var(--ui-muted);
  --border: var(--ui-border);
  --shadow-lifted: none;
  --shadow-card: none;
  --ui-radius: 6px;
  --ui-radius-sm: 4px;
  --ui-radius-lg: 8px;
  --ui-shadow: none;
  --ui-shadow-soft: none;
  --shell-bg: var(--ui-bg);
  --shell-page-bg: var(--ui-bg);
  --shell-border: var(--ui-border);
  --shell-text: var(--ui-text);
  --shell-muted: var(--ui-muted);
  --shell-accent: var(--ui-primary);
  --shell-accent-deep: var(--ui-primary-hover);
  --shell-accent-soft: var(--ui-primary-soft);
  --shell-sidebar: var(--ui-surface);
  --shell-header: var(--ui-surface);
  --shell-width: 240px;
  --sidebar-font-family: var(--app-font);
  --sidebar-nav-font-size: 0.8125rem;
  --sidebar-nav-line-height: 1.4;
  --workspace-surface: var(--ui-surface);
  --workspace-surface-strong: var(--ui-surface-soft);
  --workspace-border: var(--ui-border);
  --workspace-border-strong: var(--ui-border-strong);
  --workspace-text: var(--ui-text);
  --workspace-muted: var(--ui-muted);
  --workspace-muted-strong: var(--ui-text-soft);
  --workspace-accent: var(--ui-primary);
  --workspace-accent-deep: var(--ui-primary-deep);
  --workspace-accent-soft: var(--ui-primary-soft);
  --workspace-shadow: none;
  --workspace-shadow-soft: none;
  --fd-surface: var(--ui-surface);
  --fd-surface-soft: var(--ui-surface-soft);
  --fd-text: var(--ui-text);
  --fd-text-soft: var(--ui-muted);
  --fd-border: var(--ui-border);
  --fd-accent: var(--ui-primary);
  --fd-accent-deep: var(--ui-primary-deep);
  --fd-shadow: none;
  --page-padding-x: 14px;
  --page-padding-y: 12px;
  --app-header-height: 78px;
  --app-content-gap: 12px;
  --bs-body-color: var(--ui-text);
  --bs-body-bg: var(--ui-bg);
  --bs-border-color: var(--ui-border);
  --bs-secondary-color: var(--ui-muted);
  --bs-tertiary-bg: var(--ui-surface-soft);
  background: var(--ui-bg) !important;
  color-scheme: light;
  font-size: 0.875rem;
  letter-spacing: 0;
}

.pms-workspace .main-content { min-width: 0; width: auto; background: var(--ui-bg); }
.pms-workspace .hero { height: auto; min-height: 88px; background: var(--ui-bg); }
.pms-workspace .hero::after { display: none; }
.pms-workspace .hero-inner { padding: 12px var(--page-padding-x); }
.pms-workspace .main-content .hero .hero-greeting h1 { font-size: 1.25rem; text-shadow: none; }
.pms-workspace .kpi-grid { margin-top: 12px; }
.pms-workspace .page-body { padding-top: 0; }
.pms-workspace .shell-header {
  position: sticky; top: 0; z-index: 990;
  min-height: var(--app-header-height); height: auto;
  padding: 10px var(--page-padding-x); gap: 12px;
  border-bottom: 1px solid var(--ui-border); border-radius: 0;
  background: var(--shell-header) !important; backdrop-filter: none !important;
}
.pms-workspace .shell-header > div { min-width: 0; }
.pms-workspace .shell-title { font-size: 1.25rem; overflow-wrap: anywhere; }
.pms-workspace .shell-subtitle { font-size: 0.8125rem; }
.pms-workspace .shell-actions { flex-wrap: wrap; gap: 8px; }
.pms-workspace .page-content { padding-top: var(--app-content-gap) !important; }
.pms-workspace :is([id], .page-content) { scroll-margin-top: calc(var(--app-header-height) + var(--app-content-gap)); }
.pms-workspace .sidebar { box-shadow: none !important; backdrop-filter: none !important; }
.pms-workspace .sidebar-header { padding: 16px 12px !important; min-height: var(--app-header-height); }
.pms-workspace .sidebar-logo-text { color: var(--ui-text) !important; }
.pms-workspace .sidebar-logo-icon { background: var(--ui-primary-soft) !important; color: var(--ui-primary) !important; box-shadow: none !important; }
.pms-workspace .sidebar :is(.nav-link, .sidebar-group-toggle) { padding: 9px 12px !important; }
.pms-workspace .sidebar .nav-link.active { color: var(--bs-white) !important; background: var(--ui-primary) !important; }
.pms-workspace .sidebar-group-links .nav-link { padding-left: 32px !important; }
.pms-workspace .sidebar .nav-link.active i { color: var(--bs-white) !important; }
.pms-workspace :is(.btn, button, .shell-action-primary, .shell-action-secondary, .workspace-tab-link, .shortcut-link) {
  border-radius: var(--ui-radius) !important;
}
.pms-workspace :is(.btn-primary, .btn-success, .shell-action-primary) {
  background: var(--ui-primary-hover) !important; border-color: var(--ui-primary) !important;
}
.pms-workspace :is(.btn-outline-primary, .btn-outline-secondary, .btn-light, .shell-action-secondary, .workspace-tab-link):hover {
  background: var(--ui-primary-soft) !important; color: var(--ui-text) !important;
  -webkit-text-fill-color: var(--ui-text) !important;
}
.pms-workspace :is(.form-control, .form-select, textarea, input[type="search"], .shell-role-select) {
  background-color: var(--ui-bg) !important; color: var(--ui-text) !important; border-color: var(--ui-border) !important;
}
.pms-workspace :is(.form-control, textarea)::placeholder { color: var(--ui-muted); }
.pms-workspace :is(.workspace-section, .workspace-table-shell, .detail-hero) {
  border-radius: 0 !important; box-shadow: none !important; backdrop-filter: none !important;
}
.pms-workspace :is(.detail-hero-title, .portal-self-service-title) { font-size: 1.25rem; }
.pms-workspace :is(.workspace-kpi-grid, .kpi-grid) {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 10px;
}
.pms-workspace :is(.workspace-kpi-card, .kpi-card, .dashboard-feature) {
  min-width: 0; border: 1px solid var(--ui-border); border-radius: 6px !important;
  background: var(--ui-surface) !important; padding: 12px !important;
}
.pms-workspace :is(.workspace-kpi-value, .kpi-value) { font-size: 1.75rem; line-height: 1.2; overflow-wrap: anywhere; }
.pms-workspace :is(.workspace-kpi-label, .workspace-kpi-meta, .kpi-desc) { font-size: 0.8125rem; color: var(--ui-muted); }
.pms-workspace :is(.workspace-section-header, .card-header) {
  min-height: 44px; height: auto; padding: 10px 12px; gap: 8px;
  background: var(--ui-surface) !important; border-color: var(--ui-border);
}
.pms-workspace :is(.workspace-section-title, .card-title, .chart-header h3) { font-size: 1rem; margin: 0; }
.pms-workspace :is(.workspace-section-body, .card-body) { padding: 12px; }
.pms-workspace :is(.table, .data-table) {
  --bs-table-color: var(--ui-text); --bs-table-bg: var(--ui-surface);
  --bs-table-striped-bg: var(--ui-surface-soft); --bs-table-striped-color: var(--ui-text);
  --bs-table-hover-color: var(--ui-text); --bs-table-hover-bg: var(--ui-primary-soft);
}
.pms-workspace :is(.table thead th, .data-table thead th, .table tbody tr:nth-child(even), .data-table tbody tr:nth-child(even)) {
  background: var(--ui-surface-soft) !important; color: var(--ui-text) !important;
}
.pms-workspace :is(.table, .data-table) :is(th, td) { padding: 9px 10px; border-color: var(--ui-border); }
.pms-workspace :is(.text-success, .success) { color: var(--ui-success) !important; }
.pms-workspace :is(.text-warning, .warning) { color: var(--ui-warning) !important; }
.pms-workspace :is(.text-danger, .invalid-feedback, .danger) { color: var(--ui-danger) !important; }
.pms-workspace :is(.chart-card, .detail-card, .portal-self-service, .portal-self-service-card, .admin-action-group, .admin-action-card, .admin-shortcut-card, .legend-item, .detail-stat, .detail-hero, .workspace-empty, .empty-state) {
  background: var(--ui-surface) !important; color: var(--ui-text) !important; border-color: var(--ui-border) !important;
  border-radius: 6px !important; box-shadow: none !important;
}
.pms-workspace :is(.chart-card, .detail-card) { padding: 12px; }
.pms-workspace .dashboard-metric { display: flex; flex-direction: column; gap: 8px; }
.pms-workspace .dashboard-metric-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pms-workspace .dashboard-metric p { margin: 0; }
.pms-workspace .dashboard-metric .workspace-kpi-meta { margin-top: auto; }
.pms-workspace .dashboard-feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; margin-block: 12px; }
.pms-workspace .dashboard-feature { display: flex; flex-direction: column; padding: 0 !important; }
.pms-workspace .dashboard-feature > header { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 12px; border-bottom: 1px solid var(--ui-border); }
.pms-workspace .dashboard-feature h2 { margin: 0; font-size: 1rem; }
.pms-workspace .dashboard-feature-body { flex: 1; padding: 12px; }
.pms-workspace .dashboard-feature-body p { margin: 8px 0 0; color: var(--ui-muted); }
.pms-workspace .dashboard-feature > footer { margin-top: auto; padding: 8px 12px; border-top: 1px solid var(--ui-border); }
.pms-workspace .workspace-unavailable { width: min(440px, calc(100% - 32px)); padding: 24px; border: 1px solid var(--ui-border); border-radius: 8px; background: var(--ui-surface); color: var(--ui-text); }
.pms-workspace .workspace-unavailable::backdrop { background: #0009; }
.pms-workspace .workspace-unavailable h2 { font-size: 1.25rem; }
.pms-workspace .workspace-refresh-status { margin: 10px 14px; color: var(--ui-warning); }
.pms-workspace .app-footer { background: var(--ui-bg); color: var(--ui-muted); border-color: var(--ui-border); }
.pms-workspace [hidden] { display: none !important; }
/* Bind the imported reference shell to the existing authorized navigation and forms. */
.pms-reference { --bg: var(--ui-bg); --card: var(--ui-surface); --text: var(--ui-text); --muted: var(--ui-muted); }
.pms-reference .app-shell { background: var(--ui-bg); }
.pms-reference :is(.panel, .special-card, .special-kpi, .kpi-strip, .metric-tile) {
  background: var(--ui-surface); border-color: var(--ui-border);
}
.pms-reference :is(.header-building, .topbar .subtitle, .date-block, .filter, .special-filter, .special-row-action) {
  color: var(--ui-text);
}
.pms-reference :is(.special-kpi small, .special-kpi p, .mini-stats small, .special-mini small, .special-axis, .special-months) {
  color: var(--ui-muted);
}
.pms-reference :is(.mini-stats > div, .special-mini, .status-grid > div, .special-table th, .special-table td) {
  border-color: var(--ui-border);
}
.pms-reference :is(.donut, .special-donut)::after { background: var(--ui-surface); box-shadow: none; }
.pms-reference :is(.table-card th, .special-table th) { background: var(--ui-surface-soft); color: var(--ui-text); }
.pms-reference :is(.table-card td, .special-table td) { color: var(--ui-text); }
.pms-reference .topbar {
  height: var(--app-header-height); min-height: var(--app-header-height); z-index: 1000;
  padding: 8px var(--page-padding-x); align-items: center; gap: 12px; background: var(--ui-bg);
}
.pms-reference .topbar .title-line h1 { font-family: var(--app-display-font); font-size: 1rem; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }
.pms-reference .topbar .subtitle { display: block; font-size: 0.75rem; margin: 3px 0 0; }
.pms-reference .top-actions { min-width: 0; height: auto; gap: 10px; }
.pms-reference .top-actions .profile { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pms-reference .profile b { max-width: 160px; white-space: normal; overflow-wrap: anywhere; }
.pms-reference .profile small { color: var(--ui-muted); }
.pms-reference .main-content { margin-left: var(--shell-width); }
.pms-reference .sidebar { width: var(--shell-width); transform: none; z-index: 1010; }
.pms-reference .sidebar .sidebar-nav { overflow-y: auto; flex: 1; padding: 8px; }
.pms-reference .sidebar :is(.nav-link, .sidebar-group-toggle) { min-height: 34px; font-size: 0.75rem; }
.pms-reference .dashboard-shell { padding: var(--app-content-gap) var(--page-padding-x) 14px; gap: 10px; }
.pms-reference :is(.kpi-strip, .special-kpis) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr)); }
.pms-reference .special-kpi { min-width: 0; min-height: 78px; }
.pms-reference .special-kpi :is(small, strong, p) { white-space: normal; overflow-wrap: anywhere; }
.pms-reference .special-kpi strong { font-size: 1.25rem; }
.pms-reference .special-kpi-icon { color: var(--ui-primary); background: var(--ui-primary-soft); }
.pms-reference .panel { min-width: 0; overflow: hidden; }
.pms-reference .panel > header { min-height: 44px; height: auto; }
.pms-reference .panel > header h2 { margin: 0; font-size: 0.875rem; line-height: 1.3; }
.pms-reference .panel > :is(.panel-link, a.panel-link) { color: var(--ui-primary-deep); text-decoration: none; }
.pms-reference .panel-body { padding: 12px 0; min-width: 0; }
.pms-reference .panel-empty { padding: 16px 0; color: var(--ui-muted); }
.pms-reference .reference-chart { width: 100%; height: 145px; position: relative; }
.pms-reference .reference-chart canvas { max-width: 100%; }
.pms-reference .reference-legend { display: grid; gap: 8px; margin-top: 10px; }
.pms-reference .reference-legend > div { display: flex; justify-content: space-between; gap: 12px; }
.pms-reference .reference-legend b { overflow-wrap: anywhere; text-align: right; }
.pms-reference .panel .mini-stats { margin-top: auto; }
.pms-reference .status-grid span { color: var(--ui-muted); }
.pms-reference .status-grid b { color: var(--ui-text); }
.pms-reference .quick-grid a { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--ui-border); border-radius: 6px; text-decoration: none; color: var(--ui-text); }
.pms-reference :is(.analytics-row.primary, .analytics-row.operations, .analytics-row.records) { height: auto; min-height: 0; grid-auto-rows: minmax(270px, auto); }
.pms-reference .panel.table-card { overflow: auto; }
.pms-reference .panel.table-card table { width: 100%; }
.pms-reference .panel.table-card th { white-space: nowrap; }
.pms-reference .reference-module-records { grid-column: 1 / -1; }
.pms-reference .reference-module-records > .panel-body { overflow-x: auto; }
.pms-reference .reference-module-records .page-content { padding: 0 !important; }
.pms-reference .reference-module-records :is(.workspace-section, .workspace-table-shell) { border: 0; margin-bottom: 0; }
.pms-reference .reference-module-records > header { display: none; }
.pms-reference :is(.configuration-tile, .data-management-tile, .admin-action-grid > a) { text-decoration: none; color: var(--ui-text); }
.pms-reference .special-card a.special-link { color: var(--ui-primary-deep); text-decoration: none; }
.pms-reference .admin-action-grid > a { display: flex; align-items: center; gap: 8px; border: 1px solid var(--ui-border); border-radius: 6px; padding: 10px; }
.pms-reference :is(.admin-action-grid, .data-management-grid) > form { margin: 0; display: flex; }
.pms-reference :is(.admin-action-grid, .data-management-grid) > form > button { width: 100%; height: 100%; }
.pms-reference :is(h1, h2, h3, h4, h5, h6, small, strong, button, a) { letter-spacing: 0; }
.pms-reference:not(:has(#sidebar)) .main-content { margin-left: 0; }
@media (max-width: 1399px) {
  html:has(body.pms-workspace) { scroll-padding-top: 78px; }
  body.pms-workspace { --app-header-height: 68px; --app-content-gap: 10px; }
  .pms-workspace :is(.charts-row, .workspace-split, .detail-grid) { height: auto; min-height: 0; }
}
@media (max-width: 767px) {
  html:has(body.pms-workspace) { scroll-padding-top: 0; }
  body.pms-workspace { --app-header-height: 62px; --app-content-gap: 8px; --page-padding-x: 12px; }
  .pms-workspace .shell-header { position: relative; flex-wrap: wrap; }
  .pms-workspace .shell-actions { width: 100%; }
  .pms-workspace :is(.charts-row, .workspace-split) { grid-template-columns: minmax(0, 1fr); }
  .pms-reference .sidebar { transform: translateX(-100%); }
  .pms-reference .sidebar.mobile-open { transform: translateX(0); }
  .pms-reference .main-content { margin-left: 0 !important; }
  .pms-reference .topbar { position: sticky; }
  .pms-reference .top-actions :is(.date-block, .profile) { display: none !important; }
  .pms-reference .top-actions .shell-actions { flex-wrap: nowrap; }
  .pms-reference .title-wrap { flex: 1; }
  .pms-reference .topbar .subtitle { display: none; }
  .pms-reference .analytics-row { grid-template-columns: minmax(0, 1fr) !important; }
  .pms-reference .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pms-reference .top-actions .shell-action-secondary { display: none; }
}
