@charset "UTF-8";
/* ── Design Tokens — Attain.PropMngmt ────────────────────────────────────────
   Vendored from Web/Attain.Demos.Blazor/wwwroot/scss/abstracts/_tokens.scss.
   Brand source of truth: /home/david/Attain-Design-System/tokens/css-variables.css
   (the canonical Figma --ac-* tokens). Our --brand* family maps to the same
   #e33b25 family from those exports — keep them in sync.
   Warm-neutral palette, brand-aligned (no blue/green tints in greys).
   All text tokens target WCAG AA (4.5:1) or better on their intended bg.
   Default = LIGHT mode; dark mode opts in via [data-theme="dark"].
   ========================================================================= */
:root {
  /* Brand — fixed across modes */
  --brand: #e33b25;
  --brand-hover: #f04d38;
  --brand-subtle: rgba(227, 59, 37, 0.09);
  --brand-glow: rgba(227, 59, 37, 0.18);
  /* Text-only brand: deeper red meets AA on white */
  --brand-text: #b8301a;
  /* Surfaces — warm off-white page, pure white cards */
  --bg-root: #f5f3ee;
  --bg-base: #fdfbf6;
  --bg-raised: #ffffff;
  --bg-overlay: #f9f6f0;
  --bg-elevated: #ece7de;
  /* Text — warm near-black, AA+ on white */
  --text-primary: #1b1816;
  --text-secondary: #55504a;
  --text-muted: #7a7068;
  --text-inverse: #f4f1ec;
  /* Borders */
  --border-subtle: rgba(21, 22, 23, 0.06);
  --border-default: rgba(21, 22, 23, 0.11);
  --border-strong: rgba(21, 22, 23, 0.20);
  /* Semantic — darker variants for white backgrounds */
  --success: #2f7d4f;
  --success-subtle: rgba(47, 125, 79, 0.10);
  --warning: #a66400;
  --warning-subtle: rgba(166, 100, 0, 0.10);
  --danger: #b02a1b;
  --danger-subtle: rgba(176, 42, 27, 0.10);
  --info: #8c5a23; /* dark amber — brand guide forbids blue */
  --info-subtle: rgba(140, 90, 35, 0.10);
  /* Effects */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(21, 18, 15, 0.06);
  --shadow-md: 0 6px 18px rgba(21, 18, 15, 0.09);
  --shadow-lg: 0 14px 44px rgba(21, 18, 15, 0.14);
  --shadow-glow: 0 0 24px var(--brand-glow);
  --glass-bg: rgba(253, 251, 246, 0.82);
  --glass-border: rgba(21, 22, 23, 0.08);
  --glass-blur: blur(16px);
  /* Atmospheric gradient — subtle warm halo anchored at top of page */
  --page-atmosphere:
      radial-gradient(ellipse 90% 55% at 50% -15%, var(--brand-subtle), transparent 70%),
      radial-gradient(ellipse 60% 40% at 100% 100%, rgba(227, 59, 37, 0.03), transparent 70%);
  /* Typography scale */
  --font-heading: "Encode Sans", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  /* Layout */
  --content-max: 1280px;
  --topbar-height: 64px;
  --sidebar-width: 240px;
  /* Legacy compatibility aliases — used by demo-specific sections */
  --bg: var(--bg-root);
  --surface: var(--bg-raised);
  --text: var(--text-primary);
  --accent: var(--brand);
  --accent-hover: var(--brand-hover);
  --border: var(--border-default);
  --shadow: var(--shadow-sm);
  --radius: var(--radius-md);
  --text-muted-legacy: var(--text-secondary);
}

/* ── Dark Theme (opt-in via [data-theme="dark"]) ─────────────────────────── */
[data-theme=dark] {
  /* Brand halos are stronger on charcoal */
  --brand-subtle: rgba(227, 59, 37, 0.14);
  --brand-glow: rgba(227, 59, 37, 0.28);
  /* Softer coral reads on dark */
  --brand-text: #ff7a5c;
  /* Surfaces — warm charcoals */
  --bg-root: #0b0b0c;
  --bg-base: #131314;
  --bg-raised: #1a1a1c;
  --bg-overlay: #212123;
  --bg-elevated: #2a2a2c;
  /* Text — warm off-white, AA+ on charcoal */
  --text-primary: #f4f1ec;
  --text-secondary: #b5afa7;
  --text-muted: #8e877e;
  --text-inverse: #131314;
  /* Borders — derived from warm white */
  --border-subtle: rgba(244, 241, 236, 0.06);
  --border-default: rgba(244, 241, 236, 0.11);
  --border-strong: rgba(244, 241, 236, 0.20);
  /* Semantic — brighter variants for dark backgrounds */
  --success: #6ec488;
  --success-subtle: rgba(110, 196, 136, 0.14);
  --warning: #e8b547;
  --warning-subtle: rgba(232, 181, 71, 0.14);
  --danger: #e55c46;
  --danger-subtle: rgba(229, 92, 70, 0.14);
  --info: #c9935f; /* amber-tan — no blue */
  --info-subtle: rgba(201, 147, 95, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 14px 44px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 28px var(--brand-glow);
  --glass-bg: rgba(19, 19, 20, 0.78);
  --glass-border: rgba(244, 241, 236, 0.08);
  --page-atmosphere:
      radial-gradient(ellipse 90% 55% at 50% -15%, var(--brand-subtle), transparent 70%),
      radial-gradient(ellipse 60% 40% at 100% 100%, rgba(227, 59, 37, 0.05), transparent 70%);
}

/* ── Reset & Base ────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--page-atmosphere), var(--bg-root);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  font-size: var(--text-base);
  font-feature-settings: "ss01", "cv11"; /* Inter stylistic set for friendlier numerals */
  transition: background-color var(--duration-slow) var(--ease-out), color var(--duration-slow) var(--ease-out);
  min-height: 100vh;
}

/* Form controls don't inherit color/font from their ancestor by default —
   this makes them honor the themed body color so a <button> with a custom
   background doesn't render user-agent black text on a dark card surface. */
button, input, select, textarea {
  color: inherit;
  font: inherit;
}

::selection {
  background: var(--brand);
  color: #fff;
}

/* Focus visible — global accessibility */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Page Layout ─────────────────────────────────────────────────────────── */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top Bar ─────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  transition: background var(--duration-slow) var(--ease-out);
}

.topbar__left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.topbar__eyebrow {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
}

.topbar__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

/* Theme toggle button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: var(--text-lg);
  transition: all var(--duration-fast) var(--ease-out);
  line-height: 1;
}

.theme-toggle:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
}

:root .theme-toggle .icon-moon {
  display: inline;
}

:root .theme-toggle .icon-sun {
  display: none;
}

[data-theme=dark] .theme-toggle .icon-moon {
  display: none;
}

[data-theme=dark] .theme-toggle .icon-sun {
  display: inline;
}

/* User identity affordance */
.user-menu {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 4px 12px 4px 4px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.user-menu:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

.user-menu__avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--brand);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-xs);
}

.user-menu__email {
  color: var(--text-secondary);
}

@media (max-width: 700px) {
  .topbar {
    padding: 0 var(--space-md);
  }
  .user-menu__email {
    display: none;
  }
}
/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: #18171a;
  color: #e8e4db;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: 18px 12px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  text-decoration: none;
  color: inherit;
}

.sidebar__brand-logo {
  height: 28px;
  width: auto;
  display: block;
}

.sidebar__brand-name {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f4f1ec;
}

.sidebar__me {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__me-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: #f4f1ec;
}

.sidebar__me-tenant {
  font-size: var(--text-xs);
  color: #bbb3a6;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.sidebar__group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar__group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8a8278;
  padding: 6px 12px 4px;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: #d6d0c4;
  text-align: left;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--duration-fast), color var(--duration-fast);
}

.sidebar__link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sidebar__link.active,
.sidebar__link[aria-current=page] {
  background: var(--brand);
  color: #fff;
}

.sidebar__link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar__link.active svg {
  opacity: 1;
}

.sidebar__footer {
  margin-top: auto;
  padding: 8px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar__footer .sidebar__link {
  color: #bbb3a6;
}

.sidebar__footer .sidebar__link:hover {
  color: #fff;
}

/* Mobile collapse */
@media (max-width: 1100px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 14px;
  }
  .sidebar__brand {
    margin-right: var(--space-md);
  }
  .sidebar__me {
    display: none;
  }
  .sidebar__nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 0;
    flex: 1 1 auto;
  }
  .sidebar__group {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }
  .sidebar__group-label {
    display: none;
  }
  .sidebar__link {
    padding: 6px 10px;
    font-size: var(--text-xs);
  }
  .sidebar__footer {
    margin-top: 0;
    padding: 0;
    border-top: none;
    flex-direction: row;
    gap: 4px;
  }
}
/* ── App Shell (authenticated) ───────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--page-atmosphere), var(--bg-root);
  background-attachment: fixed;
}

.app-shell__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-shell__content {
  flex: 1;
  padding: var(--space-xl);
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
  animation: content-enter var(--duration-slow) var(--ease-out);
}

@media (max-width: 1100px) {
  .app-shell {
    flex-direction: column;
  }
  .app-shell__content {
    padding: var(--space-md);
  }
}
/* ── Auth Shell (sign-in / MFA / error / impersonate) ────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--page-atmosphere), var(--bg-root);
  background-attachment: fixed;
  padding: var(--space-xl) var(--space-md);
}

.auth-shell__card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-2xl) var(--space-xl) var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.auth-shell__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
}

.auth-shell__brand img {
  height: 32px;
  width: auto;
  display: block;
}

.auth-shell__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
  text-align: center;
}

.auth-shell__subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin: 0;
}

.auth-shell__footer {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.auth-shell__divider {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-shell__divider::before,
.auth-shell__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.auth-shell__sso-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* ── Main Content ────────────────────────────────────────────────────────── */
.content {
  flex: 1;
  padding: var(--space-xl);
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
  animation: content-enter var(--duration-slow) var(--ease-out);
}

@keyframes content-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.65rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-body);
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  background: var(--brand-hover);
  box-shadow: var(--shadow-glow), 0 2px 8px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-overlay);
  color: var(--text-primary);
  border-color: var(--border-default);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

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

.btn-danger:hover {
  filter: brightness(1.1);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-overlay);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Right-aligned action row at the bottom of forms */
.form-buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  flex-wrap: wrap;
}

.form-buttons__primary {
  order: 3;
}

.form-buttons__secondary {
  order: 2;
}

.form-buttons__destructive {
  order: 1;
  margin-right: auto;
}

@media (max-width: 700px) {
  .form-buttons {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .form-buttons__destructive {
    margin-right: 0;
  }
  .form-buttons .btn {
    width: 100%;
  }
}
/* ── Panel (surface container) ───────────────────────────────────────────── */
.panel {
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.panel + .panel {
  margin-top: var(--space-md);
}

.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin: -2px 0 0;
}

.panel__heading {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.panel__subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 4px 0 0;
}

.panel__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.panel--callout {
  background: linear-gradient(180deg, var(--brand-subtle) 0%, var(--bg-raised) 70%);
  border-color: var(--brand-subtle);
}

.panel--callout .panel__heading {
  color: var(--brand-text);
}

.panel--muted {
  background: var(--bg-overlay);
  box-shadow: none;
}

.panel--danger {
  border-color: var(--danger);
  background: var(--danger-subtle);
}

.panel--danger .panel__heading {
  color: var(--danger);
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-md);
}

/* ── Page Header ─────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.page-header__main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.page-header__main > .breadcrumbs {
  margin-bottom: 2px;
}

.page-header__eyebrow {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-text);
  font-weight: 600;
}

.page-header__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.page-header__description {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  max-width: 70ch;
  margin: 4px 0 0;
}

.page-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

@media (max-width: 700px) {
  .page-header__description {
    display: none;
  }
  .page-header__actions {
    width: 100%;
  }
  .page-header__actions .btn {
    flex: 1 1 auto;
  }
}
/* ── Breadcrumbs ─────────────────────────────────────────────────────────── */
.breadcrumbs {
  margin: 0;
  padding: 0;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.breadcrumbs__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.breadcrumbs__item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.breadcrumbs__link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--text-xs);
}

.breadcrumbs__link:hover {
  color: var(--brand-text);
}

.breadcrumbs__current {
  color: var(--brand-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.breadcrumbs__sep {
  color: var(--text-muted);
  user-select: none;
}

/* ── Data Table ──────────────────────────────────────────────────────────── */
.data-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  background: var(--bg-overlay);
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
  color: var(--text-primary);
}

.data-table tbody tr {
  transition: background var(--duration-fast) var(--ease-out);
}

.data-table tbody tr:hover {
  background: var(--bg-overlay);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table--compact th, .data-table--compact td {
  padding: 8px 10px;
  font-size: var(--text-xs);
}

.data-table--sticky thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  box-shadow: 0 1px 0 var(--border-default);
}

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

.data-table__actions {
  text-align: right;
  width: 1%;
  white-space: nowrap;
}

.data-table__actions-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.data-table__inline-form {
  display: inline-flex;
}

/* Inline `<code>` inside a table cell still styled — kept for back-compat. */
.data-table code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  background: var(--bg-overlay);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* Row hover lifts the primary action subtly */
.data-table tbody tr:hover .btn-icon {
  background: var(--bg-elevated);
}

@media (max-width: 700px) {
  .data-table th,
  .data-table td {
    padding: 8px 10px;
  }
  .data-table__actions-row {
    gap: 2px;
  }
  .data-table__actions-row .btn span:not(.icon-svg-host),
  .data-table__actions-row .btn .label-text {
    display: none;
  }
}
/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-md);
}

.form-field__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
}

.form-field__label-required {
  color: var(--danger);
  font-weight: 700;
}

.form-field__hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.form-field__validation {
  font-size: var(--text-xs);
  color: var(--danger);
  font-weight: 500;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-subtle);
}

.form-input:disabled,
.form-textarea:disabled,
.form-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.form-textarea {
  min-height: 5rem;
  line-height: 1.5;
  resize: vertical;
}

.form-select {
  appearance: auto;
}

/* Checkbox / radio */
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.form-check input {
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
}

.form-check-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

/* Inline group (radio/checkbox row) */
.form-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
}

.form-submit-feedback {
  margin-top: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.form-validation-summary {
  padding: 0.75rem 0.9rem;
  background: var(--danger-subtle);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.form-validation-summary strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--danger);
}

.form-validation-summary ul {
  margin: 0;
  padding-left: 1.1rem;
}

.form-validation-summary li + li {
  margin-top: 0.2rem;
}

.form-input[aria-required=true],
.form-select[aria-required=true],
.form-textarea[aria-required=true] {
  scroll-margin-top: calc(var(--topbar-height) + var(--space-lg));
}

/* ASP.NET Core validation classes (preserve hooks for ValidationMessage / data-val) */
.valid.modified:not([type=checkbox]) {
  border-color: var(--success);
  box-shadow: 0 0 0 3px var(--success-subtle);
}

.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-subtle);
}

.validation-message {
  color: var(--danger);
  font-size: var(--text-xs);
  margin-top: 4px;
}

/* ── Typeahead combobox ──────────────────────────────────────────────── */
.typeahead {
  position: relative;
}

.typeahead__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 18rem;
  overflow-y: auto;
}

.typeahead__option {
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  color: var(--text-primary);
}

.typeahead__option.is-active,
.typeahead__option:hover {
  background: var(--brand-subtle);
}

.typeahead__label {
  font-size: var(--text-sm);
  font-weight: 500;
}

.typeahead__sub {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.typeahead__hint {
  padding: 0.5rem 0.75rem;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ── Form Section (subdivider inside a Panel) ────────────────────────────── */
.form-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-md) 0;
}

.form-section + .form-section {
  border-top: 1px solid var(--border-subtle);
}

.form-section__header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.form-section__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.form-section__description {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.form-section__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Two-column form grid for short numeric/text fields */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
}

.form-grid > .form-field {
  margin-bottom: 0;
}

/* Help text inside forms (replaces inline <p style="…">) */
.form-help {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.form-help--muted {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.form-help a {
  color: var(--brand-text);
  text-decoration: underline;
}

/* Inline status toolbar within a form */
.form-status-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.form-status-bar__label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

/* ── Chip / Pill (status indicator) ──────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.6;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  white-space: nowrap;
}

.chip--info {
  background: var(--info-subtle);
  color: var(--info);
}

.chip--success {
  background: var(--success-subtle);
  color: var(--success);
}

.chip--warning {
  background: var(--warning-subtle);
  color: var(--warning);
}

.chip--danger {
  background: var(--danger-subtle);
  color: var(--danger);
}

.chip--muted {
  background: var(--bg-overlay);
  color: var(--text-muted);
}

.chip--brand {
  background: var(--brand-subtle);
  color: var(--brand-text);
}

/* ── Alert / Inline callout ──────────────────────────────────────────────── */
.alert {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-overlay);
  color: var(--text-primary);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.alert__icon {
  flex-shrink: 0;
  line-height: 1;
  font-size: var(--text-lg);
  display: inline-flex;
  align-items: center;
}

.alert__icon svg {
  width: 20px;
  height: 20px;
}

.alert__body {
  flex: 1;
  min-width: 0;
}

.alert__title {
  font-weight: 700;
  margin: 0 0 4px;
}

.alert__body p {
  margin: 0;
}

.alert--info {
  background: var(--info-subtle);
  border-color: var(--info);
  color: var(--text-primary);
}

.alert--info .alert__icon {
  color: var(--info);
}

.alert--success {
  background: var(--success-subtle);
  border-color: var(--success);
  color: var(--text-primary);
}

.alert--success .alert__icon {
  color: var(--success);
}

.alert--warning {
  background: var(--warning-subtle);
  border-color: var(--warning);
  color: var(--text-primary);
}

.alert--warning .alert__icon {
  color: var(--warning);
}

.alert--danger {
  background: var(--danger-subtle);
  border-color: var(--danger);
  color: var(--text-primary);
}

.alert--danger .alert__icon {
  color: var(--danger);
}

/* ── Toast / Notification host ───────────────────────────────────────────────
   Fixed-position stack of transient messages anchored to the top-right on
   desktop, full-width along the top on mobile. Each toast wraps a shared
   <Alert> so the palette stays in sync with inline alerts.
   ========================================================================= */
.toast-host {
  position: fixed;
  top: var(--space-md);
  right: var(--space-md);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: min(28rem, 100vw - var(--space-xl));
  pointer-events: none;
}

.toast {
  position: relative;
  pointer-events: auto;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-md);
  animation: toast-slide-in var(--duration-normal) var(--ease-out);
}

.toast__alert .alert {
  padding-right: calc(var(--space-lg) + 24px);
}

.toast__dismiss {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}

.toast__dismiss:hover,
.toast__dismiss:focus-visible {
  background: var(--border-subtle);
  color: var(--text-primary);
  outline: none;
}

@keyframes toast-slide-in {
  from {
    transform: translateY(-8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@media (max-width: 640px) {
  .toast-host {
    top: var(--space-sm);
    right: var(--space-sm);
    left: var(--space-sm);
    width: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
  }
}
/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.empty-state__icon {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  opacity: 0.5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.empty-state__icon svg {
  width: 100%;
  height: 100%;
}

.empty-state__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.empty-state__description {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 50ch;
}

.empty-state__actions {
  margin-top: var(--space-sm);
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Loading State + Spinner ─────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-default);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-2xl);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ── Error State ─────────────────────────────────────────────────────────── */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm);
  padding: var(--space-2xl) var(--space-lg);
  background: var(--bg-raised);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
}

.error-state__icon {
  color: var(--danger);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.error-state__icon svg {
  width: 100%;
  height: 100%;
}

.error-state__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--danger);
}

.error-state__message {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 60ch;
}

.error-state__actions {
  margin-top: var(--space-sm);
}

/* ── Blazor circuit error bar ───────────────────────────────────────────────
   Blazor toggles this element to display:block when the circuit/client fails.
   Keep it hidden by default; otherwise the framework's fallback message appears
   on every healthy page and looks like a real application error.
*/
#blazor-error-ui {
  display: none;
  position: fixed;
  inset-inline: var(--space-md);
  bottom: var(--space-md);
  z-index: 10000;
  padding: 0.85rem 3.25rem 0.85rem 1rem;
  color: var(--text-primary);
  background: var(--danger-subtle);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
}

#blazor-error-ui .reload {
  margin-inline-start: var(--space-sm);
  color: var(--danger);
  font-weight: 700;
}

#blazor-error-ui .dismiss {
  position: absolute;
  inset-block-start: 0.45rem;
  inset-inline-end: 0.65rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--text-lg);
  line-height: 1;
  text-decoration: none;
}

#blazor-error-ui .dismiss:hover {
  color: var(--text-primary);
}

/* ── KPI Grid ────────────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  gap: 1px;
  background: var(--border-default);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
}

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

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

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

.kpi {
  background: var(--bg-raised);
  padding: 14px 18px;
  border: none;
  text-align: left;
  font-family: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi--clickable {
  cursor: pointer;
  transition: background var(--duration-fast);
}

.kpi--clickable:hover {
  background: var(--bg-overlay);
}

.kpi__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.kpi__value {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
}

.kpi__value--warn {
  color: var(--warning);
}

.kpi__value--bad {
  color: var(--danger);
}

.kpi__value--good {
  color: var(--success);
}

@media (max-width: 1100px) {
  .kpi-grid--4, .kpi-grid--5 {
    grid-template-columns: repeat(2, 1fr);
  }
  .kpi-grid--3 {
    grid-template-columns: 1fr;
  }
}
/* ── Metric Bar ──────────────────────────────────────────────────────────── */
/* Inline list of compact stats — sits under page header / above content. */
.metric-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  list-style: none;
}

.metric-bar__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px var(--space-lg) 2px 0;
  margin-right: var(--space-lg);
  border-right: 1px solid var(--border-subtle);
  min-width: 0;
}

.metric-bar__item:last-child {
  margin-right: 0;
  padding-right: 0;
  border-right: none;
}

.metric-bar__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin: 0;
}

.metric-bar__value {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.metric-bar__value--good {
  color: var(--success);
}

.metric-bar__value--warn {
  color: var(--warning);
}

.metric-bar__value--bad {
  color: var(--danger);
}

.metric-bar__value--muted {
  color: var(--text-muted);
}

@media (max-width: 700px) {
  .metric-bar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    padding: var(--space-md);
  }
  .metric-bar__item {
    padding: 0;
    margin: 0;
    border-right: none;
  }
}
/* ── Toolbar (search + filters + actions row) ────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.toolbar__search {
  flex: 1 1 220px;
  min-width: 200px;
  display: flex;
}

.toolbar__filters,
.toolbar__main {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.toolbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: auto;
}

@media (max-width: 700px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar__search {
    width: 100%;
  }
  .toolbar__actions {
    margin-left: 0;
  }
  .toolbar__actions .btn {
    flex: 1 1 auto;
  }
}
/* ── Search box ──────────────────────────────────────────────────────────── */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.search-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-subtle);
}

.search-box__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 0 10px;
  color: var(--text-muted);
}

.search-box__input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: transparent;
  border: 0;
  outline: 0;
}

.search-box__input::placeholder {
  color: var(--text-muted);
}

/* ── Filter chip ─────────────────────────────────────────────────────────── */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  font-family: inherit;
}

.filter-chip:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.filter-chip--on {
  background: var(--brand-subtle);
  border-color: var(--brand);
  color: var(--brand-text);
}

.filter-chip__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 0 5px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.filter-chip--on .filter-chip__count {
  background: var(--brand);
  color: #fff;
}

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

/* ── Summary card (entity context: building, unit, tenant) ───────────────── */
.summary-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
  padding: var(--space-lg);
  background: linear-gradient(180deg, var(--brand-subtle) 0%, transparent 80%), var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.summary-card__main {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
  flex: 1;
}

.summary-card__eyebrow {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-text);
  font-weight: 600;
}

.summary-card__heading-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.summary-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--brand-subtle);
  color: var(--brand-text);
  flex-shrink: 0;
}

.summary-card__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.summary-card__status {
  display: inline-flex;
  align-items: center;
}

.summary-card__subtitle {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin: 0;
}

.summary-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  margin-top: var(--space-xs);
}

.summary-card__body {
  margin-top: var(--space-sm);
}

.summary-card__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

@media (max-width: 700px) {
  .summary-card {
    flex-direction: column;
    align-items: stretch;
  }
  .summary-card__actions {
    width: 100%;
  }
  .summary-card__actions .btn {
    flex: 1 1 auto;
  }
}
/* ── Description list (key/value metadata) ───────────────────────────────── */
.description-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md) var(--space-lg);
  margin: 0;
}

.description-list__row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.description-list__term {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin: 0;
}

.description-list__detail {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-primary);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.description-list--inline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
}

.description-list--inline .description-list__row {
  flex-direction: row;
  align-items: baseline;
  gap: var(--space-xs);
}

.description-list--inline .description-list__detail::after {
  content: "";
}

/* ── Timeline (notes feed, change history) ───────────────────────────────── */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.timeline-entry {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  position: relative;
}

.timeline-entry + .timeline-entry {
  border-top: 1px solid var(--border-subtle);
}

.timeline-entry__rail {
  display: flex;
  justify-content: center;
  position: relative;
}

.timeline-entry__rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--border-subtle);
  transform: translateX(-50%);
}

.timeline-entry:first-child .timeline-entry__rail::before {
  top: 14px;
}

.timeline-entry:last-child .timeline-entry__rail::before {
  bottom: calc(100% - 14px);
}

.timeline:has(.timeline-entry:only-child) .timeline-entry__rail::before {
  display: none;
}

.timeline-entry__marker {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  margin-top: 8px;
  border-radius: var(--radius-full);
  background: var(--bg-raised);
  border: 2px solid var(--border-strong);
  box-shadow: 0 0 0 3px var(--bg-base);
}

.timeline-entry__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.timeline-entry__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.timeline-entry__eyebrow {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.timeline-entry__title {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-entry__status {
  display: inline-flex;
  align-items: center;
}

.timeline-entry__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.timeline-entry:hover .timeline-entry__actions,
.timeline-entry:focus-within .timeline-entry__actions {
  opacity: 1;
}

.timeline-entry__content {
  color: var(--text-primary);
  font-size: var(--text-sm);
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.timeline-entry__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: var(--text-xs);
  margin-top: var(--space-xs);
}

.timeline-entry--brand .timeline-entry__marker {
  border-color: var(--brand);
  background: var(--brand-subtle);
}

.timeline-entry--success .timeline-entry__marker {
  border-color: var(--success);
  background: var(--success-subtle);
}

.timeline-entry--warning .timeline-entry__marker {
  border-color: var(--warning);
  background: var(--warning-subtle);
}

.timeline-entry--danger .timeline-entry__marker {
  border-color: var(--danger);
  background: var(--danger-subtle);
}

.timeline-entry--muted .timeline-entry__marker {
  border-color: var(--border-default);
  background: var(--bg-overlay);
}

.timeline-entry--highlight {
  background: var(--brand-subtle);
  border-radius: var(--radius-md);
  padding-left: var(--space-md);
  padding-right: var(--space-md);
  margin-left: -var(--space-md);
  margin-right: -var(--space-md);
}

/* ── Empty state for timeline-bearing panels ─────────────────────────────── */
.timeline-empty {
  padding: var(--space-lg) 0;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-style: italic;
}

/* ── Actor badge (note/revision attribution) ─────────────────────────────── */
.actor-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.actor-badge__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.actor-badge__label {
  line-height: 1;
}

/* ── Impersonation Banner ────────────────────────────────────────────────── */
.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 8px var(--space-lg);
  background: var(--brand);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 500;
}

.impersonation-banner a {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-xs);
  transition: background var(--duration-fast);
}

.impersonation-banner a:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* ── EditForm Validation Summary ─────────────────────────────────────────── */
.validation-errors {
  background: var(--danger-subtle);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  list-style: none;
  color: var(--danger);
}

.validation-errors li {
  color: var(--danger);
  font-size: var(--text-sm);
  margin-bottom: 4px;
}

.validation-errors li:last-child {
  margin-bottom: 0;
}

/* ── Misc utility classes (small, reusable) ──────────────────────────────── */
/* Empty value placeholder — use instead of inline-styled "—". */
.empty-value {
  color: var(--text-muted);
  font-size: 0.95em;
  font-weight: 400;
  user-select: none;
}

/* Inline mono code chip — short identifiers (building/tenant codes, etc). */
.code-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  line-height: 1.5;
  letter-spacing: 0.02em;
}

/* Two-row table cell: primary line + secondary muted line. */
.row-primary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.row-primary__title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--text-sm);
  line-height: 1.3;
  word-wrap: break-word;
}

.row-primary__sub {
  color: var(--text-muted);
  font-size: var(--text-xs);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Compact horizontal chip group (for type tags, etc). */
.chip-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

/* Tabular metadata strip (e.g. unit numeric attributes inline). */
.metric-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  align-items: baseline;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.metric-list__item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.metric-list__label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.metric-list__value {
  color: var(--text-primary);
  font-weight: 600;
}

/* Two-column layout (form alongside list/table) */
.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: var(--space-lg);
  align-items: start;
}

@media (max-width: 1024px) {
  .split-layout {
    grid-template-columns: 1fr;
  }
}
/* Color swatch (branding preview) */
.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-xs);
}

.swatch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 4px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-overlay);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.swatch__dot {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  flex-shrink: 0;
}

.swatch__label {
  font-family: var(--font-mono);
}

/* Overflow menu */
.overflow-menu {
  position: relative;
  display: inline-block;
}

.overflow-menu > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-out);
}

.overflow-menu > summary::-webkit-details-marker {
  display: none;
}

.overflow-menu > summary:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
}

.overflow-menu[open] > summary {
  background: var(--bg-overlay);
  color: var(--text-primary);
}

.overflow-menu__panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  min-width: 180px;
  padding: 4px;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.overflow-menu__panel .btn,
.overflow-menu__panel a,
.overflow-menu__panel button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 6px 10px;
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease-out);
  box-shadow: none;
  transform: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.overflow-menu__panel .btn:hover,
.overflow-menu__panel a:hover,
.overflow-menu__panel button:hover {
  background: var(--bg-overlay);
  box-shadow: none;
  transform: none;
}

.overflow-menu__panel .btn-danger,
.overflow-menu__panel button.danger,
.overflow-menu__panel .menu-danger {
  color: var(--danger);
  background: transparent;
}

.overflow-menu__panel .btn-danger:hover,
.overflow-menu__panel button.danger:hover,
.overflow-menu__panel .menu-danger:hover {
  background: var(--danger-subtle);
  color: var(--danger);
}

/* Icon-only ghost button (table action collapse) */
.btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
  border-color: var(--border-default);
  box-shadow: none;
  transform: none;
}

/* ===== Responsive Breakpoints ===== */
/* Tablet */
@media (max-width: 1024px) {
  .demo-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
  .fr-charts-row {
    grid-template-columns: 1fr;
  }
  .fr-bottom-grid {
    grid-template-columns: 1fr;
  }
  .ed-main {
    grid-template-columns: 1fr;
  }
  .ed-kpi-strip {
    grid-template-columns: repeat(3, 1fr);
  }
  .ed-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ed-detail-grid {
    grid-template-columns: 1fr;
  }
  .cs-panes--with-rail {
    grid-template-columns: 1fr 1fr;
  }
  .cs-rail {
    display: none;
  }
}
/* Mobile */
@media (max-width: 768px) {
  :root {
    --topbar-height: 56px;
  }
  .top-bar {
    padding: 0 var(--space-md);
  }
  .top-bar .brand-logo {
    height: 24px;
  }
  .content {
    padding: var(--space-md);
  }
  .catalog-header h1 {
    font-size: var(--text-2xl);
  }
  .demo-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  .demo-detail {
    max-width: 100%;
  }
  .password-prompt {
    margin: var(--space-xl) var(--space-md);
    padding: var(--space-lg);
  }
  .wizard-steps {
    gap: var(--space-xs);
  }
  .wizard-step-indicator {
    padding: 0.3rem 0.6rem;
    font-size: 0.65rem;
  }
  .settings-layout {
    grid-template-columns: 1fr;
  }
  .field-sidebar {
    position: static;
    max-height: none;
  }
  .fr-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .fr-create-panel,
  .fr-detail-panel {
    width: 100%;
    max-width: 100vw;
  }
  .ed-kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .ed-card-grid {
    grid-template-columns: 1fr;
  }
  .cs-panes {
    grid-template-columns: 1fr;
  }
  .cs-header {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .cs-header__center,
  .cs-header__right {
    justify-self: start;
  }
  .kb-msg {
    max-width: 90%;
  }
}
/* Small mobile */
@media (max-width: 480px) {
  .fr-kpi-row {
    grid-template-columns: 1fr;
  }
  .ed-kpi-strip {
    grid-template-columns: 1fr;
  }
  .font-picker {
    flex-direction: column;
  }
}
/* ===== Accessibility ===== */
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .demo-card:hover {
    transform: none;
  }
  .btn-primary:hover {
    transform: none;
  }
  html {
    scroll-behavior: auto;
  }
}
/* High contrast */
@media (forced-colors: active) {
  .demo-card {
    border: 2px solid CanvasText;
  }
  .btn-primary {
    border: 2px solid ButtonText;
  }
  .wizard-step-indicator.active {
    border: 2px solid Highlight;
  }
}
/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

/* ============================================================================
   ATTAIN PROPMNGMT — Design System
   ============================================================================
   Light-first design with dark mode via [data-theme="dark"].
   Brand accent: #e33b25 (Attain red).
   Fonts: Encode Sans (headings), Inter (body), JetBrains Mono (code).

   Compiled by sass (MSBuild BeforeBuild target) to wwwroot/css/app.css.
   Do NOT edit wwwroot/css/app.css directly — edit the SCSS partials.

   The compiled app.css IS checked into git, so CI and any machine
   without sass on PATH will still build — we just skip the compile
   with a warning.
   ========================================================================= */
