/**
 * ============================================================
 * SESSION EXPIRY MODAL STYLES
 * ============================================================
 * 
 * Professional, modern design with smooth animations
 */

/* Backdrop */
.session-expiry-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Modal Card */
.session-expiry-modal {
  background: #ffffff;
  border-radius: 16px;
  padding: 40px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  animation: slideUp 0.3s ease-out;
  position: relative;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Icon */
.session-expiry-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  animation: pulse 2s ease-in-out infinite;
}

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

.session-expiry-icon svg {
  width: 40px;
  height: 40px;
}

/* Title */
.session-expiry-title {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 12px;
  letter-spacing: -0.5px;
}

/* Message */
.session-expiry-message {
  font-size: 16px;
  color: #64748b;
  margin: 0 0 24px;
  font-weight: 500;
}

/* Countdown Timer */
.session-expiry-countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 24px;
  padding: 24px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
}

.session-expiry-countdown.urgent {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-color: #fca5a5;
  animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

.countdown-number {
  font-size: 64px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  min-width: 80px;
}

.session-expiry-countdown.urgent .countdown-number {
  color: #dc2626;
}

.countdown-separator {
  font-size: 48px;
  font-weight: 700;
  color: #94a3b8;
  line-height: 1;
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* Warning Text */
.session-expiry-warning {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 32px;
  line-height: 1.6;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 4px solid #f59e0b;
}

.session-expiry-countdown.urgent ~ .session-expiry-warning {
  color: #dc2626;
  background: #fee2e2;
  border-left-color: #dc2626;
  font-weight: 600;
}

/* Action Buttons */
.session-expiry-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 0 0 16px;
}

.session-expiry-actions button {
  flex: 1;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.session-expiry-actions .btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.session-expiry-actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.session-expiry-actions .btn-primary:active {
  transform: translateY(0);
}

.session-expiry-actions .btn-secondary {
  background: #ffffff;
  color: #64748b;
  border: 2px solid #e2e8f0;
}

.session-expiry-actions .btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

/* Footer Note */
.session-expiry-footer {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
  font-style: italic;
}

/* Toast Notification */
.session-expiry-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  color: #0f172a;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 1000000;
  animation: slideInRight 0.3s ease-out;
  border: 1px solid #e2e8f0;
  font-size: 15px;
  font-weight: 500;
  max-width: 400px;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive Design */
@media (max-width: 640px) {
  .session-expiry-modal {
    padding: 32px 24px;
    width: 95%;
  }

  .session-expiry-title {
    font-size: 24px;
  }

  .countdown-number {
    font-size: 48px;
    min-width: 60px;
  }

  .countdown-separator {
    font-size: 36px;
  }

  .session-expiry-actions {
    flex-direction: column;
  }

  .session-expiry-actions button {
    width: 100%;
  }

  .session-expiry-toast {
    top: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  .session-expiry-modal {
    background: #1e293b;
    color: #f1f5f9;
  }

  .session-expiry-title {
    color: #f1f5f9;
  }

  .session-expiry-message {
    color: #cbd5e1;
  }

  .countdown-number {
    color: #f1f5f9;
  }

  .session-expiry-countdown {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    border-color: #475569;
  }

  .session-expiry-warning {
    background: #334155;
    color: #cbd5e1;
  }

  .session-expiry-actions .btn-secondary {
    background: #334155;
    color: #cbd5e1;
    border-color: #475569;
  }

  .session-expiry-actions .btn-secondary:hover {
    background: #475569;
    border-color: #64748b;
  }

  .session-expiry-toast {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #f1f5f9;
    border-color: #475569;
  }
}

/* App Selector – IDMC Dashboard Layout */

.app-selector-wrapper {
  position: fixed;
  top: var(--shell-header-height);
  left: 0;
  right: 0;
  bottom: var(--shell-footer-height);
  width: 100%;
  height: calc(100vh - var(--shell-header-height) - var(--shell-footer-height));
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1;
  background: #f8fafc;
  padding: 24px;
  box-sizing: border-box;
  --panel-visible-rows: 5;
  --panel-row-height: 62px;
  --panel-row-gap: 10px;
  --panel-scroll-max-height: calc(
    var(--panel-visible-rows) * var(--panel-row-height) +
    (var(--panel-visible-rows) - 1) * var(--panel-row-gap)
  );
}

.app-selector-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Hero ─────────────────────────────────────────────── */

.app-selector-hero {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  padding: 36px 28px 40px;
  box-sizing: border-box;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background-color: #f8fafc;
  background-image:
    linear-gradient(135deg,
      rgba(248, 250, 252, 1) 0%,
      rgba(219, 234, 254, 0.7) 30%,
      rgba(165, 180, 252, 0.5) 60%,
      rgba(129, 140, 248, 0.6) 100%
    ),
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.6) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(199, 210, 254, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(224, 231, 255, 0.3) 0%, transparent 60%);
}

.hero-greeting {
  font-size: 2rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero-greeting-name {
  color: #ea580c;
}

.hero-subtitle {
  font-size: 1rem;
  color: #64748b;
  margin: 0 0 28px;
  font-weight: 400;
}

.hero-search {
  display: flex;
  align-items: center;
  max-width: 640px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  padding: 0 14px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-search:focus-within {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(129, 140, 248, 0.5);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

.hero-search-icon {
  color: #94a3b8;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.hero-search-input {
  flex: 1;
  min-width: 0;
  padding: 14px 12px;
  background: transparent;
  border: none;
  outline: none;
  color: #0f172a;
  font-size: 0.9375rem;
}

.hero-search-input::placeholder {
  color: #94a3b8;
}

.hero-search-kbd {
  flex-shrink: 0;
  padding: 4px 8px;
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 6px;
  color: #64748b;
  font-size: 0.75rem;
  font-family: inherit;
  line-height: 1;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 20px;
  color: #ea580c;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}

.platform-badge svg {
  flex-shrink: 0;
  opacity: 0.9;
}

/* ── Body ───────────────────────────────────────────── */

.app-selector-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Section headers ──────────────────────────────────── */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.section-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-icon {
  color: #f97316;
  flex-shrink: 0;
}

.section-icon-muted {
  color: #64748b;
  fill: none;
}

.section-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.06em;
  margin: 0;
}

.licensed-badge {
  padding: 4px 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 20px;
  color: #ea580c;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.section-empty {
  font-size: 0.875rem;
  color: #94a3b8;
  margin: 0;
  padding: 12px 0;
}

.panel-empty-message {
  margin: 0;
  padding: 12px 0;
  text-align: left;
}

.other-services-grid .panel-empty-message {
  grid-column: 1 / -1;
}

.recent-empty {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ── Your Services cards ──────────────────────────────── */

.services-section {
  margin-top: 0;
}

.service-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.service-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 24px 22px 22px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}

.service-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.service-badge-active {
  background: #dcfce7;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.service-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.service-card-icon svg {
  color: #ffffff;
}

.service-card-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  padding-right: 60px;
}

.service-card-desc {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
  line-height: 1.45;
}

/* ── Bottom sections ──────────────────────────────────── */

.bottom-sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.bottom-section {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px 22px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  min-height: 0;
}

.bottom-section .section-header {
  flex-shrink: 0;
}

/* Shared scroll viewport — same fixed height in both cards */
.bottom-section > .other-services-grid,
.bottom-section > .recent-list {
  flex: 1 1 auto;
  height: var(--panel-scroll-max-height);
  min-height: var(--panel-scroll-max-height);
  max-height: var(--panel-scroll-max-height);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.bottom-section > .other-services-grid {
  padding-right: 4px;
}

.bottom-section > .recent-list {
  padding-right: 12px;
}

/* ── Other Services grid ──────────────────────────────── */

.other-services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--panel-row-gap);
  align-content: start;
}

.other-service-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--panel-row-height);
  box-sizing: border-box;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: background 0.15s;
}

.other-service-item-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.other-service-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.other-service-icon svg {
  color: #ffffff;
}

.other-service-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.3;
}

/* ── Recently Accessed ────────────────────────────────── */

.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recent-list li + li {
  border-top: 1px solid #f1f5f9;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: var(--panel-row-height);
  box-sizing: border-box;
  padding: 12px 6px 12px 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: opacity 0.15s;
}

.recent-item:hover {
  opacity: 0.75;
}

.recent-item:disabled,
.recent-item-static {
  cursor: default;
}

.recent-item:disabled:hover,
.recent-item-static:hover {
  opacity: 1;
}

.recent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.recent-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recent-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-subtitle {
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-time {
  font-size: 0.75rem;
  font-style: italic;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 16px;
  padding-right: 4px;
}

/* ── Loading / Error / Empty ────────────────────────── */

.loading-message,
.error-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 300px;
  color: #64748b;
  font-size: 1rem;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: app-selector-spin 0.8s linear infinite;
}

@keyframes app-selector-spin {
  to { transform: rotate(360deg); }
}

.error-message {
  color: #ef4444;
}

.error-message svg {
  color: #ef4444;
}

.no-apps-message {
  text-align: center;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.no-apps-text {
  font-size: 1rem;
  color: #64748b;
  font-weight: 500;
}

.clear-search-btn {
  padding: 10px 24px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #ea580c;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.clear-search-btn:hover {
  background: #ffedd5;
}

/* ── Responsive ───────────────────────────────────────── */

@media (max-width: 768px) {
  .app-selector-wrapper {
    padding: 16px;
  }

  .app-selector-hero {
    padding: 28px 20px 32px;
  }

  .hero-greeting {
    font-size: 1.625rem;
  }

  .hero-subtitle {
    font-size: 0.9375rem;
    margin-bottom: 20px;
  }

  .hero-search-kbd {
    display: none;
  }

  .bottom-sections-grid {
    grid-template-columns: 1fr;
  }

  .service-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .other-services-grid {
    grid-template-columns: 1fr;
  }

  .platform-badge {
    font-size: 0.6875rem;
    padding: 5px 10px;
  }
}

:root {
  /* Primary Colors */
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #3b82f6;
  
  /* Company Brand Color */
  --color-brand: #0C88FD;
  --color-brand-light: #4DA5FD;
  --color-brand-lighter: #8EC2FE;
  --color-brand-lightest: #E6F3FF;
  
  /* Text Colors */
  --color-text-primary: #1e293b;
  --color-text-secondary: #475569;
  --color-text-tertiary: #64748b;
  --color-text-muted: #94a3b8;
  --color-text-white: #ffffff;
  
  /* Background Colors */
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f8fafc;
  --color-bg-tertiary: #f1f5f9;
  --color-bg-overlay: rgba(0, 0, 0, 0.6);
  --color-bg-overlay-light: rgba(0, 0, 0, 0.3);
  --color-bg-glass: rgba(255, 255, 255, 0.95);
  --color-bg-glass-light: rgba(255, 255, 255, 0.6);
  
  /* Border Colors */
  --color-border-primary: #e2e8f0;
  --color-border-secondary: #cbd5e1;
  --color-border-focus: #2563eb;
  
  /* Status Colors */
  --color-success: #059669;
  --color-error: #dc2626;
  --color-error-light: #fef2f2;
  --color-error-border: #fecaca;
  --color-warning: #fbbf24;
  --color-warning-bg: #fef3c7;
  --color-warning-border: #fbbf24;
  --color-warning-text: #92400e;
  --color-info: #0891b2;
  
  /* App Colors */
  --color-app-admin: #8b5cf6;
  --color-app-data-repo: #059669;
  --color-app-raf: #dc2626;
  --color-app-cwb: #0891b2;
  --color-app-provider: #ea580c;
  --color-app-quality: #2563eb;
  
  /* Blue Shades (for gradients and accents) */
  --color-blue-50: #eff6ff;
  --color-blue-100: #dbeafe;
  --color-blue-200: #bfdbfe;
  --color-blue-300: #93c5fd;
  --color-blue-400: #60a5fa;
  --color-blue-500: #3b82f6;
  --color-blue-600: #2563eb;
  --color-blue-700: #1d4ed8;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --gradient-primary-hover: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --gradient-text-primary: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --gradient-bg-login: linear-gradient(to bottom right, #f8fafc 0%, #ffffff 50%, #eff6ff 100%);
  --gradient-bg-left-panel: linear-gradient(to bottom right, #ffffff 0%, #f0f9ff 50%, #dbeafe 80%);
  --gradient-bg-right-panel: linear-gradient(to bottom right, #ffffff 0%, #f8fafc 50%, #ffffff 100%);
  --gradient-badge: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  --gradient-trust: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  --gradient-divider: linear-gradient(to bottom, transparent, #e2e8f0, transparent);
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --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.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 20px 60px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.5);
  --shadow-focus: 0 0 0 4px rgba(37, 99, 235, 0.1);
  
  /* Shell layout heights - use in child apps so sidebars align to body (e.g. top/bottom) */
  --shell-header-height: 60px;
  --shell-footer-height: 40px;

  /* Z-Index */
  --z-base: 1;
  --z-dropdown: 100;
  --z-header: 100;
  --z-overlay: 1000;
  --z-loading: 10000;
  --z-login: 9999;
  
  /* Transitions */
  --transition-fast: 0.2s;
  --transition-base: 0.3s;
  --transition-slow: 0.4s;
  --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Opacity */
  --opacity-disabled: 0.5;
  --opacity-hover: 0.85;
  --opacity-overlay: 0.6;
  --opacity-overlay-light: 0.3;
}

@media (max-width: 640px) {
  :root {
    --shell-header-height: 56px;
  }
}


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

html {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: hidden; /* Body scroll locked — apps scroll via #single-spa-application */
}

/* App Container - holds shell and micro-frontends */
#app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--color-bg-primary);
}

/* Shell root - contains header, add top padding to account for fixed header */
#root {
  flex-shrink: 0;
  padding-top: var(--shell-header-height);
}

/* Micro-frontend container - apps set their own backgrounds. Height matches viewport minus header/footer so child app sidebars can use top: var(--shell-header-height); bottom: var(--shell-footer-height); */
#single-spa-application {
  flex: 1;
  min-height: 0;
  height: calc(100vh - var(--shell-header-height) - var(--shell-footer-height));
  background: transparent;
  position: relative;
  overflow: hidden;
  padding-bottom: var(--shell-footer-height);
}

/* On home page, single-spa container must not block the app selector (search/clicks) */
#app-container.route-home #single-spa-application {
  pointer-events: none;
  overflow: visible;
  background: transparent;
}

/* Shell footer - fixed at bottom, no longer in flex flow */
#shell-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes spinnerDash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

/* Scrollbar styles are now in scrollbar.css */

/* Custom Scrollbar Styles - Slim Design with Color #7393b3 - NO ARROW HEADS */
/* Firefox - Apply to all scrollable elements */
html,
body,
div,
section,
article,
aside,
main,
.app-selector-wrapper,
#single-spa-application,
* {
  scrollbar-width: thin;
  scrollbar-color: #7393b3 #f0f4f8;
}

/* Webkit browsers (Chrome, Safari, Edge) - Slim 6px width, NO ARROWS */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
div::-webkit-scrollbar,
section::-webkit-scrollbar,
article::-webkit-scrollbar,
aside::-webkit-scrollbar,
main::-webkit-scrollbar,
.app-selector-wrapper::-webkit-scrollbar,
#single-spa-application::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 6px !important;
  height: 6px !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

/* Completely hide ALL scrollbar arrow buttons - NO ARROW HEADS */
html::-webkit-scrollbar-button,
body::-webkit-scrollbar-button,
div::-webkit-scrollbar-button,
section::-webkit-scrollbar-button,
article::-webkit-scrollbar-button,
aside::-webkit-scrollbar-button,
main::-webkit-scrollbar-button,
.app-selector-wrapper::-webkit-scrollbar-button,
#single-spa-application::-webkit-scrollbar-button,
*::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

/* Hide all arrow button variations (start/end, single/double, vertical/horizontal) */
html::-webkit-scrollbar-button:start:decrement,
html::-webkit-scrollbar-button:end:increment,
html::-webkit-scrollbar-button:single-button,
html::-webkit-scrollbar-button:double-button,
html::-webkit-scrollbar-button:vertical:start:decrement,
html::-webkit-scrollbar-button:vertical:end:increment,
html::-webkit-scrollbar-button:horizontal:start:decrement,
html::-webkit-scrollbar-button:horizontal:end:increment,
body::-webkit-scrollbar-button:start:decrement,
body::-webkit-scrollbar-button:end:increment,
body::-webkit-scrollbar-button:single-button,
body::-webkit-scrollbar-button:double-button,
body::-webkit-scrollbar-button:vertical:start:decrement,
body::-webkit-scrollbar-button:vertical:end:increment,
body::-webkit-scrollbar-button:horizontal:start:decrement,
body::-webkit-scrollbar-button:horizontal:end:increment,
div::-webkit-scrollbar-button:start:decrement,
div::-webkit-scrollbar-button:end:increment,
div::-webkit-scrollbar-button:single-button,
div::-webkit-scrollbar-button:double-button,
div::-webkit-scrollbar-button:vertical:start:decrement,
div::-webkit-scrollbar-button:vertical:end:increment,
div::-webkit-scrollbar-button:horizontal:start:decrement,
div::-webkit-scrollbar-button:horizontal:end:increment,
.app-selector-wrapper::-webkit-scrollbar-button:start:decrement,
.app-selector-wrapper::-webkit-scrollbar-button:end:increment,
.app-selector-wrapper::-webkit-scrollbar-button:single-button,
.app-selector-wrapper::-webkit-scrollbar-button:double-button,
.app-selector-wrapper::-webkit-scrollbar-button:vertical:start:decrement,
.app-selector-wrapper::-webkit-scrollbar-button:vertical:end:increment,
.app-selector-wrapper::-webkit-scrollbar-button:horizontal:start:decrement,
.app-selector-wrapper::-webkit-scrollbar-button:horizontal:end:increment,
#single-spa-application::-webkit-scrollbar-button:start:decrement,
#single-spa-application::-webkit-scrollbar-button:end:increment,
#single-spa-application::-webkit-scrollbar-button:single-button,
#single-spa-application::-webkit-scrollbar-button:double-button,
#single-spa-application::-webkit-scrollbar-button:vertical:start:decrement,
#single-spa-application::-webkit-scrollbar-button:vertical:end:increment,
#single-spa-application::-webkit-scrollbar-button:horizontal:start:decrement,
#single-spa-application::-webkit-scrollbar-button:horizontal:end:increment,
*::-webkit-scrollbar-button:start:decrement,
*::-webkit-scrollbar-button:end:increment,
*::-webkit-scrollbar-button:single-button,
*::-webkit-scrollbar-button:double-button,
*::-webkit-scrollbar-button:vertical:start:decrement,
*::-webkit-scrollbar-button:vertical:end:increment,
*::-webkit-scrollbar-button:horizontal:start:decrement,
*::-webkit-scrollbar-button:horizontal:end:increment {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
div::-webkit-scrollbar-track,
section::-webkit-scrollbar-track,
article::-webkit-scrollbar-track,
aside::-webkit-scrollbar-track,
main::-webkit-scrollbar-track,
.app-selector-wrapper::-webkit-scrollbar-track,
#single-spa-application::-webkit-scrollbar-track,
*::-webkit-scrollbar-track {
  background: #f0f4f8 !important;
  border-radius: 6px;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
div::-webkit-scrollbar-thumb,
section::-webkit-scrollbar-thumb,
article::-webkit-scrollbar-thumb,
aside::-webkit-scrollbar-thumb,
main::-webkit-scrollbar-thumb,
.app-selector-wrapper::-webkit-scrollbar-thumb,
#single-spa-application::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
  background: #7393b3 !important;
  border-radius: 6px;
  transition: background 0.2s ease;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
div::-webkit-scrollbar-thumb:hover,
section::-webkit-scrollbar-thumb:hover,
article::-webkit-scrollbar-thumb:hover,
aside::-webkit-scrollbar-thumb:hover,
main::-webkit-scrollbar-thumb:hover,
.app-selector-wrapper::-webkit-scrollbar-thumb:hover,
#single-spa-application::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:hover {
  background: #8ba5c1 !important;
}

html::-webkit-scrollbar-thumb:active,
body::-webkit-scrollbar-thumb:active,
div::-webkit-scrollbar-thumb:active,
section::-webkit-scrollbar-thumb:active,
article::-webkit-scrollbar-thumb:active,
aside::-webkit-scrollbar-thumb:active,
main::-webkit-scrollbar-thumb:active,
.app-selector-wrapper::-webkit-scrollbar-thumb:active,
#single-spa-application::-webkit-scrollbar-thumb:active,
*::-webkit-scrollbar-thumb:active {
  background: #5a7a9a !important;
}

/* Login Page Styles - Split Screen Layout */
.login-page-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  overflow: hidden;
  background: var(--gradient-bg-login);
  z-index: var(--z-login);
}

/* Left Panel - Brand & Features */
.login-left-panel {
  display: none;
  width: 50%;
  background: var(--gradient-bg-left-panel);
  position: relative;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .login-left-panel {
    display: block;
  }
}

.login-left-panel::before {
  content: '';
  position: absolute;
  top: 80px;
  left: 80px;
  width: 256px;
  height: 256px;
  background: rgba(147, 197, 253, 0.2);
  border-radius: 50%;
  filter: blur(80px);
}

.login-left-panel::after {
  content: '';
  position: absolute;
  bottom: 128px;
  right: 80px;
  width: 320px;
  height: 320px;
  background: rgba(191, 219, 254, 0.15);
  border-radius: 50%;
  filter: blur(80px);
}

.login-left-content {
  position: relative;
  z-index: 10;
  height: 100%;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--spacing-xl) var(--spacing-2xl);
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

@media (max-width: 1280px) {
  .login-left-content {
    padding: var(--spacing-lg) var(--spacing-xl);
  }
}

.login-logo-box {
  background: var(--color-bg-glass);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: inline-block;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.login-logo-box:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.login-logo-image {
  width: 200px;
  height: auto;
  display: block;
  max-width: 100%;
}

.login-logo-image-mobile {
  width: 180px;
  height: auto;
  display: block;
  max-width: 100%;
}

.login-header-text {
  margin-top: var(--spacing-md);
}

.login-main-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 var(--spacing-xs) 0;
  letter-spacing: -0.01em;
}

.login-main-subtitle {
  font-size: 0.875rem;
  color: var(--color-primary);
  margin: 0;
  font-weight: 500;
}

.login-hero-section {
  margin-bottom: var(--spacing-xl);
  flex-shrink: 0;
}

@media (max-height: 800px) {
  .login-hero-section {
    margin-bottom: var(--spacing-lg);
  }
  
  .login-hero-title {
    font-size: 2rem !important;
    margin-bottom: 12px !important;
  }
  
  .login-hero-description {
    font-size: 1rem !important;
  }
}

.login-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--gradient-badge);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-2xl);
  margin-bottom: var(--spacing-lg);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary);
}

.login-hero-badge-icon {
  width: 16px;
  height: 16px;
}

.login-hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-text-primary);
  margin: 0 0 20px 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.login-hero-accent {
  background: var(--gradient-text-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  margin-top: var(--spacing-xs);
}

.login-hero-description {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.7;
  max-width: 540px;
}

.login-stats-section {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  padding: 20px;
  background: var(--color-bg-glass-light);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-xl);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

@media (max-height: 800px) {
  .login-stats-section {
    padding: var(--spacing-md);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
  }
  
  .login-stat-value {
    font-size: 1.5rem !important;
  }
}

@media (max-width: 1280px) {
  .login-stats-section {
    gap: var(--spacing-md);
    padding: var(--spacing-md);
  }
}

.login-stat-item {
  flex: 1;
  text-align: center;
}

.login-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xs);
  background: var(--gradient-text-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

@media (max-height: 800px) {
  .login-stat-value {
    font-size: 1.125rem;
  }
}

.login-stat-label {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-stat-divider {
  width: 1px;
  height: 40px;
  background: var(--gradient-divider);
}

.login-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
  flex-shrink: 0;
}

@media (max-height: 800px) {
  .login-features-grid {
    gap: var(--spacing-sm);
  }
  
  .login-feature-item {
    padding: 12px !important;
  }
}

.login-feature-item {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

.login-feature-item:hover {
  background: rgba(255, 255, 255, 0.5);
}

.login-feature-icon-wrapper {
  flex-shrink: 0;
  padding: var(--spacing-sm);
  background: var(--color-blue-50);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.login-feature-item:hover .login-feature-icon-wrapper {
  background: var(--color-blue-100);
}

.login-feature-icon {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
}

.login-feature-content {
  flex: 1;
}

.login-feature-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 var(--spacing-xs) 0;
}

.login-feature-description {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.5;
}

.login-trust-badge {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--gradient-trust);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: var(--radius-lg);
  margin-top: var(--spacing-lg);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

@media (max-height: 800px) {
  .login-trust-badge {
    padding: 12px;
    margin-top: var(--spacing-md);
  }
}

.login-trust-badge-icon {
  width: 32px;
  height: 32px;
  color: var(--color-primary);
  flex-shrink: 0;
}

.login-trust-badge-content {
  flex: 1;
}

.login-trust-badge-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xs);
}

.login-trust-badge-subtitle {
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
}

/* Right Panel - Login Form */
.login-right-panel {
  width: 100%;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  background: var(--gradient-bg-right-panel);
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

@media (min-width: 1024px) {
  .login-right-panel {
    width: 50%;
  }
}

@media (max-width: 640px) {
  .login-right-panel {
    padding: var(--spacing-md);
  }
}

.login-form-container {
  width: 100%;
  max-width: 448px;
  margin: auto;
}

.login-logo-header {
  margin-bottom: var(--spacing-xl);
  text-align: center;
  display: flex;
  justify-content: center;
}

@media (max-width: 640px) {
  .login-logo-header {
    margin-bottom: var(--spacing-lg);
  }
}

.login-logo-image-header {
  width: 200px;
  height: auto;
  display: block;
  max-width: 100%;
}

@media (max-width: 640px) {
  .login-logo-image-header {
    width: 180px;
  }
}

.login-form-card {
  background: var(--color-bg-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-2xl);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-xl);
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .login-form-card {
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
  }
}

@media (max-height: 800px) {
  .login-form-card {
    padding: var(--spacing-lg);
  }
  
  .login-card-header {
    margin-bottom: var(--spacing-lg) !important;
  }
  
  .login-card-title {
    font-size: 1.5rem !important;
  }
}

.login-card-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.login-card-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 var(--spacing-sm) 0;
}

.login-card-subtitle {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  margin: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (max-height: 800px) {
  .login-form {
    gap: var(--spacing-md);
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

.form-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input-icon {
  position: absolute;
  left: var(--spacing-md);
  width: 20px;
  height: 20px;
  color: var(--color-text-tertiary);
  pointer-events: none;
  z-index: var(--z-base);
  transition: color var(--transition-fast);
}

.form-field:focus-within .form-input-icon {
  color: var(--color-primary);
}

.form-input {
  width: 100%;
  padding: 14px var(--spacing-md) 14px 48px;
  background: var(--color-bg-primary);
  border: 2px solid var(--color-border-primary);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  color: var(--color-text-primary);
  transition: all var(--transition-fast);
  font-family: inherit;
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

.form-input:hover {
  border-color: var(--color-border-secondary);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

.form-password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
  padding: var(--spacing-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  z-index: var(--z-base);
}

.form-password-toggle:hover {
  color: var(--color-text-secondary);
  background: var(--color-bg-tertiary);
}

.form-icon {
  width: 20px;
  height: 20px;
}

.form-error-message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--spacing-md) var(--spacing-md);
  background: var(--color-error-light);
  border: 1px solid var(--color-error-border);
  border-radius: 10px;
  color: var(--color-error);
  font-size: 0.875rem;
}

.login-submit-button {
  width: 100%;
  padding: 14px 20px;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-white);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  font-family: inherit;
  box-shadow: var(--shadow-md);
}

.login-submit-button:hover:not(:disabled) {
  background: var(--gradient-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.login-submit-button:active:not(:disabled) {
  transform: translateY(0);
}

.login-submit-button:disabled {
  opacity: var(--opacity-disabled);
  cursor: not-allowed;
}

.login-button-icon,
.login-button-loader {
  width: 20px;
  height: 20px;
}

.login-button-loader {
  animation: spin 1s linear infinite;
}

.login-sso-divider {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin: var(--spacing-md) 0;
}

.login-sso-divider::before,
.login-sso-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border-primary);
}

.login-sso-divider span {
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
}

.login-sso-button {
  width: 100%;
  padding: 12px 20px;
  background: transparent;
  border: 2px solid var(--color-border-primary);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.login-sso-button:hover:not(:disabled) {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-bg-tertiary);
}

.login-sso-button:disabled {
  opacity: var(--opacity-disabled);
  cursor: not-allowed;
}

.login-demo-section {
  margin-top: var(--spacing-lg);
}

.login-demo-divider {
  position: relative;
  margin: var(--spacing-lg) 0 var(--spacing-md) 0;
}

.login-demo-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-border-primary);
}

.login-demo-divider-text {
  position: relative;
  display: inline-block;
  padding: 0 var(--spacing-md);
  background: var(--color-bg-glass);
  font-size: 0.875rem;
  color: var(--color-text-tertiary);
}

.login-demo-credentials {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.login-demo-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  font-size: 0.8125rem;
}

.login-demo-role {
  font-weight: 600;
  color: var(--color-text-secondary);
}

.login-demo-value {
  color: var(--color-text-primary);
  font-family: 'Courier New', monospace;
}

.login-demo-separator {
  color: var(--color-text-muted);
}

.login-trust-indicators {
  margin-top: var(--spacing-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
}

.login-trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-trust-icon {
  width: 12px;
  height: 12px;
}

/* OTP verification step */
.login-otp-back-btn {
  position: absolute;
  left: 1rem;
  top: 1rem;
  padding: 0.5rem;
  color: var(--color-text-tertiary);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

.login-otp-back-btn:hover {
  color: var(--color-text-secondary);
  background: rgba(0, 0, 0, 0.05);
}

.login-otp-back-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.login-otp-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.login-otp-label {
  text-align: center;
  display: block;
}

.login-otp-inputs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.login-otp-input {
  width: 2.5rem;
  height: 3rem;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  border: 2px solid var(--color-border-primary);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.login-otp-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.login-otp-input-error,
.login-otp-inputs .login-otp-input-error {
  border-color: var(--color-error, #ef4444);
  color: var(--color-error, #ef4444);
}

.login-otp-error {
  font-size: 0.875rem;
  color: var(--color-error, #ef4444);
  text-align: center;
  margin: 0;
}

.login-otp-timer {
  font-size: 0.875rem;
  color: var(--color-text-tertiary);
  text-align: center;
  margin: 0;
}

.login-otp-timer-low {
  color: var(--color-error, #ef4444);
  font-weight: 600;
}

.login-otp-masked-email {
  font-weight: 600;
  color: var(--color-text-primary);
}

.login-otp-verify-btn {
  margin-top: var(--spacing-sm);
}

.login-otp-resend {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-align: center;
  margin: 0;
}

.login-otp-resend-btn {
  font-weight: 600;
  color: var(--color-primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.login-otp-resend-btn:hover:not(.login-otp-resend-disabled) {
  color: var(--color-primary-hover, #2563eb);
}

.login-otp-resend-disabled {
  color: var(--color-text-tertiary);
  cursor: not-allowed;
  text-decoration: none;
}

/* Forgot password link on login form */
.login-forgot-password-link {
  text-align: center;
  margin-top: var(--spacing-sm);
}

.login-forgot-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
}

.login-forgot-link:hover {
  text-decoration: underline;
  color: var(--color-primary-hover, #2563eb);
}

/* Forgot password page specific */
.login-forgot-back-link {
  text-decoration: none;
}

.login-forgot-resend {
  margin-top: var(--spacing-xs);
  font-size: 0.8125rem;
}


/* Shell Layout Styles */
.shell-app {
  position: relative;
  margin: 0;
  padding: 0;
}

.shell-header {
  background: var(--color-bg-glass);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border-primary);
  padding: 12px var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: var(--z-header);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  height: var(--shell-header-height);
  min-height: var(--shell-header-height);
  max-height: var(--shell-header-height);
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .shell-header {
    padding: 10px var(--spacing-md);
  }
}

@media (max-width: 640px) {
  .shell-header {
    padding: var(--spacing-sm) 12px;
  }
}

.shell-header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.shell-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.shell-logo-link:hover {
  opacity: var(--opacity-hover);
}

.shell-logo-image {
  height: 36px;
  width: auto;
  display: block;
}

.shell-app-dropdown {
  position: relative;
}

.shell-app-dropdown-button {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) 14px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.shell-app-dropdown-button:hover {
  background: var(--color-bg-tertiary);
  border-color: var(--color-border-secondary);
}

.shell-dropdown-arrow {
  color: var(--color-text-tertiary);
  transition: transform var(--transition-fast);
}

.shell-app-dropdown-button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.shell-app-dropdown-button:hover .shell-dropdown-arrow {
  color: var(--color-text-secondary);
}

.shell-app-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: var(--spacing-sm);
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-md);
  padding: 6px;
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
}

.shell-app-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 0.875rem;
  text-align: left;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.shell-app-dropdown-item:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

.shell-app-dropdown-item.active {
  background: var(--color-blue-50);
  color: var(--color-primary);
}

.shell-app-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  flex-shrink: 0;
}

.shell-app-name {
  flex: 1;
  font-weight: 500;
}

.shell-app-check {
  color: var(--color-primary);
  flex-shrink: 0;
}

.user-section {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  position: relative;
}

.user-profile-trigger {
  border: 1px solid var(--color-border-primary);
  background: var(--color-bg-primary);
  border-radius: 999px;
  padding: 4px 8px 4px 4px;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.user-profile-trigger:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-border-secondary);
}

.user-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-avatar-badge {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #22c55e;
  border: 2px solid #fff;
}

.user-profile-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.user-profile-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-profile-chevron {
  color: var(--color-text-tertiary);
  transition: transform var(--transition-fast);
}

.user-profile-chevron.open {
  transform: rotate(180deg);
}

.user-menu-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 260px;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border-primary);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 14px;
  z-index: var(--z-dropdown);
  animation: menuFadeIn 140ms ease;
}

.user-menu-account {
  padding-bottom: 8px;
}

.user-menu-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.user-menu-email {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--color-text-tertiary);
  word-break: break-all;
}

.user-menu-role {
  margin-top: 8px;
  margin-bottom: 12px;
  font-size: 0.75rem;
  text-transform: capitalize;
  color: var(--color-primary);
  background: var(--color-blue-50);
  border: 1px solid var(--color-blue-100);
  border-radius: 999px;
  padding: 2px 8px;
  display: inline-block;
}

.user-menu-divider {
  height: 1px;
  background: var(--color-border-primary);
  margin: 2px 0 10px 0;
}

.user-menu-action {
  width: 100%;
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-sm);
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  margin-bottom: 8px;
}

.user-menu-action:hover {
  background: var(--color-bg-tertiary);
}

.user-menu-action-rich {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-menu-action-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-primary);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border-primary);
  flex-shrink: 0;
}

.user-menu-action-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.user-menu-action-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.user-menu-action-subtitle {
  font-size: 0.74rem;
  color: var(--color-text-tertiary);
  line-height: 1.2;
  margin-top: 2px;
}

.user-menu-action-danger {
  margin-bottom: 0;
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

.user-menu-action-danger:hover {
  background: #fee2e2;
}

.user-menu-action-danger .user-menu-action-icon {
  background: #fff;
  color: #b91c1c;
  border-color: #fecaca;
}

.user-menu-action-danger .user-menu-action-title {
  color: #b91c1c;
}

.shell-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-overlay);
}

.shell-modal-card {
  width: min(92vw, 420px);
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border-primary);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 20px;
}

.shell-change-password-modal {
  width: min(92vw, 460px);
}

.shell-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.shell-modal-text {
  margin-top: 6px;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.shell-modal-alert-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 10px;
}

.shell-modal-label {
  display: block;
  margin-top: 12px;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.shell-input-wrap {
  position: relative;
}

.shell-modal-input {
  width: 100%;
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-sm);
  padding: 10px 70px 10px 12px;
  font-size: 0.9rem;
}

.shell-input-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--color-border-primary);
  background: var(--color-bg-primary);
  color: var(--color-primary);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.shell-input-toggle:hover {
  background: var(--color-bg-secondary);
}

.shell-password-checklist {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.shell-password-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--color-text-tertiary);
}

.shell-password-check-item.met {
  color: #166534;
}

.shell-password-check-icon {
  width: 14px;
  text-align: center;
  font-size: 0.85rem;
}

.shell-password-help {
  margin-top: 10px;
  margin-bottom: 0;
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
}

.shell-modal-error {
  margin-top: 8px;
  margin-bottom: 0;
  color: #b91c1c;
  font-size: 0.82rem;
}

.shell-modal-success {
  margin-top: 8px;
  margin-bottom: 0;
  color: #166534;
  font-size: 0.82rem;
}

.shell-modal-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.shell-btn-secondary,
.shell-btn-primary,
.shell-btn-danger {
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

.shell-btn-secondary {
  background: var(--color-bg-secondary);
  border-color: var(--color-border-primary);
  color: var(--color-text-primary);
}

.shell-btn-primary {
  background: var(--color-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.shell-btn-danger {
  background: #dc2626;
  color: #fff;
}

.shell-btn-secondary:disabled,
.shell-btn-primary:disabled,
.shell-btn-danger:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.shell-btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: shellSpin 0.8s linear infinite;
}

@keyframes menuFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shellSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Micro-frontend Container - styled in base.css */

/* Navigation tabs when inside an app */
.shell-nav {
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border-primary);
  padding: 0 var(--spacing-lg);
  display: flex;
  gap: var(--spacing-xs);
}

.nav-link {
  padding: var(--spacing-md) 20px;
  color: var(--color-text-tertiary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.nav-link:hover {
  color: var(--color-primary);
  background: var(--color-bg-tertiary);
}

.nav-link.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* Token expiry warning */
.token-warning {
  position: fixed;
  bottom: calc(var(--shell-footer-height) + var(--spacing-lg));
  right: var(--spacing-lg);
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md) var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  box-shadow: var(--shadow-lg);
  animation: slideIn var(--transition-base) ease;
  z-index: var(--z-overlay);
}

.token-warning-icon {
  font-size: 1.5rem;
}

.token-warning-text {
  color: var(--color-warning-text);
  font-weight: 500;
}

.token-warning button {
  margin-left: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-warning);
  border: 1px solid #f59e0b;
  border-radius: var(--radius-sm);
  color: #78350f;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.token-warning button:hover {
  background: #f59e0b;
  border-color: #d97706;
  color: #451a03;
}

/* Shell Footer - fixed to bottom */
.shell-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--shell-footer-height);
  min-height: var(--shell-footer-height);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  background: var(--color-bg-glass);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--color-border-primary);
  padding: 0 var(--spacing-lg);
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
  z-index: var(--z-header);
}

.shell-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.shell-footer-copy {
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
}

.shell-footer-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.shell-footer-link:hover {
  color: var(--color-primary-dark);
}

.shell-footer-brand {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color var(--transition-fast);
}

.shell-footer-brand:hover {
  color: var(--color-primary);
}

@media (max-width: 640px) {
  .shell-footer {
    padding: 0 12px;
  }
  .shell-footer-inner {
    flex-direction: column;
    text-align: center;
  }
}


/* Loading Overlay */
.login-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: var(--color-bg-overlay);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-loading);
  animation: fadeIn var(--transition-fast) ease-in-out;
}

.login-loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  padding: var(--spacing-2xl) 40px;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  min-width: 200px;
}

.login-spinner-icon {
  width: 64px;
  height: 64px;
  color: var(--color-primary);
  position: relative;
}

.login-spinner-icon svg {
  width: 100%;
  height: 100%;
  animation: spin 1s linear infinite;
}

.login-spinner-circle {
  animation: spinnerDash 1.5s ease-in-out infinite;
  transform-origin: center;
}

.login-loading-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
  letter-spacing: 0.01em;
}

@media (max-width: 640px) {
  .login-loading-spinner {
    padding: 40px var(--spacing-xl);
    border-radius: var(--radius-xl);
    min-width: 180px;
  }
  
  .login-spinner-icon {
    width: 56px;
    height: 56px;
  }
  
  .login-loading-text {
    font-size: 0.9375rem;
  }
}


/* App Loading Overlay – same look as login (blur overlay + white spinner card) */
.app-loading-overlay {
  position: fixed;
  top: 60px; /* Below header */
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: calc(100vh - 60px);
  background: var(--color-bg-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-loading);
  animation: fadeIn var(--transition-fast) ease-in-out;
}

@media (max-width: 640px) {
  .app-loading-overlay {
    top: 56px;
    height: calc(100vh - 56px);
  }
}

/* Main CSS Import File */


