:root {
  color-scheme: light;
  --z-primary: #136f63;
  --z-primary-hover: #0f5b52;
  --z-primary-soft: #e8fbf6;
  --z-background: #f4f7fb;
  --z-surface: #ffffff;
  --z-surface-alt: #f8fbff;
  --z-surface-raised: #ffffff;
  --z-surface-subtle: #eef5fb;
  --z-sidebar-bg: #eef7fb;
  --z-sidebar-text: #172033;
  --z-sidebar-muted: #607089;
  --z-sidebar-active: #d9eff8;
  --z-sidebar-hover: rgba(19, 111, 99, .08);
  --z-sidebar-border: #d7e7f0;
  --z-sidebar-card: rgba(255, 255, 255, .72);
  --z-text: #142033;
  --z-text-primary: #142033;
  --z-text-secondary: #40506a;
  --z-text-muted: #64748b;
  --z-border: #d7deea;
  --z-border-strong: #b8c4d6;
  --z-focus-ring: color-mix(in srgb, var(--z-primary) 30%, transparent);
  --z-success: #0f766e;
  --z-warning: #b7791f;
  --z-danger: #b42318;
  --z-info: #1677ff;
  --z-radius-sm: 7px;
  --z-radius-md: 10px;
  --z-radius-lg: 18px;
  --z-radius-xl: 24px;
  --z-control-sm: 34px;
  --z-control-md: 40px;
  --z-control-lg: 46px;
  --z-icon-sm: 16px;
  --z-icon-md: 20px;
  --z-icon-lg: 24px;
  --z-transition-fast: 140ms ease;
  --z-transition-base: 220ms ease;
  --z-shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --z-shadow-md: 0 18px 48px rgba(15, 23, 42, .12);
  --z-space-1: 4px;
  --z-space-2: 8px;
  --z-space-3: 12px;
  --z-space-4: 16px;
  --z-space-5: 20px;
  --z-space-6: 24px;
  --z-space-7: 32px;
  --z-font-size-xs: .75rem;
  --z-font-size-sm: .875rem;
  --z-font-size-md: 1rem;
  --z-font-size-lg: 1.125rem;
  --z-font-size-xl: 1.5rem;
  --z-font: Inter, "Segoe UI", Arial, sans-serif;
  --z-page-max: 1480px;
  --z-page-max-wide: 1720px;
  --z-drawer-small: 400px;
  --z-drawer-medium: 480px;
  --z-drawer-medium-wide: 560px;
  --z-drawer-large: 820px;
}

:root[data-z-theme="dark"] {
  color-scheme: dark;
  --z-primary: #2dd4bf;
  --z-primary-hover: #5eead4;
  --z-primary-soft: rgba(45, 212, 191, .12);
  --z-background: #0b1220;
  --z-surface: #111c2f;
  --z-surface-alt: #152238;
  --z-surface-raised: #17243a;
  --z-surface-subtle: #0f1a2c;
  --z-sidebar-bg: #07111f;
  --z-sidebar-text: #dbeafe;
  --z-sidebar-muted: #9fb0c8;
  --z-sidebar-active: #172a46;
  --z-sidebar-hover: rgba(255, 255, 255, .08);
  --z-sidebar-border: rgba(255, 255, 255, .1);
  --z-sidebar-card: rgba(255, 255, 255, .07);
  --z-text: #edf4ff;
  --z-text-primary: #edf4ff;
  --z-text-secondary: #c7d3e6;
  --z-text-muted: #9fb0c8;
  --z-border: #26364e;
  --z-border-strong: #3a4f6f;
  --z-focus-ring: color-mix(in srgb, var(--z-primary) 34%, transparent);
  --z-success: #2dd4bf;
  --z-warning: #f59e0b;
  --z-danger: #fb7185;
  --z-info: #60a5fa;
  --z-shadow-sm: 0 1px 2px rgba(0, 0, 0, .25);
  --z-shadow-md: 0 18px 52px rgba(0, 0, 0, .32);
}

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

html, body {
  min-height: 100%;
  margin: 0;
  background: var(--z-background);
  color: var(--z-text);
  font-family: var(--z-font);
  overflow-x: clip;
}
body { min-width: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--z-primary); }
:focus-visible {
  outline: 3px solid var(--z-focus-ring);
  outline-offset: 3px;
}
.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;
}

.z-app-shell, .zn-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 100vh;
}
.z-sidebar, .zn-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--z-space-4);
  overflow: hidden;
  padding: 22px 18px;
  color: var(--z-sidebar-text);
  background:
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--z-primary) 14%, transparent), transparent 18rem),
    var(--z-sidebar-bg);
}
.z-brand-block, .zn-brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
}
.z-brand-mark, .zn-brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--z-primary), var(--z-info));
  box-shadow: 0 14px 30px rgba(0, 0, 0, .18);
  overflow: hidden;
  padding: 0 4px;
  font-size: .92rem;
  line-height: 1;
  text-align: center;
  font-weight: 950;
}
.z-brand-block strong, .zn-brand strong { display: block; color: var(--z-sidebar-text); }
.z-brand-block small, .zn-brand small { display: block; color: var(--z-sidebar-muted); margin-top: 2px; }
.z-workspace-card, .z-context-card {
  flex: 0 0 auto;
  display: grid;
  gap: 4px;
  padding: 14px 15px;
  border: 1px solid var(--z-sidebar-border);
  border-radius: var(--z-radius-lg);
  background:
    linear-gradient(135deg, var(--z-sidebar-card), color-mix(in srgb, var(--z-sidebar-card) 55%, transparent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}
.z-workspace-card span, .z-sidebar-footer, .zn-nav-group {
  color: var(--z-sidebar-muted);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.z-workspace-card strong { color: var(--z-sidebar-text); }
.z-menu-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--z-sidebar-border);
  border-radius: 13px;
  color: var(--z-sidebar-text);
  background: var(--z-sidebar-card);
  padding: 0 13px;
}
.z-nav, .zn-nav {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding-inline-end: 3px;
}
.zn-nav-group {
  margin: 10px 4px 2px;
}
.zn-nav-group:first-child {
  margin-top: 0;
}
.z-nav a, .zn-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--z-sidebar-text);
  text-decoration: none;
  font-weight: 720;
}
.z-nav a::before, .zn-nav-link::before {
  content: "";
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 0;
  border: 0;
  background: currentColor;
  opacity: .66;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5.5h6v6H4zM14 5.5h6v6h-6zM4 15.5h6v3H4zM14 15.5h6v3h-6z'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
}
.z-nav a[href*="room"]::before,
.zn-nav-link[href*="room"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V5h16v15M4 16h16M8 16v-5h8v5M7 8h.01'/%3E%3C/svg%3E");
}
.z-nav a[href*="propert"]::before,
.zn-nav-link[href*="propert"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 21V8l8-5 8 5v13M8 21v-7h8v7M8 9h.01M12 9h.01M16 9h.01'/%3E%3C/svg%3E");
}
.z-nav a[href*="system"]::before,
.zn-nav-link[href*="system"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .34 1.88l.06.06-2.83 2.83-.06-.06A1.7 1.7 0 0 0 15 19.4a1.7 1.7 0 0 0-1 .6 1.7 1.7 0 0 0-.4 1.1V21H10.4v-.1A1.7 1.7 0 0 0 9 19.4a1.7 1.7 0 0 0-1.88.34l-.06.06-2.83-2.83.06-.06A1.7 1.7 0 0 0 4.6 15a1.7 1.7 0 0 0-1.6-1H3v-4h.1A1.7 1.7 0 0 0 4.6 9a1.7 1.7 0 0 0-.34-1.88l-.06-.06 2.83-2.83.06.06A1.7 1.7 0 0 0 9 4.6a1.7 1.7 0 0 0 1-1.6V3h4v.1A1.7 1.7 0 0 0 15 4.6'/%3E%3C/svg%3E");
}
.z-nav a.active, .z-nav a:hover, .zn-nav-link.active, .zn-nav-link:hover {
  color: var(--z-sidebar-text);
  background: var(--z-sidebar-active);
}
.z-sidebar-footer { flex: 0 0 auto; margin-top: auto; padding-top: 12px; }
.z-sidebar-footer span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--z-sidebar-border);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--z-sidebar-card);
}
.z-main, .zn-main { min-width: 0; }
.z-topbar, .zn-topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 26px;
  border-bottom: 1px solid var(--z-border);
  background: color-mix(in srgb, var(--z-surface) 92%, transparent);
  backdrop-filter: blur(16px);
}
.z-topbar-title, .zn-topbar > div:first-child { display: grid; gap: 2px; }
.z-topbar-title span, .zn-breadcrumb, .zn-runtime {
  color: var(--z-text-muted);
  font-size: .82rem;
}
.z-topbar-title strong { font-size: 1.05rem; }
.z-topbar-actions, .zn-topbar-actions, .zn-user-menu, .z-user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}
.z-topbar-actions .z-theme-selector {
  width: auto;
}
.z-user-menu, .zn-user-menu {
  min-height: 44px;
  padding: 5px 6px 5px 7px;
  border: 1px solid var(--z-border);
  border-radius: 999px;
  background: var(--z-surface);
  box-shadow: var(--z-shadow-sm);
}
.z-profile-control {
  position: relative;
}
.z-profile-control > .z-user-menu {
  border-radius: 999px;
  cursor: pointer;
}
.z-user-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--z-primary), var(--z-info));
  font-size: .78rem;
  font-weight: 950;
}
.z-user-summary {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.z-user-summary strong {
  max-width: 230px;
  overflow: hidden;
  color: var(--z-text-primary);
  font-size: .88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.z-user-summary small {
  color: var(--z-text-muted);
  font-size: .72rem;
  font-weight: 760;
}
.z-profile-caret {
  color: var(--z-text-muted);
  font-size: .78rem;
  font-weight: 900;
  padding-inline: 4px;
}
.z-profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: 250px;
  display: none;
  padding: 8px;
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-lg);
  background: var(--z-surface);
  box-shadow: var(--z-shadow-md);
}
.z-profile-open .z-profile-menu {
  display: grid;
  gap: 4px;
}
.z-profile-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--z-border);
  margin-bottom: 4px;
}
.z-profile-menu-head strong,
.z-profile-menu-head small {
  display: block;
}
.z-profile-menu-head small {
  color: var(--z-text-muted);
}
.z-profile-menu a,
.z-profile-menu button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: var(--z-radius-md);
  background: transparent;
  color: var(--z-text);
  padding: 0 10px;
  text-align: left;
  text-decoration: none;
  font-weight: 760;
}
.z-profile-menu a:hover,
.z-profile-menu button:hover {
  background: var(--z-surface-alt);
}
.z-profile-menu form {
  margin: 0;
}
.z-topbar-chip,
.zn-runtime {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--z-border);
  border-radius: 999px;
  background: var(--z-surface);
  color: var(--z-text-secondary);
  padding: 0 12px;
  font-size: .82rem;
  font-weight: 820;
}
.z-user-menu form, .zn-user-menu form { margin: 0; }
.z-icon-button, .zn-icon-action {
  min-height: 36px;
  border: 1px solid var(--z-border);
  border-radius: 999px;
  color: var(--z-text);
  background: var(--z-surface);
  padding: 0 12px;
  text-decoration: none;
}
.z-content, .zn-content { padding: 24px; }

.z-theme-selector {
  position: relative;
  display: inline-flex;
}
.z-theme-trigger {
  width: var(--z-control-md);
  min-width: var(--z-control-md);
  padding: 0;
}
.z-icon-theme {
  display: block;
  width: var(--z-icon-md);
  height: var(--z-icon-md);
  margin: auto;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: inset -6px -4px 0 -3px currentColor;
}
.z-theme-menu {
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 40;
  display: none;
  min-width: 150px;
  padding: 6px;
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-md);
  background: var(--z-surface-raised);
  box-shadow: var(--z-shadow-md);
}
.z-theme-open .z-theme-menu { display: grid; gap: 2px; }
.z-theme-menu button {
  min-height: 36px;
  border: 0;
  border-radius: var(--z-radius-sm);
  color: var(--z-text-muted);
  background: transparent;
  padding: 0 12px;
  text-align: start;
  font-size: .82rem;
  font-weight: 850;
}
:root[data-z-theme-mode="light"] .z-theme-selector [data-theme-option="light"],
:root[data-z-theme-mode="dark"] .z-theme-selector [data-theme-option="dark"],
:root[data-z-theme-mode="auto"] .z-theme-selector [data-theme-option="auto"] {
  color: var(--z-primary);
  background: var(--z-primary-soft);
}

.z-page-header, .zn-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.z-page-header h1, .zn-page-head h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  letter-spacing: -.02em;
}
.z-page-header p, .zn-page-head p { margin: 6px 0 0; color: var(--z-text-muted); }
.z-page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--z-space-2);
  min-width: 0;
}
.z-page-actions > * { flex: 0 0 auto; }
.z-eyebrow, .zn-eyebrow {
  margin: 0 0 6px;
  color: var(--z-primary);
  font-size: .76rem;
  font-weight: 950;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.z-dashboard, .zn-dashboard { display: grid; gap: 20px; }
.z-dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--z-border);
  border-radius: 24px;
  background:
    radial-gradient(circle at 82% 16%, color-mix(in srgb, var(--z-primary) 18%, transparent), transparent 22rem),
    linear-gradient(135deg, var(--z-surface), var(--z-surface-alt));
  box-shadow: var(--z-shadow-sm);
}
.z-dashboard-hero span { color: var(--z-primary); font-weight: 950; letter-spacing: .09em; text-transform: uppercase; font-size: .76rem; }
.z-dashboard-hero h1 { margin: 8px 0 0; font-size: clamp(1.9rem, 3vw, 2.55rem); line-height: 1.05; }
.z-dashboard-hero p { max-width: 720px; margin: 10px 0 0; color: var(--z-text-muted); line-height: 1.65; }
.z-dashboard-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.z-hero-meta {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--z-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--z-surface-raised) 90%, transparent);
  color: var(--z-text-secondary) !important;
  padding: 0 11px;
  font-size: .78rem !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  box-shadow: var(--z-shadow-sm);
}
.zn-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.zn-kpi-card, .zn-dashboard-panel, .z-card, .z-empty-state {
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-lg);
  background: var(--z-surface);
  box-shadow: var(--z-shadow-sm);
}
.zn-kpi-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  min-height: 128px;
}
.z-kpi-icon,
.z-action-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: var(--z-primary);
  background: var(--z-primary-soft);
  font-size: .9rem;
  font-weight: 950;
}
.z-kpi-icon::before {
  font-size: 1.05rem;
  line-height: 1;
}
.z-kpi-icon-records::before { content: "▦"; }
.z-kpi-icon-users::before { content: "◌"; }
.z-kpi-icon-modules::before { content: "◈"; }
.z-kpi-icon-pending::before { content: "!"; }
.z-kpi-body { min-width: 0; }
.zn-kpi-card:not(:has(.z-kpi-icon)) {
  grid-template-columns: minmax(0, 1fr);
}
.zn-kpi-card p, .zn-widget-list span, .zn-quick-action span { margin: 0; color: var(--z-text-muted); }
.zn-kpi-card strong { display: block; margin-top: 8px; font-size: 2.25rem; line-height: 1; }
.z-kpi-trend, .zn-dashboard-panel header span {
  color: var(--z-primary);
  font-size: .82rem;
  font-weight: 850;
}
.z-kpi-trend { display: block; margin-top: 12px; }
.zn-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
}
.zn-dashboard-panel { display: grid; gap: 14px; padding: 18px; }
.zn-dashboard-panel header, .zn-page-head, .zn-grid-toolbar, .zn-pager, .zn-drawer-head, .zn-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.zn-dashboard-panel h2 { margin: 0; font-size: 1rem; }
.zn-quick-actions, .zn-widget-list { display: grid; gap: 10px; }
.zn-quick-action {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-md);
  background: var(--z-surface-alt);
  color: var(--z-text);
  text-decoration: none;
}
.zn-quick-action > span:last-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.zn-quick-action strong {
  color: var(--z-text-primary);
}
.zn-widget-list { margin: 0; padding: 0; list-style: none; }
.zn-widget-list li { display: grid; gap: 3px; padding-bottom: 10px; border-bottom: 1px solid var(--z-border); }
.zn-chart-placeholder {
  min-height: 220px;
  display: flex;
  align-items: end;
  gap: 12px;
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-lg);
  background: linear-gradient(180deg, var(--z-surface), var(--z-surface-alt));
  padding: 18px;
}
.zn-chart-placeholder span { flex: 1; min-height: 36px; border-radius: 8px 8px 0 0; background: var(--z-primary); }

.zn-crud { display: grid; gap: 14px; }
.z-app-shell:has(.zn-crud-editor-page) {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.z-app-shell:has(.zn-crud-editor-page) .z-main {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}
.z-app-shell:has(.zn-crud-editor-page) .z-content {
  min-height: 0;
  display: flex;
  overflow: hidden;
  padding-block: 6px 0;
}
.zn-crud-editor-page {
  min-width: 0;
  min-height: 0;
  flex: 1;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}
.zn-crud-editor-page .z-breadcrumbs { min-height: 20px; font-size: .8rem; }
/* Keep the current accessible heading and legacy compiled FullPage header
   available to assistive technology without consuming visual layout space. */
.zn-crud-editor-page > h1.sr-only,
.zn-crud-editor-page > .z-page-header {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.zn-crud-editor-surface { min-width: 0; min-height: 0; }
.zn-crud-editor-surface > .z-surface { height: 100%; overflow: hidden; padding: 0; }
.zn-crud-editor-form {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
}
.zn-crud-editor-content {
  min-height: 0;
  overflow: auto;
  padding: 0 10px 10px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}
.zn-form-actions--page {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 9px 14px;
  border-top: 1px solid var(--z-border);
  background: var(--z-surface);
  box-shadow: 0 -10px 24px rgba(15, 23, 42, .06);
}
.zn-crud-editor-page .zn-detail-table { min-width: 720px; }
.zn-crud-editor-page .zn-detail-table-wrap--auto {
  max-height: none;
  overflow-x: auto;
  overflow-y: clip;
}
.zn-crud-editor-page .zn-detail-table-wrap--scroll {
  max-height: min(360px, 45vh);
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.zn-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.zn-detail-table th.zn-numeric,
.zn-detail-table td.zn-numeric,
.zn-detail-table .zn-number-input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.zn-detail-add,
.zn-detail-delete { white-space: nowrap; }
.zn-detail-add {
  display: inline-flex;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  vertical-align: middle;
}
.zn-detail-add .zn-row-action-icon {
  display: block;
  width: 19px;
  height: 19px;
  margin: 0;
}
.zn-detail-table th,
.zn-detail-table td { padding: 7px 8px; }
.zn-detail-table .zn-detail-data-cell { min-width: 0; }
.zn-detail-table .zn-detail-actions {
  width: 1%;
  min-width: 52px;
  padding-inline: 7px;
  white-space: nowrap;
  text-align: center;
}
.zn-detail-table .zn-detail-actions .zn-detail-delete {
  display: inline-grid;
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  place-items: center;
  padding: 0;
}
.zn-crud-editor-page .zn-form { align-items: start; gap: 7px 10px; margin-top: 7px; }
.zn-crud-editor-page .zn-field { align-content: start; gap: 3px; font-size: .84rem; }
.zn-crud-editor-page .zn-tab-panel,
.zn-crud-editor-page .zn-section,
.zn-crud-editor-page .zn-group,
.zn-crud-editor-page .zn-detail { gap: 7px; margin-top: 7px; padding: 10px 12px; }
.zn-crud-editor-page .zn-section h4,
.zn-crud-editor-page .zn-group h4,
.zn-crud-editor-page .zn-tab-panel h3,
.zn-crud-editor-page .zn-detail h3 { margin-block: 0 2px; }
.zn-crud-editor-page .zn-input { min-height: 36px; padding: 6px 9px; }
.zn-crud-editor-page .zn-textarea { min-height: 72px; }
.zn-crud-editor-page .zn-lookup { gap: 4px 6px; }
.zn-crud-editor-page .zn-lookup-clear { min-height: 36px; }
.zn-crud-editor-page .zn-check-list { gap: 6px; padding: 8px 10px; }
.zn-crud-editor-page .zn-upload { gap: 6px; padding: 8px; }
.zn-crud-editor-page .zn-upload-dropzone { min-height: 54px; }
.zn-grid-toolbar { justify-content: flex-start; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--z-border); border-radius: var(--z-radius-lg); background: var(--z-surface); }
.zn-input, .z-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-md);
  background: var(--z-surface);
  color: var(--z-text);
  padding: 10px 12px;
}
.zn-input:not(:disabled):not([readonly]):focus,
.z-input:not(:disabled):not([readonly]):focus {
  border-color: var(--z-primary);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--z-primary) 20%, transparent);
}
.zn-input:not(:disabled):not([readonly]):focus-visible,
.z-input:not(:disabled):not([readonly]):focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--z-primary) 24%, transparent);
}
.zn-input[readonly]:focus,
.z-input[readonly]:focus {
  box-shadow: none;
}
.zn-input[readonly]:focus-visible,
.z-input[readonly]:focus-visible {
  outline: 2px solid var(--z-border-strong);
  outline-offset: 2px;
}
.zn-search { max-width: 360px; }
.zn-page-size { max-width: 140px; }
.zn-primary, .z-btn-primary {
  min-height: 42px;
  border: 0;
  border-radius: var(--z-radius-md);
  background: var(--z-primary);
  color: #fff;
  padding: 0 16px;
  font-weight: 850;
}
.zn-primary:hover, .z-btn-primary:hover { background: var(--z-primary-hover); }
.z-btn-secondary, .z-btn-outline, .z-btn-danger, .zn-actions button, .zn-actions a, .zn-drawer-head button, .zn-pager button {
  min-height: 38px;
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-md);
  background: var(--z-surface);
  color: var(--z-text);
  padding: 0 12px;
  text-decoration: none;
}
.z-btn-danger { color: var(--z-danger); border-color: color-mix(in srgb, var(--z-danger) 26%, var(--z-border)); }
.z-btn-success { color: var(--z-success); border-color: color-mix(in srgb, var(--z-success) 28%, var(--z-border)); }
.z-is-loading {
  pointer-events: none;
  opacity: .78;
}
.z-is-loading::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: z-spin .8s linear infinite;
  vertical-align: -2px;
}
@keyframes z-spin { to { transform: rotate(360deg); } }
.zn-table-wrap {
  overflow: auto;
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-lg);
  background: var(--z-surface);
  box-shadow: var(--z-shadow-sm);
}
.zn-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.zn-table th, .zn-table td { padding: 12px 14px; border-bottom: 1px solid var(--z-border); text-align: left; vertical-align: middle; }
.zn-table th { position: sticky; top: 0; background: var(--z-surface-alt); color: var(--z-text-muted); font-size: .8rem; }
.zn-sort { display: inline-flex; gap: 6px; align-items: center; border: 0; background: transparent; color: inherit; padding: 0; font-weight: 850; }
.zn-actions { width: 1%; white-space: nowrap; }
.zn-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}
.zn-actions .zn-row-action {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--z-border);
  border-radius: 8px;
  background: var(--z-surface);
  color: var(--z-text-muted);
}
.zn-row-action-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.zn-actions .zn-row-action:hover,
.zn-actions .zn-row-action:focus-visible {
  color: var(--z-primary);
  border-color: color-mix(in srgb, var(--z-primary) 54%, var(--z-border));
  background: color-mix(in srgb, var(--z-primary) 9%, var(--z-surface));
}
.zn-actions .zn-row-action--activate { color: var(--z-success); }
.zn-actions .zn-row-action--deactivate { color: var(--z-warning); }
.zn-actions .zn-row-action--delete { color: var(--z-danger); }
.zn-actions .zn-row-action--delete:hover,
.zn-actions .zn-row-action--delete:focus-visible {
  color: var(--z-danger);
  border-color: color-mix(in srgb, var(--z-danger) 52%, var(--z-border));
  background: color-mix(in srgb, var(--z-danger) 8%, var(--z-surface));
}
.zn-state, .zn-alert, .z-alert {
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-lg);
  background: var(--z-surface);
  padding: 16px;
}
.z-alert { display: grid; gap: 4px; }
.z-alert-success { border-color: color-mix(in srgb, var(--z-success) 30%, var(--z-border)); color: var(--z-success); }
.z-alert-warning { border-color: color-mix(in srgb, var(--z-warning) 30%, var(--z-border)); color: var(--z-warning); }
.z-alert-danger, .zn-alert { border-color: color-mix(in srgb, var(--z-danger) 30%, var(--z-border)); color: var(--z-danger); }
.z-alert-info { border-color: color-mix(in srgb, var(--z-info) 30%, var(--z-border)); color: var(--z-info); }
.z-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--z-surface-alt);
  color: var(--z-text-muted);
  font-size: .78rem;
  font-weight: 900;
}
.z-status-success { background: color-mix(in srgb, var(--z-success) 12%, var(--z-surface)); color: var(--z-success); }
.z-status-warning { background: color-mix(in srgb, var(--z-warning) 14%, var(--z-surface)); color: var(--z-warning); }
.z-status-danger { background: color-mix(in srgb, var(--z-danger) 12%, var(--z-surface)); color: var(--z-danger); }
.z-status-info { background: color-mix(in srgb, var(--z-info) 12%, var(--z-surface)); color: var(--z-info); }
.zn-pager { justify-content: flex-end; color: var(--z-text-muted); font-size: .9rem; }

.zn-form {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.zn-field { display: grid; gap: 7px; color: var(--z-text-muted); font-size: .9rem; font-weight: 800; grid-column: span 12; }
.zn-col-1 { grid-column: span 1; } .zn-col-2 { grid-column: span 2; } .zn-col-3 { grid-column: span 3; }
.zn-col-4 { grid-column: span 4; } .zn-col-5 { grid-column: span 5; } .zn-col-6 { grid-column: span 6; }
.zn-col-7 { grid-column: span 7; } .zn-col-8 { grid-column: span 8; } .zn-col-9 { grid-column: span 9; }
.zn-col-10 { grid-column: span 10; } .zn-col-11 { grid-column: span 11; } .zn-col-12 { grid-column: span 12; }
.zn-field strong { color: var(--z-danger); margin-left: 4px; }
.zn-tabs, .zn-section, .zn-group, .zn-detail { display: grid; gap: 14px; }
.zn-tab-panel, .zn-section, .zn-group, .zn-detail {
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-lg);
  background: var(--z-surface);
  padding: 16px;
  margin-top: 16px;
}
.zn-textarea { min-height: 110px; resize: vertical; }
.zn-check-list, .zn-upload {
  display: grid;
  gap: 10px;
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-md);
  background: var(--z-surface-alt);
  padding: 12px;
}
.zn-upload { border-style: dashed; }
.zn-boolean-control { width: max-content; min-height: 40px; }
.zn-boolean-control input,
.zn-check-option input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--z-primary);
}
.zn-check-option { min-height: 24px; }
.zn-lookup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
}
.zn-lookup-search,
.zn-lookup > small { grid-column: 1 / -1; }
.zn-lookup-clear { align-self: stretch; min-height: 40px; }
.zn-upload { position: relative; }
.zn-upload-dropzone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 72px;
  border: 0;
  border-radius: var(--z-radius-md);
  background: transparent;
  color: var(--z-text-muted);
  text-align: left;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.zn-upload:hover,
.zn-upload:focus-within {
  border-color: var(--z-primary);
  background: var(--z-primary-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--z-primary) 14%, transparent);
}
.zn-upload-dropzone strong,
.zn-upload-dropzone small { display: block; }
.zn-upload-dropzone strong { color: var(--z-text); }
.zn-upload-glyph { color: var(--z-primary); font-size: 1.35rem; font-weight: 900; }
.zn-upload-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
}
.zn-upload-image img { width: 120px; height: 120px; object-fit: cover; border-radius: var(--z-radius-md); border: 1px solid var(--z-border); }
.zn-form-actions { justify-content: flex-end; margin-top: 20px; }

.zn-drawer, .z-drawer, .z-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, .44);
}
.zn-drawer-panel, .z-drawer-panel {
  width: min(620px, 100vw);
  height: 100%;
  overflow: auto;
  background: var(--z-surface);
  box-shadow: var(--z-shadow-md);
  padding: 24px;
}
.z-record-form .zn-form-actions,
.zn-drawer-panel .zn-form-actions,
.z-drawer-panel .zn-form-actions {
  position: sticky;
  bottom: -24px;
  margin-inline: -24px;
  padding: 14px 24px 0;
  border-top: 1px solid var(--z-border);
  background: color-mix(in srgb, var(--z-surface) 94%, transparent);
  backdrop-filter: blur(12px);
}
.z-modal { align-items: center; justify-content: center; padding: 20px; }
.z-modal-panel {
  width: min(520px, 100%);
  border-radius: var(--z-radius-lg);
  background: var(--z-surface);
  box-shadow: var(--z-shadow-md);
  padding: 22px;
}
.zn-drawer-head, .z-drawer-head, .z-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.zn-drawer-head h2, .z-drawer-head h2, .z-modal-head h2 { margin: 0; }
.z-empty-state { display: grid; justify-items: center; gap: 8px; padding: 34px; text-align: center; }
.z-empty-state > span { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; color: var(--z-primary); background: var(--z-primary-soft); }
.z-empty-state h2, .z-empty-state p { margin: 0; }
.z-empty-state p { color: var(--z-text-muted); }
.zn-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: var(--z-radius-lg);
  box-shadow: var(--z-shadow-md);
  background: var(--z-text);
  color: var(--z-surface);
  padding: 13px 16px;
}
.zn-toast-success { background: var(--z-success); }
.zn-toast-warning { background: var(--z-warning); }
.zn-toast-error { background: var(--z-danger); }
.zn-toast[role="alert"] { outline: 1px solid color-mix(in srgb, white 34%, transparent); }

.zn-status-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.zn-definition-list {
  display: grid;
  grid-template-columns: minmax(120px, .45fr) minmax(0, 1fr);
  gap: 10px 16px;
  margin: 0;
}

.zn-definition-list dt {
  color: var(--z-text-muted);
  font-size: .82rem;
  font-weight: 850;
}

.zn-definition-list dd {
  min-width: 0;
  margin: 0;
  color: var(--z-text-primary);
  overflow-wrap: anywhere;
  font-weight: 720;
}

.z-login-page, .zn-login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, .92fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  padding: clamp(24px, 5vw, 60px);
  background:
    radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--z-primary) 18%, transparent), transparent 28rem),
    linear-gradient(135deg, var(--z-background), var(--z-surface-alt));
}
.z-login-story {
  display: grid;
  gap: 22px;
  max-width: 680px;
}
.z-login-story h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: .98;
  overflow-wrap: anywhere;
}
.z-login-story p { margin: 0; color: var(--z-text-muted); font-size: 1.08rem; line-height: 1.72; }
.z-login-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.z-login-highlights li {
  padding: 14px;
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-lg);
  background: color-mix(in srgb, var(--z-surface) 78%, transparent);
  box-shadow: var(--z-shadow-sm);
  font-weight: 850;
}
.z-login-panel, .zn-login-panel {
  width: min(480px, 100%);
  justify-self: end;
  display: grid;
  gap: 18px;
  border: 1px solid var(--z-border);
  border-radius: 24px;
  background: color-mix(in srgb, var(--z-surface) 94%, transparent);
  box-shadow: var(--z-shadow-md);
  padding: clamp(24px, 4vw, 34px);
}
.z-login-form, .zn-login-form, .z-password-form { display: grid; gap: 13px; }
.z-field, .zn-login-form label { display: grid; gap: 7px; color: var(--z-text-muted); font-weight: 800; }
.z-check, .zn-login-check { display: flex !important; align-items: center; gap: 9px; color: var(--z-text) !important; font-weight: 600 !important; }
.z-login-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.z-password-requirements {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 14px 14px 14px 30px;
  border-radius: var(--z-radius-lg);
  color: var(--z-text-muted);
  background: var(--z-surface-alt);
}

#blazor-error-ui { display: none; }

@media (max-width: 980px) {
  .z-app-shell, .zn-shell { grid-template-columns: 1fr; }
  .z-sidebar, .zn-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 24;
    width: min(320px, calc(100vw - 38px));
    transform: translateX(-102%);
    transition: transform .18s ease;
  }
  body.z-sidebar-open .z-sidebar,
  body.z-sidebar-open .zn-sidebar { transform: translateX(0); }
  .z-topbar, .zn-topbar { padding-inline: 16px; }
  .z-topbar-actions, .zn-topbar-actions { gap: 6px; }
  .z-content, .zn-content { padding: 18px; }
  .zn-kpi-grid, .zn-dashboard-grid { grid-template-columns: 1fr; }
  .z-login-page, .zn-login-page { grid-template-columns: 1fr; }
  .z-login-panel, .zn-login-panel { justify-self: stretch; width: 100%; }
}

@media (max-width: 680px) {
  .z-topbar-title span, .z-user-menu span, .zn-user-menu span { display: none; }
  .z-page-header, .zn-page-head, .z-dashboard-hero, .zn-grid-toolbar, .zn-pager {
    align-items: flex-start;
    flex-direction: column;
  }
  .zn-form { grid-template-columns: 1fr; }
  [class^="zn-col-"], [class*=" zn-col-"] { grid-column: span 1; }
  .z-login-page, .zn-login-page { padding: 24px; }
  .z-login-story h1 { font-size: clamp(2.1rem, 12vw, 3rem); line-height: 1.02; }
  .z-login-highlights { grid-template-columns: 1fr; }
  .z-login-tools { align-items: flex-start; flex-direction: column; }
}

/* Premium application shell refinement layer */
.z-brand-logo,
.z-login-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 14px;
  background: color-mix(in srgb, var(--z-surface-raised) 84%, transparent);
  box-shadow: var(--z-shadow-sm);
}

.z-login-logo {
  width: 54px;
  height: 54px;
}

.z-menu-glyph,
.z-menu-glyph::before,
.z-menu-glyph::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.z-menu-glyph {
  position: relative;
}

.z-menu-glyph::before,
.z-menu-glyph::after {
  content: "";
  position: absolute;
  left: 0;
}

.z-menu-glyph::before { top: -5px; }
.z-menu-glyph::after { top: 5px; }

.z-nav a:hover,
.zn-nav-link:hover {
  background: var(--z-sidebar-hover);
}

.z-app-shell[data-shell-collapsed="true"] {
  grid-template-columns: 92px minmax(0, 1fr);
}

.z-app-shell[data-shell-collapsed="true"] .z-sidebar {
  align-items: center;
}

.z-app-shell[data-shell-collapsed="true"] .z-brand-block div,
.z-app-shell[data-shell-collapsed="true"] .z-workspace-card,
.z-app-shell[data-shell-collapsed="true"] .z-menu-search,
.z-app-shell[data-shell-collapsed="true"] .z-sidebar-footer,
.z-app-shell[data-shell-collapsed="true"] .zn-nav-group,
.z-app-shell[data-shell-collapsed="true"] .z-nav a span {
  display: none;
}

.z-app-shell[data-shell-collapsed="true"] .z-nav,
.z-app-shell[data-shell-collapsed="true"] .zn-nav {
  width: 100%;
}

.z-app-shell[data-shell-collapsed="true"] .z-nav a,
.z-app-shell[data-shell-collapsed="true"] .zn-nav-link {
  justify-content: center;
  padding-inline: 0;
  font-size: 0;
}

.z-app-shell[data-shell-collapsed="true"] .z-nav a::before,
.z-app-shell[data-shell-collapsed="true"] .zn-nav-link::before {
  margin: 0;
}

.z-content,
.zn-content {
  max-width: var(--z-page-max);
  width: 100%;
  margin-inline: auto;
}

.zn-input,
.z-input {
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.zn-input::placeholder,
.z-input::placeholder {
  color: color-mix(in srgb, var(--z-text-muted) 72%, transparent);
}

.zn-input:disabled,
.z-input:disabled {
  cursor: not-allowed;
  opacity: .72;
  background: var(--z-surface-subtle);
}

.zn-table tbody tr {
  transition: background .16s ease;
}

.zn-table tbody tr:hover {
  background: color-mix(in srgb, var(--z-primary-soft) 38%, transparent);
}

.z-table-description {
  display: block;
  max-width: 54ch;
  margin-top: 4px;
  color: var(--z-text-muted);
  line-height: 1.45;
}

.z-filter-bar {
  align-items: end;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(160px, 220px) auto;
}

.z-filter-bar .z-field {
  margin: 0;
}

.z-filter-search,
.z-filter-select {
  grid-column: auto;
}

.zn-primary,
.z-btn-primary,
.z-btn-secondary,
.z-btn-outline,
.z-btn-danger,
.zn-actions button,
.zn-actions a,
.zn-drawer-head button,
.zn-pager button {
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}

.zn-primary:hover,
.z-btn-primary:hover {
  box-shadow: 0 10px 22px color-mix(in srgb, var(--z-primary) 18%, transparent);
  transform: translateY(-1px);
}

.z-btn-secondary:hover,
.z-btn-outline:hover,
.zn-actions button:hover,
.zn-actions a:hover,
.zn-drawer-head button:hover,
.zn-pager button:hover {
  border-color: var(--z-border-strong);
  background: var(--z-surface-alt);
}

button:disabled,
.zn-pager button:disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
}

.z-help {
  color: var(--z-text-muted);
  font-size: .84rem;
}

.z-field-error .zn-input,
.z-field-error .z-input,
.zn-field.has-errors .zn-input,
.zn-field.has-errors .z-input,
.zn-input[aria-invalid="true"],
.z-input[aria-invalid="true"] {
  border-color: color-mix(in srgb, var(--z-danger) 55%, var(--z-border));
}

.z-field-error .zn-input:not(:disabled):not([readonly]):focus,
.z-field-error .z-input:not(:disabled):not([readonly]):focus,
.zn-field.has-errors .zn-input:not(:disabled):not([readonly]):focus,
.zn-field.has-errors .z-input:not(:disabled):not([readonly]):focus,
.zn-input[aria-invalid="true"]:not(:disabled):not([readonly]):focus,
.z-input[aria-invalid="true"]:not(:disabled):not([readonly]):focus {
  border-color: var(--z-danger);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--z-danger) 24%, transparent);
}

.z-field-error .z-help {
  color: var(--z-danger);
}

.z-playground {
  display: grid;
  gap: 22px;
}

.z-play-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-lg);
  background: var(--z-surface);
  box-shadow: var(--z-shadow-sm);
}

.z-play-section > header {
  display: grid;
  gap: 6px;
}

.z-play-section h2,
.z-play-section p {
  margin: 0;
}

.z-play-section code {
  width: fit-content;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: var(--z-radius-sm);
  background: var(--z-surface-alt);
  color: var(--z-text-secondary);
  white-space: normal;
}

.z-play-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.z-play-stack {
  display: grid;
  gap: 12px;
}

.z-play-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.z-play-type,
.z-status-card {
  padding: 18px;
}

.z-status-card h3,
.z-status-card p {
  margin: 0;
}

.z-password-control {
  position: relative;
  display: block;
}

.z-password-control .zn-input,
.z-password-control .z-input {
  padding-right: 72px;
}

.z-password-control button {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  place-items: center;
  width: 36px;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--z-primary);
  padding: 0;
  font-size: 0;
  font-weight: 850;
  transform: translateY(-50%);
}
.z-password-control button::before {
  content: "";
  width: 18px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50% / 58%;
  box-shadow: inset 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
}

.z-password-control button:hover {
  background: var(--z-primary-soft);
}

.z-login-page,
.zn-login-page {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 500px);
  background:
    linear-gradient(rgba(19, 111, 99, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 111, 99, .035) 1px, transparent 1px),
    radial-gradient(circle at 16% 12%, color-mix(in srgb, var(--z-primary) 18%, transparent), transparent 26rem),
    radial-gradient(circle at 84% 76%, color-mix(in srgb, var(--z-info) 16%, transparent), transparent 30rem),
    linear-gradient(135deg, var(--z-background), var(--z-surface-alt));
  background-size: 40px 40px, 40px 40px, auto, auto, auto;
}

.zn-login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.zn-login-brand strong {
  display: block;
  color: var(--z-text-primary);
  font-size: 1.12rem;
}

.zn-login-brand small {
  display: block;
  color: var(--z-text-muted);
  margin-top: 2px;
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.z-login-story h1 {
  max-width: 620px;
  font-size: clamp(2.35rem, 5vw, 4rem);
  letter-spacing: -.035em;
}

.z-login-story p {
  max-width: 620px;
  color: var(--z-text-secondary);
}

.z-login-highlights li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 12px 14px;
  border-radius: var(--z-radius-md);
  background: color-mix(in srgb, var(--z-surface-raised) 82%, transparent);
  color: var(--z-text-secondary);
  font-size: .95rem;
}

.z-login-highlights li::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid var(--z-primary);
  background: radial-gradient(circle, var(--z-primary) 0 32%, transparent 35%);
}

.z-login-panel,
.zn-login-panel {
  border-color: var(--z-border-strong);
  background: color-mix(in srgb, var(--z-surface-raised) 94%, transparent);
  backdrop-filter: blur(18px);
}

.z-login-panel h1,
.zn-login-panel h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  letter-spacing: -.025em;
}

.zn-login-help {
  margin: 6px 0 0;
  color: var(--z-text-muted);
}

.z-theme-selector {
  width: 100%;
}

.z-theme-selector button {
  flex: 1 1 0;
}

.z-drawer,
.zn-drawer,
.z-modal {
  backdrop-filter: blur(4px);
}

.z-drawer-panel,
.zn-drawer-panel {
  border-left: 1px solid var(--z-border);
}

.z-record-form {
  margin-top: 22px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 1120px) {
  .z-topbar,
  .zn-topbar {
    flex-wrap: wrap;
  }

  .z-topbar-actions,
  .zn-topbar-actions {
    margin-left: auto;
  }

  .z-user-summary {
    display: none;
  }
}

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
  }

  .z-login-page,
  .zn-login-page {
    min-height: 100svh;
    padding: 18px;
  }

  .z-login-story {
    gap: 14px;
  }

  .z-login-story h1 {
    font-size: clamp(1.95rem, 10vw, 2.55rem);
  }

  .z-login-story p {
    font-size: .98rem;
  }

  .z-login-panel,
  .zn-login-panel {
    padding: 20px;
    border-radius: 20px;
  }

  .z-filter-bar {
    grid-template-columns: 1fr;
  }

  .z-play-form {
    grid-template-columns: 1fr;
  }

  .zn-table {
    min-width: 680px;
  }

  .z-drawer-panel,
  .zn-drawer-panel {
    width: 100vw;
    padding: 18px;
  }

  .z-record-form .zn-form-actions,
  .zn-drawer-panel .zn-form-actions,
  .z-drawer-panel .zn-form-actions {
    bottom: -18px;
    margin-inline: -18px;
    padding: 12px 18px 0;
  }

  .zn-definition-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .z-login-page,
  .zn-login-page {
    padding: 14px;
  }

  .z-login-logo,
  .zn-brand-mark {
    width: 46px;
    height: 46px;
  }

  .z-login-highlights {
    gap: 8px;
  }

  .z-login-highlights li {
    min-height: 46px;
    padding: 10px 12px;
  }

  .z-login-panel,
  .zn-login-panel {
    padding: 18px 14px;
  }

  .z-theme-selector {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .z-content,
  .zn-content {
    padding: 14px;
  }

  .z-topbar,
  .zn-topbar {
    gap: 10px;
  }

  .z-topbar-actions,
  .zn-topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .z-topbar-chip {
    display: none;
  }
}

.z-app-shell[dir="rtl"] .z-sidebar {
  border-right: 0;
  border-left: 1px solid var(--z-border);
}

.z-language-switcher select {
  min-height: 40px;
  border: 1px solid var(--z-border);
  border-radius: 999px;
  background: var(--z-surface);
  color: var(--z-text);
  padding: 0 12px;
  font: inherit;
}

/* Enterprise shell and operational component primitives */
.z-shell-context { flex: 0 0 auto; }
.z-context-card {
  display: grid;
  gap: 7px;
  padding: 13px 14px;
  border: 1px solid var(--z-sidebar-border);
  border-radius: var(--z-radius-lg);
  background: var(--z-sidebar-card);
}
.z-context-label {
  color: var(--z-sidebar-muted);
  font-size: var(--z-font-size-xs);
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.z-context-identity { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.z-context-identity strong, .z-context-identity small { display: block; }
.z-context-identity strong { color: var(--z-sidebar-text); }
.z-context-identity small { margin-top: 2px; color: var(--z-sidebar-muted); font-size: var(--z-font-size-xs); }
.z-context-switcher { flex: 0 0 auto; }

.z-context-scope-selector {
    width: 100%;
    min-height: 36px;
    border: 1px solid var(--z-border);
    border-radius: 10px;
    background: var(--z-surface);
    color: var(--z-text);
    padding: 6px 30px 6px 10px;
    font: inherit;
    font-weight: 750;
}

.z-context-scope-selector:focus-visible {
    border-color: var(--z-primary);
    outline: 3px solid color-mix(in srgb, var(--z-primary), transparent 78%);
}

.z-ai-action { display: inline-flex; }
.z-ai-action > button, .z-ai-action > a {
  min-height: var(--z-control-sm);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid color-mix(in srgb, var(--z-primary), var(--z-border) 58%);
  border-radius: 999px;
  background: var(--z-primary-soft);
  color: var(--z-primary);
  padding: 0 12px;
  text-decoration: none;
  font-weight: 800;
}

.z-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--z-space-2);
  color: var(--z-text-muted);
  font-size: var(--z-font-size-sm);
}
.z-breadcrumbs a { color: var(--z-primary); text-decoration: none; font-weight: 700; }
.z-breadcrumbs a:hover { text-decoration: underline; }
.z-breadcrumbs [aria-current="page"] { color: var(--z-text); font-weight: 700; }

.z-filter-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--z-space-3);
  padding: var(--z-space-3);
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-lg);
  background: var(--z-surface);
}
.z-filter-fields { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: end; gap: var(--z-space-3); min-width: 0; }
.z-filter-fields > * { flex: 1 1 150px; min-width: 0; max-width: 280px; }
.z-filter-fields > [data-filter-search] { flex-basis: 220px; max-width: 380px; }
.z-filter-actions { flex: 0 0 auto; display: flex; align-items: center; gap: var(--z-space-2); }

.z-metric-card {
  --z-metric-accent: var(--z-primary);
  min-height: 104px;
  display: flex;
  align-items: flex-start;
  gap: var(--z-space-3);
  padding: var(--z-space-4);
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-lg);
  background: var(--z-surface);
  box-shadow: var(--z-shadow-sm);
}
.z-metric-success { --z-metric-accent: var(--z-success); }
.z-metric-info { --z-metric-accent: var(--z-info); }
.z-metric-warning { --z-metric-accent: var(--z-warning); }
.z-metric-danger { --z-metric-accent: var(--z-danger); }
.z-metric-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; color: var(--z-metric-accent); background: color-mix(in srgb, var(--z-metric-accent) 12%, transparent); }
.z-metric-content { display: grid; gap: 3px; min-width: 0; }
.z-metric-label { color: var(--z-text-muted); font-size: var(--z-font-size-xs); font-weight: 800; text-transform: uppercase; letter-spacing: .045em; }
.z-metric-value { color: var(--z-text); font-size: 1.75rem; line-height: 1.08; font-variant-numeric: tabular-nums; }
.z-metric-content small { color: var(--z-text-muted); }
.z-metric-status { margin-top: 4px; }

.z-surface { background: var(--z-surface); color: var(--z-text); }
.z-surface-card { border: 1px solid var(--z-border); border-radius: var(--z-radius-lg); box-shadow: var(--z-shadow-sm); }
.z-surface-inset { border: 1px solid var(--z-border); border-radius: var(--z-radius-md); background: var(--z-surface-subtle); }
.z-surface-attention { border-inline-start: 3px solid var(--z-warning); background: color-mix(in srgb, var(--z-warning) 7%, var(--z-surface)); }
.z-surface-action { border: 1px solid color-mix(in srgb, var(--z-primary), var(--z-border) 60%); background: var(--z-primary-soft); }
.z-density-comfortable { padding: var(--z-space-5); }
.z-density-compact { padding: var(--z-space-3); }
.z-density-dense { padding: var(--z-space-2); }

.z-status { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; white-space: nowrap; }
.z-status-icon { width: 14px; height: 14px; display: inline-grid; place-items: center; }

.z-drawer { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; background: rgba(5, 12, 24, .46); backdrop-filter: blur(2px); }
.z-drawer-panel { width: min(100%, var(--z-drawer-medium)); height: 100%; min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; padding: 0; background: var(--z-surface-raised); box-shadow: var(--z-shadow-md); }
.z-drawer-small { width: min(100%, var(--z-drawer-small)); max-width: var(--z-drawer-small); }
.z-drawer-medium { width: min(100%, var(--z-drawer-medium)); max-width: var(--z-drawer-medium); }
.z-drawer-large { width: min(100%, var(--z-drawer-large)); max-width: var(--z-drawer-large); }
.z-drawer-head, .z-drawer-footer, .z-modal-head, .z-modal-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--z-space-3); padding: var(--z-space-4) var(--z-space-5); }
.z-drawer-head, .z-modal-head { border-bottom: 1px solid var(--z-border); }
.z-drawer-footer, .z-modal-footer { border-top: 1px solid var(--z-border); background: var(--z-surface-alt); }
.z-drawer-head h2, .z-modal-head h2 { margin: 0; font-size: var(--z-font-size-lg); }
.z-drawer-body { min-width: 0; min-height: 0; overflow-x: clip; overflow-y: auto; padding: var(--z-space-5); }
.z-drawer-body > form { width: 100%; min-width: 0; max-width: 100%; }
.z-drawer-panel .zn-form-actions {
  bottom: calc(-1 * var(--z-space-5));
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
  padding-inline: 0;
}
.z-drawer-panel .zn-table-wrap { max-width: 100%; overflow-x: auto; }
.z-loading-state { min-height: 160px; display: grid; place-items: center; color: var(--z-text-muted); }
.z-modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: var(--z-space-5); background: rgba(5, 12, 24, .5); backdrop-filter: blur(3px); }
.z-modal-panel { width: min(100%, 560px); max-height: calc(100vh - 40px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid var(--z-border); border-radius: var(--z-radius-lg); background: var(--z-surface-raised); box-shadow: var(--z-shadow-md); }
.z-modal-danger .z-modal-head { border-top: 3px solid var(--z-danger); }
.z-modal-body { overflow-y: auto; padding: var(--z-space-5); }

.zn-table-wrap { overflow: auto; border: 1px solid var(--z-border); border-radius: var(--z-radius-lg); background: var(--z-surface); }
.zn-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--z-font-size-sm); }
.zn-table th { position: sticky; top: 0; z-index: 1; background: var(--z-surface-alt); color: var(--z-text-secondary); font-size: var(--z-font-size-xs); letter-spacing: .035em; text-transform: uppercase; }
.zn-table th, .zn-table td { padding: 11px 13px; border-bottom: 1px solid var(--z-border); text-align: start; }
.zn-table tbody tr { transition: background var(--z-transition-fast); }
.zn-table tbody tr:hover { background: var(--z-primary-soft); }

@media (max-width: 1024px) {
  .z-topbar, .zn-topbar { padding-inline: 18px; }
  .z-user-summary { display: none; }
  .z-filter-toolbar { align-items: stretch; flex-direction: column; }
  .z-filter-actions { justify-content: flex-end; }
}
@media (max-width: 768px) {
  .z-topbar-actions { gap: 6px; }
  .z-topbar-chip { display: none; }
  .z-language-switcher select { max-width: 136px; }
  .z-filter-fields > * { max-width: none; flex-basis: calc(50% - 6px); }
  .z-drawer-panel { width: 100%; max-width: 100%; }
}

.zn-export-menu { position: relative; flex: 0 0 auto; }

/* Shared enterprise productivity stabilization */
.z-app-shell {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.z-sidebar {
  height: 100dvh;
  padding: 16px 14px;
  gap: 12px;
  border-inline-end: 1px solid var(--z-sidebar-border);
  background: var(--z-sidebar-bg);
}
.z-brand-block { min-height: 46px; }
.z-workspace-card { padding: 11px 13px; border-radius: 14px; }
.z-menu-search input { min-height: 38px; border-radius: 11px; }
.z-nav a, .zn-nav-link {
  position: relative;
  min-height: 38px;
  border-radius: 10px;
  transition: color var(--z-transition-fast), background var(--z-transition-fast), box-shadow var(--z-transition-fast);
}
.z-nav a.active, .zn-nav-link.active {
  color: var(--z-primary);
  background: var(--z-sidebar-active);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--z-primary) 10%, transparent);
}
.z-nav a.active::after, .zn-nav-link.active::after {
  content: "";
  position: absolute;
  inset-block: 9px;
  inset-inline-start: 0;
  width: 3px;
  border-radius: 999px;
  background: var(--z-primary);
}
.z-main { min-width: 0; min-height: 0; height: 100dvh; overflow: hidden; }
.z-topbar {
  min-height: 70px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--z-border);
  background: color-mix(in srgb, var(--z-surface-raised) 96%, transparent);
  box-shadow: 0 1px 8px rgba(15, 23, 42, .035);
}
.z-topbar-title strong { letter-spacing: -.015em; }
.z-content { min-width: 0; min-height: 0; overflow-x: clip; overflow-y: auto; padding: 18px 22px; }
.z-user-menu, .z-language-switcher select, .z-theme-selector { min-height: 38px; }

.zn-input, .z-input, .zn-display {
  min-height: var(--z-control-md);
  padding: 7px 10px;
  border-radius: 9px;
}
.zn-textarea { min-height: 76px; line-height: 1.45; }
.zn-form { min-width: 0; gap: 10px 12px; margin-top: 10px; }
.zn-field { min-width: 0; gap: 4px; font-size: .84rem; }
.zn-field > span:first-child { line-height: 1.25; }
.zn-tab-panel, .zn-section, .zn-group, .zn-detail {
  gap: 9px;
  padding: 12px 14px;
  border-radius: 13px;
  box-shadow: none;
}
.zn-section + .zn-section, .zn-group + .zn-group, .zn-detail + .zn-detail { margin-top: 10px; }
.zn-crud-editor-content { scrollbar-gutter: stable; }
.zn-crud-editor-page .zn-input { min-height: 38px; }
.zn-crud-editor-page .zn-form { gap: 8px 10px; }
.zn-crud-editor-page .zn-tab-panel,
.zn-crud-editor-page .zn-section,
.zn-crud-editor-page .zn-group,
.zn-crud-editor-page .zn-detail { padding: 10px 12px; }

.zn-tabs { min-width: 0; display: grid; gap: 10px; }
.zn-tab-list {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px;
  border: 1px solid var(--z-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--z-surface-alt) 70%, var(--z-surface));
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 32%, transparent);
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.zn-tab-button {
  position: relative;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  color: var(--z-text-muted);
  background: transparent;
  font-weight: 800;
  white-space: nowrap;
  transition: color var(--z-transition-fast), background var(--z-transition-fast), box-shadow var(--z-transition-fast);
}
.zn-tab-button:hover:not(.is-active) {
  color: var(--z-text);
  background: color-mix(in srgb, var(--z-surface-raised) 82%, transparent);
}
.zn-tab-button:focus-visible {
  outline: 2px solid var(--z-focus-ring);
  outline-offset: -2px;
}
.zn-tab-button.is-active {
  color: var(--z-primary);
  background: color-mix(in srgb, var(--z-primary-soft) 84%, var(--z-surface));
  box-shadow: 0 1px 2px color-mix(in srgb, var(--z-text) 8%, transparent);
}
.zn-tab-button.is-active::after {
  content: "";
  position: absolute;
  inset-inline: 9px;
  bottom: 2px;
  height: 2px;
  border-radius: 999px;
  background: var(--z-primary);
}
.zn-tab-button.has-errors { color: var(--z-danger); }
.zn-tab-error-indicator {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-inline-start: 7px;
  border-radius: 50%;
  background: currentColor;
}

.zn-validation-summary,
.zn-validation-banner {
  width: 100%;
  margin: 8px 0 0;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--z-danger) 38%, var(--z-border));
  border-radius: 9px;
  background: color-mix(in srgb, var(--z-danger) 7%, var(--z-surface));
  color: var(--z-danger);
  line-height: 1.35;
}
.zn-validation-summary ul { margin: 0; padding-inline-start: 20px; }
.zn-validation-summary:empty { display: none; }
.zn-crud-editor-content > .zn-validation-summary + .zn-validation-banner { margin-top: 6px; }
.zn-field > .zn-field-error { display: block; color: var(--z-danger); font-size: .75rem; line-height: 1.25; }

.zn-detail td.has-errors .zn-input,
.zn-detail td.has-errors .zn-combobox-control {
  border-color: var(--z-danger);
}

.zn-detail .zn-field-error {
  display: block;
  margin-top: 4px;
  color: var(--z-danger);
  font-size: 0.75rem;
  line-height: 1.25;
}
.zn-tab-panel[hidden] { display: none !important; }
.zn-tab-panel { min-width: 0; }

.zn-combobox { position: relative; min-width: 0; }
.zn-combobox-control { position: relative; display: flex; align-items: center; min-width: 0; }
.zn-combobox-input { padding-inline-end: 70px; }
.zn-combobox-clear, .zn-combobox-toggle {
  position: absolute;
  inset-block: 4px;
  width: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: var(--z-text-muted);
  background: transparent;
}
.zn-combobox-clear { inset-inline-end: 34px; font-size: 1.15rem; }
.zn-combobox-toggle { inset-inline-end: 4px; }
.zn-combobox-clear:hover, .zn-combobox-toggle:hover { color: var(--z-primary); background: var(--z-primary-soft); }
.zn-combobox-popover {
  position: fixed;
  z-index: 1000;
  inset: auto;
  width: auto;
  max-height: 240px;
  overflow-y: auto;
  display: grid;
  padding: 5px;
  border: 1px solid var(--z-border-strong);
  border-radius: 11px;
  background: var(--z-surface-raised);
  box-shadow: var(--z-shadow-md);
}
.zn-combobox-popover[data-positioned="false"] { visibility: hidden; }
.zn-combobox-option {
  min-height: 36px;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  color: var(--z-text);
  background: transparent;
  text-align: start;
}
.zn-combobox-option.is-hovered,
.zn-combobox-option.is-active { color: var(--z-primary); background: var(--z-primary-soft); }
.zn-combobox-option.is-selected,
.zn-combobox-option[aria-selected="true"] { color: var(--z-primary); font-weight: 750; }
.zn-combobox-option.is-selected:not(.is-hovered):not(.is-active) {
  background: color-mix(in srgb, var(--z-primary-soft) 34%, transparent);
}
.zn-combobox-state { padding: 12px; color: var(--z-text-muted); font-size: .84rem; text-align: center; }
.zn-combobox-error { color: var(--z-danger); }

.zn-dashboard { display: grid; gap: 14px; }
.z-dashboard-hero { padding: 18px 20px; border-radius: 16px; }
.z-dashboard-hero h1 { font-size: clamp(1.65rem, 3vw, 2.35rem); letter-spacing: -.03em; }
.zn-kpi-grid { gap: 12px; }
.zn-kpi-card { min-height: 118px; padding: 16px; border-radius: 15px; border-top: 3px solid var(--z-kpi-accent, var(--z-primary)); }
.zn-kpi-card-link { color: inherit; text-decoration: none; }
.zn-kpi-card-link:hover { transform: translateY(-1px); box-shadow: var(--z-shadow-md); }
.zn-kpi-card strong { font-size: clamp(1.65rem, 2.5vw, 2.1rem); }
.zn-insight-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  overflow-x: auto;
  padding: 11px 14px;
  border: 1px solid var(--z-border);
  border-inline-start: 4px solid var(--z-primary);
  border-radius: 12px;
  background: var(--z-surface-raised);
}
.zn-insight-strip > div { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.zn-insight-strip span { color: var(--z-text-muted); }

.z-login-page, .zn-login-page { padding: clamp(22px, 4vw, 52px); gap: clamp(28px, 5vw, 70px); }
.z-login-story h1 { font-size: clamp(2.2rem, 4.4vw, 3.8rem); line-height: 1.04; }
.z-login-panel, .zn-login-panel { max-width: 500px; padding: clamp(24px, 3vw, 32px); border-radius: 18px; }
.z-login-preferences { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 4px; border-top: 1px solid var(--z-border); }

[dir="rtl"] .zn-combobox-option { text-align: right; }
@media (max-width: 680px) {
  .z-content { padding: 14px; }
  .zn-tab-list {
    margin-inline: -2px;
    scroll-snap-type: inline proximity;
  }
  .zn-tab-button {
    min-height: 40px;
    padding-inline: 14px;
    scroll-snap-align: start;
  }
  .z-login-preferences { align-items: stretch; flex-direction: column; }
  .zn-detail-table .zn-detail-actions { min-width: 46px; padding-inline: 5px; }
}
.zn-export-trigger { display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.zn-export-chevron { width: 7px; height: 7px; border-inline-end: 1.5px solid currentColor; border-block-end: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform var(--z-transition-fast); }
.zn-export-trigger[aria-expanded="true"] .zn-export-chevron { transform: translateY(2px) rotate(225deg); }
.zn-export-menu__items { position: absolute; z-index: 50; inset-block-start: calc(100% + 6px); inset-inline-end: 0; width: max-content; min-width: 10.5rem; max-width: min(15rem, calc(100vw - 24px)); padding: .35rem; overflow: hidden; border: 1px solid var(--z-border); border-radius: var(--z-radius-sm); background: var(--z-surface); box-shadow: var(--z-shadow-md); }
.zn-export-menu__items[hidden] { display: none; }
.zn-export-menu__items button { display: flex; width: 100%; min-height: var(--z-control-md); align-items: center; gap: 9px; padding: .5rem .65rem; border: 0; border-radius: .35rem; background: transparent; color: var(--z-text); text-align: start; cursor: pointer; }
.zn-export-menu__items button:hover, .zn-export-menu__items button:focus-visible { background: var(--z-surface-subtle); }
.z-export-icon { display: inline-flex; width: 18px; height: 18px; flex: 0 0 18px; align-items: center; justify-content: center; color: currentColor; }
.z-export-icon svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.z-nav [hidden], .zn-nav [hidden] { display: none !important; }

.z-step-wizard {
  display: grid;
  gap: var(--z-space-4);
  min-width: 0;
}
.z-step-wizard__steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--z-space-2);
  min-width: 0;
}
.z-step-wizard__step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--z-space-2);
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-sm);
  background: var(--z-surface);
  color: var(--z-text);
  text-align: start;
}
.z-step-wizard__step.is-active {
  border-color: var(--z-primary);
  background: var(--z-primary-soft);
}
.z-step-wizard__step.is-complete .z-step-wizard__number {
  color: #fff;
  background: var(--z-success);
}
.z-step-wizard__step.has-error {
  border-color: var(--z-danger);
}
.z-step-wizard__number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: var(--z-surface-subtle);
  color: var(--z-text-secondary);
  font-size: var(--z-font-size-sm);
  font-weight: 900;
}
.z-step-wizard__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.z-step-wizard__text strong,
.z-step-wizard__text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.z-step-wizard__text small {
  color: var(--z-text-muted);
  font-size: var(--z-font-size-xs);
}
.z-step-wizard__body {
  min-width: 0;
}
.z-step-wizard__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--z-space-2);
  min-width: 0;
}

/* Canonical compact operational composition shared by Sample and generated products. */
.z-app-shell, .zn-shell { grid-template-columns: 252px minmax(0, 1fr); }
.z-sidebar, .zn-sidebar {
  gap: 8px;
  padding: 12px 10px 10px;
  border-inline-end: 1px solid var(--z-sidebar-border);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--z-primary) 5%, var(--z-sidebar-bg)), var(--z-sidebar-bg) 42%),
    var(--z-sidebar-bg);
}
.z-brand-block, .zn-brand { min-height: 40px; gap: 8px; padding: 0 3px; }
.z-brand-mark, .zn-brand-mark { width: 36px; height: 36px; border-radius: 10px; box-shadow: var(--z-shadow-sm); }
.z-brand-block strong, .zn-brand strong { font-size: .9rem; line-height: 1.1; }
.z-brand-block small, .zn-brand small { margin-top: 1px; font-size: .7rem; }
.z-workspace-card, .z-context-card { gap: 2px; padding: 8px 10px; border-radius: 10px; }
.z-workspace-card--compact {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 6px;
  border-color: transparent;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
}
.z-workspace-card--compact span { font-size: .64rem; }
.z-workspace-card--compact strong { color: var(--z-sidebar-muted); font-size: .72rem; }
.z-menu-search input { min-height: 36px; border-radius: 9px; padding-inline: 10px; }
.z-nav, .zn-nav { gap: 1px; }
.zn-nav-group { margin: 7px 6px 2px; font-size: .67rem; letter-spacing: .09em; }
.z-nav a, .zn-nav-link {
  position: relative;
  min-height: 36px;
  gap: 8px;
  padding-inline: 9px;
  border-radius: 9px;
  font-size: .84rem;
  font-weight: 720;
}
.z-nav a::before, .zn-nav-link::before { width: 19px; height: 19px; mask-size: 18px 18px; }
.z-nav a.active, .zn-nav-link.active { color: var(--z-primary); background: var(--z-primary-soft); }
.z-nav a.active::after, .zn-nav-link.active::after {
  content: "";
  position: absolute;
  inset-block: 8px;
  inset-inline-start: -14px;
  width: 3px;
  border-radius: 999px;
  background: var(--z-primary);
}
.z-sidebar-footer { padding: 5px 3px 0; }
.z-sidebar-footer span { min-height: 24px; padding-inline: 8px; font-size: .66rem; }

.z-main, .zn-main { min-height: 100vh; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.z-topbar, .zn-topbar {
  min-height: 58px;
  padding: 8px 16px;
  gap: 10px;
  background: color-mix(in srgb, var(--z-surface) 96%, transparent);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--z-border) 70%, transparent);
}
.z-topbar-title { gap: 1px; min-width: 0; }
.z-topbar-title span { font-size: .75rem; }
.z-topbar-title strong { max-width: min(44vw, 620px); overflow: hidden; font-size: .98rem; text-overflow: ellipsis; white-space: nowrap; }
.z-topbar-actions, .zn-topbar-actions { gap: 7px; }
.z-icon-button, .zn-icon-action, .z-topbar-chip, .z-theme-selector button, .z-language-selector select {
  min-width: var(--z-control-md);
  min-height: var(--z-control-md);
}
.z-topbar-chip { display: inline-flex; align-items: center; justify-content: center; padding-inline: 11px; border: 1px solid var(--z-border); border-radius: 999px; background: var(--z-surface); font-size: .76rem; font-weight: 800; }
.z-user-menu, .zn-user-menu { min-height: var(--z-control-md); padding: 3px 5px; }
.z-user-avatar { width: 32px; height: 32px; }
.z-user-summary strong { font-size: .82rem; }
.z-content { min-width: 0; padding: 18px 22px 24px; }

/* The expanded desktop sidebar owns product identity and the breadcrumb owns
   page context. Keep the compact top-bar identity for collapsed and narrow UI. */
@media (min-width: 981px) {
  .z-app-shell:not([data-shell-collapsed="true"]) .z-topbar-title { display: none; }
  .z-app-shell:not([data-shell-collapsed="true"]) .z-topbar-actions { margin-inline-start: auto; }
}

.z-dashboard-hero { padding: 17px 19px; border-radius: 16px; }
.z-dashboard-hero h1 { margin-top: 5px; font-size: clamp(1.55rem, 2.35vw, 2.1rem); }
.z-dashboard-hero p { margin-top: 7px; line-height: 1.5; }
.z-hero-meta { min-height: 30px; padding-inline: 10px; font-size: .73rem !important; }
.zn-kpi-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 11px; }
.zn-kpi-card { min-height: 108px; gap: 11px; padding: 14px; }
.z-kpi-icon, .z-action-icon { width: 38px; height: 38px; border-radius: 11px; }
.zn-kpi-card strong { margin-top: 5px; font-size: clamp(1.55rem, 2vw, 1.9rem); }
.z-kpi-trend { margin-top: 8px; font-size: .77rem; }
.zn-dashboard-grid { gap: 12px; }
.zn-dashboard-panel { gap: 11px; padding: 15px; }
.zn-quick-actions { gap: 8px; }
.zn-quick-action { gap: 10px; min-height: 62px; padding: 10px 11px; }
.zn-status-cards { display: grid; gap: 8px; }
.zn-status-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 62px; padding: 10px 11px; border: 1px solid var(--z-border); border-radius: 11px; background: var(--z-surface-alt); }
.z-status-card-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: var(--z-primary); background: var(--z-primary-soft); font-weight: 900; }
.zn-status-card > div { display: grid; gap: 2px; min-width: 0; }
.zn-status-card > div span { color: var(--z-text-muted); font-size: .78rem; }
.zn-insight-strip { min-height: 44px; padding: 8px 12px; }

.z-page-header, .zn-page-head { margin-bottom: 10px; }
.z-page-header h1, .zn-page-head h1 { font-size: clamp(1.55rem, 2.2vw, 2rem); }
.z-filter-toolbar, .zn-grid-toolbar {
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 14px;
  box-shadow: var(--z-shadow-sm);
}
.z-filter-fields { align-items: end; gap: 9px 11px; }
.z-filter-actions { align-self: end; }
.zn-input, .z-input, .zn-primary, .z-btn-primary, .z-btn-secondary { min-height: var(--z-control-md); }
.zn-table-wrap { border-radius: 14px; }
.zn-table { min-width: 680px; font-size: .84rem; }
.zn-table th, .zn-table td { padding: 9px 11px; }
.zn-table th { height: 40px; }
.zn-table .zn-actions { white-space: nowrap; }
.zn-table .zn-actions .zn-row-action { min-height: 34px; padding: 0; }
.zn-pager { min-height: 44px; margin-top: 0; padding: 7px 10px; }
.zn-pager button { min-height: 34px; }

.zn-form, .zn-form > *, .zn-field, .zn-section, .zn-group, .zn-tab-panel, .zn-detail { min-width: 0; }
.zn-crud-editor-page .zn-input, .zn-drawer-panel .zn-input { min-height: var(--z-control-md); }
.zn-crud-editor-page .zn-form { gap: 8px 11px; }
.zn-crud-editor-page .zn-tab-panel, .zn-crud-editor-page .zn-section, .zn-crud-editor-page .zn-group, .zn-crud-editor-page .zn-detail { padding: 11px 13px; }
.zn-crud-editor-content { overflow-x: hidden; }
.zn-combobox, .zn-combobox-control, .zn-combobox-input { max-width: 100%; }
.zn-form-actions--page { min-height: 58px; padding: 8px 13px; }

.zn-login-page { grid-template-columns: minmax(0, 1.05fr) minmax(360px, 480px); align-items: center; min-height: 100dvh; padding: clamp(24px, 5vw, 64px); }
.z-login-story { max-width: 720px; }
.z-login-story h1 { max-width: 680px; font-size: clamp(2.05rem, 4vw, 3.35rem); }
.zn-login-panel { width: 100%; max-width: 480px; padding: clamp(24px, 3vw, 32px); box-shadow: var(--z-shadow-md); }
.zn-login-form { gap: 12px; }
.zn-login-form .zn-primary { width: 100%; }

@media (max-width: 1100px) {
  .z-app-shell, .zn-shell { grid-template-columns: 252px minmax(0, 1fr); }
  .z-content { padding-inline: 16px; }
  .z-user-summary { display: none; }
  .zn-dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .zn-login-page { grid-template-columns: 1fr; }
  .z-login-story { display: none; }
  .zn-login-panel { margin: auto; }
}

/* Keep the compact shell responsive after the desktop stabilization rules above. */
@media (max-width: 980px) {
  .z-app-shell, .zn-shell { grid-template-columns: minmax(0, 1fr); }
  .z-main, .zn-main { grid-column: 1; width: 100%; }
  .z-sidebar, .zn-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 24;
    width: min(320px, calc(100vw - 38px));
    transform: translateX(-102%);
    transition: transform .18s ease;
  }
  body.z-sidebar-open .z-sidebar,
  body.z-sidebar-open .zn-sidebar { transform: translateX(0); }
  .z-content, .zn-content { width: 100%; }
}

/* Full-page CRUD boundary hierarchy: outer editor, one section surface, controls. */
.z-app-shell:has(.zn-crud-editor-page) .z-content {
  max-width: none;
  padding-inline: clamp(12px, 1.25vw, 22px);
}
.zn-crud-editor-page .zn-tabs { gap: 0; }
.zn-crud-editor-page .zn-tab-panel {
  margin-top: 0;
  padding: 6px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.zn-crud-editor-page .zn-tab-panel > .zn-section,
.zn-crud-editor-page .zn-tab-panel > .zn-group,
.zn-crud-editor-page .zn-crud-editor-content > .zn-section,
.zn-crud-editor-page .zn-crud-editor-content > .zn-group {
  margin-top: 0;
  padding: 10px 12px 12px;
  border: 0;
  border-radius: 13px;
  background: color-mix(in srgb, var(--z-surface-alt) 78%, var(--z-surface));
}
.zn-crud-editor-page .zn-tab-panel > .zn-section + .zn-section,
.zn-crud-editor-page .zn-tab-panel > .zn-group + .zn-group,
.zn-crud-editor-page .zn-crud-editor-content > .zn-section + .zn-section,
.zn-crud-editor-page .zn-crud-editor-content > .zn-group + .zn-group,
.zn-crud-editor-page .zn-tabs + .zn-detail,
.zn-crud-editor-page .zn-section + .zn-detail,
.zn-crud-editor-page .zn-group + .zn-detail,
.zn-crud-editor-page .zn-detail + .zn-detail {
  margin-top: 14px;
}
.zn-crud-editor-page .zn-section > .zn-group,
.zn-crud-editor-page .zn-section > .zn-section,
.zn-crud-editor-page .zn-group > .zn-group,
.zn-crud-editor-page .zn-group > .zn-section {
  margin-top: 20px;
  padding: 20px 0 0;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--z-border) 72%, transparent);
  border-radius: 0;
  background: transparent;
}
.zn-crud-editor-page .zn-detail {
  width: 100%;
  border: 1px solid var(--z-border);
  background: var(--z-surface);
}
.zn-crud-editor-page .zn-form-actions--page {
  min-height: 50px;
  padding: 5px 12px;
  box-shadow: 0 -6px 16px rgba(15, 23, 42, .05);
}

/* FullPage fields retain their declared 12-column proportions on large desktops,
   then gain predictable three-, two-, and one-column density floors. */
@media (max-width: 1440px) and (min-width: 1101px) {
  .zn-form--full-page > .zn-col-1,
  .zn-form--full-page > .zn-col-2,
  .zn-form--full-page > .zn-col-3 { grid-column: span 4; }
}

@media (max-width: 1100px) and (min-width: 681px) {
  .zn-form--full-page > .zn-col-tablet-1 { grid-column: span 1; }
  .zn-form--full-page > .zn-col-tablet-2 { grid-column: span 2; }
  .zn-form--full-page > .zn-col-tablet-3 { grid-column: span 3; }
  .zn-form--full-page > .zn-col-tablet-4 { grid-column: span 4; }
  .zn-form--full-page > .zn-col-tablet-5 { grid-column: span 5; }
  .zn-form--full-page > .zn-col-tablet-6 { grid-column: span 6; }
  .zn-form--full-page > .zn-col-tablet-7 { grid-column: span 7; }
  .zn-form--full-page > .zn-col-tablet-8 { grid-column: span 8; }
  .zn-form--full-page > .zn-col-tablet-9 { grid-column: span 9; }
  .zn-form--full-page > .zn-col-tablet-10 { grid-column: span 10; }
  .zn-form--full-page > .zn-col-tablet-11 { grid-column: span 11; }
  .zn-form--full-page > .zn-col-tablet-12 { grid-column: span 12; }
}

@media (max-width: 680px) {
  .z-page-actions { width: 100%; justify-content: flex-start; }
  .zn-export-menu__items { inset-inline-start: 0; inset-inline-end: auto; }
  .zn-form--full-page > [class*=" zn-col-mobile-"] { grid-column: span 12; }
}

/* Wide workspaces use additional room for composition rather than stretching
   every control. Section widths are opt-in metadata and remain inert below this
   breakpoint, preserving the accepted normal-desktop flow. */
@media (min-width: 1600px) {
  .z-content:has(.zn-crud:not(.zn-crud-editor-page)),
  .zn-content:has(.zn-crud:not(.zn-crud-editor-page)) {
    max-width: var(--z-page-max-wide);
  }

  .zn-crud-editor-page .zn-tab-panel {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
    column-gap: 14px;
  }

  .zn-crud-editor-page .zn-tab-panel > .zn-form,
  .zn-crud-editor-page .zn-tab-panel > .zn-detail {
    grid-column: 1 / -1;
  }

  .zn-crud-editor-page .zn-tab-panel > .zn-section,
  .zn-crud-editor-page .zn-tab-panel > .zn-group {
    margin-top: 0;
    grid-column: span 12;
  }

  .zn-crud-editor-page .zn-tab-panel > .zn-node-col-1 { grid-column: span 1; }
  .zn-crud-editor-page .zn-tab-panel > .zn-node-col-2 { grid-column: span 2; }
  .zn-crud-editor-page .zn-tab-panel > .zn-node-col-3 { grid-column: span 3; }
  .zn-crud-editor-page .zn-tab-panel > .zn-node-col-4 { grid-column: span 4; }
  .zn-crud-editor-page .zn-tab-panel > .zn-node-col-5 { grid-column: span 5; }
  .zn-crud-editor-page .zn-tab-panel > .zn-node-col-6 { grid-column: span 6; }
  .zn-crud-editor-page .zn-tab-panel > .zn-node-col-7 { grid-column: span 7; }
  .zn-crud-editor-page .zn-tab-panel > .zn-node-col-8 { grid-column: span 8; }
  .zn-crud-editor-page .zn-tab-panel > .zn-node-col-9 { grid-column: span 9; }
  .zn-crud-editor-page .zn-tab-panel > .zn-node-col-10 { grid-column: span 10; }
  .zn-crud-editor-page .zn-tab-panel > .zn-node-col-11 { grid-column: span 11; }
  .zn-crud-editor-page .zn-tab-panel > .zn-node-col-12 { grid-column: span 12; }

  .z-drawer-medium { width: min(100%, var(--z-drawer-medium-wide)); max-width: var(--z-drawer-medium-wide); }
}

@media (forced-colors: active) {
  .zn-tab-list { border-color: CanvasText; box-shadow: none; }
  .zn-tab-button:focus-visible { outline-color: Highlight; }
  .zn-tab-button.is-active { color: Highlight; box-shadow: none; }
  .zn-tab-button.is-active::after { background: Highlight; }
  .zn-input:not(:disabled):not([readonly]):focus,
  .z-input:not(:disabled):not([readonly]):focus {
    border-color: Highlight;
    outline: 2px solid Highlight;
    outline-offset: 2px;
    box-shadow: none;
  }
  .z-field-error .zn-input:not(:disabled):not([readonly]):focus,
  .z-field-error .z-input:not(:disabled):not([readonly]):focus,
  .zn-field.has-errors .zn-input:not(:disabled):not([readonly]):focus,
  .zn-field.has-errors .z-input:not(:disabled):not([readonly]):focus,
  .zn-input[aria-invalid="true"]:not(:disabled):not([readonly]):focus,
  .z-input[aria-invalid="true"]:not(:disabled):not([readonly]):focus {
    border-color: Mark;
    outline-color: Mark;
  }
}

