/* Apovio Design System – Premium application shell */
:root {
  --ap-color-canvas: #f6f9fc;
  --ap-color-surface: #ffffff;
  --ap-color-surface-glass: rgba(255, 255, 255, .76);
  --ap-color-surface-muted: #f5f8fc;
  --ap-color-text: #111a36;
  --ap-color-text-muted: #64748b;
  --ap-color-border: #dce5ef;
  --ap-color-brand: #20bfa9;
  --ap-color-brand-strong: #129b93;
  --ap-color-blue: #3b82f6;
  --ap-color-purple: #8b5cf6;
  --ap-color-focus: #1cb8aa;
  --ap-color-danger: #b42318;
  --ap-color-warning: #8a4b08;
  --ap-space-1: 4px;
  --ap-space-2: 8px;
  --ap-space-3: 12px;
  --ap-space-4: 16px;
  --ap-space-5: 24px;
  --ap-space-6: 32px;
  --ap-space-7: 48px;
  --ap-space-8: 64px;
  --ap-radius-sm: 10px;
  --ap-radius-md: 16px;
  --ap-radius-lg: 24px;
  --ap-radius-xl: 28px;
  --ap-shadow-sm: 0 4px 14px rgba(37, 55, 88, .06);
  --ap-shadow-md: 0 16px 42px rgba(37, 55, 88, .09);
  --ap-shadow-floating: 0 22px 60px rgba(37, 55, 88, .12);
  --ap-focus-ring: 0 0 0 4px rgba(32, 191, 169, .18);
  --ap-transition-fast: 180ms cubic-bezier(.2,.8,.2,1);
  --ap-transition-base: 240ms cubic-bezier(.2,.8,.2,1);
  --ap-control-height: 44px;
  --ap-content-width: 1440px;

  --text: var(--ap-color-text);
  --text-soft: var(--ap-color-text-muted);
  --text-light: var(--ap-color-text-muted);
  --primary: var(--ap-color-brand);
  --primary-2: var(--ap-color-brand-strong);
  --panel-border: var(--ap-color-border);
}

html { scroll-behavior: smooth; }
body { line-height: 1.5; font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body:has(.app-shell) {
  background: radial-gradient(circle at 47% 5%, rgba(76, 201, 240, .08), transparent 24%), linear-gradient(135deg, #f7faff 0%, #f3f7fb 100%);
}

.app-shell { --sidebar-width: 284px; }
.sidebar {
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: 22px 18px;
  background: rgba(249, 252, 255, .82);
  border-right: 1px solid rgba(183, 199, 218, .5);
  box-shadow: 10px 0 40px rgba(51, 72, 103, .035);
  backdrop-filter: blur(22px);
  transition: width var(--ap-transition-base), padding var(--ap-transition-base);
  z-index: 40;
}
.brand { min-height: 62px; margin-bottom: 42px; padding: 0 4px; }
.brand-logo { width: 54px; height: 48px; background: transparent; box-shadow: none; }
.brand-logo img { width: 48px; height: 44px; }
.brand-text strong { font-size: 21px; letter-spacing: -.025em; }
.brand-text span { display: none; }
.sidebar-collapse {
  margin-left: auto; width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--ap-color-border);
  color: #38506f; background: rgba(255,255,255,.8); cursor: pointer; font-size: 24px; line-height: 1;
  box-shadow: var(--ap-shadow-sm); transition: transform var(--ap-transition-fast), background var(--ap-transition-fast);
}
.sidebar-collapse:hover { background: #fff; transform: translateX(-1px); }
.sidebar-section { margin-bottom: 28px; }
.sidebar-section-label { padding: 0 14px; margin-bottom: 10px; color: #8796ae; font-size: 11px; letter-spacing: .12em; }
.sidebar-nav { gap: 6px; }
.sidebar-link { min-height: 50px; padding: 11px 14px; border-radius: 14px; color: #233452; font-size: 14px; font-weight: 550; }
.sidebar-link-icon { display: grid; place-items: center; width: 24px; min-width: 24px; color: #324a6c; }
.sidebar-link-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-link:hover { background: rgba(235, 247, 249, .9); border-color: rgba(32,191,169,.08); transform: none; }
.sidebar-link:hover .sidebar-link-icon { transform: translateX(2px); }
.sidebar-link.active { color: #149f91; background: linear-gradient(110deg, rgba(235,253,249,.96), rgba(240,248,255,.9)); border-color: rgba(85,190,184,.18); box-shadow: 0 8px 22px rgba(41,156,149,.08); }
.sidebar-footer { margin-top: auto; }
.sidebar-user-context { padding-inline: 4px; }

.main { margin-left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); padding: 0 32px 42px; transition: margin-left var(--ap-transition-base), width var(--ap-transition-base); }
.app-topbar { height: 94px; display: flex; align-items: center; justify-content: space-between; gap: 24px; max-width: var(--ap-content-width); margin: 0 auto; }
.app-search { display: flex; align-items: center; gap: 11px; width: min(370px, 42vw); height: 50px; padding: 0 13px; border: 1px solid rgba(190,203,220,.6); border-radius: 15px; background: rgba(255,255,255,.7); color: #8492a9; box-shadow: var(--ap-shadow-sm); backdrop-filter: blur(16px); }
.app-search-icon { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: #536780; stroke-width: 1.8; stroke-linecap: round; }
.app-search kbd { margin-left: auto; padding: 4px 7px; border: 0; border-radius: 7px; background: #f3f6fa; color: #536780; font: 12px inherit; }
.app-topbar-actions { display: flex; align-items: center; gap: 12px; }
.app-icon-button { width: 46px; height: 46px; border: 1px solid rgba(220,229,239,.65); border-radius: 14px; background: rgba(255,255,255,.72); color: #5c708b; font: 600 16px inherit; box-shadow: var(--ap-shadow-sm); cursor: pointer; }
.app-user-menu { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 6px 14px 6px 7px; border: 1px solid rgba(220,229,239,.65); border-radius: 15px; background: rgba(255,255,255,.72); box-shadow: var(--ap-shadow-sm); }
.app-user-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #155f68; background: linear-gradient(135deg,#c7f8ec,#a9eafa); font-weight: 750; }
.app-user-menu strong { max-width: 140px; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }

.sidebar-collapsed .app-shell { --sidebar-width: 86px; }
.sidebar-collapsed .sidebar { padding-inline: 14px; overflow-x: hidden; }
.sidebar-collapsed .brand { justify-content: center; }
.sidebar-collapsed .brand-logo { width: 46px; }
.sidebar-collapsed .brand-text, .sidebar-collapsed .sidebar-section-label, .sidebar-collapsed .sidebar-link-label, .sidebar-collapsed .sidebar-user-context { display: none; }
.sidebar-collapsed .sidebar-collapse { position: fixed; left: 70px; top: 30px; transform: rotate(180deg); }
.sidebar-collapsed .sidebar-link { justify-content: center; padding-inline: 12px; }
.sidebar-collapsed .sidebar-link:hover { transform: none; }

.dashboard-console { max-width: var(--ap-content-width); margin: 0 auto; gap: 20px; animation: ap-page-in .28s ease both; }
.dashboard-hero-card { position: relative; min-height: 198px; padding: 38px 44px; overflow: hidden; isolation: isolate; border-radius: var(--ap-radius-xl); border: 1px solid rgba(201,215,229,.62); background: linear-gradient(105deg,rgba(255,255,255,.94),rgba(238,249,255,.8) 58%,rgba(231,255,247,.8)); box-shadow: var(--ap-shadow-md); }
.dashboard-command-copy { position: relative; z-index: 2; }
.dashboard-command-copy h1 { margin: 0 0 12px; color: #0d1734; font-size: clamp(34px,3vw,46px); font-weight: 750; }
.dashboard-command-copy p { max-width: 650px; font-size: 16px; line-height: 1.75; }
.dashboard-hero-art { position: absolute; z-index: 1; right: -4%; bottom: -42px; width: 48%; height: 190px; opacity: .9; transform: rotate(-5deg); }
.dashboard-hero-art span { position: absolute; inset: auto -5% 0; height: 74px; border: 6px solid rgba(255,255,255,.72); border-radius: 50%; filter: drop-shadow(0 8px 10px rgba(43,185,200,.12)); background: linear-gradient(180deg,rgba(37,198,209,.04),rgba(28,188,172,.42)); transform: skewX(-16deg); }
.dashboard-hero-art span:nth-child(2) { bottom: 34px; left: 12%; background: linear-gradient(180deg,rgba(69,176,247,.03),rgba(48,180,230,.34)); animation: ap-wave 11s ease-in-out infinite alternate; }
.dashboard-hero-art span:nth-child(3) { bottom: 12px; left: 34%; background: linear-gradient(180deg,rgba(69,210,189,.02),rgba(30,185,148,.4)); animation: ap-wave 14s ease-in-out infinite alternate-reverse; }
.dashboard-board-grid { display: block; }
.dashboard-news-card { padding: 24px 28px; border-radius: 23px; box-shadow: var(--ap-shadow-sm); }
.dashboard-panel-head { margin-bottom: 14px; }
.dashboard-panel-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; }
.dashboard-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #24bfa8; box-shadow: 0 0 0 4px rgba(36,191,168,.1); }
.dashboard-announcement-row { display: flex; align-items: flex-start; gap: 18px; }
.dashboard-announcement-icon { width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 15px; color: #178ee3; background: linear-gradient(135deg,#e3f6ff,#dcecff); font-size: 20px; }
.dashboard-announcement-row h3 { min-height: 0; margin: 2px 0 5px; font-size: 15px; }
.dashboard-news-content { font-size: 14px; line-height: 1.55; }
.dashboard-news-content p:last-child { margin-bottom: 0; }
.formcenter-modules-panel { padding: 10px 6px 6px; background: transparent; border: 0; box-shadow: none; backdrop-filter: none; }
.dashboard-module-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; }
.dashboard-module-card { position: relative; min-height: 168px; padding: 20px; border-radius: 20px; background: rgba(255,255,255,.7); border: 1px solid rgba(212,223,235,.66); box-shadow: var(--ap-shadow-sm); overflow: hidden; transition: transform var(--ap-transition-base), box-shadow var(--ap-transition-base), border-color var(--ap-transition-base); }
.dashboard-module-card:hover { transform: translateY(-4px); border-color: rgba(32,191,169,.28); box-shadow: var(--ap-shadow-md); }
.dashboard-module-card .formcenter-module-logo { width: 48px; height: 48px; border-radius: 14px; box-shadow: 0 9px 20px rgba(57,120,215,.15); }
.dashboard-module-card .formcenter-module-logo::before, .dashboard-module-card .formcenter-module-logo::after { display: none; }
.dashboard-module-card .formcenter-module-logo-core { min-width: 0; min-height: 0; padding: 0; border-radius: 0; color: #fff; background: transparent; }
.dashboard-module-card .formcenter-module-logo-core svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-module-card .formcenter-module-copy h3 { margin-top: 2px; font-size: 16px; }
.dashboard-module-card .formcenter-module-copy p { font-size: 13px; line-height: 1.45; }
.dashboard-module-arrow { position: absolute; right: 16px; bottom: 15px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: #667892; background: #f2f6fa; transition: transform var(--ap-transition-fast); }
.dashboard-module-card:hover .dashboard-module-arrow { transform: translateX(3px); }

@keyframes ap-page-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes ap-wave { to { transform: translateX(18px) skewX(-12deg) translateY(-6px); } }

.btn-primary { background: linear-gradient(135deg,var(--ap-color-brand),var(--ap-color-brand-strong)); box-shadow: 0 10px 22px rgba(20,159,145,.18); }
input:not([type='checkbox']):not([type='radio']), select, textarea { border-radius: 12px; background-color: rgba(255,255,255,.9); transition: border-color var(--ap-transition-fast), box-shadow var(--ap-transition-fast); }
.table-wrap { border-radius: var(--ap-radius-md); box-shadow: var(--ap-shadow-sm); }

/* Shared product surfaces: all authenticated modules inherit one visual language. */
.main > :not(.app-topbar) { max-width: var(--ap-content-width); margin-inline: auto; }
.hero, .tile, .info-card, .table-card, .panel, .card, .release-card, .module-card,
.admin-hero, .dashboard-command-card, .dashboard-console-topbar {
  border-color: rgba(207, 220, 234, .72);
  background-color: var(--ap-color-surface-glass);
  box-shadow: var(--ap-shadow-sm);
  backdrop-filter: blur(18px);
}
.card, .panel, .table-card, .admin-section-card, .side-card { border-radius: 20px; }
.dashboard-command-card:not(.dashboard-hero-card), .admin-hero {
  position: relative;
  overflow: hidden;
  padding: 28px 30px;
  border-radius: 23px;
  background: linear-gradient(112deg, rgba(255,255,255,.94), rgba(242,249,252,.9));
  box-shadow: var(--ap-shadow-md);
}
.dashboard-command-card:not(.dashboard-hero-card)::before, .admin-hero::before {
  content: ""; position: absolute; width: 190px; height: 190px; right: -50px; top: -95px; border-radius: 50%;
  background: radial-gradient(circle, rgba(67,211,197,.14), transparent 68%); pointer-events: none;
}
.dashboard-command-copy h1, .topbar h1, .admin-hero h2 { color: var(--ap-color-text); font-weight: 730; letter-spacing: -.035em; }
.dashboard-command-card:not(.dashboard-hero-card) .dashboard-command-copy h1 { margin-top: 0; font-size: clamp(30px, 3vw, 39px); }
.dashboard-command-copy p, .topbar p, .admin-hero p, .admin-section-head p { color: var(--ap-color-text-muted); line-height: 1.65; }
.dashboard-command-chip, .badge, .mini-chip, .module-badge {
  border-color: rgba(32,191,169,.16); background: rgba(229,249,246,.75); color: #137f78; font-weight: 650;
}
.section-head h2, .dashboard-panel-head h2, .admin-section-head h3 { color: var(--ap-color-text); font-weight: 700; letter-spacing: -.025em; }

.btn {
  min-height: 42px; padding: 10px 16px; border-radius: 12px; border-color: rgba(193,207,222,.7);
  background: rgba(255,255,255,.82); color: #263953; font-size: 14px; font-weight: 650;
  box-shadow: 0 1px 2px rgba(15,23,42,.03); transition: transform var(--ap-transition-fast), box-shadow var(--ap-transition-fast), border-color var(--ap-transition-fast), background var(--ap-transition-fast);
}
.btn:hover { border-color: rgba(32,191,169,.3); background: #fff; box-shadow: 0 8px 20px rgba(34,62,94,.09); }
.btn-primary { color: #fff; border-color: transparent; }
.btn-primary:hover { background: linear-gradient(135deg,#22cbb3,#0d918b); border-color: transparent; box-shadow: 0 12px 25px rgba(20,159,145,.23); }
.btn-danger-strong { background: linear-gradient(135deg,#dc5a64,#bd3f4b); }

label { color: #263852; font-size: 13px; font-weight: 650; }
.input, input:not([type='checkbox']):not([type='radio']), select, textarea {
  min-height: 44px; padding: 11px 13px; border: 1px solid rgba(190,204,220,.74); border-radius: 11px;
  background: rgba(255,255,255,.9); color: var(--ap-color-text); font-size: 14px; box-shadow: inset 0 1px 2px rgba(15,23,42,.015);
}
.input:hover, input:not([type='checkbox']):not([type='radio']):hover, select:hover, textarea:hover { border-color: rgba(144,164,187,.8); }
.input:focus, input:not([type='checkbox']):not([type='radio']):focus, select:focus, textarea:focus {
  border-color: var(--ap-color-focus); box-shadow: var(--ap-focus-ring); outline: none;
}
.field-note { font-size: 12px; line-height: 1.55; }
.module-fieldset { border-radius: 16px; border-color: rgba(207,220,234,.75); background: rgba(247,250,253,.72); }
.permission-card { border-radius: 14px; box-shadow: none; }
.permission-card:hover, .permission-card.selected { border-color: rgba(32,191,169,.32); box-shadow: 0 8px 20px rgba(34,62,94,.07); }

.admin-table-card { border-radius: 18px; }
.table { font-size: 14px; }
.table thead th { padding: 14px 18px; color: #687991; background: rgba(246,249,252,.94); font-size: 11px; font-weight: 750; letter-spacing: .075em; }
.table tbody td { padding: 17px 18px; border-color: rgba(221,229,238,.8); }
.table tbody tr { transition: background var(--ap-transition-fast); }
.table tbody tr:hover { background: rgba(235,250,248,.46); }
.user-avatar { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg,#35c9b3,#429be9); box-shadow: 0 7px 17px rgba(39,157,171,.16); }

.alert { padding: 13px 15px; border-radius: 13px; font-size: 14px; box-shadow: none; }
.alert-success { color: #08745d; background: #edf9f5; border-color: #bfe9dc; }
.alert-warning { color: #8a5514; background: #fff8e8; border-color: #f1ddb0; }
.alert-danger { color: #a43a43; background: #fff1f2; border-color: #f2c7cb; }
.empty, .admin-empty-inline, .admin-empty-card { border-radius: 16px; background: rgba(247,250,253,.82); border-color: rgba(184,201,219,.75); }

.filter-card, .settings-search-card { border-radius: 18px; }
.settings-module-tile, .formcenter-module-tile:not(.dashboard-module-card), .module-card, .tile {
  border-color: rgba(207,220,234,.72); border-radius: 18px; background: rgba(255,255,255,.76); box-shadow: var(--ap-shadow-sm);
  transition: transform var(--ap-transition-base), border-color var(--ap-transition-base), box-shadow var(--ap-transition-base);
}
.settings-module-tile:hover, .formcenter-module-link:hover, a.module-card:hover, a.tile:hover { transform: translateY(-3px); border-color: rgba(32,191,169,.28); box-shadow: var(--ap-shadow-md); }

/* Preserve the public dark marketing surface while sharing the improved control geometry. */
.landing-page .landing-btn-secondary, .auth-landing-page .landing-btn-secondary { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.16); }
.landing-page .landing-btn-secondary:hover, .auth-landing-page .landing-btn-secondary:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); }

/* Authentication follows the same calm, high-trust product identity. */
.auth-login-page {
  background: radial-gradient(circle at 18% 12%,rgba(60,207,190,.12),transparent 22%), radial-gradient(circle at 82% 20%,rgba(72,155,235,.11),transparent 24%), linear-gradient(145deg,#f8fbff,#f1f6fb) !important;
  color: var(--ap-color-text);
}
.auth-login-page .auth-landing-stage { color: var(--ap-color-text); padding-bottom: 64px; }
.auth-login-page .auth-landing-stage::before { background: radial-gradient(circle at 50% 55%,rgba(255,255,255,.7),transparent 38%); }
.auth-login-page .auth-landing-topbar { max-width: 1320px; margin: 0 auto; }
.auth-login-page .landing-brand { color: var(--ap-color-text); }
.auth-login-page .landing-nav-link { color: #52657f; background: rgba(255,255,255,.58); border-color: rgba(207,220,234,.7); }
.auth-login-page .landing-nav-link-accent { color: #117e77; background: rgba(224,248,244,.82); border-color: rgba(32,191,169,.18); }
.auth-login-page .auth-landing-login-grid { max-width: 760px; margin-top: 68px; }
.auth-login-page .auth-login-page-head { text-align: center; justify-items: center; }
.auth-login-page .auth-login-page-head h1 { color: var(--ap-color-text); font-size: clamp(38px,5vw,58px); font-weight: 740; }
.auth-login-page .auth-login-page-head p { max-width: 620px; color: var(--ap-color-text-muted); font-size: 16px; line-height: 1.65; }
.auth-login-page .auth-form-section-xupe { max-width: 560px; width: 100%; margin: 14px auto 0; padding: 30px; border-radius: 22px; background: rgba(255,255,255,.82); border-color: rgba(207,220,234,.76); box-shadow: var(--ap-shadow-floating); backdrop-filter: blur(20px); }
.auth-login-page .auth-form-section-xupe .auth-login-form .input { min-height: 50px; border-radius: 12px; }
.auth-login-page .auth-form-section-xupe .auth-submit-login { min-height: 50px; border-radius: 12px; color: #fff; background: linear-gradient(135deg,var(--ap-color-brand),var(--ap-color-brand-strong)); box-shadow: 0 12px 25px rgba(20,159,145,.2); }
.auth-login-page .auth-form-inline-link { text-align: center; }
.auth-login-page .auth-form-inline-link a { color: #128a82; font-size: 13px; }
.auth-login-page .auth-login-support { margin-top: 34px; text-align: center; }
.auth-login-page .auth-login-support-copy { justify-items: center; }
.auth-login-page .auth-login-support-kicker { color: #128a82; }
.auth-login-page .auth-login-support-copy h3 { color: var(--ap-color-text); font-size: 27px; }
.auth-login-page .auth-login-support-copy p { color: var(--ap-color-text-muted); font-size: 14px; line-height: 1.65; }
.auth-login-page .auth-login-service-item { text-align: left; border-radius: 16px; background: rgba(255,255,255,.64); border-color: rgba(207,220,234,.7); box-shadow: var(--ap-shadow-sm); }
.auth-login-page .auth-login-service-item strong { color: #137f78; font-size: 15px; }
.auth-login-page .auth-login-service-item span { color: var(--ap-color-text-muted); font-size: 13px; line-height: 1.55; }
.auth-shell:not(.auth-login-page) { background: radial-gradient(circle at 15% 10%,rgba(60,207,190,.1),transparent 24%),linear-gradient(145deg,#f8fbff,#f1f6fb); }
.auth-shell:not(.auth-login-page) .auth-card { border-color: rgba(207,220,234,.75); background: rgba(255,255,255,.82); box-shadow: var(--ap-shadow-floating); }

@media (min-width: 1280px) and (max-width: 1540px) { .dashboard-module-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }

.skip-link {
  position: fixed;
  z-index: 10000;
  top: var(--ap-space-3);
  left: var(--ap-space-3);
  padding: var(--ap-space-3) var(--ap-space-4);
  border-radius: var(--ap-radius-sm);
  background: var(--ap-color-text);
  color: #fff;
  font-weight: 800;
  transform: translateY(-180%);
  transition: transform .15s ease;
}
.skip-link:focus { transform: translateY(0); }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--ap-color-focus);
  outline-offset: 3px;
  box-shadow: var(--ap-focus-ring);
}

.btn { min-height: var(--ap-control-height); }
.btn:active { transform: translateY(0); }
.btn[aria-busy="true"] { cursor: wait; }
.btn-danger, .btn-danger-strong { color: var(--ap-color-danger); }

.input,
input:not([type='checkbox']):not([type='radio']),
select,
textarea {
  min-height: var(--ap-control-height);
  border-color: var(--ap-color-border);
}

input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--ap-color-danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, .15);
}

.field-note, .muted, .table-subline { color: var(--ap-color-text-muted); }
.alert { border-left: 4px solid currentColor; }

.main > :first-child { max-width: var(--ap-content-width); margin-inline: auto; }
.table-wrap:focus-visible { border-radius: var(--ap-radius-sm); }
.table tbody tr:focus-within { background: rgba(21, 94, 239, .06); }
.table th { vertical-align: bottom; }
.table td, .table th { line-height: 1.45; }

.sidebar-user-context {
  display: grid;
  gap: 2px;
  margin: 0 10px var(--ap-space-3);
  overflow-wrap: anywhere;
}
.sidebar-user-context span { color: var(--ap-color-text-muted); font-size: 12px; }
.sidebar-user-context strong { font-size: 14px; }

.mobile-nav-toggle,
.mobile-nav-overlay { display: none; }

@media (max-width: 960px) {
  body.nav-enhanced { padding-top: 64px; }
  .nav-enhanced .mobile-nav-toggle {
    display: inline-flex;
    position: fixed;
    z-index: 1002;
    top: 10px;
    left: 12px;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid var(--ap-color-border);
    border-radius: var(--ap-radius-sm);
    background: var(--ap-color-surface);
    color: var(--ap-color-text);
    font: inherit;
    font-weight: 700;
    box-shadow: var(--ap-shadow-sm);
  }
  .nav-enhanced .sidebar {
    position: fixed;
    z-index: 1001;
    inset: 0 auto 0 0;
    width: min(88vw, 320px);
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform .2s ease;
  }
  .nav-enhanced.nav-open .sidebar { transform: translateX(0); }
  .nav-enhanced .mobile-nav-overlay {
    position: fixed;
    z-index: 1000;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(15, 23, 42, .48);
  }
  .nav-enhanced.nav-open .mobile-nav-overlay { display: block; }
  .nav-enhanced.nav-open { overflow: hidden; }
  .nav-enhanced .main { width:100%; margin-left:0; padding-top:var(--ap-space-4); }
  .sidebar-collapse { display: none; }
  .sidebar-collapsed .app-shell { --sidebar-width: 284px; }
  .app-topbar { height: 58px; justify-content: flex-end; }
  .app-search { display: none; }
  .dashboard-module-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-hero-art { width: 55%; opacity: .55; }
}

@media (max-width: 640px) {
  .main { padding-inline: var(--ap-space-3); }
  .card, .dashboard-command-card, .dashboard-welcome { border-radius: var(--ap-radius-md); }
  .table thead th, .table tbody td { padding: 14px 12px; }
  .form-grid.two-up { grid-template-columns: 1fr; }
  .btn, .topbar-actions .btn, .admin-form-actions .btn { width: 100%; }
  .main { padding-inline: var(--ap-space-3); }
  .app-user-menu strong { display: none; }
  .dashboard-hero-card { min-height: 240px; padding: 28px 24px; }
  .dashboard-hero-art { width: 100%; height: 120px; right: -20%; opacity: .35; }
  .dashboard-module-grid { grid-template-columns: 1fr; }
  .dashboard-announcement-row { gap: 12px; }
}

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

/* Mandanten-Explorer: Apotheke -> Einrichtung -> Wohngruppe */
.tenant-breadcrumb { display:flex; align-items:center; gap:8px; margin:0 0 8px; color:#667892; font-size:13px; }
.tenant-breadcrumb a { color:#47627f; text-decoration:none; }
.tenant-breadcrumb a:hover { text-decoration:underline; }
.tenant-list-shell { overflow:hidden; padding:0; }
.tenant-list-toolbar { display:flex; align-items:center; gap:10px; padding:14px 16px; border-bottom:1px solid #e6ebf2; background:#fbfcfe; }
.tenant-search-control { position:relative; display:block; flex:1 1 360px; max-width:540px; }
.tenant-search-control svg { position:absolute; z-index:1; left:16px; top:50%; width:18px; height:18px; transform:translateY(-50%); fill:none; stroke:#526b82; stroke-width:1.8; pointer-events:none; }
.tenant-module-page .tenant-search-control input.input { padding-left:48px; }
.tenant-list-result { margin-left:auto; color:#64748b; font-size:13px; white-space:nowrap; }
.tenant-pharmacy-table th { white-space:nowrap; font-size:11px; letter-spacing:.055em; text-transform:uppercase; color:#66758a; }
.tenant-pharmacy-table td { vertical-align:middle; }
.tenant-pharmacy-cell { display:flex; align-items:center; gap:11px; min-width:240px; }
.tenant-pharmacy-cell > div { display:grid; gap:2px; }
.tenant-pharmacy-cell span { color:#728096; font-size:12px; }
.tenant-entity-icon { display:grid; place-items:center; width:34px; height:34px; flex:0 0 34px; border-radius:9px; background:#edf3fa; color:#355e86; }
.tenant-entity-icon svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.tenant-list-action { text-align:right; }
.tenant-toast-stack { position:fixed; z-index:900; top:76px; right:22px; width:min(420px,calc(100vw - 32px)); pointer-events:none; }
.tenant-toast-stack:empty { display:none; }
.tenant-toast-stack .alert { pointer-events:auto; box-shadow:0 14px 32px rgba(25,42,62,.16); }

.btn.tenant-create-button {
  color:#fff;
  background:#185b83;
  border-color:#185b83;
  box-shadow:0 6px 16px rgba(24,91,131,.22);
}
.btn.tenant-create-button:hover {
  color:#fff;
  background:#104866;
  border-color:#104866;
  box-shadow:0 8px 20px rgba(16,72,102,.28);
}
.btn.tenant-create-button:focus-visible {
  color:#fff;
  background:#104866;
  border-color:#fff;
  outline:3px solid #185b83;
  outline-offset:3px;
}
.btn.tenant-edit-button {
  color:#123f61;
  background:#e8f1f8;
  border:2px solid #39759f;
  box-shadow:0 3px 9px rgba(24,91,131,.12);
  font-weight:700;
}
.btn.tenant-edit-button:hover {
  color:#fff;
  background:#185b83;
  border-color:#185b83;
  box-shadow:0 6px 14px rgba(24,91,131,.24);
}
.btn.tenant-edit-button:focus-visible {
  color:#fff;
  background:#185b83;
  border-color:#fff;
  outline:3px solid #185b83;
  outline-offset:3px;
}

.tenant-explorer { display:grid; grid-template-columns:minmax(380px, 38%) minmax(0, 62%); gap:20px; align-items:start; min-height:620px; }
.tenant-tree-pane,.tenant-detail-pane { min-width:0; padding:0; overflow:hidden; }
.tenant-tree-pane { position:sticky; top:16px; border-radius:20px; }
.tenant-tree-pane-head { display:flex; align-items:center; justify-content:space-between; gap:18px; min-height:88px; padding:18px 20px; border-bottom:1px solid #dce5ee; background:linear-gradient(135deg,#f8fbfd,#f2f7fb); }
.tenant-tree-pane-head h2 { margin:5px 0 0; font-size:16px; line-height:1.35; }
.tenant-tree-pane-head .section-kicker { color:#17645e; }
.tenant-icon-button { display:grid; place-items:center; width:40px; height:40px; flex:0 0 40px; border:1px solid #d7e0eb; border-radius:10px; color:#315f89; background:#fff; }
.tenant-icon-button:hover { border-color:#9fb7cf; background:#f3f7fb; }
.tenant-icon-button svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; }
.tenant-tree { max-height:calc(100vh - 270px); overflow:auto; padding:16px 14px 20px; }
.tenant-tree details > summary { display:flex; align-items:center; min-width:0; list-style:none; cursor:default; }
.tenant-tree details > summary::-webkit-details-marker { display:none; }
.tenant-tree-row { display:flex; align-items:center; min-width:0; gap:7px; margin:3px 0; }
.tenant-tree-branch { margin:2px 0 6px; }
.tenant-tree-toggle-button { display:grid; place-items:center; width:30px; height:38px; flex:0 0 30px; padding:0; border:0; border-radius:8px; background:transparent; cursor:pointer; }
.tenant-tree-toggle-button:hover { background:#e8eef5; }
.tenant-tree-chevron { width:28px; height:36px; flex:0 0 28px; position:relative; cursor:pointer; }
.tenant-tree-chevron::before { content:""; position:absolute; left:9px; top:12px; width:8px; height:8px; border-right:2px solid #526b82; border-bottom:2px solid #526b82; transform:rotate(-45deg); transition:transform .15s ease; }
.tenant-tree details[open] > summary > .tenant-tree-chevron::before { transform:rotate(45deg); top:10px; }
.tenant-tree-toggle-button[aria-expanded="true"] .tenant-tree-chevron::before { transform:rotate(45deg); top:10px; }
.tenant-tree-label { display:flex; align-items:center; gap:10px; min-width:0; flex:1; min-height:44px; height:auto; padding:8px 13px; border:0; border-radius:10px; background:transparent; color:#263a50; font:inherit; font-size:14px; line-height:1.35; text-align:left; cursor:pointer; }
.tenant-tree-label:hover { background:#edf3f8; }
.tenant-tree-label.is-selected { background:#dceaf6; color:#174d78; font-weight:700; box-shadow:inset 4px 0 #2f719f,0 3px 9px rgba(47,113,159,.08); }
.tenant-tree-label svg { width:20px; height:20px; flex:0 0 20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.tenant-tree-label > span:not(.tenant-tree-status) { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tenant-tree-pharmacy { font-weight:700; }
.tenant-tree-children { margin:6px 0 8px 15px; padding:2px 0 2px 21px; border-left:2px solid #d7e3ed; }
.tenant-tree-leaf { display:flex; align-items:center; gap:7px; margin:5px 0; }
.tenant-tree-spacer { width:30px; flex:0 0 30px; }
.tenant-tree-unit .tenant-tree-label { color:#51657b; }
.tenant-tree-status { margin-left:auto; color:#9a6700; font-size:10px; font-weight:600; }
.tenant-tree-empty-state { margin:10px 6px 6px 8px; padding:16px; border:1px dashed #b8cad9; border-radius:11px; color:#536b82; font-size:13px; background:#f8fbfd; }
.tenant-tree-empty-state p { margin:0 0 10px; }

.tenant-detail-panel { padding:20px 22px 24px; }
.tenant-detail-panel[hidden] { display:none !important; }
.tenant-detail-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; padding-bottom:15px; margin-bottom:18px; border-bottom:1px solid #e5eaf1; }
.tenant-detail-heading h2 { margin:3px 0 4px; font-size:22px; }
.tenant-detail-heading p { margin:0; color:#6b7c91; font-size:13px; }
.tenant-detail-form { gap:15px; }
.tenant-detail-actions { display:flex; flex-wrap:wrap; gap:9px; padding-top:16px; border-top:1px solid #e7ecf2; }
.tenant-detail-meta { display:flex; flex-wrap:wrap; gap:8px 18px; color:#69798d; font-size:12px; }
.tenant-context-field { display:grid; gap:4px; padding:11px 13px; border:1px solid #dde5ee; border-radius:9px; background:#f8fafc; }
.tenant-context-field span { color:#536780; font-size:11px; text-transform:uppercase; letter-spacing:.05em; }

@media (max-width: 1100px) {
  .tenant-explorer { grid-template-columns:1fr; }
  .tenant-tree-pane { position:static; }
  .tenant-tree { max-height:460px; }
  .tenant-list-toolbar { flex-wrap:wrap; }
  .tenant-list-result { width:100%; margin-left:0; }
}

@media (max-width: 640px) {
  .tenant-detail-panel { padding:16px; }
  .tenant-tree-pane-head { min-height:78px; padding:15px 16px; }
  .tenant-tree { padding:12px 10px 16px; }
  .tenant-tree-children { margin-left:12px; padding-left:13px; }
  .tenant-tree-label { min-height:42px; padding:7px 10px; }
  .tenant-list-toolbar { align-items:stretch; }
  .tenant-search-control { max-width:none; flex-basis:100%; }
  .tenant-pharmacy-table { min-width:820px; }
}

@media (prefers-contrast: more) {
  :root { --ap-color-border: #7b8799; --ap-color-text-muted: #344054; }
  .card, .panel, .table-card, .input, input, select, textarea { border-width: 2px; }
}

/* Mandantenmodul: kontrastreiche und eindeutig erkennbare Aktionen */
.tenant-module-page .main .btn {
  color:#173f5f;
  background:#edf4f9;
  border:2px solid #527b99;
  box-shadow:0 3px 9px rgba(23,63,95,.12);
  font-weight:700;
}
.tenant-module-page .main .btn:hover {
  color:#fff;
  background:#174f78;
  border-color:#174f78;
  box-shadow:0 7px 16px rgba(23,79,120,.25);
}
.tenant-module-page .main .btn:focus-visible,
.tenant-module-page .main button:focus-visible,
.tenant-module-page .main a:focus-visible {
  outline:3px solid #0b6a9b;
  outline-offset:3px;
}
.tenant-module-page .main .btn.btn-primary,
.tenant-module-page .main .btn.tenant-create-button {
  color:#fff;
  background:#125a82;
  border-color:#125a82;
  box-shadow:0 6px 16px rgba(18,90,130,.25);
}
.tenant-module-page .main .btn.btn-primary:hover,
.tenant-module-page .main .btn.tenant-create-button:hover {
  color:#fff;
  background:#0b4364;
  border-color:#0b4364;
}
.tenant-module-page .main .btn.tenant-edit-button {
  color:#123f61;
  background:#e4f0f8;
  border-color:#39759f;
}
.tenant-module-page .main .btn.tenant-edit-button:hover {
  color:#fff;
  background:#174f78;
  border-color:#174f78;
}
.tenant-module-page .main .btn.btn-danger,
.tenant-module-page .main .btn.btn-danger-strong {
  color:#8a1c24;
  background:#fff0f1;
  border-color:#bd4a53;
}
.tenant-module-page .main .btn.btn-danger:hover,
.tenant-module-page .main .btn.btn-danger-strong:hover {
  color:#fff;
  background:#9f2832;
  border-color:#9f2832;
}
.tenant-module-page .main .btn.btn-warning-soft {
  color:#6d3b00;
  background:#fff3d6;
  border-color:#bd7b19;
}
.tenant-module-page .main .btn.btn-warning-soft:hover {
  color:#fff;
  background:#805006;
  border-color:#805006;
}
.tenant-module-page .main .btn:disabled,
.tenant-module-page .main button:disabled {
  color:#526170;
  background:#e3e8ed;
  border-color:#8d99a5;
  box-shadow:none;
  opacity:1;
}
.tenant-module-page .main .btn-small {
  min-height:40px;
  padding:9px 14px;
}
.tenant-module-page .tenant-icon-button {
  color:#fff;
  background:#125a82;
  border:2px solid #125a82;
  box-shadow:0 5px 13px rgba(18,90,130,.24);
}
.tenant-module-page .tenant-icon-button:hover {
  color:#fff;
  background:#0b4364;
  border-color:#0b4364;
}
.tenant-module-page .tenant-tree-toggle-button {
  border:1px solid #b8c8d6;
  background:#f1f6fa;
}
.tenant-module-page .tenant-tree-toggle-button:hover {
  border-color:#527b99;
  background:#dceaf4;
}
.tenant-module-page .tenant-tree-label:not(.is-selected) {
  border:1px solid #d5e0e9;
  background:#f8fafc;
}
.tenant-module-page .tenant-tree-label:not(.is-selected):hover {
  border-color:#8ca9bf;
  background:#e8f1f7;
}
.tenant-module-page .facility-record-tab {
  color:#173f5f;
  background:#edf4f9;
  border:2px solid #8ba6ba;
  font-weight:700;
}
.tenant-module-page .facility-record-tab:hover,
.tenant-module-page .facility-record-tab.is-active {
  color:#fff;
  background:#17645e;
  border-color:#17645e;
}

/* Standortbenutzer: kompakte Enterprise-Arbeitsansicht */
.facility-users-page-shell {
  display:grid;
  gap:18px;
  max-width:1560px;
  margin:0 auto;
}
.facility-users-page-header {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:24px;
  padding:2px 0 6px;
}
.facility-users-heading-block { min-width:0; }
.facility-users-heading-block .tenant-breadcrumb { margin-bottom:9px; font-size:13px; }
.facility-users-title-row { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.facility-users-title-row h1 {
  margin:0;
  color:#101a35;
  font-size:clamp(28px,2.4vw,32px);
  line-height:1.15;
  letter-spacing:-.03em;
}
.facility-users-heading-block > p { margin:7px 0 0; color:#62738a; font-size:14px; }
.facility-users-context-badge,
.facility-users-type-badge {
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:4px 9px;
  border:1px solid #b9ddd8;
  border-radius:8px;
  color:#17645e;
  background:#edf8f6;
  font-size:12px;
  font-weight:700;
}
.facility-users-header-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:9px; }
.facility-users-page-shell .btn {
  min-height:40px;
  padding:9px 14px;
  border:1px solid #9eb0c1;
  border-radius:9px;
  color:#173f5f;
  background:#fff;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
  font-size:13px;
  font-weight:700;
}
.facility-users-page-shell .btn:hover {
  color:#123b58;
  border-color:#527b99;
  background:#f3f7fa;
  box-shadow:0 3px 8px rgba(23,63,95,.1);
}
.facility-users-page-shell .btn.btn-primary {
  color:#fff;
  border-color:#176d78;
  background:#176d78;
  box-shadow:0 3px 9px rgba(23,109,120,.18);
}
.facility-users-page-shell .btn.btn-primary:hover { border-color:#105860; background:#105860; }
.facility-users-page-shell :is(.btn,button,input,select):focus-visible { outline:3px solid rgba(23,109,120,.28); outline-offset:2px; }
.facility-users-context-line {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  min-height:34px;
  color:#65758a;
  font-size:13px;
}
.facility-users-context-line svg { width:17px; height:17px; fill:none; stroke:#52758b; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.facility-users-context-line strong { color:#243b53; font-weight:700; }
.facility-users-workspace {
  overflow:hidden;
  border:1px solid #dce5ee;
  border-radius:16px;
  background:#fff;
  box-shadow:0 2px 8px rgba(15,23,42,.045);
}
.facility-users-toolbar {
  display:grid;
  grid-template-columns:minmax(250px,1.45fr) repeat(4,minmax(130px,.82fr)) minmax(145px,.8fr) auto auto;
  align-items:center;
  gap:9px;
  padding:14px 16px;
  border-bottom:1px solid #e4eaf0;
  background:#f8fafc;
}
.facility-users-toolbar-compact {
  grid-template-columns:minmax(280px,1fr) minmax(190px,.34fr) auto auto;
}
.facility-users-toolbar label { min-width:0; }
.facility-users-toolbar .input {
  width:100%;
  min-height:42px;
  height:42px;
  padding:9px 12px;
  border:1px solid #cbd7e2;
  border-radius:8px;
  color:#17243d;
  background:#fff;
  box-shadow:none;
  font-size:13px;
}
.facility-users-toolbar .input:hover { border-color:#9db0c2; }
.facility-users-toolbar .input:focus { border-color:#2c7f87; box-shadow:0 0 0 3px rgba(44,127,135,.12); }
.facility-users-search-field { position:relative; display:block; }
.facility-users-search-field svg {
  position:absolute;
  z-index:1;
  left:13px;
  top:50%;
  width:17px;
  height:17px;
  transform:translateY(-50%);
  fill:none;
  stroke:#657a90;
  stroke-width:1.8;
  pointer-events:none;
}
.facility-users-search-field input.input { padding-left:39px; }
.facility-users-filter-submit { white-space:nowrap; }
.facility-users-reset { white-space:nowrap; }
.facility-users-content-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  padding:18px 20px 10px;
}
.facility-users-content-head h2 { margin:0; color:#15213b; font-size:20px; letter-spacing:-.02em; }
.facility-users-content-head p { margin:4px 0 0; color:#586b82; font-size:13px; }
.facility-users-count {
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:4px 9px;
  border-radius:7px;
  color:#52657b;
  background:#f1f5f8;
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
}
.facility-users-page-shell .facility-user-tabset {
  display:flex;
  align-items:center;
  gap:3px;
  margin:0;
  padding:0 20px;
  overflow-x:auto;
  border-bottom:1px solid #dfe6ed;
}
.facility-users-page-shell .facility-user-tab {
  position:relative;
  min-height:40px;
  padding:8px 11px;
  border:0;
  border-radius:7px 7px 0 0;
  color:#5d6e82;
  background:transparent;
  box-shadow:none;
  font-size:13px;
  font-weight:650;
  white-space:nowrap;
  transform:none;
}
.facility-users-page-shell .facility-user-tab:hover { color:#1d4d61; background:#f2f7f8; }
.facility-users-page-shell .facility-user-tab.is-active {
  color:#17645e;
  background:#eff8f6;
  border:0;
  box-shadow:none;
  transform:none;
}
.facility-users-page-shell .facility-user-tab.is-active::after {
  content:"";
  position:absolute;
  right:8px;
  bottom:0;
  left:8px;
  height:2px;
  border-radius:2px 2px 0 0;
  background:#198579;
}
.facility-user-table-wrap { width:100%; overflow-x:auto; }
.facility-user-data-table { width:100%; min-width:1120px; border-collapse:collapse; table-layout:auto; }
.facility-user-data-table th {
  padding:10px 14px;
  border-bottom:1px solid #e1e7ee;
  color:#66768a;
  background:#fbfcfd;
  font-size:11px;
  font-weight:700;
  letter-spacing:.045em;
  text-align:left;
  text-transform:uppercase;
  white-space:nowrap;
}
.facility-user-data-table td {
  padding:12px 14px;
  border-bottom:1px solid #e7ecf1;
  color:#263b50;
  font-size:13px;
  vertical-align:middle;
}
.facility-user-data-table tbody tr:last-child td { border-bottom:0; }
.facility-user-data-table tbody tr:not(.facility-users-empty-row):hover td { background:#f8fafb; }
.facility-users-page-shell .facility-user-card.facility-user-table-row {
  display:table-row;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
.facility-users-page-shell .facility-user-table-row[hidden] { display:none !important; }
.facility-users-page-shell .facility-user-card-identity { gap:10px; }
.facility-users-page-shell .facility-user-avatar {
  width:36px;
  height:36px;
  flex:0 0 36px;
  color:#145966;
  background:#d9f2f1;
  box-shadow:none;
  font-size:13px;
}
.facility-users-page-shell .facility-user-card-copy { gap:2px; }
.facility-users-page-shell .facility-user-card-copy h4 { font-size:14px; font-weight:650; }
.facility-users-page-shell .facility-user-card-copy p { color:#586b82; font-size:12px; }
.facility-user-role-badge {
  display:inline-flex;
  min-height:25px;
  align-items:center;
  padding:3px 8px;
  border:1px solid #d0dbe5;
  border-radius:7px;
  color:#42566d;
  background:#f5f7f9;
  font-size:11px;
  font-weight:700;
  white-space:nowrap;
}
.facility-user-role-admin { color:#17546a; border-color:#b9d8e3; background:#eef7fa; }
.facility-users-page-shell .facility-user-card-badges .chip {
  min-height:25px;
  padding:3px 8px;
  border-radius:7px;
  font-size:11px;
  white-space:nowrap;
}
.facility-users-page-shell .facility-user-card-badges .chip-success { color:#08734d; }
.facility-users-page-shell .facility-user-card-badges .chip::before {
  content:"";
  width:6px;
  height:6px;
  flex:0 0 6px;
  border-radius:50%;
  background:currentColor;
}
.facility-users-page-shell .mini-chip-group { gap:4px; }
.facility-users-page-shell .mini-chip { padding:3px 7px; border-radius:6px; font-size:11px; }
.facility-user-assignment-list { max-width:270px; }
.facility-user-module-list { max-width:240px; }
.facility-user-created { color:#52657a; white-space:nowrap; }
.facility-users-page-shell .facility-user-card-actions { flex-wrap:nowrap; justify-content:flex-end; gap:6px; }
.facility-users-page-shell .facility-user-card-actions .btn { min-height:34px; padding:7px 10px; font-size:12px; white-space:nowrap; }
.facility-users-page-shell .facility-user-card-actions form { margin:0; }
.facility-users-empty-row td { padding:0; }
.facility-users-empty-state {
  display:grid;
  justify-items:center;
  min-height:210px;
  padding:32px 20px;
  text-align:center;
}
.facility-users-empty-state > svg {
  width:38px;
  height:38px;
  margin-bottom:12px;
  fill:none;
  stroke:#7890a4;
  stroke-width:1.45;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.facility-users-empty-state h3 { margin:0; color:#1c2b45; font-size:17px; }
.facility-users-empty-state p { max-width:520px; margin:7px 0 16px; color:#586b82; font-size:13px; line-height:1.55; }
.facility-users-empty-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; }

@media (max-width:1350px) {
  .facility-users-toolbar { grid-template-columns:minmax(260px,1.5fr) repeat(3,minmax(145px,1fr)); }
  .facility-users-search-field { grid-column:span 2; }
}
@media (max-width:900px) {
  .facility-users-page-header { align-items:flex-start; flex-direction:column; }
  .facility-users-header-actions { justify-content:flex-start; }
  .facility-users-toolbar { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .facility-users-toolbar-compact { grid-template-columns:minmax(0,1fr) minmax(180px,.5fr); }
  .facility-users-search-field { grid-column:1 / -1; }
  .facility-users-filter-submit,.facility-users-reset { width:100%; }
}
@media (max-width:640px) {
  .facility-users-page-shell { gap:14px; }
  .facility-users-title-row h1 { font-size:27px; }
  .facility-users-header-actions { width:100%; }
  .facility-users-header-actions .btn { width:100%; }
  .facility-users-toolbar { grid-template-columns:1fr; padding:12px; }
  .facility-users-toolbar-compact { grid-template-columns:1fr; }
  .facility-users-search-field { grid-column:auto; }
  .facility-users-content-head { align-items:flex-start; padding:16px 14px 9px; }
  .facility-users-page-shell .facility-user-tabset { padding-inline:12px; }
}

/* Enterprise user creation */
.user-create-page {
  --user-create-accent:#176b78;
  --user-create-accent-soft:#edf7f7;
  --user-create-border:#d9e3ec;
  --user-create-muted:#607188;
  width:100%;
  max-width:1240px;
}
.user-create-page .user-create-header {
  align-items:flex-end;
  margin-bottom:14px;
  padding-bottom:0;
}
.user-create-page .user-create-header h1 {
  margin:0;
  color:#14213d;
  font-size:clamp(28px,2.5vw,32px);
  font-weight:740;
  letter-spacing:-.035em;
  line-height:1.15;
}
.user-create-page .user-create-header p {
  max-width:720px;
  margin:7px 0 0;
  color:var(--user-create-muted);
  font-size:14px;
  line-height:1.55;
}
.user-create-breadcrumb { margin-bottom:10px; font-size:12px; }
.user-create-breadcrumb strong { color:#40546d; font-weight:700; }
.user-create-back-button { min-height:40px; padding:8px 13px; border-radius:8px; }
.user-create-back-button svg {
  width:17px;
  height:17px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.user-create-meta-bar {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px 18px;
  width:min(100%,1080px);
  margin-bottom:14px;
  padding:10px 14px;
  border:1px solid var(--user-create-border);
  border-radius:10px;
  background:#f9fbfd;
  color:#5a6c82;
  font-size:12px;
  box-shadow:0 1px 2px rgba(15,23,42,.025);
}
.user-create-state,
.user-create-context-badge {
  display:inline-flex;
  align-items:center;
  gap:7px;
  color:#27566b;
  font-weight:700;
}
.user-create-state > span {
  width:7px;
  height:7px;
  border-radius:50%;
  background:#25a995;
  box-shadow:0 0 0 3px rgba(37,169,149,.11);
}
.user-create-context-badge {
  min-height:25px;
  padding:3px 8px;
  border:1px solid #c8e0df;
  border-radius:6px;
  background:#eef8f7;
  color:#24656b;
  font-size:11px;
}
.user-create-meta-item { position:relative; padding-left:14px; }
.user-create-meta-item::before {
  content:"";
  position:absolute;
  left:0;
  top:50%;
  width:4px;
  height:4px;
  border-radius:50%;
  background:#a4b3c2;
  transform:translateY(-50%);
}
.user-create-page .admin-edit-grid-single { display:block; width:min(100%,1080px); }
.user-create-page .admin-edit-main { padding:0; }
.user-create-page .user-create-workspace {
  width:100%;
  padding:0;
  overflow:visible;
  border:1px solid var(--user-create-border);
  border-radius:13px;
  background:#fff;
  box-shadow:0 4px 14px rgba(34,52,78,.055);
}
.user-create-page .facility-record-tabset {
  display:flex;
  flex-wrap:nowrap;
  gap:24px;
  margin:0;
  padding:0 28px;
  overflow-x:auto;
  border-bottom:1px solid #e3e9ef;
  scrollbar-width:thin;
}
.user-create-page .facility-record-tab {
  position:relative;
  display:inline-flex;
  width:auto;
  min-height:52px;
  flex:0 0 auto;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:0 2px;
  border:0;
  border-radius:0;
  background:transparent;
  color:#69788c;
  font-size:13px;
  font-weight:650;
  box-shadow:none;
  cursor:pointer;
}
.user-create-page .facility-record-tab::after {
  content:"";
  position:absolute;
  right:0;
  bottom:-1px;
  left:0;
  height:2px;
  border-radius:2px 2px 0 0;
  background:transparent;
}
.user-create-page .facility-record-tab:hover { color:#253c58; background:transparent; }
.user-create-page .facility-record-tab.is-active {
  color:#153f50;
  border:0;
  background:transparent;
  box-shadow:none;
}
.user-create-page .facility-record-tab.is-active::after { background:var(--user-create-accent); }
.user-create-page .facility-record-tab:focus-visible { outline:3px solid rgba(23,107,120,.2); outline-offset:-4px; }
.user-create-step-number {
  display:grid;
  place-items:center;
  width:22px;
  height:22px;
  border:1px solid #d3dde6;
  border-radius:6px;
  background:#f5f7f9;
  color:#708095;
  font-size:11px;
  font-weight:750;
}
.user-create-page .facility-record-tab.is-active .user-create-step-number {
  border-color:#aad5d2;
  background:var(--user-create-accent-soft);
  color:var(--user-create-accent);
}
.user-create-page .user-record-card { padding:28px 32px 30px; }
.user-create-page .user-create-panel-heading {
  margin:0 0 24px;
  padding:0 0 16px;
  border-bottom:1px solid #e6ebf0;
}
.user-create-page .user-create-panel-heading h3,
.user-create-page .user-record-card > .admin-section-head h3 {
  margin:0 0 4px;
  color:#17243d;
  font-size:20px;
  font-weight:700;
  letter-spacing:-.02em;
}
.user-create-page .user-create-panel-heading p,
.user-create-page .user-record-card > .admin-section-head p {
  margin:0;
  color:var(--user-create-muted);
  font-size:13px;
  line-height:1.55;
}
.user-create-form-section { display:grid; gap:16px; }
.user-create-section-heading h4 { margin:0; color:#24344c; font-size:15px; font-weight:700; }
.user-create-section-heading p { margin:3px 0 0; color:#596a7e; font-size:12px; }
.user-create-divider { height:1px; margin:24px 0; background:#e8edf2; }
.user-create-page .user-create-field-grid { gap:18px; }
.user-create-field { display:grid; align-content:start; gap:7px; min-width:0; }
.user-create-label-row { display:flex; min-height:18px; align-items:center; gap:7px; color:#243650; font-size:12px; font-weight:700; }
.user-create-optional,
.user-create-auto-badge {
  display:inline-flex;
  min-height:20px;
  align-items:center;
  padding:2px 6px;
  border:1px solid #d9e1e8;
  border-radius:5px;
  background:#f6f8fa;
  color:#55677c;
  font-size:10px;
  font-weight:700;
}
.user-create-field small { color:#596a7e; font-size:11px; font-weight:500; line-height:1.45; }
.user-create-page .user-create-field .input {
  min-height:44px;
  padding:10px 12px;
  border-color:#ccd8e4;
  border-radius:8px;
  background:#fff;
  font-size:14px;
}
.user-create-page .user-create-field .input:hover { border-color:#9eb1c3; }
.user-create-page .user-create-field .input:focus {
  border-color:var(--user-create-accent);
  box-shadow:0 0 0 3px rgba(23,107,120,.12);
}
.user-create-technical-status {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-top:2px;
  padding:12px 14px;
  border:1px solid #e0e7ed;
  border-radius:8px;
  background:#f8fafc;
}
.user-create-technical-status > div { display:grid; gap:2px; }
.user-create-technical-status strong { color:#46596f; font-size:12px; font-weight:650; }
.user-create-system-label { color:#55677c; font-size:10px; font-weight:750; letter-spacing:.06em; text-transform:uppercase; }
.user-create-status-badge {
  display:inline-flex;
  min-height:25px;
  flex:0 0 auto;
  align-items:center;
  gap:6px;
  padding:3px 8px;
  border:1px solid #d6dee6;
  border-radius:6px;
  background:#f5f7f9;
  color:#56677b;
  font-size:11px;
  font-weight:700;
}
.user-create-status-badge > span { width:6px; height:6px; border-radius:50%; background:currentColor; }
.user-create-status-badge.is-pending { border-color:#cdd9e5; background:#f3f6f9; color:#52677d; }
.user-create-status-badge.is-active { border-color:#bde3d8; background:#eef9f5; color:#14795f; }
.user-create-status-badge.is-warning { border-color:#f0d4a6; background:#fff8eb; color:#9a5b09; }
.user-create-status-badge.is-muted { border-color:#d9dee5; background:#f3f4f6; color:#697386; }
.user-create-provision-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(280px,.8fr); gap:18px; align-items:stretch; }
.user-create-system-info {
  display:grid;
  align-content:center;
  gap:4px;
  min-height:91px;
  padding:12px 14px;
  border:1px solid #dce5eb;
  border-radius:8px;
  background:#f8fafb;
}
.user-create-system-info-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.user-create-auto-badge { border-color:#bfe0dd; background:#edf8f6; color:#266f70; }
.user-create-system-info > strong { color:#2d4159; font-size:12px; }
.user-create-system-info > p { margin:0; color:#55697d; font-size:11px; line-height:1.45; }
.user-create-info-callout {
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:11px 13px;
  border:1px solid #cfe2e7;
  border-radius:8px;
  background:#f2f8fa;
}
.user-create-info-callout > svg {
  width:17px;
  height:17px;
  flex:0 0 17px;
  margin-top:1px;
  fill:none;
  stroke:#397485;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.user-create-info-callout strong { color:#2b5060; font-size:12px; }
.user-create-info-callout p { margin:2px 0 0; color:#5f7484; font-size:11px; line-height:1.5; }
.user-create-page .user-record-card > .admin-section-head { margin:0 0 20px; padding:0 0 14px; }
.user-create-page .module-fieldset {
  padding:18px;
  border-color:#dce4eb;
  border-radius:9px;
  background:#fafbfd;
}
.user-create-page .module-fieldset legend { color:#405169; font-size:12px; }
.user-create-page .permission-card { border-radius:8px; }
.user-create-page .facility-record-card .inline-note {
  padding:11px 13px;
  border-radius:8px;
  background:#f7f9fb;
  font-size:12px;
}
.user-create-page .user-create-action-bar {
  position:sticky;
  z-index:12;
  bottom:12px;
  justify-content:flex-end;
  margin-top:0;
  padding:13px 18px;
  border-top:1px solid #dce4eb;
  border-radius:0 0 12px 12px;
  background:rgba(255,255,255,.97);
  box-shadow:0 -5px 14px rgba(24,39,60,.055);
  backdrop-filter:blur(8px);
}
.user-create-page .user-create-action-bar .btn { min-height:40px; border-radius:8px; }
.user-create-page .user-create-action-bar .btn-primary {
  min-width:150px;
  color:#fff;
  border-color:#165f70;
  background:#165f70;
  box-shadow:0 2px 5px rgba(22,95,112,.18);
}
.user-create-page .user-create-action-bar .btn-primary:hover { border-color:#104b5a; background:#104b5a; }

@media (max-width:900px) {
  .user-create-page .user-create-header { align-items:flex-start; }
  .user-create-page .facility-record-tabset { gap:18px; padding-inline:22px; }
  .user-create-page .user-record-card { padding:24px; }
}
@media (max-width:700px) {
  .user-create-page .user-create-header { gap:12px; }
  .user-create-page .user-create-header .topbar-actions { width:auto; }
  .user-create-page .user-create-header .btn { width:auto; }
  .user-create-meta-bar { align-items:flex-start; flex-direction:column; gap:7px; }
  .user-create-meta-item { padding-left:0; }
  .user-create-meta-item::before { display:none; }
  .user-create-page .facility-record-tabset { gap:17px; padding-inline:16px; }
  .user-create-page .facility-record-tab { min-height:49px; font-size:12px; }
  .user-create-page .user-record-card { padding:20px 16px 24px; }
  .user-create-page .user-create-field-grid,
  .user-create-provision-grid { grid-template-columns:1fr; }
  .user-create-technical-status { align-items:flex-start; flex-direction:column; gap:9px; }
  .user-create-page .user-create-action-bar { bottom:0; padding:12px; }
  .user-create-page .user-create-action-bar .btn { width:100%; }
  .user-create-page .user-create-action-bar .btn-primary { order:-1; }
}

/* Global enterprise button contrast: normal state must never depend on hover. */
.btn.btn-primary,
a.btn.btn-primary,
button.btn.btn-primary {
  color:#fff;
  border-color:#176d78;
  background:#176d78;
  box-shadow:0 3px 9px rgba(23,109,120,.2);
}
.btn.btn-primary:hover,
a.btn.btn-primary:hover,
button.btn.btn-primary:hover {
  color:#fff;
  border-color:#105861;
  background:#105861;
  box-shadow:0 6px 14px rgba(16,88,97,.24);
}
.btn.btn-primary:active,
a.btn.btn-primary:active,
button.btn.btn-primary:active {
  color:#fff;
  border-color:#0c4850;
  background:#0c4850;
  box-shadow:0 2px 5px rgba(12,72,80,.2);
}
.btn.btn-danger {
  color:#8f2029;
  border-color:#d08389;
  background:#fff3f4;
  box-shadow:0 1px 3px rgba(143,32,41,.06);
}
.btn.btn-danger:hover {
  color:#fff;
  border-color:#9e2b35;
  background:#9e2b35;
  box-shadow:0 5px 12px rgba(158,43,53,.2);
}
.btn.btn-danger-strong {
  color:#fff;
  border-color:#b53b47;
  background:#b53b47;
  box-shadow:0 3px 9px rgba(181,59,71,.2);
}
.btn.btn-danger-strong:hover {
  color:#fff;
  border-color:#962f3a;
  background:#962f3a;
}
.btn.btn-warning-soft {
  color:#714006;
  border-color:#d29b4a;
  background:#fff4dd;
  box-shadow:0 1px 3px rgba(113,64,6,.06);
}
.btn.btn-warning-soft:hover {
  color:#fff;
  border-color:#815109;
  background:#815109;
}
.btn:focus-visible,
a.btn:focus-visible,
button.btn:focus-visible {
  outline:3px solid rgba(23,109,120,.35);
  outline-offset:3px;
}
.btn:disabled,
button.btn:disabled,
.btn[aria-disabled="true"] {
  color:#536578;
  border-color:#aebbc7;
  background:#e7ecf1;
  box-shadow:none;
  opacity:1;
  cursor:not-allowed;
  transform:none;
}
