/* =============================================================
   Lenskart IdP ? SSO Access Management + Identity Governance
   Inspired by OneLogin, miniOrange, Entrust + SailPoint, Saviynt
   ============================================================= */

/* Shared design tokens — colours live only in [data-theme] blocks below */
:root {
  --radius:       6px;
  --radius-lg:    10px;
  --font:         'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'IBM Plex Mono', 'Cascadia Code', Menlo, Consolas, monospace;
  --text-xs:      0.6875rem;
  --text-sm:      0.8125rem;
  --text-md:      0.875rem;
  --text-lg:      1.0625rem;
  --text-xl:      1.25rem;
  --text-2xl:     1.5rem;
}

[data-theme="light"] {
  --bg:           #f0f2f5;
  --bg-tint:      #e8ecf2;
  --surface:      #ffffff;
  --surface-2:    #f7f8fa;
  --surface-3:    #eef1f5;
  --border:       #dce1e8;
  --border-strong:#c5cdd8;
  --text:         #0f172a;
  --text-muted:   #475569;
  --text-dim:     #94a3b8;
  --primary:      #0f4c81;
  --primary-hover:#0a3a63;
  --primary-soft: #e8f1f8;
  --primary-dark: #0a2744;
  --accent:       #0e7490;
  --accent-soft:  rgba(14,116,144,0.12);
  --success:      #047857;
  --success-soft: #d1fae5;
  --success-text: #065f46;
  --warning:      #b45309;
  --warning-soft: #fef3c7;
  --warning-text: #92400e;
  --danger:       #b91c1c;
  --danger-soft:  #fee2e2;
  --danger-text:  #991b1b;
  --info:         #0f4c81;
  --info-soft:    #e8f1f8;
  --info-text:    #0a2744;
  --teal:         #0f766e;
  --purple:       #5b21b6;
  --pink:         #be185d;
  --orange:       #c2410c;
  --topnav-bg:    #0a1628;
  --topnav-text:  #94a3b8;
  --topnav-active:#ffffff;
  --topnav-border:#152238;
  --subnav-bg:    #111d2e;
  --subnav-text:  #7c8da3;
  --subnav-border:#1c2d45;
  --overlay:      rgba(10,22,40,0.58);
  --hero-from:    #0a2744;
  --hero-mid:     #0f4c81;
  --hero-to:      #0e7490;
  --code-bg:      #0f172a;
  --code-text:    #e2e8f0;
  --code-muted:   #94a3b8;
  --shadow-sm:    0 1px 2px rgba(15,23,41,0.04);
  --shadow:       0 2px 8px rgba(15,23,41,0.06);
  --shadow-lg:    0 12px 28px rgba(15,23,41,0.10);
  --focus-ring:   0 0 0 3px rgba(15,76,129,0.18);
}

[data-theme="dark"] {
  --bg:           #0b1220;
  --bg-tint:      #111827;
  --surface:      #1e293b;
  --surface-2:    #273449;
  --surface-3:    #334155;
  --border:       #334155;
  --border-strong:#475569;
  --text:         #f1f5f9;
  --text-muted:   #94a3b8;
  --text-dim:     #64748b;
  --primary:      #60a5fa;
  --primary-hover:#3b82f6;
  --primary-soft: rgba(59,130,246,0.16);
  --primary-dark: #bfdbfe;
  --accent:       #22d3ee;
  --accent-soft:  rgba(34,211,238,0.12);
  --success:      #34d399;
  --success-soft: rgba(16,185,129,0.16);
  --success-text: #6ee7b7;
  --warning:      #fbbf24;
  --warning-soft: rgba(245,158,11,0.16);
  --warning-text: #fcd34d;
  --danger:       #f87171;
  --danger-soft:  rgba(248,113,113,0.14);
  --danger-text:  #fca5a5;
  --info:         #60a5fa;
  --info-soft:    rgba(59,130,246,0.16);
  --info-text:    #93c5fd;
  --teal:         #2dd4bf;
  --purple:       #a78bfa;
  --pink:         #f472b6;
  --orange:       #fb923c;
  --topnav-bg:    #020617;
  --topnav-text:  #94a3b8;
  --topnav-active:#f8fafc;
  --topnav-border:#1e293b;
  --subnav-bg:    #0f172a;
  --subnav-text:  #64748b;
  --subnav-border:#334155;
  --overlay:      rgba(2,6,23,0.72);
  --hero-from:    #020617;
  --hero-mid:     #1e3a8a;
  --hero-to:      #0891b2;
  --code-bg:      #020617;
  --code-text:    #e2e8f0;
  --code-muted:   #64748b;
  --shadow-sm:    0 1px 2px rgba(0,0,0,0.25);
  --shadow:       0 4px 12px rgba(0,0,0,0.35);
  --shadow-lg:    0 12px 32px rgba(0,0,0,0.45);
  --focus-ring:   0 0 0 3px rgba(96,165,250,0.28);
}

[data-theme="ocean"] {
  --bg:           #f0fdfa;
  --bg-tint:      #ecfeff;
  --surface:      #ffffff;
  --surface-2:    #f0fdfa;
  --surface-3:    #ccfbf1;
  --border:       #99f6e4;
  --border-strong:#5eead4;
  --text:         #134e4a;
  --text-muted:   #3d6b68;
  --text-dim:     #5f8a87;
  --primary:      #0d9488;
  --primary-hover:#0f766e;
  --primary-soft: #ccfbf1;
  --primary-dark: #115e59;
  --accent:       #0891b2;
  --accent-soft:  rgba(8,145,178,0.12);
  --success:      #059669;
  --success-soft: #d1fae5;
  --success-text: #065f46;
  --warning:      #d97706;
  --warning-soft: #fef3c7;
  --warning-text: #92400e;
  --danger:       #dc2626;
  --danger-soft:  #fee2e2;
  --danger-text:  #991b1b;
  --info:         #0d9488;
  --info-soft:    #ccfbf1;
  --info-text:    #115e59;
  --teal:         #0f766e;
  --purple:       #7c3aed;
  --pink:         #db2777;
  --orange:       #ea580c;
  --topnav-bg:    #134e4a;
  --topnav-text:  #99f6e4;
  --topnav-active:#ecfeff;
  --topnav-border:#115e59;
  --subnav-bg:    #115e59;
  --subnav-text:  #5eead4;
  --subnav-border:#0f766e;
  --overlay:      rgba(19,78,74,0.55);
  --hero-from:    #115e59;
  --hero-mid:     #0d9488;
  --hero-to:      #0891b2;
  --code-bg:      #134e4a;
  --code-text:    #ecfeff;
  --code-muted:   #5eead4;
  --shadow-sm:    0 1px 2px rgba(19,78,74,0.06);
  --shadow:       0 2px 8px rgba(19,78,74,0.08);
  --shadow-lg:    0 12px 28px rgba(19,78,74,0.12);
  --focus-ring:   0 0 0 3px rgba(13,148,136,0.22);
}

[data-theme="slate"] {
  --bg:           #f8fafc;
  --bg-tint:      #f1f5f9;
  --surface:      #ffffff;
  --surface-2:    #f8fafc;
  --surface-3:    #f1f5f9;
  --border:       #e2e8f0;
  --border-strong:#cbd5e1;
  --text:         #0f172a;
  --text-muted:   #64748b;
  --text-dim:     #94a3b8;
  --primary:      #475569;
  --primary-hover:#334155;
  --primary-soft: #f1f5f9;
  --primary-dark: #1e293b;
  --accent:       #64748b;
  --accent-soft:  rgba(100,116,139,0.12);
  --success:      #047857;
  --success-soft: #d1fae5;
  --success-text: #065f46;
  --warning:      #b45309;
  --warning-soft: #fef3c7;
  --warning-text: #92400e;
  --danger:       #b91c1c;
  --danger-soft:  #fee2e2;
  --danger-text:  #991b1b;
  --info:         #475569;
  --info-soft:    #e2e8f0;
  --info-text:    #1e293b;
  --teal:         #0f766e;
  --purple:       #5b21b6;
  --pink:         #be185d;
  --orange:       #c2410c;
  --topnav-bg:    #1e293b;
  --topnav-text:  #cbd5e1;
  --topnav-active:#f8fafc;
  --topnav-border:#334155;
  --subnav-bg:    #334155;
  --subnav-text:  #94a3b8;
  --subnav-border:#475569;
  --overlay:      rgba(15,23,42,0.55);
  --hero-from:    #1e293b;
  --hero-mid:     #475569;
  --hero-to:      #64748b;
  --code-bg:      #1e293b;
  --code-text:    #f1f5f9;
  --code-muted:   #94a3b8;
  --shadow-sm:    0 1px 2px rgba(15,23,42,0.04);
  --shadow:       0 2px 8px rgba(15,23,42,0.06);
  --shadow-lg:    0 12px 28px rgba(15,23,42,0.10);
  --focus-ring:   0 0 0 3px rgba(71,85,105,0.22);
}

[data-theme="violet"] {
  --bg:           #faf5ff;
  --bg-tint:      #f5f3ff;
  --surface:      #ffffff;
  --surface-2:    #faf5ff;
  --surface-3:    #ede9fe;
  --border:       #ddd6fe;
  --border-strong:#c4b5fd;
  --text:         #2e1065;
  --text-muted:   #5b4b8a;
  --text-dim:     #7c6aad;
  --primary:      #7c3aed;
  --primary-hover:#6d28d9;
  --primary-soft: #ede9fe;
  --primary-dark: #4c1d95;
  --accent:       #a855f7;
  --accent-soft:  rgba(168,85,247,0.12);
  --success:      #059669;
  --success-soft: #d1fae5;
  --success-text: #065f46;
  --warning:      #d97706;
  --warning-soft: #fef3c7;
  --warning-text: #92400e;
  --danger:       #dc2626;
  --danger-soft:  #fee2e2;
  --danger-text:  #991b1b;
  --info:         #7c3aed;
  --info-soft:    #ede9fe;
  --info-text:    #4c1d95;
  --teal:         #0d9488;
  --purple:       #6d28d9;
  --pink:         #db2777;
  --orange:       #ea580c;
  --topnav-bg:    #2e1065;
  --topnav-text:  #ddd6fe;
  --topnav-active:#faf5ff;
  --topnav-border:#4c1d95;
  --subnav-bg:    #4c1d95;
  --subnav-text:  #c4b5fd;
  --subnav-border:#6d28d9;
  --overlay:      rgba(46,16,101,0.55);
  --hero-from:    #4c1d95;
  --hero-mid:     #7c3aed;
  --hero-to:      #a855f7;
  --code-bg:      #2e1065;
  --code-text:    #f5f3ff;
  --code-muted:   #c4b5fd;
  --shadow-sm:    0 1px 2px rgba(46,16,101,0.05);
  --shadow:       0 2px 8px rgba(46,16,101,0.07);
  --shadow-lg:    0 12px 28px rgba(46,16,101,0.11);
  --focus-ring:   0 0 0 3px rgba(124,58,237,0.22);
}

[data-theme="midnight"] {
  --bg:           #060912;
  --bg-tint:      #0c101d;
  --surface:      #121829;
  --surface-2:    #181f33;
  --surface-3:    #1f2740;
  --border:       #2a334d;
  --border-strong:#3d4a6a;
  --text:         #e8eaf6;
  --text-muted:   #9aa3c2;
  --text-dim:     #6b7494;
  --primary:      #818cf8;
  --primary-hover:#6366f1;
  --primary-soft: rgba(99,102,241,0.18);
  --primary-dark: #c7d2fe;
  --accent:       #a78bfa;
  --accent-soft:  rgba(167,139,250,0.14);
  --success:      #4ade80;
  --success-soft: rgba(74,222,128,0.14);
  --success-text: #86efac;
  --warning:      #fbbf24;
  --warning-soft: rgba(251,191,36,0.14);
  --warning-text: #fde68a;
  --danger:       #fb7185;
  --danger-soft:  rgba(251,113,133,0.14);
  --danger-text:  #fda4af;
  --info:         #818cf8;
  --info-soft:    rgba(99,102,241,0.18);
  --info-text:    #a5b4fc;
  --teal:         #2dd4bf;
  --purple:       #c084fc;
  --pink:         #f472b6;
  --orange:       #fb923c;
  --topnav-bg:    #030510;
  --topnav-text:  #8b93b8;
  --topnav-active:#f5f3ff;
  --topnav-border:#151b2e;
  --subnav-bg:    #0a0f1c;
  --subnav-text:  #6b7494;
  --subnav-border:#2a334d;
  --overlay:      rgba(3,5,16,0.78);
  --hero-from:    #030510;
  --hero-mid:     #312e81;
  --hero-to:      #6366f1;
  --code-bg:      #030510;
  --code-text:    #e0e7ff;
  --code-muted:   #6b7494;
  --shadow-sm:    0 1px 2px rgba(0,0,0,0.32);
  --shadow:       0 4px 14px rgba(0,0,0,0.42);
  --shadow-lg:    0 14px 36px rgba(0,0,0,0.52);
  --focus-ring:   0 0 0 3px rgba(129,140,248,0.28);
}

[data-theme="sand"] {
  --bg:           #f7f2ea;
  --bg-tint:      #f3ece2;
  --surface:      #fffcf7;
  --surface-2:    #faf6ef;
  --surface-3:    #f0e8dc;
  --border:       #e4d8c8;
  --border-strong:#d4c4ae;
  --text:         #3d3428;
  --text-muted:   #6b5f52;
  --text-dim:     #9a8b7a;
  --primary:      #9a6b3c;
  --primary-hover:#7c5429;
  --primary-soft: #f5ebe0;
  --primary-dark: #5c3d1e;
  --accent:       #b8860b;
  --accent-soft:  rgba(184,134,11,0.12);
  --success:      #047857;
  --success-soft: #d1fae5;
  --success-text: #065f46;
  --warning:      #b45309;
  --warning-soft: #fef3c7;
  --warning-text: #92400e;
  --danger:       #b91c1c;
  --danger-soft:  #fee2e2;
  --danger-text:  #991b1b;
  --info:         #9a6b3c;
  --info-soft:    #f5ebe0;
  --info-text:    #5c3d1e;
  --teal:         #0f766e;
  --purple:       #7c3aed;
  --pink:         #be185d;
  --orange:       #c2410c;
  --topnav-bg:    #3d3428;
  --topnav-text:  #d9cfc1;
  --topnav-active:#fffcf7;
  --topnav-border:#524638;
  --subnav-bg:    #524638;
  --subnav-text:  #b8a893;
  --subnav-border:#6b5f52;
  --overlay:      rgba(61,52,40,0.55);
  --hero-from:    #524638;
  --hero-mid:     #9a6b3c;
  --hero-to:      #b8860b;
  --code-bg:      #3d3428;
  --code-text:    #f5ebe0;
  --code-muted:   #b8a893;
  --shadow-sm:    0 1px 2px rgba(61,52,40,0.05);
  --shadow:       0 2px 8px rgba(61,52,40,0.07);
  --shadow-lg:    0 12px 28px rgba(61,52,40,0.11);
  --focus-ring:   0 0 0 3px rgba(154,107,60,0.22);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#app { min-height: 100vh; }
#app:has(.shell) {
  height: 100vh;
  overflow: hidden;
}

/* app-root wrapper ? must carry height:100% down to .shell */
.app-root {
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
#app:has(.app-root) {
  height: 100vh;
  overflow: hidden;
}
.app-root:has(.shell) {
  height: 100vh;
  overflow: hidden;
}
.app-root > .shell {
  flex: 1 1 0;
  min-height: 0;
}

@supports (height: 100dvh) {
  #app,
  .app-root { min-height: 100dvh; }
  #app:has(.shell),
  #app:has(.app-root),
  .app-root:has(.shell) { height: 100dvh; }
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-3);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

button { font-family: inherit; cursor: pointer; }

/* ============================================================
   LOGIN — always light page; logo/accent from Branding settings
   ============================================================ */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  --login-accent: #0f4c81;
  --login-accent-hover: #0c3d68;
  --login-text: #0f172a;
  --login-muted: #475569;
  background: #f4f7fb;
}

.auth-shell--light {
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, color-mix(in srgb, var(--login-accent) 14%, transparent) 0%, transparent 60%),
    radial-gradient(ellipse 45% 40% at 90% 90%, color-mix(in srgb, var(--login-accent) 8%, transparent) 0%, transparent 55%),
    linear-gradient(180deg, #f8fafc 0%, #eef3f9 55%, #e8eef6 100%);
  color: var(--login-text);
}

.auth-shell--light.auth-shell--bg-image {
  background-color: #f4f7fb;
  background-image:
    linear-gradient(180deg, rgba(244, 247, 251, 0.92) 0%, rgba(238, 243, 249, 0.94) 100%),
    var(--login-bg-image);
  background-size: cover;
  background-position: center;
}

.auth-hero { display: none; }

.auth-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow-y: auto;
  z-index: 1;
}

.auth-theme-bar {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
}

.auth-shell--light .theme-picker-btn {
  background: #fff;
  border: 1px solid #d0d7e2;
  color: var(--login-accent);
  box-shadow: 0 2px 8px rgba(15, 76, 129, 0.08);
}

.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 2.1rem;
  box-shadow: var(--shadow-lg);
}

.auth-card--light {
  max-width: 340px;
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #dce3ec;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 18px 40px rgba(15, 76, 129, 0.1);
  color: var(--login-text);
}

.auth-card--light .muted,
.auth-card--light .hint,
.auth-card--light .auth-lead {
  color: var(--login-muted) !important;
}

.auth-card--light .auth-lead {
  font-size: 0.82rem !important;
  margin-bottom: 1rem !important;
  text-align: center;
}

.auth-card--light #email-form,
.auth-card--light #password-form {
  width: 100%;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

.auth-card--light .field {
  margin-bottom: 0.75rem;
}

.auth-card--light .field label {
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.auth-card--light .form-input,
.auth-card--light input[type="email"],
.auth-card--light input[type="password"],
.auth-card--light input[type="text"],
.auth-card--light .otp-masked {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: var(--login-text);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  min-height: 2.35rem;
  box-sizing: border-box;
}

.auth-card--light .form-input::placeholder,
.auth-card--light input::placeholder {
  color: #94a3b8;
}

.auth-card--light .form-input:focus,
.auth-card--light input:focus {
  outline: none;
  border-color: var(--login-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--login-accent) 22%, transparent);
  background: #fff;
}

.auth-card--light .auth-continue.btn-primary,
.auth-shell--light .auth-continue.btn-primary,
.auth-shell--light .btn-primary {
  background: var(--login-accent);
  border-color: var(--login-accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 8px;
  min-height: 2.35rem;
  padding: 0.5rem 1rem;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--login-accent) 24%, transparent);
}

.auth-card--light .auth-continue.btn-primary:hover,
.auth-shell--light .btn-primary:hover {
  background: var(--login-accent-hover);
  border-color: var(--login-accent-hover);
  color: #fff;
}

.auth-card--light .auth-sso-btn.btn-secondary,
.auth-card--light .btn-secondary {
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  border-radius: 8px;
}

.auth-card--light .auth-sso-btn.btn-secondary:hover,
.auth-card--light .btn-secondary:hover {
  background: color-mix(in srgb, var(--login-accent) 8%, #fff);
  border-color: color-mix(in srgb, var(--login-accent) 45%, #cbd5e1);
  color: var(--login-accent);
}

.auth-sso-btn--google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.5rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  max-width: 280px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.auth-sso-btn--google .auth-google-logo {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
}

.auth-sso-btn--google .auth-sso-btn__label {
  text-align: left;
  font-weight: 500;
}

.auth-sso-btn--google .auth-sso-btn__label strong {
  font-weight: 700;
  color: inherit;
}

.auth-card--light .auth-divider {
  max-width: 280px;
  margin: 0.85rem auto;
}

.auth-card--light .auth-sso-btn--google.btn-secondary:hover {
  color: #1e293b;
}

.auth-card--light .auth-sso-btn--google.btn-secondary:hover .auth-sso-btn__label {
  color: var(--login-accent);
}

.auth-card--light .btn-link {
  color: var(--login-accent);
}

.auth-card--light a {
  color: var(--login-accent);
}

.auth-card--light .alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.auth-card--light .alert-success {
  background: #eff6ff;
  border-color: color-mix(in srgb, var(--login-accent) 35%, #bfdbfe);
  color: #1e3a5f;
}

.auth-card--light .alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.auth-card--light .alert-info {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0c4a6e;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.15rem;
  gap: 0.35rem;
}

.auth-brand-logo {
  display: block;
  max-height: 52px;
  max-width: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin-bottom: 0.35rem;
}

.auth-brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
  background: var(--login-accent);
  border: 1px solid color-mix(in srgb, var(--login-accent) 70%, #000);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--login-accent) 28%, transparent);
  margin-bottom: 0.35rem;
}

.auth-brand-name {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--login-accent);
  line-height: 1.1;
}

.auth-brand-sub {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--login-accent) 55%, #64748b);
}

.auth-lead {
  text-align: center;
  margin: 0 0 1.35rem !important;
  font-size: 0.9rem !important;
}

.auth-step-title {
  font-size: 1.15rem !important;
  font-weight: 600;
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
  color: var(--login-text);
  text-align: center;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 1.15rem 0;
  color: #94a3b8;
  font-size: 0.75rem;
  text-transform: lowercase;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.auth-card--light .auth-avatar-circle {
  background: color-mix(in srgb, var(--login-accent) 12%, #fff);
  color: var(--login-accent);
  border: 1px solid color-mix(in srgb, var(--login-accent) 28%, #e2e8f0);
}

.auth-card--light .auth-email-chip {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.auth-card--light .auth-email-chip a {
  color: var(--login-accent);
}

.auth-card h2 { font-size: 1.35rem; font-weight: 600; margin-bottom: 0.3rem; letter-spacing: -0.025em; }
.auth-card .muted { color: var(--login-muted); font-size: 0.85rem; margin-bottom: 1.5rem; line-height: 1.45; }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
}

/* ============================================================
   MODAL SYSTEM
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 1200; /* above profile drawer (1100) so nested edit modals center on screen */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px rgba(10,22,40,0.2);
  width: 520px;
  max-width: 96vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modal-in 0.16s ease;
}
@keyframes modal-in {
  from { opacity:0; transform:translateY(6px); }
  to   { opacity:1; transform:translateY(0); }
}

.modal-header {
  padding: 0.95rem 1.2rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface-2);
}
.modal-header h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
}

.modal-body {
  padding: 1.1rem 1.2rem;
  overflow-y: auto;
  flex: 1;
}

/* ============================================================
   INTEGRATION WIZARD (multi-step modal)
   ============================================================ */
.modal.modal-wizard {
  width: 760px;
}
.modal.modal-wide {
  width: 860px;
}
.modal-wizard .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
}
.modal-wizard .modal-header .wizard-title-block { min-width: 0; flex: 1; }
.modal-wizard .modal-header h2 { font-size: 1.05rem; font-weight: 700; }
.modal-wizard .modal-header .muted { font-size: 0.78rem; margin-top: 0.15rem; color: var(--text-muted); }
.modal-wizard .wizard-close {
  background: transparent;
  border: none;
  width: 32px; height: 32px;
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
}
.modal-wizard .wizard-close:hover { background: var(--surface-2); color: var(--text); }

.wizard-stepper {
  display: flex;
  align-items: center;
  padding: 0.85rem 1.5rem;
  background: var(--surface-3);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  gap: 0;
  overflow-x: auto;
  flex-shrink: 0;
}
.wizard-stepper .wiz-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
}
.wizard-stepper .wiz-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.78rem;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  color: var(--text-dim);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.wizard-stepper .wiz-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
}
.wizard-stepper .wiz-sep {
  width: 28px;
  height: 2px;
  background: var(--border-strong);
  margin: 0 0.65rem;
  border-radius: 2px;
}
.wizard-stepper .wiz-step-active .wiz-num {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.18);
}
.wizard-stepper .wiz-step-active .wiz-label { color: var(--primary); font-weight: 600; }
.wizard-stepper .wiz-step-done .wiz-num {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.wizard-stepper .wiz-step-done + .wiz-sep,
.wizard-stepper .wiz-step-done .wiz-sep { background: var(--success); }
.wizard-stepper .wiz-step-done .wiz-label { color: var(--text); }

.modal-wizard .modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}
.modal-wizard .modal-footer .footer-right { display: flex; gap: 0.5rem; }

.wizard-success {
  text-align: center;
  padding: 2rem 1rem 1rem;
}
.wizard-success .check-circle {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.wizard-success .check-circle svg { width: 32px; height: 32px; stroke-width: 2.5; }
.wizard-success h3 { font-size: 1.1rem; font-weight: 700; }
.wizard-success p.muted { font-size: 0.88rem; margin: 0.4rem 0 1.25rem; }

.wiz-vendor-card {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.85rem;
  background: var(--surface-3);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.wiz-vendor-card .wiz-vendor-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 1.25rem;
  flex-shrink: 0;
}
.wiz-vendor-card h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.wiz-vendor-card p { margin: 0.25rem 0 0; font-size: 0.82rem; color: var(--text-muted); }

.wiz-tip-list {
  margin: 0.5rem 0 0 1.25rem;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
}
.wiz-tip-list li { margin-bottom: 0.25rem; }

.wiz-readonly-input {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.wiz-readonly-input input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--surface-2);
}
.wiz-readonly-input .copy-btn {
  flex-shrink: 0;
  font-size: 0.75rem;
}

.modal-footer {
  padding: 0.75rem 1.2rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.45rem;
  justify-content: flex-end;
  flex-shrink: 0;
  flex-wrap: wrap;
  background: var(--surface-2);
}

/* ============================================================
   FORMS  (form-group / form-label / form-input etc.)
   ============================================================ */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}
.field .hint { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.3rem; }

/* OTP fields: mask digits without type=password (avoids password-manager hangs on login/MFA). */
input.otp-masked {
  -webkit-text-security: disc;
  letter-spacing: 0.15em;
}

/* Modern form-* aliases used by admin views */
.form-group { margin-bottom: 1rem; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.form-hint {
  font-size: 0.73rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-sm);
  font-family: inherit;
  line-height: 1.4;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
  background: var(--surface);
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-dim); }
.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled { background: var(--surface-3); cursor: not-allowed; opacity: 0.7; }

.form-textarea { resize: vertical; min-height: 80px; }
.form-select   { cursor: pointer; appearance: auto; }

.form-check {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.form-check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* filter bar */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.filter-bar .form-input,
.filter-bar .form-select { width: auto; min-width: 140px; }
.filter-bar label { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); white-space: nowrap; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.4rem;
  min-height: 34px;
  padding: 0.45rem 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 550;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.1s ease, box-shadow 0.12s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(0.5px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn-primary  { background: var(--primary); color: white; box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset; }
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); text-decoration: none; }
.btn-danger  { background: var(--surface); color: var(--danger); border-color: rgba(185,28,28,0.35); }
.btn-danger:hover { background: var(--danger); color: white; border-color: var(--danger); }
.btn-ghost    { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-block { width: 100%; }
.btn-sm { min-height: 28px; padding: 0.28rem 0.6rem; font-size: var(--text-xs); }
.btn-lg { min-height: 40px; padding: 0.65rem 1.15rem; font-size: var(--text-md); }

.divider {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 1.5rem 0;
  position: relative;
}
.divider::before, .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--border);
}
.divider::before { left: 0; }
.divider::after  { right: 0; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  display: flex; align-items: flex-start; gap: 0.55rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  margin-bottom: 0.85rem;
  border: 1px solid transparent;
  border-left-width: 3px;
  border-left-style: solid;
  line-height: 1.4;
}
.alert-error   { background: var(--danger-soft);  color: var(--danger-text);  border-color: color-mix(in srgb, var(--danger) 22%, transparent); border-left-color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success-text); border-color: color-mix(in srgb, var(--success) 22%, transparent); border-left-color: var(--success); }
.alert-warning { background: var(--warning-soft); color: var(--warning-text); border-color: color-mix(in srgb, var(--warning) 22%, transparent); border-left-color: var(--warning); }
.alert-info    { background: var(--info-soft);    color: var(--info-text);    border-color: color-mix(in srgb, var(--info) 18%, transparent); border-left-color: var(--primary); }

/* ============================================================
   TOP-NAV SHELL  (SailPoint IdentityNow-style primary nav,
                   miniOrange-style content area)
   ============================================================ */
.shell {
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.topnav {
  background: var(--topnav-bg);
  border-bottom: 1px solid var(--topnav-border);
  display: flex;
  align-items: stretch;
  height: 52px;
  min-height: 52px;
  flex-shrink: 0;
  padding: 0 1rem 0 1.1rem;
  gap: 1rem;
  z-index: 50;
}

.topnav .brand {
  display: flex; align-items: center; gap: 0.55rem;
  color: white; font-weight: 600; font-size: 0.92rem; letter-spacing: -0.02em;
  padding-right: 0.9rem;
  border-right: 1px solid var(--topnav-border);
  flex-shrink: 0;
  white-space: nowrap;
}

.topnav .brand-logo {
  width: 28px; height: 28px;
  background: linear-gradient(145deg, var(--hero-mid) 0%, var(--hero-to) 100%);
  border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 0.82rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}

.primary-nav {
  display: flex;
  align-items: stretch;
  flex: 1;
  min-width: 0;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.primary-nav::-webkit-scrollbar { display: none; }

.primary-nav button {
  background: transparent;
  border: none;
  color: var(--topnav-text);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0 1rem;
  display: flex; align-items: center; gap: 0.4rem;
  cursor: pointer;
  position: relative;
  font-family: inherit;
  white-space: nowrap;
}
.primary-nav button:hover { color: var(--topnav-active); }
.primary-nav button.active { color: var(--topnav-active); }
.primary-nav button.active::after {
  content: '';
  position: absolute;
  left: 0.85rem; right: 0.85rem; bottom: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}
.primary-nav .badge-count {
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  margin-left: 0.25rem;
  font-weight: 700;
}

/* Admin pill ? Entrust-style separator + accented chip in the dark topnav */
.primary-nav .admin-pill {
  margin-left: auto;
  align-self: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--topnav-active);
  font-weight: 600;
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  display: inline-flex; align-items: center; gap: 0.45rem;
  height: 32px;
}
.primary-nav .admin-pill .i-wrap { display: inline-flex; }
.primary-nav .admin-pill .i { width: 16px; height: 16px; }
.primary-nav .admin-pill:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.24); }
.primary-nav .admin-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.primary-nav .admin-pill.active::after { display: none; }

.topnav-actions {
  display: flex; align-items: center; gap: 0.5rem;
  padding-left: 1rem;
  border-left: 1px solid var(--topnav-border);
  flex-shrink: 0;
}

.search-global {
  position: relative;
}
.search-global input {
  width: 220px;
  padding: 0.4rem 0.75rem 0.4rem 2rem;
  border-radius: 999px;
  border: 1px solid var(--topnav-border);
  background: var(--subnav-bg);
  color: white;
  font-size: 0.85rem;
  font-family: inherit;
}
.search-global input::placeholder { color: var(--subnav-text); }
.search-global input:focus { outline: none; border-color: var(--accent); }
.search-global::before {
  content: '?';
  position: absolute; left: 0.7rem; top: 50%;
  transform: translateY(-50%);
  color: var(--subnav-text);
  font-size: 1rem;
}

.profile-menu {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.3rem 0.6rem 0.3rem 0.35rem;
  border: 1px solid var(--topnav-border);
  border-radius: 999px;
  background: var(--subnav-bg);
  cursor: pointer;
  position: relative;
}
.profile-menu:hover { border-color: var(--accent); }

.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.75rem;
}

.profile-name { font-size: 0.8rem; font-weight: 500; color: white; }
.profile-role { font-size: 0.65rem; color: var(--subnav-text); text-transform: uppercase; letter-spacing: 0.05em; }

.profile-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  padding: 0.4rem;
  display: none;
  z-index: 200;
}
.profile-dropdown.open { display: block; }
.profile-dropdown a, .profile-dropdown button {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 5px;
  font-size: 0.85rem;
  color: var(--text);
  width: 100%; text-align: left;
  border: none; background: transparent;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.profile-dropdown a:hover, .profile-dropdown button:hover { background: var(--surface-2); text-decoration: none; }
.profile-dropdown .danger { color: var(--danger); }
.profile-dropdown .sep { height: 1px; background: var(--border); margin: 0.3rem 0; }

/* ============================================================
   ADMIN SIDEBAR (visible only when in Admin)
   Independent scroll ? sidebar never pushes page
   ============================================================ */

/* admin-body fills the remaining row and splits into sidebar + content */
.admin-body { display: contents; }

.shell.admin-mode .admin-body,
.shell.user-mode .admin-body {
  display: grid;
  min-height: 0;
  overflow: hidden;
}

.shell.admin-mode .admin-body {
  grid-template-columns: 208px minmax(0, 1fr);
}

.shell.admin-mode.sidebar-collapsed .admin-body {
  grid-template-columns: 52px minmax(0, 1fr);
}

.shell.user-mode .admin-body {
  grid-template-columns: 200px minmax(0, 1fr);
}

.admin-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0;
  height: 100%;
  min-height: 0;
  width: 208px;
  transition: width 0.2s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-track { background: transparent; }
.admin-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.admin-sidebar.hidden { display: none; }

/* SVG icons (Lucide-style) used across the shell */
.i { width: 18px; height: 18px; flex-shrink: 0; display: inline-block; vertical-align: middle; }

.admin-sidebar .nav-section {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 0.7rem 0.85rem 0.25rem 0.95rem;
  font-weight: 650;
  line-height: 1.2;
  user-select: none;
}
.admin-sidebar .nav-section:first-child { padding-top: 0.25rem; }
.admin-sidebar .nav-section:not(:first-child) {
  margin-top: 0.15rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.admin-sidebar button {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.75rem 0.4rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 450;
  letter-spacing: -0.01em;
  color: var(--text-muted);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  border-left: 2px solid transparent;
  transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}
.admin-sidebar button .nav-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: color 0.12s;
}
.admin-sidebar button:hover {
  background: var(--surface-2);
  color: var(--text);
}
.admin-sidebar button:hover .nav-icon { color: var(--primary); }
.admin-sidebar button.active {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
  border-left-color: var(--primary);
}
.admin-sidebar button.active .nav-icon { color: var(--primary); }

/* ============================================================
   CONTENT  ? scrolls independently of sidebar
   ============================================================ */
.content {
  padding: 1.25rem 1.5rem 1.75rem;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 90% 55% at 0% -5%, color-mix(in srgb, var(--primary) 7%, transparent), transparent 62%),
    radial-gradient(ellipse 70% 45% at 100% 0%, color-mix(in srgb, var(--accent) 5%, transparent), transparent 58%),
    var(--bg);
  height: 100%;
  min-height: 0;
  min-width: 0;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  animation: content-in 0.22s ease;
}
@keyframes content-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; }
.content::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

.page-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}
.page-header .subtitle {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-top: 0.2rem;
  line-height: 1.4;
  max-width: 62ch;
}
.page-header-actions { display: flex; gap: 0.45rem; flex-shrink: 0; align-items: center; flex-wrap: wrap; }
.page-header--compact { margin-bottom: 1.15rem; padding-bottom: 0.85rem; }

.welcome-banner {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary), var(--accent));
  color: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.welcome-banner h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.welcome-banner p  { opacity: 0.9; font-size: 0.95rem; }
.welcome-banner .badge-light { background: rgba(255,255,255,0.18); color: white; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
}
.card:has(.card-head) {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.card.compact { padding: 0.9rem 1rem; }
.card.compact:has(.card-head) { padding: 0; }
.card h2 {
  font-size: var(--text-md);
  font-weight: 600;
  margin-bottom: 0.65rem;
  letter-spacing: -0.015em;
  color: var(--text);
}
.card-head {
  padding: 0.95rem 1.15rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
}
.card-head h2 { margin: 0 0 0.2rem; }
.card-head .subtitle {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin: 0;
  line-height: 1.45;
}
.card-body { padding: 1rem 1.15rem; flex: 1; }
.card h3 { font-size: var(--text-sm); font-weight: 600; margin-bottom: 0.45rem; letter-spacing: -0.01em; }
.card .subtitle { color: var(--text-muted); font-size: var(--text-sm); }

.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin: 1.5rem 0 0.75rem;
}
.section-header h2 { font-size: 1rem; font-weight: 600; }
.section-header .muted { color: var(--text-muted); font-size: 0.8rem; }

/* ============================================================
   KPI / STAT TILES
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  box-shadow: none;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.65rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.stat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--primary);
  opacity: 0.55;
}
.stat-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }

.stat-card .stat-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700;
  flex-shrink: 0;
}
.stat-card .stat-icon .i { width: 22px; height: 22px; stroke-width: 1.7; }
.stat-icon.primary { background: var(--primary-soft); color: var(--primary); }
.stat-icon.accent  { background: var(--accent-soft); color: var(--accent); }
.stat-icon.success { background: var(--success-soft); color: var(--success); }
.stat-icon.warning { background: var(--warning-soft); color: var(--warning); }
.stat-icon.danger  { background: var(--danger-soft); color: var(--danger); }
.stat-icon.info    { background: var(--info-soft); color: var(--info); }
.stat-icon.purple  { background: rgba(124,58,237,0.12); color: var(--purple); }
.stat-icon.pink    { background: rgba(219,39,119,0.12); color: var(--pink); }
.stat-icon.orange  { background: rgba(234,88,12,0.12); color: var(--orange); }
.stat-icon.teal    { background: rgba(13,148,136,0.12); color: var(--teal); }

.stat-card .stat-label {
  font-size: 0.78rem; color: var(--text-muted);
  margin-bottom: 0.15rem;
  font-weight: 500;
}
.stat-card .stat-value {
  font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
}
.stat-card .stat-sub { font-size: 0.72rem; color: var(--text-dim); margin-top: 0.15rem; }

.stat-card-action {
  cursor: pointer;
}
.stat-card-action:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.stat-card-action:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============================================================
   CHARTS
   ============================================================ */
.chart-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 1100px) { .chart-row { grid-template-columns: 1fr; } }

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.chart-card .chart-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
}
.chart-card .chart-title { font-size: 0.95rem; font-weight: 600; }
.chart-card .chart-meta { font-size: 0.75rem; color: var(--text-muted); }

.chart-svg { width: 100%; height: 220px; }
.chart-svg .grid-line { stroke: var(--border); stroke-width: 1; }
.chart-svg .axis-label { font-size: 10px; fill: var(--text-dim); }
.chart-svg .area-fill { fill: var(--primary); fill-opacity: 0.12; }
.chart-svg .area-fill-2 { fill: var(--accent); fill-opacity: 0.10; }
.chart-svg .line-stroke { stroke: var(--primary); stroke-width: 2; fill: none; }
.chart-svg .line-stroke-2 { stroke: var(--accent); stroke-width: 2; fill: none; }
.chart-svg .data-point { fill: var(--primary); }
.chart-svg .data-point-2 { fill: var(--accent); }

.legend { display: flex; gap: 1rem; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.5rem; }
.legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 0.35rem; vertical-align: middle; }
.legend .swatch.primary { background: var(--primary); }
.legend .swatch.accent { background: var(--accent); }
.legend .swatch.success { background: var(--success); }
.legend .swatch.warning { background: var(--warning); }
.legend .swatch.danger { background: var(--danger); }

/* Donut */
.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.donut-wrap svg { width: 180px; height: 180px; }
.donut-center {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
.donut-center .v { font-size: 1.6rem; font-weight: 700; }
.donut-center .l { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.donut-relative { position: relative; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  overflow-x: auto;
  box-shadow: none;
}

.table-toolbar {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  display: flex; gap: 0.65rem; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
  background: var(--surface-2);
}

.search-input { position: relative; flex: 1; max-width: 360px; min-width: 200px; }
.search-input input {
  width: 100%;
  padding: 0.45rem 0.75rem 0.45rem 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  background: var(--surface);
}
.search-input::before { content: '?'; position: absolute; left: 0.65rem; top: 50%; transform: translateY(-50%); font-size: 0.9rem; color: var(--text-dim); }

table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); min-width: 640px; }
th, td { text-align: left; padding: 0.55rem 0.85rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--text-dim);
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-strong);
}
tbody tr { transition: background 0.1s ease; }
tbody tr:hover { background: rgba(15,76,129,0.035); }
tbody tr:last-child td { border-bottom: none; }

td.cell-strong { font-weight: 550; color: var(--text); letter-spacing: -0.01em; }
td.muted { color: var(--text-muted); font-size: var(--text-sm); }
td.actions { text-align: right; }

.empty-state {
  padding: 2.75rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}
.empty-state .empty-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  background: var(--surface-3);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
  opacity: 0.85;
  color: var(--text-dim);
}
.empty-state p { font-size: var(--text-sm); max-width: 36ch; line-height: 1.45; margin: 0; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-transform: uppercase;
  line-height: 1.2;
  border: 1px solid transparent;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
  flex-shrink: 0;
}
.badge-success { background: var(--success-soft); color: var(--success-text); border-color: color-mix(in srgb, var(--success) 28%, transparent); }
.badge-warning { background: var(--warning-soft); color: var(--warning-text); border-color: color-mix(in srgb, var(--warning) 28%, transparent); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger-text);  border-color: color-mix(in srgb, var(--danger) 28%, transparent); }
.badge-info    { background: var(--info-soft);    color: var(--info-text);    border-color: color-mix(in srgb, var(--info) 28%, transparent); }
.badge-neutral { background: var(--surface-3); color: var(--text-muted); border-color: var(--border); }
.badge-neutral::before { opacity: 0.45; }

/* ============================================================
   GRID HELPERS
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 1rem; }

/* Stable 2/3 + 1/3 layout — prefer over grid-column:span on .grid-3 */
.grid-main-side {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
  gap: 1rem;
  align-items: start;
}
.grid-main-side > * { min-width: 0; }

@media (max-width: 900px) {
  .grid-main-side { grid-template-columns: 1fr; }
}
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }

/* ============================================================
   APP TILES (miniOrange-style launcher)
   ============================================================ */
.apps-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.apps-section .section-title-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.25rem;
}
.apps-section h2 { font-size: 1rem; font-weight: 600; }
.apps-section .meta { color: var(--text-muted); font-size: 0.8rem; }

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.85rem;
}

.app-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 0.5rem;
  display: flex; flex-direction: column; align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  text-align: center;
  position: relative;
}
.app-tile:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.app-tile .saml-badge {
  position: absolute; top: 6px; right: 6px;
  width: 14px; height: 14px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 0.55rem; font-weight: 700;
}

.app-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  object-fit: contain;
  background: var(--surface-2);
  padding: 4px;
}
.app-icon-fallback {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-size: 1.2rem; font-weight: 700;
  padding: 0;
}
.app-name { font-size: 0.82rem; font-weight: 500; line-height: 1.2; }

/* ============================================================
   TABS (within a page)
   ============================================================ */
.tabs {
  display: flex; gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}
.tabs--compact { margin-bottom: 0.6rem; }
.tab {
  background: transparent;
  border: none;
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

.section-title {
  font-size: var(--text-md);
  font-weight: 600;
  margin: 1rem 0 0.65rem;
  color: var(--text);
  letter-spacing: -0.015em;
}

/* ============================================================
   MISC
   ============================================================ */
.truncate { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-row { padding: 2rem; text-align: center; color: var(--text-muted); }

.kv-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.kv {
  display: grid;
  grid-template-columns: minmax(128px, 34%) minmax(0, 1fr);
  gap: 0.65rem 1.25rem;
  font-size: var(--text-sm);
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
  min-height: 2.75rem;
}
.kv:last-child { border-bottom: none; }
.kv .k {
  color: var(--text-dim);
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.3;
  min-width: 0;
}
.kv .v {
  color: var(--text);
  font-weight: 500;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.45;
}
.kv .v code {
  display: inline-block;
  max-width: 100%;
  font-size: 0.78rem;
  padding: 0.22rem 0.5rem;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  word-break: break-all;
  line-height: 1.4;
  vertical-align: middle;
}
.kv .v a {
  font-weight: 600;
  text-decoration: none;
}
.kv .v a:hover { text-decoration: underline; }
/* Nested .kv packs rows into the label track → vertical text. Flatten legacy markup. */
.kv .kv { display: contents; }

.btn-inline { width: auto; min-width: 200px; margin-top: 0.5rem; }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
/* General .muted for any element */
.muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }

/* Truncate on any element (avoid inside .kv .v — use full wrap there) */
.truncate { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }

/* Flex helpers */
.flex        { display: flex; }
.flex-col    { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.gap-sm      { gap: 0.5rem; }
.gap-md      { gap: 1rem; }
.flex-wrap   { flex-wrap: wrap; }

/* Section spacing */
.section-gap { margin-top: 1.5rem; }

/* Inline code tag in tables */
td code, .td-code { font-size: 0.78rem; }

/* Detail panel (edit view beside list) */
.detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

/* Tab bar inside a card / page */
.inline-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.inline-tab {
  padding: 0.6rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.inline-tab:hover { color: var(--text); }
.inline-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Application Access Policy layout polish */
.aap-page .page-header { margin-bottom: 1rem; }
.aap-stats { margin-bottom: 1rem; }
.aap-tabs { margin-bottom: 1rem; }
.aap-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.aap-actions .section-title { margin: 0; }
.aap-actions .subtitle { color: var(--text-muted); font-size: 0.84rem; margin-top: 0.2rem; }
.aap-actions-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.aap-table { margin-bottom: 1.25rem; }
.aap-note { font-size: 0.85rem; margin: 0 0 0.9rem; }

/* Tag / chip row */
.tag-list { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; }
.tag {
  display: inline-flex; align-items: center; gap: 0.25rem;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.tag-remove {
  border: none; background: transparent; cursor: pointer;
  color: var(--text-dim); font-size: 0.85rem; padding: 0;
  line-height: 1;
}
.tag-remove:hover { color: var(--danger); }

/* Two-column form grid inside modal */
.form-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.25rem;
  min-width: 0;
}
@media (max-width: 540px) { .form-2col { grid-template-columns: 1fr; } }
.form-2col > .span2,
.form-2col .form-group.span2 { grid-column: 1 / -1; }

/* SAML application registration modal */
.modal.modal-saml-reg { width: 720px; }
.saml-reg-panel {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2, #f8fafc);
  min-width: 0;
}
.saml-reg-panel + .saml-reg-panel { margin-top: 0.85rem; }
.saml-reg-panel__title {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: var(--text);
}
.saml-reg-panel__hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  line-height: 1.45;
}
.saml-reg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.saml-reg-actions .btn { white-space: nowrap; }
.saml-reg-drop {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  background: var(--bg);
  margin-bottom: 0.75rem;
}
.saml-reg-section-title {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0.25rem 0 0.15rem;
}

/* Read-only display field */
.display-field {
  padding: 0.55rem 0.85rem;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--text);
  font-family: var(--font-mono);
  word-break: break-all;
}

/* Info box */
.info-box {
  background: var(--info-soft);
  border: 1px solid rgba(37,99,235,0.2);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: var(--info);
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* Action toolbar above a table */
.table-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

/* Step indicator */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1.5rem;
  font-size: 0.8rem;
}
.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 2px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.75rem; color: var(--text-muted);
  flex-shrink: 0;
}
.step-dot.active  { background: var(--primary); border-color: var(--primary); color: white; }
.step-dot.done    { background: var(--success); border-color: var(--success); color: white; }
.step-line { flex: 1; height: 2px; background: var(--border); }
.step-line.done   { background: var(--success); }

/* Expandable row */
.row-detail {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.row-detail td { padding: 0.75rem 1rem 1rem; }

/* Full-width spinner overlay inside card */
.card-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Health status row */
.health-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.health-row:last-child { border-bottom: none; }
.health-row .label { font-weight: 500; }
.health-row .value { color: var(--text-muted); font-size: 0.82rem; }

@media (max-width: 900px) {
  .topnav { padding: 0 0.75rem; gap: 0.5rem; }
  .topnav .brand span:not(.brand-logo) { display: none; }
  .topnav .brand { padding-right: 0.5rem; border-right: none; }
  .search-global { display: none; }
  .profile-menu .profile-name,
  .profile-menu .profile-role { display: none; }
  .content { padding: 0.85rem; }
  .shell.user-mode .admin-body,
  .shell.admin-mode .admin-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
  }
  .form-2col { grid-template-columns: 1fr; }
  .form-2col > .span2,
  .form-2col .form-group.span2 { grid-column: 1; }
  .modal { max-height: 95vh; }
  .page-header { align-items: flex-start; }
  .chart-row { grid-template-columns: 1fr; }
}

/* ============================================================
   END-USER SIDEBAR (JumpCloud User Portal style)
   ============================================================ */
.shell.user-mode .admin-body {
  grid-template-columns: 200px minmax(0, 1fr);
}

.user-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  height: 100%;
  min-height: 0;
  min-width: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  display: flex;
  flex-direction: column;
}

.user-sidebar.hidden { display: none; }

.user-sidebar-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.user-sidebar button {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  color: var(--text);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  transition: background 0.1s, color 0.1s;
}
.user-sidebar button:hover { background: var(--surface-2); }
.user-sidebar button.active {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
}
.user-sidebar button.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}
.user-sidebar .nav-icon {
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: color 0.12s;
}
.user-sidebar button:hover .nav-icon { color: var(--primary); }
.user-sidebar button.active .nav-icon { color: var(--primary); }
.user-sidebar .task-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}
.user-sidebar .task-badge.hidden { display: none; }

/* Hide primary-nav user-mode buttons when sidebar is shown */
.shell.user-mode .primary-nav .user-nav-btn { display: none; }

/* ============================================================
   ADMIN SIDEBAR COLLAPSE (JumpCloud collapse behaviour)
   ============================================================ */
.admin-sidebar.collapsed {
  width: 52px;
  overflow: hidden;
}
.admin-sidebar.collapsed .nav-section {
  height: 0;
  margin: 0.5rem 0.65rem 0.2rem;
  padding: 0;
  border-top: 1px solid var(--border);
  overflow: hidden;
  font-size: 0;
  color: transparent;
}
.admin-sidebar.collapsed .nav-section:first-child,
.admin-sidebar.collapsed .nav-section:not(:first-child) {
  margin-top: 0.5rem;
  padding-top: 0;
}
.admin-sidebar.collapsed .nav-section:first-child { display: none; }
.admin-sidebar.collapsed button .label-text { display: none; }
.admin-sidebar.collapsed button { padding-left: 0; padding-right: 0; justify-content: center; gap: 0; }
.admin-sidebar.collapsed .sidebar-toggle-btn { justify-content: center; padding: 0.4rem 0.5rem 0.6rem; }

.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.4rem 0.75rem 0.6rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.4rem;
}
.sidebar-toggle-btn button {
  width: 28px;
  height: 28px;
  padding: 0 !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--text-muted) !important;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.sidebar-toggle-btn button:hover {
  background: var(--primary-soft) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}
.sidebar-toggle-btn button .i { width: 14px; height: 14px; }

/* ============================================================
   IDENTITY FIRST LOGIN
   ============================================================ */
.auth-avatar-circle {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; font-weight: 700;
  margin: 0 auto 0.85rem;
  letter-spacing: -0.01em;
}
.auth-email-chip {
  display: flex; align-items: center; justify-content: center; gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  text-align: center;
}
.auth-email-chip a {
  font-size: 0.8rem;
  color: var(--primary);
}

/* ============================================================
   APP FAVORITES
   ============================================================ */
.app-tile { position: relative; }
.app-fav-btn {
  position: absolute; top: 5px; right: 5px;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: none; cursor: pointer;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.15s;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  color: var(--text-dim);
  backdrop-filter: blur(2px);
}
.app-tile-wrap:hover .app-fav-btn { opacity: 1; }
.app-fav-btn.starred { opacity: 1; color: var(--warning); }

/* Home search bar */
.home-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.home-toolbar .form-input {
  flex: 1;
  max-width: 360px;
}

/* Home tabs */
.home-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.25rem;
}
.home-tab {
  padding: 0.5rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  transition: color 0.15s;
}
.home-tab:hover { color: var(--text); }
.home-tab.active {
  color: var(--primary);
  font-weight: 600;
}
.home-tab.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
}

/* ============================================================
   END-USER PAGE POLISH
   ============================================================ */
.enduser-home .app-tile {
  min-height: 116px;
}
.enduser-home .app-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.enduser-request .ra-item-card:hover {
  box-shadow: var(--shadow);
}
.ra-backdrop {
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.ra-drawer {
  overscroll-behavior: contain;
}

.enduser-tasks td .btn-sm {
  min-width: 86px;
}

/* ============================================================
   PROFILE PANEL  (slide-in right drawer, godmode)
   ============================================================ */
.profile-panel-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 1100;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.profile-panel {
  width: 680px;
  max-width: 96vw;
  height: 100%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  box-shadow: -6px 0 32px rgba(0,0,0,0.22);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.profile-panel.pp-open {
  transform: translateX(0);
}

/* ?? Header ?? */
.pp-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--primary-dim, #eff6ff) 0%, var(--surface) 60%);
  display: grid;
  grid-template-columns: 56px 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.25rem 1rem;
  align-items: center;
  position: relative;
}

.pp-avatar {
  grid-row: 1 / 3;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary, #3b82f6), #6366f1);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(59,130,246,0.35);
}

.pp-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.pp-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.pp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.3rem;
}

.pp-actions {
  grid-column: 3;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-end;
  z-index: 2;
}

.pp-lifecycle {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-end;
}

#pp-close-x {
  min-width: 4.5rem;
}

/* ?? Tab bar ?? */
.pp-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.pp-tabs::-webkit-scrollbar { display: none; }

.pp-tab {
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  position: relative;
  transition: color 0.15s;
  flex-shrink: 0;
}
.pp-tab:hover { color: var(--text); }
.pp-tab.active {
  color: var(--primary, #3b82f6);
  font-weight: 600;
}
.pp-tab.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--primary, #3b82f6);
  border-radius: 2px 2px 0 0;
}
.pp-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary, #3b82f6);
  color: #fff;
  border-radius: 10px;
  padding: 0 5px;
  font-size: 0.68rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  margin-left: 5px;
  vertical-align: middle;
}

/* ?? Body ?? */
.pp-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ?? Section headers inside panel ?? */
.pp-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim, #9ca3af);
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* ?? Attribute grid ?? */
.pp-attr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1.75rem;
  margin-bottom: 1.5rem;
}
.pp-attr { display: flex; flex-direction: column; gap: 0.15rem; }
.pp-attr-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim, #9ca3af);
}
.pp-attr-value {
  font-size: 0.9rem;
  color: var(--text);
  word-break: break-word;
}

/* ?? Reset result rows ?? */
.pp-reset-result {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
}
.pp-reset-result.success { background: var(--success-bg, #f0fdf4); color: var(--success-text, #166534); }
.pp-reset-result.fail    { background: var(--danger-bg,  #fff1f2); color: var(--danger-text,  #9f1239); }

/* ?? Empty state ?? */
.pp-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.pp-empty-icon { font-size: 2rem; margin-bottom: 0.5rem; }

/* ?? Alert banners in panel ?? */
.pp-alert {
  padding: 0.65rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  border-left: 3px solid;
}
.pp-alert.success { background: var(--success-soft); border-color: var(--success); color: var(--success-text); }
.pp-alert.warning { background: var(--warning-soft); border-color: var(--warning); color: var(--warning-text); }
.pp-alert.error   { background: var(--danger-soft); border-color: var(--danger); color: var(--danger-text); }

/* ============================================================
   THEME PICKER
   ============================================================ */
.theme-picker { position: relative; }

.theme-picker-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--topnav-border);
  background: var(--subnav-bg);
  color: var(--topnav-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.theme-picker-btn .i { width: 16px; height: 16px; }
.theme-picker-btn:hover {
  border-color: var(--accent);
  color: var(--topnav-active);
}

.theme-picker-btn--light {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
}
.theme-picker-btn--light:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.theme-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 232px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0.75rem;
  display: none;
  z-index: 300;
}
.theme-picker-menu.open { display: block; }

.theme-picker-heading {
  font-family: var(--font);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
  padding: 0 0.2rem;
}

.theme-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.theme-picker-grid--settings {
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  max-width: 520px;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-align: left;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
.theme-option:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}
.theme-option.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--text);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 22%, transparent);
}

.theme-swatch {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}

.theme-option[data-theme-option="light"] .theme-swatch {
  background: linear-gradient(145deg, #0a2744 0%, #0f4c81 52%, #0e7490 100%);
}
.theme-option[data-theme-option="dark"] .theme-swatch {
  background: linear-gradient(145deg, #020617 0%, #1e3a8a 52%, #0891b2 100%);
}
.theme-option[data-theme-option="ocean"] .theme-swatch {
  background: linear-gradient(145deg, #115e59 0%, #0d9488 52%, #0891b2 100%);
}
.theme-option[data-theme-option="slate"] .theme-swatch {
  background: linear-gradient(145deg, #1e293b 0%, #475569 52%, #64748b 100%);
}
.theme-option[data-theme-option="violet"] .theme-swatch {
  background: linear-gradient(145deg, #4c1d95 0%, #7c3aed 52%, #a855f7 100%);
}
.theme-option[data-theme-option="midnight"] .theme-swatch {
  background: linear-gradient(145deg, #030510 0%, #312e81 52%, #6366f1 100%);
}
.theme-option[data-theme-option="sand"] .theme-swatch {
  background: linear-gradient(145deg, #524638 0%, #9a6b3c 52%, #b8860b 100%);
}

.theme-label {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

.content > div { max-width: none; width: 100%; }

.stat-grid,
.chart-row,
.grid-2,
.grid-3 { width: 100%; }

.page-header h1 { line-height: 1.2; }

.auth-card { position: relative; z-index: 1; }

/* ============================================================
   ENTERPRISE ADMIN DENSITY (laptop-first admin consoles)
   ============================================================ */
.admin-page { min-width: 0; }

.page-toolbar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}
.page-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.kpi-strip {
  display: flex;
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.kpi-strip--spaced { margin-bottom: 0.65rem; }

.kpi-strip-item {
  flex: 1 1 0;
  min-width: 88px;
  padding: 0.45rem 0.75rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  justify-content: center;
}
.kpi-strip-item:last-child { border-right: none; }

.kpi-strip-value {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-strip-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.kpi-strip-item--accent .kpi-strip-value { color: var(--primary); }
.kpi-strip-item--success .kpi-strip-value { color: var(--success); }
.kpi-strip-item--danger .kpi-strip-value { color: var(--danger); }
.kpi-strip-item--info .kpi-strip-value { color: var(--info); }
.kpi-strip-item--neutral .kpi-strip-value { color: var(--text-muted); }

.filter-toolbar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
  padding: 0.45rem 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
/* Author display:flex overrides the UA [hidden] rule — keep toolbars truly hideable */
.filter-toolbar[hidden],
.ud-bulk-bar[hidden] {
  display: none !important;
}
.filter-toolbar .form-select { width: auto; min-width: 118px; max-width: 160px; }
.filter-toolbar-search {
  flex: 1 1 180px;
  min-width: 140px;
  max-width: 280px;
}
.filter-toolbar-spacer { flex: 1 1 auto; min-width: 0.5rem; }

.table-wrap--flat { box-shadow: none; }
.dense-table { min-width: 680px; font-size: 0.8125rem; }
.dense-table th {
  padding: 0.42rem 0.7rem;
  font-size: 0.65rem;
  white-space: nowrap;
}
.dense-table td {
  padding: 0.48rem 0.7rem;
  vertical-align: middle;
}
.dense-table tbody tr:last-child td { border-bottom: none; }

.connector-cell {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.connector-cell-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--surface-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.connector-cell-body { min-width: 0; }
.connector-cell-name {
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.connector-cell-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Universal Directory (Directory Sync) */
.ds-page .page-header { margin-bottom: 1rem; }
.ds-tabs { margin-bottom: 1.15rem; }

.ds-overview {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.ds-stat-grid { margin-bottom: 0; }

.ds-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.65rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.ds-actions-bar__left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  min-width: 0;
}
.ds-actions-bar__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.ds-actions-bar__sep {
  width: 1px;
  height: 1.25rem;
  background: var(--border);
  flex-shrink: 0;
}

.ds-callout {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem 1rem;
  align-items: start;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, rgba(15, 76, 129, 0.06), rgba(15, 76, 129, 0.02));
  border: 1px solid rgba(15, 76, 129, 0.14);
  border-radius: var(--radius);
}
.ds-callout--inline {
  grid-template-columns: auto 1fr;
  max-width: 42rem;
  margin: 1.25rem auto 0;
  text-align: left;
}
.ds-callout__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ds-callout__icon .i { width: 20px; height: 20px; }
.ds-callout__title {
  margin: 0 0 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}
.ds-callout__text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.ds-callout__steps {
  margin: 0.55rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-muted);
}
.ds-callout__steps code {
  font-size: 0.76rem;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  background: rgba(15, 76, 129, 0.08);
}
.ds-callout__cta { align-self: center; white-space: nowrap; }

.ds-sources-panel { margin-bottom: 0; }
.ent-panel-body--flush { padding: 0; }
.ds-sources-table .actions-col { width: 1%; white-space: nowrap; }

.connector-cell-icon--ad {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}
.connector-cell-icon--agent {
  background: rgba(124, 58, 237, 0.12);
  color: #7c3aed;
}
.connector-cell-icon--google {
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
}
.connector-cell-icon--azure {
  background: rgba(14, 116, 144, 0.12);
  color: #0e7490;
}
.connector-cell-icon--default {
  background: var(--surface-3);
  color: var(--text-muted);
}

.ds-status-cell { display: flex; flex-direction: column; gap: 0.15rem; align-items: flex-start; }
.ds-status-sub { font-size: 0.68rem; line-height: 1.2; }
.ds-row-error {
  display: inline-flex;
  align-items: center;
  color: var(--danger);
  margin-left: 0.2rem;
  vertical-align: middle;
}
.ds-row-error .i { width: 14px; height: 14px; }

.row-actions--compact { gap: 0.3rem; }
.row-actions--compact .btn-sm { padding-left: 0.55rem; padding-right: 0.55rem; }

.ds-empty-panel {
  max-width: 44rem;
  margin: 2rem auto;
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, var(--radius));
  box-shadow: var(--shadow-sm);
}
.ds-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ds-empty-icon .i { width: 28px; height: 28px; }
.ds-empty-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  vertical-align: middle;
}
.btn-with-icon .i {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.btn-with-icon > span { line-height: 1.2; }

/* Connector guides grid */
.ds-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.ds-guide-card {
  padding: 0.85rem 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.ds-guide-card__head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
}
.ds-guide-card__head h4 {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
}
.ds-guide-card__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 0.95rem;
}
.ds-guide-card p {
  margin: 0 0 0.45rem;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.ds-guide-card ol {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.ds-guide-card--google { border-top: 2px solid #16a34a; }
.ds-guide-card--ad { border-top: 2px solid #2563eb; }
.ds-guide-card--agent { border-top: 2px solid #7c3aed; }

/* Connector type picker modal */
.ds-modal { width: min(720px, 96vw); max-width: 96vw; }
.ds-modal .modal-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.modal-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.ds-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
.ds-type-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 0.95rem;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}
.ds-type-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.ds-type-card .i:last-child {
  margin-left: auto;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.ds-type-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}
.ds-type-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.ds-type-card__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}
.ds-type-card__desc {
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-muted);
}

/* Connector config modal */
.ds-config-modal { width: min(760px, 96vw); }
.ds-config-modal__head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}
.ds-config-modal__badge {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  flex-shrink: 0;
}
.ds-config-modal__body {
  max-height: 72vh;
  overflow-y: auto;
}
.ds-config-modal__footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.modal-footer-spacer { flex: 1 1 auto; min-width: 0.5rem; }
.ds-config-section { margin-top: 1rem; }
.ds-config-section__title {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ds-cfg-tabs { margin: 0.75rem 0 1rem; }
.ds-cfg-pane { padding-top: 0.15rem; }
.ds-cfg-pane-intro {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.ds-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.ds-form-grid--2col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1rem;
}
.ds-config-basics { margin-bottom: 0.25rem; }
.ds-callout--compact {
  grid-template-columns: auto 1fr;
  margin-top: 1rem;
  padding: 0.75rem 0.85rem;
}
.ds-callout--compact .ds-callout__icon { width: 36px; height: 36px; }

/* Users tab */
.ds-users-panel .ent-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.ds-users-filters { margin-bottom: 0.85rem; }
.ds-bulk-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ds-inline-toast { min-height: 0; margin-bottom: 0.65rem; }
.ds-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  padding: 0.55rem 0.15rem 0;
}
.ds-table-footer__pager {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.ds-src-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  margin-right: 0.2rem;
  border: 1px solid transparent;
}
.ds-src-badge--ad { background: rgba(37, 99, 235, 0.1); color: #2563eb; border-color: rgba(37, 99, 235, 0.18); }
.ds-src-badge--google { background: rgba(22, 163, 74, 0.1); color: #16a34a; border-color: rgba(22, 163, 74, 0.18); }
.ds-src-badge--local { background: var(--surface-3); color: var(--text-muted); border-color: var(--border); }
.ds-src-badge--default { background: var(--surface-3); color: var(--text-muted); }
.ds-empty-panel--compact {
  margin: 1.5rem auto;
  padding: 1.75rem 1rem;
}

/* Attribute mapping + Google sync */
.ds-mapping-actions { padding: 0.75rem 1rem 1rem; }
.ds-sync-panel .ent-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.ds-sync-panel__badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  margin-right: 0.65rem;
}
.ds-sync-panel .panel-meta {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.ds-sync-checkgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 1.25rem;
  margin-bottom: 1rem;
}
.ds-sync-schedule {
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.ds-sync-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.ds-sync-progress { margin-top: 1rem; }
.ds-sync-progress__label { font-size: 0.78rem; margin-bottom: 0.35rem; }
.ds-sync-progress__track {
  height: 8px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.ds-sync-progress__bar {
  height: 100%;
  width: 15%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.ds-log-section { padding: 0 0 1rem; }
.ds-log-section + .ds-log-section {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.ds-log-error {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.76rem;
}
.connector-cell-icon--okta {
  background: rgba(234, 88, 12, 0.12);
  color: #ea580c;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.user-cell-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
}
.user-cell-name {
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.25;
}
.user-cell-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.row-actions {
  display: flex;
  gap: 0.2rem;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.row-actions .btn-sm { padding: 0.28rem 0.5rem; font-size: 0.72rem; }

.empty-panel {
  text-align: center;
  padding: 2rem 1.25rem;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.empty-panel--compact { padding: 1.5rem 1rem; }
.empty-panel-icon { font-size: 2rem; margin-bottom: 0.65rem; opacity: 0.7; }
.empty-panel h2 { font-size: 1rem; margin: 0 0 0.35rem; font-weight: 600; }
.empty-panel p { margin-bottom: 0.85rem; font-size: 0.85rem; }

@media (min-width: 901px) and (max-width: 1440px) {
  .topnav { padding: 0 0.85rem; gap: 0.65rem; }
  .search-global input { width: 168px; }
  .primary-nav button { padding: 0 0.7rem; font-size: 0.8125rem; }
  .chart-row { gap: 0.65rem; margin-bottom: 0.85rem; }
  .card { padding: 1rem 1.1rem; }
  .card.compact { padding: 0.75rem 0.9rem; }
  .grid-2, .grid-3 { gap: 0.65rem; }
}

/* iPad + compact laptop layout tightening */
@media (min-width: 901px) and (max-width: 1180px) {
  .shell.admin-mode .admin-body { grid-template-columns: 188px minmax(0, 1fr); }
  .shell.user-mode .admin-body { grid-template-columns: 176px minmax(0, 1fr); }
  .admin-sidebar { width: 188px; }
  .topnav .brand span:not(.brand-logo) { display: none; }
  .search-global { display: none; }
  .topnav-actions { padding-left: 0.6rem; }
  .primary-nav button { padding: 0 0.58rem; font-size: 0.78rem; }
  .profile-menu .profile-role { display: none; }
}

/* iPad portrait: keep top bar controls uncluttered */
@media (min-width: 901px) and (max-width: 1024px) {
  .topnav-actions { gap: 0.35rem; padding-left: 0.45rem; }
  .profile-menu .profile-name { display: none; }
}

/* Laptop widths: restore a bit more breathing room */
@media (min-width: 1181px) and (max-width: 1366px) {
  .search-global input { width: 196px; }
  .primary-nav button { padding: 0 0.78rem; font-size: 0.82rem; }
}

@media (max-width: 1100px) {
  .row-actions { flex-wrap: wrap; justify-content: flex-start; }
  .dense-table { min-width: 560px; }
}

/* ============================================================
   RESPONSIVE ? mobile, tablet, laptop
   Breakpoints: 480 ? 768 ? 900 ? 1100
   ============================================================ */

/* ?? Hamburger button (hidden on desktop) ?? */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--topnav-border);
  border-radius: 8px;
  background: var(--subnav-bg);
  color: var(--topnav-text);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.mobile-menu-btn .i { width: 20px; height: 20px; }
.mobile-menu-btn:hover { border-color: var(--accent); color: var(--topnav-active); }

/* ?? Backdrop overlay behind open sidebar ?? */
.mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  top: 56px;
  background: var(--overlay);
  z-index: 115;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.mobile-nav-open .mobile-backdrop { display: block; }

body.nav-locked { overflow: hidden; }

/* ???????????????????????????????????????????????????????????????
   ? 900px ? MOBILE NAV DRAWER
   ??????????????????????????????????????????????????????????????? */
@media (max-width: 900px) {

  /* Show hamburger */
  .mobile-menu-btn { display: inline-flex; }

  /* Topnav ? allow dropdowns to overflow below the bar */
  .topnav {
    overflow: visible;
    padding: 0 0.75rem;
    gap: 0.5rem;
  }
  .topnav .brand span:not(.brand-logo) { display: none; }
  .topnav .brand { padding-right: 0.5rem; border-right: none; }
  .search-global { display: none; }
  .profile-menu .profile-name, .profile-menu .profile-role { display: none; }

  /* Primary nav ? compact scrollable strip (admin labels) */
  .primary-nav {
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .primary-nav::-webkit-scrollbar { display: none; }
  /* Hide all per-route buttons in user mode (sidebar handles them) */
  .shell.user-mode .primary-nav .user-nav-btn { display: none; }
  .shell.user-mode .primary-nav .admin-pill { display: inline-flex; }

  /* Single-column content grid ? sidebar is taken out of flow via position:fixed */
  .admin-body {
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(0, 1fr) !important;
  }

  /* Content area ? no horizontal overflow */
  .content {
    overflow-x: hidden;
    padding: 0.85rem;
  }
  .content > div { min-width: 0; max-width: 100%; }
  /* Dim & block interaction with content when sidebar is open */
  .mobile-nav-open .content {
    pointer-events: none;
    user-select: none;
  }

  /* Tables scroll horizontally inside their wrapper */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table { min-width: 540px; }

  /* Page header actions wrap */
  .page-header-actions { width: 100%; flex-wrap: wrap; }
  .chart-row { grid-template-columns: 1fr; }
  .form-2col { grid-template-columns: 1fr; }
  .form-2col > .span2, .form-2col .form-group.span2 { grid-column: 1; }

  /* ?? SHARED DRAWER STYLES (admin & user sidebars) ??????????? */
  .admin-sidebar:not(.hidden),
  .user-sidebar:not(.hidden) {
    position: fixed !important;
    top: 56px !important;
    left: 0 !important;
    bottom: 0 !important;
    width: min(288px, 88vw) !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 120 !important;
    transform: translateX(-110%) !important;
    transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: none !important;
    border-right: 1px solid var(--border) !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Slide in when nav open */
  .mobile-nav-open .admin-sidebar:not(.hidden),
  .mobile-nav-open .user-sidebar:not(.hidden) {
    transform: translateX(0) !important;
    box-shadow: var(--shadow-lg) !important;
  }

  /* Uncollapse the admin sidebar when in drawer mode */
  .admin-sidebar.collapsed {
    width: min(288px, 88vw) !important;
  }
  .admin-sidebar.collapsed .nav-section,
  .admin-sidebar.collapsed .label-text {
    display: block !important;
    height: auto !important;
    font-size: inherit !important;
    color: inherit !important;
    overflow: visible !important;
  }
  .admin-sidebar.collapsed button {
    justify-content: flex-start !important;
    padding: 0.38rem 0.85rem 0.38rem 1rem !important;
  }
  /* Hide the desktop collapse toggle in mobile drawer */
  .admin-sidebar .sidebar-toggle-btn { display: none !important; }

  /* User sidebar nav items */
  .user-sidebar button {
    width: 100%;
    min-height: 44px;
    padding: 0.75rem 1.25rem;
    white-space: normal;
  }
  .user-sidebar button.active::before {
    left: 0; top: 0; bottom: 0;
    width: 3px; height: auto;
    border-radius: 0 3px 3px 0;
  }
  .user-sidebar-header { display: block !important; }

  .modal { max-height: 95vh; }
  .page-header { align-items: flex-start; }
}

/* ???????????????????????????????????????????????????????????????
   ? 768px ? TABLET PORTRAIT
   ??????????????????????????????????????????????????????????????? */
@media (max-width: 768px) {
  .welcome-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem;
  }
  .welcome-banner h1 { font-size: 1.25rem; }

  .page-header h1 { font-size: 1.1rem; }
  .page-header-actions { width: 100%; justify-content: flex-start; }

  .page-toolbar { flex-direction: column; align-items: stretch; }
  .page-toolbar-actions { justify-content: flex-start; flex-wrap: wrap; }

  .ds-callout {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .ds-callout__cta { justify-self: start; }
  .ds-actions-bar { flex-direction: column; align-items: stretch; }
  .ds-actions-bar__left { flex-direction: column; align-items: stretch; }
  .ds-actions-bar__sep { display: none; }
  .ds-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .ds-guide-grid { grid-template-columns: 1fr; }
  .ds-type-grid { grid-template-columns: 1fr; }
  .ds-form-grid--2col { grid-template-columns: 1fr; }
  .ds-sync-checkgrid { grid-template-columns: 1fr; }

  .kpi-strip { flex-wrap: wrap; }
  .kpi-strip-item {
    flex: 1 1 calc(50% - 1px);
    min-width: 120px;
    border-bottom: 1px solid var(--border);
  }
  .kpi-strip-item:nth-last-child(-n+2) { border-bottom: none; }

  .filter-toolbar .form-select,
  .filter-toolbar-search,
  .filter-bar .form-input,
  .filter-bar .form-select { width: 100%; max-width: none; min-width: 0; }
  .filter-toolbar-spacer { display: none; }

  .pp-header {
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto auto;
    padding: 1.25rem 1rem 1rem;
  }
  .pp-avatar { width: 48px; height: 48px; font-size: 1.15rem; grid-row: 1 / 2; }
  .pp-lifecycle {
    grid-column: 1 / -1;
    grid-row: 3;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .pp-attr-grid { grid-template-columns: 1fr; }

  .profile-panel { width: 100%; max-width: 100vw; }
  .kv { grid-template-columns: 1fr; gap: 0.25rem; }
  .ent-kv { grid-template-columns: 1fr; gap: 0.15rem; }

  .home-toolbar { flex-direction: column; align-items: stretch; }
  .home-toolbar .form-input { max-width: none; }

  .app-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.65rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  .tabs, .inline-tabs, .home-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar,
  .inline-tabs::-webkit-scrollbar,
  .home-tabs::-webkit-scrollbar { display: none; }
  .tab, .inline-tab, .home-tab { flex-shrink: 0; }

  .table-toolbar { flex-direction: column; align-items: stretch; }
  .search-input { max-width: none; width: 100%; }
  table { min-width: 460px; font-size: 0.8125rem; }
  th, td { padding: 0.6rem 0.7rem; }

  .enduser-page .page-header .btn { width: 100%; }
  .enduser-request .ra-filter-card #ra-search,
  .enduser-request .ra-filter-card #ra-type {
    width: 100% !important;
    min-width: 0 !important;
  }
  .enduser-request .ra-drawer {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border-left: none !important;
    box-shadow: none !important;
  }
  .enduser-request .ra-drawer-inner { padding: 1rem !important; }
  .enduser-request .ra-date-row,
  .enduser-request .ra-action-row { flex-direction: column; }
  .enduser-request .ra-action-row .btn { width: 100%; }

  .enduser-tasks td[style*="white-space:nowrap"] { white-space: normal !important; min-width: 172px; }
  .enduser-tasks td .btn-sm {
    width: 100%;
    margin: 0.2rem 0 0 !important;
  }

  .aap-actions { flex-direction: column; }
  .aap-actions-btns { width: 100%; }

  .modal-backdrop { padding: 0.75rem; align-items: flex-end; }
  .modal, .modal.modal-wizard, .modal.modal-saml-reg, .modal.modal-wide {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .auth-panel { padding: 1.25rem 1rem; }
  .auth-card { padding: 1.5rem; }
  .auth-theme-bar { top: 0.65rem; right: 0.65rem; }
}

/* ???????????????????????????????????????????????????????????????
   ? 480px ? PHONE
   ??????????????????????????????????????????????????????????????? */
@media (max-width: 480px) {
  body { font-size: 13px; }

  .topnav { padding: 0 0.5rem; gap: 0.35rem; }
  .topnav-actions { padding-left: 0.35rem; gap: 0.35rem; border-left: none; }

  .content { padding: 0.65rem; }

  .card { padding: 1rem; }
  .card.compact { padding: 0.85rem; }

  .stat-grid { grid-template-columns: 1fr; }
  .stat-card .stat-value { font-size: 1.2rem; }

  .kpi-strip-item { flex: 1 1 100%; border-right: none; }

  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }
  .page-header-actions .btn { flex: 1 1 auto; }

  .apps-section { padding: 1rem; }
  .app-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .enduser-home .app-tile { min-height: 102px; padding: 0.9rem 0.45rem; }

  .wizard-stepper { padding: 0.65rem 0.75rem; }
  .wizard-stepper .wiz-label { display: none; }
  .wizard-stepper .wiz-sep { width: 16px; margin: 0 0.35rem; }

  .modal-header, .modal-body, .modal-footer,
  .modal-wizard .modal-footer { padding-left: 1rem; padding-right: 1rem; }

  .pp-body { padding: 1rem; }
  .pp-tab { padding: 0.65rem 0.85rem; font-size: 0.8125rem; }

  .auth-card { padding: 1.25rem; border-radius: var(--radius); }
  .auth-card h2 { font-size: 1.25rem; }

  .theme-picker-grid { grid-template-columns: 1fr; }
  table { min-width: 380px; }
}

/* Narrow phone widths (390 and below) */
@media (max-width: 390px) {
  .topnav { padding: 0 0.4rem; gap: 0.28rem; }
  .topnav-actions { padding-left: 0.2rem; gap: 0.22rem; }
  .mobile-menu-btn,
  .theme-picker-btn {
    width: 34px;
    height: 34px;
  }
  .profile-menu {
    padding: 0.2rem 0.42rem 0.2rem 0.24rem;
    border-radius: 999px;
  }
  .content { padding: 0.55rem; }
  .btn-inline { min-width: 0; width: 100%; }
}

/* Very small phones (360 and below) */
@media (max-width: 360px) {
  .topnav { padding: 0 0.3rem; gap: 0.2rem; }
  .topnav-actions { border-left: none; padding-left: 0; gap: 0.18rem; }
  .profile-menu { padding: 0.15rem 0.3rem 0.15rem 0.2rem; }
  .avatar { width: 26px; height: 26px; font-size: 0.68rem; }
  .content { padding: 0.45rem; }
  table { min-width: 340px; }
}

/* ?? Notch / safe-area padding ?? */
@supports (padding: env(safe-area-inset-top)) {
  .topnav {
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
  }
  .content { padding-bottom: max(0.85rem, env(safe-area-inset-bottom)); }
  .admin-sidebar, .user-sidebar { padding-bottom: env(safe-area-inset-bottom); }
  .profile-panel { padding-bottom: env(safe-area-inset-bottom); }
}

/* Legacy iOS safe-area syntax */
@supports (padding: constant(safe-area-inset-top)) {
  .topnav {
    padding-left: max(0.75rem, constant(safe-area-inset-left));
    padding-right: max(0.75rem, constant(safe-area-inset-right));
  }
  .content { padding-bottom: max(0.85rem, constant(safe-area-inset-bottom)); }
}

/* Touch devices ? remove hover-only micro-interactions */
@media (hover: none) and (pointer: coarse) {
  .app-fav-btn { opacity: 1; }
  .app-tile:hover { transform: none; }
  .stat-card:hover { box-shadow: var(--shadow-sm); }
}

/* Landscape phone */
@media (max-height: 500px) and (orientation: landscape) {
  .auth-panel { min-height: auto; padding: 1rem; }
  .auth-hero { padding: 1.5rem; }
  .modal { max-height: 98vh; }
}

/* ============================================================
   Attendance IGA ? enterprise governance console
   ============================================================ */
.aig-page { display: flex; flex-direction: column; gap: 1rem; }
.aig-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 0.85rem 1.15rem;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.aig-status-left { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.aig-status-meta { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; }
.aig-status-meta strong { color: var(--text); font-weight: 600; }
.aig-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.aig-dash-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1rem;
}
.aig-run-card .kv { grid-template-columns: minmax(110px, 140px) minmax(0, 1fr); }

/* Settings shell: left nav + content */
.aig-settings {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  min-height: 520px;
}
.aig-settings-nav {
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.aig-settings-nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.25rem 0.75rem 0.65rem;
}
.aig-nav-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.aig-nav-item:hover { background: var(--surface); color: var(--text); }
.aig-nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: inset 3px 0 0 var(--primary);
}
.aig-nav-item .aig-nav-title {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.2;
}
.aig-nav-item .aig-nav-desc {
  font-size: 0.72rem;
  color: inherit;
  opacity: 0.75;
  line-height: 1.3;
}
.aig-settings-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
}
.aig-settings-scroll {
  padding: 1.35rem 1.5rem 1.1rem;
  flex: 1;
}
.aig-section { display: none; }
.aig-section.active { display: block; }
.aig-section-head {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.aig-section-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
}
.aig-section-head p {
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  max-width: 56ch;
  line-height: 1.45;
}
.aig-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}
.aig-field-grid .span-2 { grid-column: 1 / -1; }
.aig-field .form-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.aig-field .form-hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.74rem;
  color: var(--text-dim);
  line-height: 1.35;
}
.aig-source-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.aig-source-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem 0.9rem 2.4rem;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.aig-source-card:hover { border-color: var(--border-strong); background: var(--surface); }
.aig-source-card.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 1px var(--primary);
}
.aig-source-card input {
  position: absolute;
  left: 0.9rem;
  top: 1.05rem;
  accent-color: var(--primary);
}
.aig-source-card strong {
  display: block;
  font-size: 0.86rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.aig-source-card span {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.aig-callout {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-top: 1.15rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  background: var(--surface-2);
}
.aig-callout-title {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.aig-callout ol {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}
.aig-preview {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.5;
  word-break: break-all;
}
.aig-preview-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--code-muted);
  margin-bottom: 0.4rem;
}
.aig-preview .muted { color: var(--code-muted); }
.aig-token-hints {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0.85rem 0 0.25rem;
}
.aig-token-hints code {
  font-size: 0.7rem;
  padding: 0.18rem 0.45rem;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-radius: 4px;
}
.aig-inline-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
}
.aig-settings-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
}
[data-theme="dark"] .aig-settings-footer { background: rgba(30,41,59,0.92); }
.aig-settings-footer .btn { min-width: 140px; }
.aig-divider {
  height: 1px;
  background: var(--border);
  margin: 1.25rem 0;
}
.aig-csv-box {
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 1rem;
  background: var(--surface-2);
}
#aig-sftp-archive-wrap { grid-column: 1 / -1; }
.aig-source-cards { margin-bottom: 1.35rem; }
@media (max-width: 960px) {
  .aig-dash-grid { grid-template-columns: 1fr; }
  .aig-settings { grid-template-columns: 1fr; }
  .aig-settings-nav {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    overflow-x: auto;
    padding: 0.65rem;
  }
  .aig-settings-nav-label { display: none; }
  .aig-nav-item { min-width: 140px; }
  .aig-nav-item .aig-nav-desc { display: none; }
  .aig-source-cards,
  .aig-field-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   ENTERPRISE CONSOLE ? shared .ent-* primitives
   (AIG classes remain; aliases map onto the same language)
   ============================================================ */
.ent-page,
.enduser-page {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 1400px;
}

.ent-status,
.ent-status-bar,
.aig-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.ent-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ent-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.ent-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.ent-panel-head h2,
.ent-panel-head h3 {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.ent-panel-head .panel-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.ent-panel-head .subtitle {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.45;
}

.ent-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 1280px;
}

.config-form-panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.config-form-panel h3 {
  margin: 0 0 0.85rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.card-footnote {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.45;
}

.mfa-method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 1rem;
}
.mfa-method-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem 1.1rem;
  min-height: 148px;
}
.mfa-method-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}
.mfa-method-card-head strong {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.mfa-method-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}
.mfa-method-card .muted {
  font-size: var(--text-sm);
  line-height: 1.45;
  flex: 1;
}
.mfa-method-card-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: auto;
}
.mfa-policy-methods {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.15rem 1rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.mfa-exclude-shuttle,
.option-shuttle {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: stretch;
}
.mfa-exclude-col,
.option-shuttle-col {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}
.mfa-exclude-col-head,
.option-shuttle-col-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.82rem;
}
.mfa-exclude-search,
.option-shuttle-search { width: 100%; }
.mfa-exclude-hint,
.option-shuttle-hint {
  font-size: 0.75rem;
  margin: -0.15rem 0 0;
}
.mfa-exclude-list,
.option-shuttle-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 180px;
  max-height: 240px;
  overflow: auto;
  background: var(--surface-2);
  padding: 0.25rem;
}
.mfa-exclude-list {
  min-height: 220px;
  max-height: 280px;
}
.mfa-exclude-list.is-drop-target,
.option-shuttle-list.is-drop-target {
  border-color: var(--accent, var(--primary));
  box-shadow: inset 0 0 0 1px var(--accent, var(--primary));
  background: color-mix(in srgb, var(--accent, var(--primary)) 8%, var(--surface-2));
}
.mfa-exclude-item,
.option-shuttle-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  cursor: grab;
  user-select: none;
  border: 1px solid transparent;
}
.mfa-exclude-item:hover,
.option-shuttle-item:hover {
  background: var(--surface-3, var(--surface));
}
.mfa-exclude-item.is-selected,
.option-shuttle-item.is-selected {
  background: color-mix(in srgb, var(--accent, var(--primary)) 14%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent, var(--primary)) 35%, var(--border));
}
.mfa-exclude-item.is-dragging,
.option-shuttle-item.is-dragging { opacity: 0.45; }
.mfa-exclude-item-name,
.option-shuttle-item-name {
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mfa-exclude-item-src {
  margin-left: auto;
  font-size: 0.72rem;
  flex-shrink: 0;
}
.mfa-exclude-empty,
.option-shuttle-empty {
  padding: 1.25rem 0.75rem;
  text-align: center;
  font-size: 0.82rem;
}
.mfa-exclude-actions,
.option-shuttle-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
  padding-top: 1.6rem;
}
.mfa-exclude-actions .btn,
.option-shuttle-actions .btn {
  min-width: 2.25rem;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}
.option-shuttle-custom {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  align-items: center;
}
.option-shuttle-custom .form-input { flex: 1; }
.mfa-tab-pane.is-hidden,
.is-hidden {
  display: none !important;
}
.mfa-method-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.mfa-method-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-3, var(--surface));
  border: 1px solid var(--border);
  color: var(--text);
}
@media (max-width: 720px) {
  .mfa-exclude-shuttle,
  .option-shuttle {
    grid-template-columns: 1fr;
  }
  .mfa-exclude-actions,
  .option-shuttle-actions {
    flex-direction: row;
    justify-content: center;
    padding-top: 0;
  }
}
.mfa-delivery-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
@media (max-width: 960px) {
  .mfa-delivery-split { grid-template-columns: 1fr; }
}
.mfa-delivery-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}
.mfa-delivery-head h3 {
  margin: 0;
}
.mfa-delivery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 640px) {
  .form-row-2 { grid-template-columns: 1fr; }
}
.mfa-transport-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
@media (max-width: 520px) {
  .mfa-transport-pills { grid-template-columns: 1fr; }
}
.mfa-transport-pill {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.mfa-transport-pill:has(input:checked) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
}
.mfa-transport-pill input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}
.mfa-transport-pill strong {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 0.1rem;
}
.mfa-transport-pill .muted {
  display: block;
  font-size: 0.75rem;
  line-height: 1.35;
}
#mfa-email-smtp-fields.is-hidden,
#mfa-email-api-fields.is-hidden {
  display: none;
}

.mfa-toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.7rem 0.8rem;
  margin: 0.35rem 0 0.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}
.mfa-toggle-row input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}
.mfa-toggle-row strong {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.mfa-toggle-row .muted {
  display: block;
  font-size: 0.78rem;
  line-height: 1.4;
}
.mfa-settings { max-width: 960px; }

.auth-config-row {
  align-items: stretch;
}
.auth-config-row .ent-panel,
.auth-config-row .card {
  height: 100%;
}
.auth-oidc-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 960px) {
  .auth-oidc-split { grid-template-columns: 1fr; }
}

.ent-panel-body { padding: 1rem 1.1rem; }

.ent-kv {
  display: grid;
  grid-template-columns: minmax(128px, 34%) minmax(0, 1fr);
  gap: 0.65rem 1.25rem;
  font-size: var(--text-sm);
  align-items: center;
  min-height: 2.75rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
}
.ent-kv:last-child { border-bottom: none; }
.ent-kv .k {
  color: var(--text-dim);
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 0;
  line-height: 1.3;
}
.ent-kv .v {
  color: var(--text);
  font-weight: 500;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.45;
}
@media (max-width: 640px) {
  .ent-kv { grid-template-columns: 1fr; gap: 0.15rem 0; }
  .ent-kv .k { margin-top: 0.35rem; }
  .ent-kv .k:first-child { margin-top: 0; }
}

/* Alias AIG shell pieces onto shared language where helpful */
.aig-page { gap: 0.9rem; }
.aig-status-bar { box-shadow: none; }

/* End-user portal */
.enduser-page .page-header {
  align-items: flex-end;
}
.enduser-page .card {
  transition: border-color 0.12s ease;
}
.enduser-page .card:hover {
  border-color: var(--border-strong);
}

.ra-filter-card {
  padding: 0.75rem 1rem !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: none !important;
}

.home-app-grid .app-tile,
.app-tile {
  border-radius: var(--radius);
  transition: border-color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}
.app-tile:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

/* Dense settings stacks (General, License, MFA, etc.) */
.ent-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 720px;
}
.ent-stack .card h2 {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
}

/* Profile menu ? less pill candy */
.profile-menu {
  border-radius: var(--radius) !important;
  padding: 0.25rem 0.55rem 0.25rem 0.3rem !important;
}
.profile-dropdown {
  border-radius: var(--radius) !important;
  animation: modal-in 0.14s ease;
}

/* Prefer mono for IDs / codes */
code, .mono, td code {
  font-family: var(--font-mono);
  font-size: 0.84em;
}

@media (prefers-reduced-motion: reduce) {
  .content,
  .modal,
  .profile-dropdown,
  .btn,
  .app-tile { animation: none !important; transition: none !important; }
}

/* License page — table layout (immune to nested .kv grid crush) */
.lic-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
  gap: 1rem;
  align-items: start;
}
.lic-layout > * { min-width: 0; }
.lic-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  font-size: var(--text-sm);
}
.lic-table th,
.lic-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
}
.lic-table th {
  width: 10rem;
  max-width: 36%;
  color: var(--text-dim);
  font-weight: 550;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lic-table td { color: var(--text); font-weight: 500; }
@media (max-width: 900px) {
  .lic-layout { grid-template-columns: 1fr; }
}

.ent-feature-grid {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.65rem;
}
.ent-feature-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: var(--text-sm);
}
.enduser-page .section-title {
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0.35rem 0 0.55rem;
}
.tab.active { font-weight: 600; }

/* Audit & compliance filters */
.audit-filter-panel { margin-bottom: 1rem; }
.audit-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.audit-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.audit-preset-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.audit-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.85rem 0 0.25rem;
}
.audit-payload {
  margin: 0.45rem 0 0;
  padding: 0.55rem 0.65rem;
  max-width: 420px;
  max-height: 180px;
  overflow: auto;
  font-size: 0.75rem;
  line-height: 1.4;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  white-space: pre-wrap;
  word-break: break-word;
}
.audit-payload.is-hidden { display: none; }
.audit-summary-grid { margin-bottom: 0.25rem; }

/* Enterprise Reports Hub catalog */
.report-catalog { margin-top: 0.5rem; }
.report-cat { margin-bottom: 1.25rem; }
.report-cat-title {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.report-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}
.report-catalog-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  text-align: left;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.report-catalog-card:hover {
  border-color: var(--primary);
  background: var(--surface-2);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}
.report-catalog-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.5rem;
  background: var(--surface-2);
  color: var(--primary);
  flex-shrink: 0;
}
.report-catalog-icon svg { width: 1.1rem; height: 1.1rem; }
.report-catalog-body { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.report-catalog-title { font-weight: 600; font-size: 0.92rem; }
.report-catalog-desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.35; }

/* ── Request Access status panels ── */
.ra-status-hero {
  text-align: center;
  padding: 2rem 1.25rem 1.25rem;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, var(--primary-soft), transparent 70%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}
.ra-status-hero-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 0.85rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 8px 20px rgba(15, 76, 129, 0.22);
}
.ra-status-hero h2 {
  margin: 0 0 0.35rem;
  font-size: var(--text-xl);
  font-weight: 650;
  letter-spacing: -0.02em;
}
.ra-status-hero p {
  margin: 0 auto;
  max-width: 36rem;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}
.ra-status-section {
  margin-bottom: 1.25rem;
}
.ra-status-section h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin: 0 0 0.65rem;
}
.ra-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}
.ra-status-card {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem 1.05rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ra-status-card:hover {
  box-shadow: var(--shadow);
}
.ra-status-card--pending {
  border-color: color-mix(in srgb, var(--warning) 35%, var(--border));
  background: linear-gradient(135deg, var(--warning-soft) 0%, var(--surface) 55%);
}
.ra-status-card--assigned {
  border-color: color-mix(in srgb, var(--success) 35%, var(--border));
  background: linear-gradient(135deg, var(--success-soft) 0%, var(--surface) 55%);
}
.ra-status-card--other {
  background: var(--surface-2);
}
.ra-status-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  color: #fff;
  background: var(--primary);
}
.ra-status-card--pending .ra-status-card-icon { background: var(--warning); }
.ra-status-card--assigned .ra-status-card-icon { background: var(--success); }
.ra-status-card-body { min-width: 0; flex: 1; }
.ra-status-card-title {
  font-weight: 650;
  font-size: 0.95rem;
  margin: 0 0 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ra-status-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}
.ra-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.45rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.ra-status-badge--pending {
  background: var(--warning-soft);
  color: var(--warning-text);
}
.ra-status-badge--assigned {
  background: var(--success-soft);
  color: var(--success-text);
}
.ra-status-badge--muted {
  background: var(--surface-3);
  color: var(--text-muted);
}
.ra-item-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.ra-item-card:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  box-shadow: var(--shadow);
}
