.app-breadcrumbs {
  padding: 12px 24px 4px;
  background-color: #ffffff;
}

.app-breadcrumbs__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2, 8px);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12.5px;
  line-height: 1;
}

.app-breadcrumbs__item {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
}

.app-breadcrumbs__link {
  color: var(--color-text-muted, #64748b);
  text-decoration: none;
  font-weight: 400;
  font-size: 12.5px;
  transition: color var(--transition-fast, 0.15s ease);
}

.app-breadcrumbs__link:hover {
  color: var(--color-brand-600, #2563eb);
}

.app-breadcrumbs__separator {
  color: var(--color-border-subtle, #94a3b8);
  user-select: none;
  font-weight: 400;
}

.app-breadcrumbs__current {
  color: var(--color-text-primary, #334155);
  font-weight: 600;
  font-size: 12.5px;
}.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 var(--space-6);
  background-color: var(--color-bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ── Brand ──────────────────────────────────────────── */
.app-header__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.app-header__logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-header__logo-img {
  width: 24px;
  height: 24px;
  display: block;
}

.app-header__title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--color-text-primary);
}

.app-header__badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  background-color: rgba(99, 102, 241, 0.15);
  color: var(--color-brand-500);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-full);
}

/* ── Actions row ────────────────────────────────────── */
.app-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-5); /* 20px between each action group */
}

/* ── Sync section ───────────────────────────────────── */

/* Outer wrapper: stacks button row + timestamp vertically, right-aligned */
.app-header__sync-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  /* Soft left divider to separate from the rest of the header actions */
  padding-right: var(--space-5);
  border-right: 1px solid var(--color-border-subtle);
}

/* Inner row: toast + button side by side */
.app-header__sync-row {
  display: flex;
  align-items: center;
  gap: var(--space-3); /* 12px between toast and button */
}

/* Sync status toast badge */
.app-header__sync-toast {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 6px;
  white-space: nowrap;
  line-height: 1;
}

.app-header__sync-toast--success {
  color: #059669;
  background: rgba(16, 185, 129, 0.09);
  border: 1px solid rgba(16, 185, 129, 0.22);
}

.app-header__sync-toast--error {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.09);
  border: 1px solid rgba(239, 68, 68, 0.22);
}

/* "Last synced X min ago" timestamp line */
.app-header__sync-timestamp {
  font-size: 11px;
  color: var(--color-text-muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
  line-height: 1;
}

/* ── Icon buttons (Bell, etc.) ──────────────────────── */
.app-header__icon-btn {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  position: relative;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  transition: color var(--transition-fast), background var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-header__icon-btn:hover {
  color: var(--color-text-primary);
  background-color: var(--color-bg-surface);
}

.app-header__dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background-color: var(--color-brand-500);
  border-radius: 50%;
}

/* ── User section ───────────────────────────────────── */
.app-header__user-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-left: var(--space-5);
  border-left: 1px solid var(--color-border-subtle);
}

.app-header__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-brand-500);
  flex-shrink: 0;
}

.app-header__avatar-placeholder {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--color-bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.app-header__user-details {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.app-header__user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
}

.app-header__user-role {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ── Spin animation ─────────────────────────────────── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.spin-animation {
  animation: spin 1.5s linear infinite;
}

.app-sidebar {
  display: flex;
  flex-direction: row;
  height: 100%;
  align-self: stretch;
  flex-shrink: 0;
  z-index: 10;
  background-color: var(--color-bg-secondary);
}

.app-sidebar__primary {
  width: 240px;
  background-color: var(--color-bg-secondary);
  border-right: 1px solid var(--color-border-subtle);
  padding: var(--space-4) var(--space-2);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--transition-normal, 0.2s ease);
}

.app-sidebar__primary--collapsed {
  width: 64px;
}

.app-sidebar__primary--collapsed .section-header {
  opacity: 0;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.app-sidebar__primary--collapsed .app-sidebar__link span,
.app-sidebar__primary--collapsed .sidebar-flyout__chevron {
  display: none;
}

.app-sidebar__primary--collapsed .app-sidebar__link {
  justify-content: center;
  padding: var(--space-2) 0;
}

.app-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  flex: 1;
}

.app-sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  flex: 1;
}

.app-sidebar__link:hover,
.app-sidebar__link--open {
  color: var(--color-text-primary);
  background-color: var(--color-bg-surface);
}

.app-sidebar__link--active {
  color: var(--color-text-primary);
  background-color: rgba(99, 102, 241, 0.15);
  border-left: 3px solid var(--color-brand-500);
}

.app-sidebar__icon {
  flex-shrink: 0;
}

.sidebar-flyout__chevron {
  color: var(--color-text-muted);
  transition: transform var(--transition-fast);
  margin-left: auto;
}

.sidebar-nav-item:hover .sidebar-flyout__chevron,
.sidebar-nav-item--open .sidebar-flyout__chevron {
  color: var(--color-text-primary);
  transform: translateX(2px);
}

/* Sidebar Section Headers */
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--space-4);
}

.section-header {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  padding: var(--space-1) var(--space-3);
  margin-bottom: var(--space-1);
}

.sidebar-nav-item {
  position: relative;
}

/* Secondary full-height adjacent nav panel (exact 240px width match) */
.app-sidebar__subpanel {
  width: 240px;
  background-color: var(--color-bg-secondary);
  border-right: 1px solid var(--color-border-subtle);
  padding: var(--space-4) var(--space-2);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  animation: slideSubpanel 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideSubpanel {
  from {
    opacity: 0;
    transform: translateX(-8px);
    width: 200px;
  }
  to {
    opacity: 1;
    transform: translateX(0);
    width: 240px;
  }
}

/* Sidebar Collapse Toggle Footer */
.app-sidebar__footer {
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border-subtle);
}

.app-sidebar__toggle-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  color: var(--color-text-secondary);
  background: transparent;
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.app-sidebar__primary--collapsed .app-sidebar__toggle-btn {
  justify-content: center;
  padding: var(--space-2) 0;
}

.app-sidebar__toggle-btn:hover {
  color: var(--color-text-primary);
  background-color: var(--color-bg-surface);
}.main-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.main-layout__body {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

.main-layout__content {
  flex: 1;
  padding: 0;
  background-color: #ffffff;
  overflow-y: auto;
  overflow-x: auto;
  min-width: 0;
}
.login-page {
  display: flex;
  min-height: 100vh;
  background-color: #eff3fa;
}

/* Left Panel: Premium Branding */
.login-page__brand-side {
  flex: 1.1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f4c81 0%, #1a1f36 100%);
  color: #ffffff;
  padding: var(--space-12);
  position: relative;
  overflow: hidden;
}

@media (max-width: 768px) {
  .login-page__brand-side {
    display: none; /* Hide branding on mobile for usability */
  }
}

.login-page__brand-side::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(46, 125, 246, 0.15) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.login-page__brand-side::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(116, 59, 0, 0.12) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.login-page__brand-content {
  max-width: 520px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 10;
}

.login-page__brand-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.login-page__brand-logo svg {
  color: #2e7df6;
  filter: drop-shadow(0 0 8px rgba(46, 125, 246, 0.4));
}

.login-page__brand-logo-img {
  width: 28px;
  height: 28px;
  display: block;
}

.login-page__brand-middle {
  margin: var(--space-12) 0;
}

.login-page__brand-headline {
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.25;
  margin-bottom: var(--space-4);
  background: linear-gradient(to right, #ffffff, #eff3fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-page__brand-description {
  font-size: 1rem;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: var(--space-8);
}

.login-page__brand-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.login-page__brand-feature {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.95rem;
  font-weight: 500;
  color: #e2e8f0;
}

.login-page__brand-feature .feature-icon {
  color: #2e7df6;
}

.login-page__brand-feature-text {
  text-align: left;
}

.login-page__brand-footer {
  font-size: 0.8125rem;
  color: #64748b;
}

/* Right Panel: Clean form */
.login-page__form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background-color: #eff3fa;
}

.login-page__container {
  width: 100%;
  max-width: 440px;
}

.login-page__card-wrapper {
  background: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  border-radius: 16px !important;
  box-shadow:
    0 10px 25px -5px rgba(26, 31, 54, 0.05),
    0 8px 16px -6px rgba(26, 31, 54, 0.03) !important;
}

.login-page__card {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: var(--space-8) var(--space-6);
}

.login-page__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-align: left;
}

.login-page__title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: #1a1f36 !important;
  line-height: 1.1;
}

.login-page__subtitle {
  font-size: 0.875rem;
  color: #4e5983 !important;
  font-weight: 500;
}

.login-page__alert {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background-color: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-md);
  color: #b91c1c;
  font-size: 0.85rem;
  font-weight: 600;
}

.login-page__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.login-page__submit {
  width: 100%;
  margin-top: var(--space-2);
  font-weight: 600 !important;
  padding: 12px 20px !important;
  border-radius: 8px !important;
  cursor: pointer;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast) !important;
}

.login-page__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(46, 125, 246, 0.3) !important;
}

.login-page__demo-hint {
  padding: var(--space-4);
  background-color: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  font-size: 0.8125rem;
  color: #4e5983;
  text-align: center;
}

.login-page__demo-hint code {
  color: #0f4c81;
  font-family: monospace;
  font-weight: 700;
  background-color: rgba(15, 76, 129, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
}
/* =============================================================
   SessionExpiryModal.css
   Premium glassmorphism warning dialog for session expiry
   ============================================================= */

/* ── Backdrop ─────────────────────────────────────────────── */
.sem-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: sem-backdrop-in 0.2s ease forwards;
}

@keyframes sem-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Dialog ───────────────────────────────────────────────── */
.sem-dialog {
  position: relative;
  background: #ffffff;
  border-radius: 20px;
  box-shadow:
    0 24px 48px -12px rgba(15, 23, 42, 0.24),
    0 0 0 1px rgba(226, 232, 240, 0.8),
    0 0 0 4px rgba(46, 125, 246, 0.08);
  padding: 0;
  width: min(460px, calc(100vw - 32px));
  overflow: hidden;
  animation: sem-dialog-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes sem-dialog-in {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ── Top accent bar ───────────────────────────────────────── */
.sem-accent-bar {
  height: 4px;
  background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%);
}

/* ── Header ───────────────────────────────────────────────── */
.sem-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 24px 24px 0 24px;
}

.sem-icon-wrap {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d97706;
}

.sem-icon-pulse {
  animation: sem-pulse 2s ease-in-out infinite;
}

@keyframes sem-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.12); }
}

.sem-titles {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 2px;
}

.sem-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.sem-subtitle {
  font-size: 13px;
  color: #64748b;
  font-weight: 400;
}

/* ── Body ─────────────────────────────────────────────────── */
.sem-body {
  padding: 18px 24px 0 24px;
}

.sem-message {
  font-size: 14px;
  color: #334155;
  line-height: 1.6;
}

/* ── Countdown pill ───────────────────────────────────────── */
.sem-countdown-wrap {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 12px;
  padding: 12px 16px;
}

.sem-countdown-label {
  font-size: 12.5px;
  color: #64748b;
  font-weight: 500;
}

.sem-countdown-value {
  margin-left: auto;
  font-size: 20px;
  font-weight: 700;
  color: #d97706;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.sem-countdown-value--critical {
  color: #dc2626;
  animation: sem-blink 1s step-start infinite;
}

@keyframes sem-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ── Footer ───────────────────────────────────────────────── */
.sem-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 24px 24px 24px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.sem-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 20px;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.sem-btn:active {
  transform: scale(0.97);
}

.sem-btn--cancel {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.sem-btn--cancel:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.sem-btn--continue {
  background: linear-gradient(135deg, #2e7df6 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(46, 125, 246, 0.35);
}

.sem-btn--continue:hover {
  background: linear-gradient(135deg, #1d68e0 0%, #1a40b8 100%);
  box-shadow: 0 4px 14px rgba(46, 125, 246, 0.45);
}

.sem-btn--continue:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Spinner inside the continue button */
.sem-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: sem-spin 0.7s linear infinite;
}

@keyframes sem-spin {
  to { transform: rotate(360deg); }
}
/* ==========================================================================
   Enterprise Design Tokens & Design System Foundation
   WCAG AA Compliant Color Palette, Typography, Glassmorphism & Spacing
   ========================================================================== */

:root {
  /* Color Palette - Modern Dark/Light Design Tokens */
  --font-family-base:
    'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Theme: Light (Default ELEMENT Modern) */
  --color-bg-primary: #eff3fa;
  --color-bg-secondary: #ffffff;
  --color-bg-tertiary: #eef2fa;
  --color-bg-surface: rgba(239, 243, 250, 0.8);
  --color-bg-glass: rgba(255, 255, 255, 0.85);

  --color-border-subtle: #e2e8f0;
  --color-border-medium: #cbd5e1;
  --color-border-focus: #2e7df6;

  --color-text-primary: #1a1f36;
  --color-text-secondary: #4e5983;
  --color-text-muted: #94a3b8;
  --color-text-inverse: #ffffff;

  /* Brand & Status Colors */
  --color-brand-500: #0f4c81;
  --color-brand-600: #2e7df6;
  --color-brand-700: #1a1f36;
  --color-tertiary-500: #743b00;

  --color-success-500: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.15);

  --color-warning-500: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.15);

  --color-danger-500: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.15);

  --color-info-500: #06b6d4;

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Radius Scale */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Shadow & Glow Tokens */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --glow-brand: 0 0 20px rgba(99, 102, 241, 0.2);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme='dark'] {
  --color-bg-primary: #0f172a;
  --color-bg-secondary: #1e293b;
  --color-bg-tertiary: #334155;
  --color-bg-surface: rgba(30, 41, 59, 0.7);
  --color-bg-glass: rgba(15, 23, 42, 0.75);

  --color-border-subtle: rgba(255, 255, 255, 0.08);
  --color-border-medium: rgba(255, 255, 255, 0.16);

  --color-text-primary: #f8fafc;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --color-text-inverse: #0f172a;
}

/* CSS Reset & General Base Styles - Scoped to host root */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

#root {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: var(--font-family-base);
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Utility Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn var(--transition-normal) forwards;
}

/* Accessibility Focus Ring */
:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}
.iam-page {
  --bg: #eef0f3;
  --panel: #ffffff;
  --panel-raised: #f6f7f9;
  --hairline: #dee2e8;
  --hairline-soft: #e9ecf0;
  --text: #1b212b;
  --text-dim: #4e5566;
  --text-faint: #8a93a3;
  --red: var(--color-brand-500);
  --red-dim: var(--color-bg-tertiary);
  --blue: var(--color-brand-600);
  --blue-dim: rgba(46, 125, 246, 0.1);
  --green: #10b981;
  --green-dim: rgba(16, 185, 129, 0.12);
  --orange: #f59e0b;
  --orange-dim: rgba(245, 158, 11, 0.12);
  --radius: 6px;
  --font-mono: 'IBM Plex Mono', monospace;

  font-family: 'Inter', sans-serif;
  color: var(--text);
  padding: 10px 24px 40px;
}

/* ---------- Header ---------- */
.iam-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.iam-header .eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.iam-header h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--text);
  text-transform: uppercase;
}

/* ---------- Actions/Filters Row ---------- */
.filter-group {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 0 10px;
  width: 280px;
}

.search-bar input {
  border: none;
  background: transparent;
  padding: 8px 6px;
  font-size: 13px;
  width: 100%;
  outline: none;
}

.filter-group select {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-dim);
  outline: none;
  cursor: pointer;
  min-width: 120px;
}

.add-btn {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast, 0.15s ease);
}

.add-btn:hover {
  background-color: var(--color-brand-600) !important;
  box-shadow: var(--glow-brand);
}

.add-btn.danger-red {
  background-color: var(--red) !important;
}

.add-btn.danger-red:hover {
  background-color: var(--color-brand-600) !important;
}

/* ---------- Card ---------- */
.iam-card {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  background: var(--panel) !important;
  border: 1px solid var(--hairline) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
}

/* ---------- Tables ---------- */
.iam-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.iam-table {
  width: 100%;
  border-collapse: collapse;
}

.iam-table th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
  letter-spacing: 0.05em;
  background: #fafbfd;
}

.iam-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline-soft);
  font-size: 13px;
  color: var(--text-dim);
  vertical-align: middle;
}

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

.bold-name {
  font-weight: 600;
  color: var(--text) !important;
}

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

.text-muted {
  color: var(--text-faint) !important;
}

.role-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.role-tag.bg-green-dim {
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #d1fae5;
}

.users-count-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--color-brand-500);
  background: var(--color-bg-tertiary);
  padding: 3px 8px;
  border-radius: 4px;
}

.security-level-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: #e11d48;
  background: #fff1f2;
  padding: 3px 8px;
  border-radius: 4px;
}

.status-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pill.active {
  color: #047857;
  background: #d1fae5;
}

.status-pill.inactive {
  color: #4b5563;
  background: #e5e7eb;
}

.status-pill.pending {
  color: #d97706;
  background: #fef3c7;
}

.status-pill.locked {
  color: #b91c1c;
  background: #fee2e2;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.act-btn {
  background: #f3f4f6;
  border: none;
  border-radius: 4px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.act-btn.edit-icon-btn {
  color: var(--color-brand-600);
}

.act-btn.edit-icon-btn:hover {
  background: rgba(46, 125, 246, 0.1);
}

.act-btn.key-perm-btn {
  color: #059669;
  background: #ecfdf5;
}

.act-btn.key-perm-btn:hover {
  background: #d1fae5;
}

.act-btn.finger-state-btn {
  color: #d97706;
  background: #fffbeb;
}

.act-btn.finger-state-btn:hover {
  background: #fef3c7;
}

.act-btn.delete {
  color: #dc2626;
  background: #fee2e2;
}

.act-btn.delete:hover {
  background: #fca5a5;
}

/* Method pills */
.method-pill {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.method-pill.get {
  color: #047857;
  background: #d1fae5;
}
.method-pill.post {
  color: #1d4ed8;
  background: #dbeafe;
}
.method-pill.put {
  color: #b45309;
  background: #fef3c7;
}
.method-pill.delete {
  color: #b91c1c;
  background: #fee2e2;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background: var(--panel);
  border-radius: 8px;
  width: 460px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hairline);
  background: #fafbfd;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
}

.modal-form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-row {
  display: flex;
  gap: 10px;
}

.form-row .form-group {
  flex: 1;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

.form-group input,
.form-group select {
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  background: var(--panel);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--text);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: var(--panel-raised);
  padding: 10px;
  border-radius: 4px;
  border: 1px solid var(--hairline-soft);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  cursor: pointer;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--hairline);
  padding-top: 14px;
  margin-top: 10px;
}

.btn-sec {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-dim);
}

.btn-sec:hover {
  border-color: var(--text);
  color: var(--text);
}

/* ==================== DRAWER FOR PERMISSIONS ACCESS MATRIX ==================== */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 110;
}

.drawer-content {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 900px;
  background: var(--panel);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  z-index: 120;
  animation: slideIn 0.25s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--hairline);
  background: #fafbfd;
}

.drawer-header h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.drawer-form-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-fields {
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  border-bottom: 1px solid var(--hairline-soft);
}

.drawer-tabs-bar {
  display: flex;
  border-bottom: 1px solid var(--hairline);
  padding: 0 24px;
  background: #fafbfd;
}

.drawer-tab-btn {
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 12px 18px;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
}

.drawer-tab-btn:hover {
  color: var(--text);
}

.drawer-tab-btn.active {
  color: var(--red);
}

.drawer-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  background: var(--red);
}

.drawer-tab-panel {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

/* Matrix Table styles */
.matrix-table-wrap {
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
}

.matrix-table th {
  background: #fafbfd;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 10px;
  border-bottom: 1px solid var(--hairline);
  color: var(--text-dim);
}

.matrix-table th:first-child {
  text-align: left;
  padding-left: 16px;
}

.matrix-table td {
  padding: 10px;
  border-bottom: 1px solid var(--hairline-soft);
  text-align: center;
  font-size: 12.5px;
}

.matrix-table td:first-child {
  text-align: left;
  padding-left: 16px;
}

.screen-name-label {
  font-weight: 600;
  color: var(--text);
}

.screen-module-label {
  font-size: 10px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-weight: normal;
}

.matrix-table input[type='checkbox'] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--red);
}

.matrix-toggles {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
}

.matrix-toggles span {
  cursor: pointer;
  font-weight: 700;
}

.matrix-toggles .all-link {
  color: #047857;
}

.matrix-toggles .none-link {
  color: #b91c1c;
}

.drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #fafbfd;
}

.btn-lg-foot {
  padding: 10px 24px;
  font-size: 13.5px;
}

.tab-placeholder-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  color: var(--text-dim);
}

.tab-placeholder-info h4 {
  font-size: 15px;
  font-weight: 700;
  margin: 12px 0 6px;
  color: var(--text);
}

.tab-placeholder-info p {
  font-size: 13px;
  max-width: 400px;
  line-height: 1.5;
}
