: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-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-font: Inter, "Segoe UI", Arial, sans-serif;
}

: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: auto;
  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 {
  display: flex;
  align-items: center;
  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 {
  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 { display: grid; gap: 6px; }
.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: 8px;
  border: 1px solid var(--z-sidebar-border);
  background: var(--z-sidebar-card);
}
.z-nav a[href=""]::before,
.zn-nav-link[href=""]::before { box-shadow: inset 0 0 0 6px color-mix(in srgb, var(--z-primary) 62%, transparent); }
.z-nav a[href*="records"]::before,
.zn-nav-link[href*="records"]::before { box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--z-info) 62%, transparent); }
.z-nav a[href*="system"]::before,
.zn-nav-link[href*="system"]::before { box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--z-warning) 62%, transparent); }
.z-nav a[href*="ui-playground"]::before,
.zn-nav-link[href*="ui-playground"]::before { box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--z-success) 62%, transparent); }
.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 { 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 {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--z-border);
  border-radius: 999px;
  background: var(--z-surface-alt);
}
.z-theme-selector button {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  color: var(--z-text-muted);
  background: transparent;
  padding: 0 10px;
  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: #fff;
  background: var(--z-primary);
}

.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-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; }
.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:focus, .z-input:focus {
  border-color: var(--z-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--z-primary) 18%, transparent);
}
.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: 220px; white-space: nowrap; }
.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-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-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: 1480px;
  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 {
  border-color: color-mix(in srgb, var(--z-danger) 55%, var(--z-border));
}

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