/**
 * CloudME V2.1 标准文件头
 * 模块: Portal Shell (3001/3101) - App Shell Styles (neumorphism)
 * 创建时间: 2025-12-24
 * 最后更新: 2026-03-18 01:32 HKT
 * 功能描述: Shell 全局样式（包含 app-shell 双列布局、滚动容器与视觉令牌）。
 *
 * 依赖文件:
 * - (none)
 *
 * 被引用文件:
 * - src/App.tsx
 *
 * 更新历史:
 * - 2025-12-24: 初始版本（双列布局 + 视觉令牌）
 * - 2025-12-31: 固定 Shell 侧栏基础样式与滚动容器约束
 * - 2026-01-06: Decision:A 口径固化：root 禁止滚动、main 独立滚动、sidebar sticky + 内部 nav 滚动 + 底部 user-profile 固定
 * - 2026-03-02: 修复缺失的设计令牌定义（--box-shadow-* / --color-*）并补齐跨 MF alias（--glass-primary/--shadow-raised 等），避免 UI 玻璃/阴影效果静默丢失
 * - 2026-03-03: 补齐跨 MF 常用的 spacing/radius tokens（--space-* / --radius-*），避免 styled-components 使用 var(...) 时因 token 为空导致 UI 退化（例如圆角/间距变 0）
 * - 2026-03-18: 新增 shared shell tokens（宽度 / radius / motion），统一侧栏与 drawer 动效口径
 */

/* Import CloudME Design System */

/* @import '../../../packages/shared/src/design/variables.css'; */

:root {
  /*
   * Design tokens (fail-closed):
   * - This file is shipped as the single global stylesheet for Shell.
   * - Do not reference undefined CSS variables here; it silently degrades UI (e.g. shadows become `none`).
   */
  --color-primary-50: #e6f0ff;
  --color-primary-500: #2684ff;
  --color-primary-600: #0478ff;
  --color-primary-900: #0b2b5b;

  --color-success-500: #00c781;
  --color-warning-500: #ffb800;
  --color-danger-500: #ff5c5c;

  --color-gray-500: #8c9fb1;
  --color-gray-600: #4a5568;
  --color-gray-900: #1a202c;

  /* Neumorphism shadow tokens (used by --shadow-neu / --shadow-inset) */
  --box-shadow-lg: 4px 4px 10px rgba(0,0,0,0.05), -4px -4px 10px rgba(255,255,255,0.92);
  --box-shadow-inner: inset 2px 2px 4px rgba(0,0,0,0.07), inset -2px -2px 4px rgba(255,255,255,0.9);

  --glass-bg: rgba(252, 253, 255, 0.95);
  --color-glass-surface: var(--glass-bg);
  /*
   * Cross-MF shared tokens:
   * Some microfrontends (e.g. infra-management-aliyun) use `--glass-primary` / `--shadow-raised`.
   * Define aliases here so MF CSS never sees empty vars in prod (fail-closed).
   */
  --glass-primary: var(--glass-bg);
  --glass-secondary: rgba(245, 247, 250, 0.92);
  --glass-accent: rgba(230, 240, 255, 0.85);

  --shadow-raised: var(--box-shadow-lg);
  --shadow-hover: 6px 6px 16px rgba(0,0,0,0.07), -6px -6px 16px rgba(255,255,255,0.86);
  --glow-focus: 0 0 10px rgba(38,132,255,0.15);

  --primary-blue: var(--color-primary-500);
  --accent-gradient: linear-gradient(135deg, #50CAFF 0%, var(--color-primary-600) 100%);
  --gradient-primary: var(--accent-gradient);
  --alert-critical: var(--color-danger-500);
  --alert-warning: var(--color-warning-500);
  --alert-running: var(--color-success-500);
  --alert-stopped: var(--color-gray-500);
  --text-main: var(--color-gray-900);
  --text-secondary: var(--color-gray-600);
  --text-primary: var(--text-main);
  --text-tertiary: var(--color-gray-500);
  --sidebar-bg: rgba(245, 247, 250, 0.95);
  --sidebar-active: var(--color-primary-50);
  --border-glass: 1px solid rgba(0, 0, 0, 0.05);
  --shadow-neu: var(--box-shadow-lg);
  --shadow-inset: var(--box-shadow-inner);
  --hover-glow: 0 0 10px rgba(59, 130, 246, 0.15);

  /*
   * Spacing & radius tokens (cross-MF):
   * Some remotes (e.g. infra-management-aliyun) reference these as globals.
   * Keep values aligned with Portal design system (8px base unit).
   */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;

  --radius-sm: 8px;
  --radius-md: 15px;
  --radius-lg: 20px;
  --radius-xl: 25px;

  /* Shared shell tokens */
  --shell-sidebar-width: 248px;
  --shell-sidebar-collapsed-width: 86px;
  --shell-drawer-width: min(84vw, 320px);
  --shell-surface-radius: 28px;
  --shell-motion-standard: 180ms cubic-bezier(0.22, 1, 0.36, 1);
  --shell-motion-quick: 140ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Dark theme overrides */

.dark {
  --box-shadow-lg: 4px 4px 10px rgba(0,0,0,0.45), -4px -4px 10px rgba(255,255,255,0.06);
  --box-shadow-inner: inset 2px 2px 4px rgba(0,0,0,0.5), inset -2px -2px 4px rgba(255,255,255,0.06);

  --glass-bg: rgba(17, 24, 39, 0.95);
  --sidebar-bg: rgba(31, 41, 55, 0.95);
  --sidebar-active: var(--color-primary-900);
  --border-glass: 1px solid rgba(255, 255, 255, 0.1);
  --hover-glow: 0 0 10px rgba(59, 130, 246, 0.25);
}

html, body, #root {
  height: 100%;
  overflow: hidden; /* app-shell: main-content scrolls; root must not scroll */
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f5f7fa;
  color: var(--text-main);
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden; /* app-shell: main-content scrolls; body must not scroll */
  line-height: 1.5;
}

/* App container - Flexbox布局重构 */

.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

/* Main content area - 空间最大化 */

.main-content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  position: relative;
  width: 100%;
  min-height: 0;
  z-index: 0;
  isolation: isolate;
  transition: filter var(--shell-motion-standard), opacity var(--shell-motion-standard);
  /* 移除宽度限制，实现全宽度利用 */
}

.app-container[data-shell-state="drawer"] .main-content {
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  filter: blur(8px) saturate(0.92);
  transform: translateZ(0);
}

.app-container[data-shell-state="drawer"] .main-content > * {
  pointer-events: none !important;
}

/* Standalone routes (e.g. /ai): remote app owns layout (including its own sidebar) */

.main-content.main-content--standalone {
  padding: 0;
}

/* Table styles */

.table-container {
  background: var(--glass-bg);
  border-radius: 20px;
  padding: 35px;
  box-shadow: var(--shadow-neu);
  border: var(--border-glass);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
  font-size: 16px;
}

th {
  text-align: left;
  padding: 18px;
  font-weight: 700;
  background: transparent;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

td {
  padding: 24px 18px;
  background: rgba(255, 255, 255, 0.92);
  transition: all 0.3s ease;
  position: relative;
}

tr:first-child td {
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
}

tr:last-child td {
  border-bottom-left-radius: 15px;
  border-bottom-right-radius: 15px;
}

tr:hover td {
  background: rgba(255, 255, 255, 1);
  box-shadow: 
      0 10px 25px rgba(0,0,0,0.05),
      0 5px 15px rgba(0,0,0,0.03);
  transform: translateY(-3px);
  z-index: 2;
}

/* Status badges */

.status-badge {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-inset);
  position: relative;
}

.status-badge::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.status-running {
  background: rgba(16, 185, 129, 0.18);
  color: #047857;
}

.status-stopped {
  background: rgba(107, 114, 128, 0.18);
  color: var(--text-secondary);
}

.status-pending {
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}

.status-critical {
  background: rgba(239, 68, 68, 0.18);
  color: #b91c1c;
  animation: pulse 1.8s infinite;
}

/* Patch Status Styles */

.patch-up-to-date {
  background: rgba(16, 185, 129, 0.18);
  color: #047857;
}

.patch-critical-pending {
  background: rgba(239, 68, 68, 0.18);
  color: #b91c1c;
  animation: pulse 1.8s infinite;
}

.patch-non-critical-pending {
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}

.patch-excluded {
  background: rgba(107, 114, 128, 0.18);
  color: var(--text-secondary);
}

.patch-failed {
  background: rgba(239, 68, 68, 0.25);
  color: #b91c1c;
  border: 1px dashed rgba(239, 68, 68, 0.5);
}

.patch-partial {
  background: linear-gradient(135deg, 
      rgba(245, 158, 11, 0.18) 0%, 
      rgba(245, 158, 11, 0.18) 50%, 
      rgba(16, 185, 129, 0.18) 50%, 
      rgba(16, 185, 129, 0.18) 100%);
  color: #b45309;
}

@keyframes pulse {
  0% { 
      opacity: 0.95;
      box-shadow: 
          inset 3px 3px 7px rgba(0,0,0,0.1),
          inset -3px -3px 7px rgba(255,255,255,0.9),
          0 0 10px rgba(239,68,68,0.2);
  }
  50% { 
      opacity: 1;
      box-shadow: 
          inset 3px 3px 7px rgba(0,0,0,0.1),
          inset -3px -3px 7px rgba(255,255,255,0.9),
          0 0 20px rgba(239,68,68,0.3);
  }
  100% { 
      opacity: 0.95;
      box-shadow: 
          inset 3px 3px 7px rgba(0,0,0,0.1),
          inset -3px -3px 7px rgba(255,255,255,0.9),
          0 0 10px rgba(239,68,68,0.2);
  }
}

/* Responsive design - Flexbox优化 */

@media (max-width: 992px) {
  .app-container {
    flex-direction: column;
  }

  .main-content {
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 15px;
  }
}

/* 认证系统相关样式 */

.app-loading, .app-login {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: var(--glass-bg);
}

.loading-spinner {
  padding: 20px 40px;
  background: var(--glass-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-neu);
  color: var(--text-main);
  font-weight: 500;
  animation: pulse 1.5s ease-in-out infinite;
}

.cm-loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 240px;
  width: 100%;
  color: var(--text-main);
}

.cm-loading-spinner__icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(59, 130, 246, 0.25);
  border-top-color: rgba(59, 130, 246, 1);
  animation: cm-spin 900ms linear infinite;
}

.cm-loading-spinner__text {
  font-size: 14px;
  opacity: 0.75;
}

@keyframes cm-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.login-message {
  padding: 20px 40px;
  background: var(--glass-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-neu);
  color: var(--text-main);
  font-weight: 500;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: var(--glass-bg);
  border-bottom: var(--border-glass);
  box-shadow: var(--shadow-neu);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-info span {
  font-size: 14px;
  color: var(--text-main);
}

.user-role {
  font-size: 12px !important;
  color: var(--text-secondary) !important;
  opacity: 0.8;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
}

.user-role {
  color: var(--text-secondary);
  font-size: 0.9em;
  font-weight: 400;
}

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* ═══════════════════════════════════════════════════
   Branded Login Page (matching Portal Auth 3008)
   ═══════════════════════════════════════════════════ */

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

.app-login-branded {
  position: relative;
  height: 100dvh;
  min-height: 100dvh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 24px;
  padding: max(200px, 34vh, env(safe-area-inset-top)) 20px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

.app-login-branded *, .app-login-branded *::before, .app-login-branded *::after { box-sizing: border-box; }

/* On very tall desktop viewports (e.g. 1440p/4K), the card can end up visually too close to the bottom.
 * Keep the same design, but center the card vertically to reduce the gap to the slogan.
 */

@media (min-height: 1200px) {
  .app-login-branded { gap: 32px; }
}

.app-login-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(92, 170, 255, 0.22), transparent 34%),
    linear-gradient(135deg, #3b495b 0%, #4f6176 22%, #6f7f92 48%, #7f8e9f 74%, #95a1af 100%);
  z-index: 0;
}

.app-login-bg-image {
  position: absolute;
  inset: 0;
  background-image: url("/assets/cloudme-login-background-Do0YHNRz.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  opacity: 1;
  transform: scale(1.01);
  transform-origin: center;
}

.app-login-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1;
}

/* Mouse follow glow effect (matching 3008 TKELoginPage) */

.app-login-mouse-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(38, 132, 255, 0.08) 0%, rgba(80, 202, 255, 0.04) 40%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: left 150ms ease-out, top 150ms ease-out, opacity 300ms ease;
  will-change: left, top;
}

.app-login-branding {
  position: absolute;
  top: 18vh;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 32px);
  z-index: 10;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.app-login-title {
  font-size: 96px;
  font-weight: 900;
  color: white;
  margin: 0 0 12px 0;
  letter-spacing: 0;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
  animation: loginBrandBreath 3s ease-in-out infinite;
  font-family: system-ui, -apple-system, sans-serif;
}

.app-login-slogan {
  font-size: 24px;
  color: white;
  font-weight: 600;
  letter-spacing: 0;
  margin: 0;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.3));
  font-family: system-ui, -apple-system, sans-serif;
  animation: loginBrandBreath 3s ease-in-out infinite;
}

@keyframes loginBrandBreath {
  0%, 100% { opacity: .65; }
  50% { opacity: 1; }
}

@media (max-width: 1100px) { .app-login-title { font-size: 64px; } }

@media (max-width: 700px) {
  .app-login-title { font-size: 48px; }
  .app-login-slogan { font-size: 16px; }
}

.app-login-card {
  box-sizing: border-box;
  position: relative;
  z-index: 20;
  width: min(100%, 420px);
  max-width: 420px;
  flex: 0 0 auto;
  margin: 0 16px;
  background: rgba(252, 253, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .22);
  overflow: hidden;
  animation: loginFadeInUp 600ms cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

.app-login-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.7) 100%);
  pointer-events: none;
  border-radius: 8px;
}

.app-login-card-inner {
  position: relative;
  z-index: 1;
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.app-login-logo {
  margin-bottom: 16px;
}

.app-login-logo img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.app-login-brand {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 2px;
  background: linear-gradient(135deg, #50CAFF 0%, #0478FF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-login-subtitle {
  font-size: 12px;
  color: #526173;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 24px;
}

.app-login-error {
  width: 100%;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  text-align: left;
  background: rgba(255, 92, 92, 0.08);
  border: 1px solid rgba(255, 92, 92, 0.2);
  color: #b42318;
}

.app-login-error-reference {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
}

.app-login-error-reference code { overflow-wrap: anywhere; }

.app-login-local-form {
  width: 100%;
  display: grid;
  gap: 14px;
  margin: 0 0 20px;
  text-align: left;
}

.app-login-field { display: grid; gap: 6px; color: #334155; font-size: 13px; font-weight: 650; }

.app-login-field input {
  width: 100%;
  min-height: 46px;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #b7c4d4;
  border-radius: 8px;
  color: #142033;
  background: #fff;
  font: inherit;
  font-size: 16px;
}

.app-login-field input:focus { border-color: #1d4ed8; outline: 3px solid rgba(29, 78, 216, .2); outline-offset: 1px; }

.app-login-field input:disabled { background: #eef2f7; cursor: wait; }

.app-login-password { position: relative; }

.app-login-password input { padding-right: 48px; }

.app-login-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #334155;
  background: transparent;
  cursor: pointer;
}

.app-login-password .app-login-icon-button { position: absolute; right: 1px; top: 1px; }

.app-login-icon-button:hover:not(:disabled) { color: #1d4ed8; background: #eef4ff; }

.app-login-icon-button:disabled { opacity: .45; cursor: not-allowed; }

.app-login-back { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 0; color: #334155; background: transparent; cursor: pointer; }

.app-login-back:disabled { opacity: .5; cursor: not-allowed; }

.app-login-help { margin: -2px 0 0; color: #526173; font-size: 12px; line-height: 1.45; text-align: center; }

.app-login-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-login-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  min-height: 46px;
  color: white;
  background: #1459c7;
  box-shadow: 0 2px 8px rgba(38, 132, 255, 0.3);
  cursor: pointer;
  transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.app-login-btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(38, 132, 255, 0.4);
  transform: translateY(-2px);
}

.app-login-btn-primary:disabled { opacity: .52; cursor: not-allowed; box-shadow: none; transform: none; }

.app-login-btn-primary:focus-visible, .app-login-btn-secondary:focus-visible, .app-login-back:focus-visible { outline: 3px solid #57b6ff; outline-offset: 2px; }

.app-login-spinner { animation: loginSpin 800ms linear infinite; }

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

.app-login-btn-primary:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
  box-shadow: inset 3px 3px 7px rgba(0, 0, 0, 0.08), inset -3px -3px 7px rgba(255, 255, 255, 0.95);
}

.app-login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 0;
  font-size: 11px;
  color: #526173;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0;
}

.app-login-divider span:first-child,
.app-login-divider span:last-child {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.06), transparent);
}

.app-login-btn-secondary {
  min-height: 46px;
  width: 100%;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #1a202c;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(203, 213, 225, 0.6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.app-login-btn-secondary:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.app-login-btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.app-login-footer {
  position: relative;
  width: 100%;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  gap: 12px;
  flex-wrap: wrap;
  flex: 0 0 auto;
  margin-top: auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.app-login-footer-links {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.app-login-footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 8px;
  border-radius: 6px;
  color: #fff;
  text-decoration: none;
  transition: color 200ms, background 200ms;
}

.app-login-footer-links a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.app-login-footer-links span {
  color: rgba(255, 255, 255, 0.3);
}

.app-login-footer-copy {
  font-size: 12px;
  color: #fff;
}

/* System keeps the existing identity-provider entry, but uses a quieter admin-console surface. */

.app-login-branded--system {
  align-items: center;
  padding: 76px 20px 12px;
}

.app-login-overlay--system {
  background: rgba(15, 23, 32, 0.68);
}

.app-login-branding--system {
  top: auto;
  display: none;
}

.app-login-branding--system .app-login-title {
  font-size: 40px;
  font-weight: 760;
  letter-spacing: 0;
  animation: none;
}

.app-login-branding--system .app-login-slogan {
  font-weight: 500;
  letter-spacing: 0;
}

.app-login-card--system {
  width: min(100%, 440px);
  max-width: 440px;
  margin-top: auto;
  border-radius: 8px;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 24px 64px rgba(2, 12, 24, 0.24);
}

.app-login-card--system::before {
  border-radius: 8px;
}

.app-login-card--system .app-login-card-inner {
  padding: 30px 36px 28px;
}

.system-login-heading {
  width: 100%;
  margin: 0 0 8px;
  color: #142033;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: left;
}

.system-login-description {
  width: 100%;
  margin: 0 0 22px;
  color: #526173;
  font-size: 14px;
  line-height: 1.55;
  text-align: left;
}

.system-login-security {
  margin: 18px 0 0;
  color: #526173;
  font-size: 12px;
  line-height: 1.5;
}

.system-login-language {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 40;
  display: block;
}

.system-login-language .shell-language-menu__trigger {
  min-height: 44px;
  color: rgba(255, 255, 255, 0.86);
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(17, 28, 40, 0.72);
  box-shadow: 0 10px 28px rgba(2, 12, 24, 0.18);
}

.system-login-language .shell-language-menu__list {
  right: 0;
  left: auto;
  color: #142033;
  background: rgba(255, 255, 255, 0.98);
}

.app-login-card--system button:focus-visible,
.app-login-card--system a:focus-visible {
  outline: 2px solid #57b6ff;
  outline-offset: 2px;
}

@media (max-width: 700px), (max-height: 650px) {
  .app-login-branded { gap: 20px; justify-content: flex-start; padding: max(200px, 34vh) 16px 16px; }
  .app-login-card { margin: 0; }
  .app-login-card-inner { padding: 26px 22px 24px; }
  .app-login-branded--system {
    align-items: center;
    padding: 76px 16px 16px;
  }

  .app-login-branding--system {
    display: none;
  }

  .app-login-card--system {
    margin-top: 0;
  }

  .app-login-card--system .app-login-card-inner {
    padding: 26px 22px 24px;
  }

  .system-login-language {
    top: 14px;
    right: 14px;
  }
}

.app-login-language {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 40;
}

.app-login-language .shell-language-menu__trigger { min-height: 44px; }

.app-login-mouse-glow { display: none; }

.app-login-card button:focus-visible, .app-login-footer a:focus-visible { outline: 3px solid #57b6ff; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .app-login-card, .app-login-title, .app-login-slogan, .app-login-spinner { animation: none; }
  .app-login-card button { transition: none; }
}

.shell-language-menu {
  position: relative;
  z-index: 50;
  min-width: 0;
}

.shell-language-menu__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  max-width: 190px;
  padding: 0 10px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 10px;
  color: #334155;
  background: rgba(255, 255, 255, 0.8);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(148, 163, 184, 0.12);
  transition: border-color var(--shell-motion-quick), color var(--shell-motion-quick), background var(--shell-motion-quick), box-shadow var(--shell-motion-quick);
}

.shell-language-menu__trigger:hover,
.shell-language-menu__trigger[aria-expanded='true'] {
  border-color: rgba(59, 130, 246, 0.32);
  color: #1d4ed8;
  background: rgba(255, 255, 255, 0.98);
}

.shell-language-menu__trigger:focus-visible,
.shell-language-menu__option:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.58);
  outline-offset: 2px;
}

.shell-language-menu__chevron {
  transition: transform 160ms ease;
}

.shell-language-menu__chevron.is-open {
  transform: rotate(180deg);
}

.shell-language-menu__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  line-height: 0;
}

.shell-language-menu__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.shell-language-menu__current {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-language-menu__list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  min-width: 214px;
  padding: 6px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.shell-language-menu__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  color: #334155;
  background: transparent;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.shell-language-menu__option:hover,
.shell-language-menu__option[aria-checked='true'] {
  color: #1d4ed8;
  background: rgba(219, 234, 254, 0.72);
}

.shell-language-menu__option small {
  color: #64748b;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.shell-sidebar .shell-sidebar__locale-row {
  margin-left: -6px;
  width: calc(100% + 8px);
  padding-left: 0;
}

.shell-sidebar__locale-row .shell-language-menu {
  width: 100%;
}

.shell-sidebar .shell-language-menu__trigger {
  justify-content: flex-start;
  width: 100%;
  min-height: 44px;
  max-width: none;
  gap: 12px;
  padding: 0 16px;
  border-color: transparent;
  border-radius: 15px;
  background: transparent;
  box-shadow: none;
  color: rgba(51, 65, 85, 0.94);
  font-size: 13px;
  font-weight: 600;
  box-sizing: border-box;
}

.shell-sidebar .shell-language-menu__trigger:hover,
.shell-sidebar .shell-language-menu__trigger[aria-expanded='true'] {
  border-color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 10px 24px rgba(148, 163, 184, 0.12);
  color: #0f172a;
}

.shell-sidebar .shell-language-menu__trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.shell-sidebar .shell-language-menu__icon {
  width: 18px;
  height: 18px;
}

.shell-sidebar .shell-language-menu__current {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.shell-sidebar__locale-row .shell-language-menu__list {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.shell-sidebar--collapsed .shell-language-menu__current {
  display: none;
}

.shell-sidebar--collapsed .shell-sidebar__locale-row {
  width: 46px;
  margin-left: 0;
}

.shell-sidebar--collapsed .shell-sidebar__locale-row .shell-language-menu {
  width: 46px;
}

.shell-sidebar--collapsed .shell-language-menu__trigger {
  justify-content: center;
  width: 46px;
  min-height: 48px;
  gap: 0;
  padding: 0;
}

.shell-sidebar--collapsed .shell-language-menu__icon {
  width: 18px;
  height: 18px;
}

.shell-sidebar--collapsed .shell-language-menu__chevron {
  display: none;
}

.shell-sidebar--collapsed .shell-sidebar__header .shell-language-menu__list {
  top: 0;
  right: auto;
  left: calc(100% + 12px);
  width: 214px;
  min-width: 214px;
}

.shell-mobile-bar .shell-language-menu__trigger {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  gap: 0;
  border-color: rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94), 0 10px 22px rgba(148, 163, 184, 0.14);
}

.shell-mobile-bar .shell-language-menu__current {
  display: none;
}

.shell-mobile-bar .shell-language-menu__chevron {
  display: none;
}

.shell-mobile-bar .shell-language-menu__list {
  right: auto;
  left: 50%;
  width: min(214px, calc(100vw - 24px));
  min-width: 0;
  transform: translateX(-50%);
}

.shell-mobile-bar {
  gap: 8px;
}

@media (max-width: 700px), (max-height: 900px) {
  .app-login-language {
    top: 14px;
    right: 14px;
  }
}
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Magic Component Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-fadeIn {
  animation: fadeIn 1s ease-in-out;
}