/* ============================================
   IT-ASSET-Delivery — Premium Design System
   ============================================ */

/* Google Font Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   1. CSS Variables
   ============================================ */
:root {
  /* ── Primary Backgrounds ── */
  --bg-darkest: #e2e8f0;
  --bg-dark: #f8f9fa;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-input: #ffffff;
  --bg-overlay: rgba(0, 0, 0, 0.5);

  /* ── Accent Colors (Betagro Green theme) ── */
  --accent-cyan: #10b981; /* Main Green */
  --accent-cyan-light: #34d399;
  --accent-cyan-dark: #059669;
  --accent-teal: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-purple-light: #a78bfa;
  --accent-green: #10b981;
  --accent-green-light: #34d399;
  --accent-amber: #f59e0b;
  --accent-amber-light: #fbbf24;
  --accent-red: #ef4444;
  --accent-red-light: #f87171;

  /* ── Text Colors ── */
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-accent: var(--accent-cyan);
  --text-inverse: #ffffff;

  /* ── Glassmorphism ── */
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-bg-light: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-blur: 16px;
  --glass-blur-heavy: 24px;

  /* ── Borders ── */
  --border-color: rgba(0, 0, 0, 0.08);
  --border-color-hover: rgba(0, 0, 0, 0.15);
  --border-color-focus: var(--accent-cyan);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* ── Spacing ── */
  --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;

  /* ── Typography ── */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.8125rem;
  --font-size-base: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 1.875rem;
  --font-size-3xl: 2.25rem;
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* ── Shadows ── */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow-cyan: 0 0 20px rgba(0, 212, 255, 0.15);
  --shadow-glow-purple: 0 0 20px rgba(139, 92, 246, 0.15);
  --shadow-glow-green: 0 0 20px rgba(16, 185, 129, 0.15);
  --shadow-glow-amber: 0 0 20px rgba(245, 158, 11, 0.15);
  --shadow-glow-red: 0 0 20px rgba(239, 68, 68, 0.15);

  /* ── Transitions ── */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-spring: 350ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ── Layout ── */
  --navbar-height: 64px;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
}

/* ============================================
   2. Reset & Base Styles
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-darkest);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-cyan-light);
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-darkest);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

::selection {
  background: rgba(0, 212, 255, 0.3);
  color: var(--text-primary);
}

/* ============================================
   3. Typography
   ============================================ */
h1, h2, h3, h4 {
  color: var(--text-primary);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-extrabold);
}

h2 {
  font-size: var(--font-size-2xl);
}

h3 {
  font-size: var(--font-size-xl);
}

h4 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

p {
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-4);
}

label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

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

.text-accent {
  color: var(--text-accent);
}

/* ============================================
   4. Layout Utilities
   ============================================ */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

.grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

/* ============================================
   5. Login Screen — V99.0016 Betagro Corporate
   ============================================ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(24px, 5vw, 64px);
  background:
    radial-gradient(circle at 14% 19%, rgba(159, 220, 120, 0.42) 0, rgba(159, 220, 120, 0.15) 16%, transparent 34%),
    radial-gradient(circle at 88% 17%, rgba(255, 219, 120, 0.33) 0, rgba(255, 219, 120, 0.10) 17%, transparent 35%),
    radial-gradient(circle at 86% 76%, rgba(72, 207, 154, 0.34) 0, rgba(72, 207, 154, 0.10) 22%, transparent 41%),
    linear-gradient(135deg, #fbfcf4 0%, #f6faf2 46%, #eef9f2 100%);
}

.login-screen::before,
.login-screen::after {
  content: '';
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.login-screen::before {
  left: -10%;
  bottom: -21%;
  width: 64%;
  height: 46%;
  border-radius: 50% 55% 0 0 / 55% 65% 0 0;
  background: rgba(255, 253, 244, 0.90);
  transform: rotate(3deg);
  box-shadow: 0 -1px 60px rgba(122, 166, 115, 0.05);
}

.login-screen::after {
  right: -15%;
  bottom: -28%;
  width: 70%;
  height: 58%;
  border-radius: 62% 0 0 0 / 48% 0 0 0;
  background: linear-gradient(135deg, rgba(208, 242, 218, 0.62), rgba(157, 226, 196, 0.64));
  transform: rotate(-5deg);
}

.login-container {
  position: relative;
  z-index: 2;
  width: min(510px, 100%);
  max-width: 510px;
  padding: 16px;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.90);
  border: 1px solid rgba(255, 255, 255, 0.96);
  box-shadow:
    0 26px 64px rgba(28, 74, 51, 0.14),
    0 8px 22px rgba(28, 74, 51, 0.06);
  animation: loginCardEnter 520ms cubic-bezier(.2,.75,.3,1) both;
}

.login-panel {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 42px 36px;
  border-radius: 27px;
  border: 1px solid rgba(58, 151, 92, 0.30);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.login-brand {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 24px;
}

.login-logo {
  display: block;
  width: min(190px, 58vw);
  height: auto;
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 4px 9px rgba(29, 82, 48, 0.08));
}

.login-title {
  width: 100%;
  margin: 0;
  text-align: center;
  color: #113c31;
  background: none;
  -webkit-text-fill-color: currentColor;
}

.login-title h1 {
  margin: 0;
  color: #113c31;
  font-size: clamp(1.78rem, 3vw, 2.15rem);
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.login-subtitle {
  margin: 18px 0 0;
  color: #66756f;
  font-size: 1.03rem;
  line-height: 1.5;
  font-weight: 500;
}

.login-divider {
  width: min(310px, 82%);
  height: 1px;
  margin: 30px auto 32px;
  background: linear-gradient(90deg, transparent, rgba(50, 152, 91, 0.34) 13%, rgba(50, 152, 91, 0.34) 87%, transparent);
}

.login-action-area {
  width: 100%;
  display: flex;
  justify-content: center;
}

.login-betagro-button {
  width: min(350px, 100%);
  min-height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
  padding: 15px 24px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #08734f 0%, #0b966c 58%, #11a978 100%);
  box-shadow: 0 16px 30px rgba(6, 113, 77, 0.22);
  font: inherit;
  font-size: 1.08rem;
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.login-betagro-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 36px rgba(6, 113, 77, 0.27);
  filter: saturate(1.05) brightness(1.02);
}

.login-betagro-button:active {
  transform: translateY(0);
}

.login-betagro-button:focus-visible {
  outline: 3px solid rgba(86, 183, 81, 0.38);
  outline-offset: 4px;
}

.login-account-icon {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
}

.login-account-icon::before {
  content: '';
  position: absolute;
  top: 7px;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  transform: translateX(-50%);
}

.login-account-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 20px;
  height: 10px;
  border: 2px solid #fff;
  border-bottom: 0;
  border-radius: 14px 14px 4px 4px;
  transform: translateX(-50%);
}

.login-secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 38px;
  color: #66746f;
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: center;
}

.login-shield-icon {
  width: 20px;
  height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5d7069;
  border: 1.7px solid #6d8179;
  border-radius: 8px 8px 10px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  clip-path: polygon(50% 0, 95% 18%, 90% 70%, 50% 100%, 10% 70%, 5% 18%);
}

.login-note-dot {
  color: #9aa6a1;
  font-size: 0.72rem;
}

.login-config-error {
  width: min(370px, 100%);
  margin: 0 auto;
  padding: 16px 18px;
  border: 1px solid #e6b4aa;
  border-radius: 14px;
  color: #8a3325;
  background: rgba(255, 245, 242, 0.92);
  font-size: 0.9rem;
  line-height: 1.55;
  text-align: center;
}

@keyframes loginCardEnter {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
  .login-screen {
    padding: 18px;
    align-items: center;
  }

  .login-container {
    padding: 10px;
    border-radius: 27px;
  }

  .login-panel {
    min-height: 0;
    padding: 36px 22px 30px;
    border-radius: 22px;
  }

  .login-brand { margin-bottom: 18px; }
  .login-logo { width: min(166px, 62vw); }
  .login-title h1 { font-size: clamp(1.55rem, 7vw, 1.85rem); }
  .login-subtitle { margin-top: 14px; font-size: 0.96rem; }
  .login-divider { margin: 24px auto 26px; }
  .login-betagro-button { min-height: 58px; padding: 13px 16px; font-size: 0.98rem; gap: 12px; }
  .login-account-icon { flex-basis: 34px; width: 34px; height: 34px; }
  .login-account-icon::before { top: 6px; }
  .login-account-icon::after { bottom: 5px; width: 18px; }
  .login-secure-note { margin-top: 30px; font-size: 0.78rem; }
}

@media (prefers-reduced-motion: reduce) {
  .login-container { animation: none; }
  .login-betagro-button { transition: none; }
}

.role-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.role-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-6);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.role-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  padding: 1px;
  background: linear-gradient(135deg, transparent 30%, rgba(0, 212, 255, 0.3) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.role-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), var(--shadow-glow-cyan);
  border-color: rgba(0, 212, 255, 0.2);
  background: rgba(26, 26, 46, 0.85);
}

.role-card:hover::before {
  opacity: 1;
}

.role-card .role-icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  display: block;
  filter: drop-shadow(0 0 12px rgba(0, 212, 255, 0.3));
}

.role-card .role-name {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.role-card .role-desc {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  line-height: var(--line-height-relaxed);
}

.team-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8.825L.35 3.175l.7-.7L6 7.425l4.95-4.95.7.7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.team-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

/* ===================/* ── Navbar is now inline in app.js for Topbar ── */
.navbar {
  display: none;
}

/* ============================================
   7. Sidebar
   ============================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  z-index: 900;
  transition: width var(--transition-base), transform var(--transition-base);
}

.sidebar-mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 850;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.sidebar-mobile-overlay.show {
  display: block;
  opacity: 1;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: 0 var(--space-3);
}

.sidebar-section-title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--space-4) var(--space-4) var(--space-2);
  margin-top: var(--space-2);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  text-decoration: none;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-link.active {
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.08);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--accent-cyan);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

.sidebar-link .icon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity var(--transition-fast);
}

.sidebar-link:hover .icon,
.sidebar-link.active .icon {
  opacity: 1;
}

.sidebar-link .label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   8. Main Content Area
   ============================================ */
.main-content {
  /* Layout now handled by inline styles in app.js (.main-wrapper) */
  animation: fadeIn 0.4s ease-out;
}

.page-header {
  margin-bottom: var(--space-8);
}

.page-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: var(--font-size-base);
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ============================================
   9. Stat Cards
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  animation: slideUp 0.5s ease-out both;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-color-hover);
}

/* Stat Card Variants */
.stat-card.cyan::before { background: linear-gradient(90deg, var(--accent-cyan), var(--accent-teal)); }
.stat-card.cyan:hover { box-shadow: var(--shadow-lg), var(--shadow-glow-cyan); }
.stat-card.cyan .stat-icon { color: var(--accent-cyan); background: rgba(0, 212, 255, 0.1); }

.stat-card.green::before { background: linear-gradient(90deg, var(--accent-green), var(--accent-green-light)); }
.stat-card.green:hover { box-shadow: var(--shadow-lg), var(--shadow-glow-green); }
.stat-card.green .stat-icon { color: var(--accent-green); background: rgba(16, 185, 129, 0.1); }

.stat-card.amber::before { background: linear-gradient(90deg, var(--accent-amber), var(--accent-amber-light)); }
.stat-card.amber:hover { box-shadow: var(--shadow-lg), var(--shadow-glow-amber); }
.stat-card.amber .stat-icon { color: var(--accent-amber); background: rgba(245, 158, 11, 0.1); }

.stat-card.red::before { background: linear-gradient(90deg, var(--accent-red), var(--accent-red-light)); }
.stat-card.red:hover { box-shadow: var(--shadow-lg), var(--shadow-glow-red); }
.stat-card.red .stat-icon { color: var(--accent-red); background: rgba(239, 68, 68, 0.1); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-4);
  transition: transform var(--transition-spring);
}

.stat-card:hover .stat-icon {
  transform: scale(1.1);
}

.stat-value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-weight: var(--font-weight-medium);
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  margin-top: var(--space-3);
}

.stat-trend.up {
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.1);
}

.stat-trend.down {
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.1);
}

/* ============================================
   10. Data Table
   ============================================ */
.table-container {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  overflow-y: hidden;
  animation: slideUp 0.5s ease-out both;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-color);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.table-header .search-input {
  max-width: 280px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.data-table thead {
  background: rgba(0, 0, 0, 0.2);
}

.data-table th {
  padding: var(--space-3) var(--space-5);
  text-align: left;
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
  position: relative;
}

.data-table th:hover {
  color: var(--text-primary);
}

.data-table th.sortable::after {
  content: '⇅';
  margin-left: var(--space-2);
  opacity: 0.4;
  font-size: 0.7em;
}

.data-table th.sort-asc::after {
  content: '↑';
  opacity: 1;
  color: var(--accent-cyan);
}

.data-table th.sort-desc::after {
  content: '↓';
  opacity: 1;
  color: var(--accent-cyan);
}

.data-table td {
  padding: var(--space-3) var(--space-5);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  transition: color var(--transition-fast);
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.data-table tbody tr:hover td {
  color: var(--text-primary);
}

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

/* ============================================
   11. Status Badges
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
  letter-spacing: 0.02em;
  transition: all var(--transition-fast);
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-pending {
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.badge-pending::before { background: var(--accent-amber); }

.badge-in-progress {
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.12);
  border: 1px solid rgba(0, 212, 255, 0.2);
}
.badge-in-progress::before { background: var(--accent-cyan); animation: pulse 2s infinite; }

.badge-delivered {
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.badge-delivered::before { background: var(--accent-green); }

.badge-confirmed {
  color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.2);
}
.badge-confirmed::before { background: var(--accent-purple); }

/* ============================================
   12. Priority Badges
   ============================================ */
.badge-high {
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.badge-high::before { background: var(--accent-red); animation: pulse 1.5s infinite; }

.badge-medium {
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.badge-medium::before { background: var(--accent-amber); }

.badge-low {
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.badge-low::before { background: var(--accent-green); }

/* ============================================
   13. Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
  white-space: nowrap;
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:hover::after {
  opacity: 1;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan-dark) 0%, var(--accent-cyan) 50%, var(--accent-teal) 100%);
  color: var(--text-inverse);
  box-shadow: 0 4px 16px rgba(0, 212, 255, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(0, 212, 255, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color-hover);
}

.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626, var(--accent-red));
  color: #fff;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  box-shadow: 0 6px 24px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #059669, var(--accent-green));
  color: #fff;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-xs);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

#sidebar-toggle {
  display: none;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--border-color-hover);
}

/* ============================================
   14. Modal
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center; /* Center the modal */
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: scale(0.95);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.modal-overlay.active .modal {
  transform: scale(1);
  opacity: 1;
}

/* Phone usage detail and month-over-month history */
.phone-detail-panel { max-width: 1180px; }
.phone-detail-panel .modal-header,
.phone-detail-panel .modal-footer { background: #effaf2; border-color: #cfe7d7; }
.phone-detail-panel .modal-body {
  background:
    radial-gradient(circle at 95% 5%, rgba(74, 222, 128, 0.16), transparent 28%),
    linear-gradient(145deg, #eaf8ef, #f5fcf7 52%, #e8f7ed);
  padding: 22px;
}
.phone-detail-hero,
.phone-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.phone-detail-hero {
  padding: 22px 24px;
  color: white;
  border-radius: 16px;
  background: linear-gradient(120deg, #0b3d32, #087f5b 62%, #10b981);
  box-shadow: 0 14px 28px rgba(8, 127, 91, 0.2);
}
.phone-detail-hero .eyebrow { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.14em; opacity: 0.72; }
.phone-detail-hero h2 { margin: 5px 0 2px; color: white; font: 800 1.75rem/1.1 monospace; }
.phone-detail-hero p { margin: 0; opacity: 0.82; }
.phone-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.phone-summary-card,
.phone-detail-section { background: rgba(248, 255, 250, 0.94); border: 1px solid #cfe7d7; border-radius: 14px; }
.phone-summary-card { position: relative; overflow: hidden; padding: 16px; }
.phone-summary-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: #10b981; }
.phone-summary-card.call::before { background: #3b82f6; }
.phone-summary-card.data::before { background: #f59e0b; }
.phone-summary-card.history::before { background: #64748b; }
.phone-summary-card > span { color: #64748b; font-size: 0.78rem; font-weight: 700; }
.phone-summary-card strong { display: block; margin: 7px 0 4px; color: #10233f; font-size: 1.25rem; }
.phone-trend { font-size: 0.7rem; font-weight: 700; }
.phone-trend.positive { color: #059669; }
.phone-trend.negative { color: #dc2626; }
.phone-trend.neutral { color: #94a3b8; }
.phone-detail-section { padding: 18px; margin-top: 14px; }
.phone-chart-section { background: linear-gradient(145deg, rgba(248, 255, 250, 0.98), rgba(236, 250, 241, 0.98)); }
.phone-chart-wrap { position: relative; height: 285px; margin-top: 14px; }
.phone-section-heading { padding-bottom: 13px; border-bottom: 1px solid #eef1f5; }
.phone-section-heading span { color: #8492a6; font-size: 0.74rem; }
.phone-section-heading h3 { margin: 2px 0 0; color: #10233f; font-size: 1rem; }
.phone-fields-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 22px; }
.phone-field { min-width: 0; padding: 11px 0; border-bottom: 1px solid #eef1f5; }
.phone-field span { display: block; color: #7b8798; font-size: 0.7rem; margin-bottom: 3px; }
.phone-field strong { display: block; color: #1d2c43; font-size: 0.82rem; overflow-wrap: anywhere; }
.phone-history-wrap { overflow-x: auto; }
.phone-history-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.phone-history-table th { color: #64748b; text-align: left; padding: 12px 10px; white-space: nowrap; }
.phone-history-table td { color: #26364d; padding: 11px 10px; border-top: 1px solid #eef1f5; white-space: nowrap; }
.phone-history-table tr.current { background: rgba(16, 185, 129, 0.07); }
.phone-history-table td small { display: block; color: #059669; font-size: 0.62rem; }
.phone-history-diff { display: inline-block; margin-left: 5px; font-size: 0.67rem; font-weight: 800; }
.phone-history-diff.up { color: #dc2626; }
.phone-history-diff.down { color: #059669; }
.phone-history-diff.neutral { color: #94a3b8; }
.phone-status { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 0.7rem; font-weight: 800; white-space: nowrap; }
.phone-status.active { color: #047857; background: #d1fae5; }
.phone-status.inactive { color: #64748b; background: #e9eef4; }
.phone-detail-btn {
  border: 1px solid rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.09);
  color: var(--accent-green);
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}
.phone-detail-btn:hover { background: var(--accent-green); color: white; }

/* Asset master classification summary */
.asset-group-section,
.asset-status-summary {
  margin-bottom: 20px;
  padding: 20px;
  background: linear-gradient(145deg, #f2fbf5, #ffffff 58%, #edf9f1);
  border: 1px solid #cfe7d7;
  border-radius: 14px;
}

.asset-summary-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.asset-summary-heading span {
  color: #059669;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.asset-summary-heading h2 {
  margin: 3px 0 0;
  color: #10233f;
  font-size: 1.05rem;
}

.asset-summary-heading p { margin: 0; color: #718096; font-size: 0.76rem; }
.asset-group-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.asset-group-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid color-mix(in srgb, var(--group-color) 24%, #dce7e0);
  border-radius: 12px;
}
.asset-group-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--group-color); }
.asset-group-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 11px; background: color-mix(in srgb, var(--group-color) 12%, white); font-size: 1.15rem; }
.asset-group-content { min-width: 0; }
.asset-group-content span { display: block; color: #45576e; font-size: 0.76rem; font-weight: 700; }
.asset-group-content strong { display: block; color: var(--group-color); font-size: 1.45rem; line-height: 1.2; }
.asset-group-content small { display: block; overflow: hidden; color: #94a3b8; font-size: 0.62rem; text-overflow: ellipsis; white-space: nowrap; }
.asset-group-share { margin-left: auto; align-self: flex-start; padding: 4px 7px; color: var(--group-color); background: color-mix(in srgb, var(--group-color) 10%, white); border-radius: 999px; font-size: 0.65rem; font-weight: 800; }
.asset-status-table-wrap { overflow-x: auto; }
.asset-status-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.asset-status-table th { padding: 10px; color: #64748b; text-align: left; border-bottom: 1px solid #cfe7d7; }
.asset-status-table td { padding: 10px; color: #334155; border-bottom: 1px solid #e5f1e9; }
.asset-status-table .number { text-align: right; font-variant-numeric: tabular-nums; }
.asset-status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; background: #10b981; border-radius: 50%; }
.asset-status-progress { width: 100%; min-width: 110px; height: 7px; overflow: hidden; background: #e5efe8; border-radius: 999px; }
.asset-status-progress span { display: block; height: 100%; min-width: 2px; background: linear-gradient(90deg, #059669, #4ade80); border-radius: inherit; }

@media (max-width: 900px) {
  .asset-group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .asset-summary-heading { align-items: flex-start; flex-direction: column; }
  .asset-group-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .phone-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phone-fields-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .phone-detail-panel .modal-body { padding: 12px; }
  .phone-detail-hero, .phone-section-heading { align-items: flex-start; flex-direction: column; }
  .phone-summary-grid, .phone-fields-grid { grid-template-columns: 1fr; }
  .phone-detail-hero h2 { font-size: 1.35rem; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-color);
}

/* ============================================
   15. Form Controls
   ============================================ */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
  background: rgba(15, 23, 42, 0.8);
}

.form-select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8.825L.35 3.175l.7-.7L6 7.425l4.95-4.95.7.7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: var(--line-height-relaxed);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

/* ============================================
   16. Toast Notifications
   ============================================ */
.toast-container {
  position: fixed;
  top: calc(var(--navbar-height) + var(--space-4));
  right: var(--space-4);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  min-width: 320px;
  max-width: 420px;
  pointer-events: auto;
  animation: slideRight 0.4s var(--transition-spring) both;
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.toast-success::before { background: var(--accent-green); }
.toast-error::before { background: var(--accent-red); }
.toast-warning::before { background: var(--accent-amber); }
.toast-info::before { background: var(--accent-cyan); }

.toast-success { border-color: rgba(16, 185, 129, 0.2); }
.toast-error { border-color: rgba(239, 68, 68, 0.2); }
.toast-warning { border-color: rgba(245, 158, 11, 0.2); }
.toast-info { border-color: rgba(0, 212, 255, 0.2); }

.toast-message {
  flex: 1;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
}

.toast-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  font-size: 1rem;
  flex-shrink: 0;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.toast.toast-exit {
  animation: slideDown 0.3s ease-in forwards;
}

/* ============================================
   17. Charts
   ============================================ */
.chart-container {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.chart-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-5);
}

.donut-chart {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  margin: 0 auto var(--space-5);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-chart::after {
  content: '';
  position: absolute;
  width: 65%;
  height: 65%;
  border-radius: 50%;
  background: var(--bg-card);
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-sm);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.legend-label {
  color: var(--text-secondary);
  flex: 1;
}

/* ============================================
   18. Activity Feed
   ============================================ */
.activity-feed {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  position: relative;
}

.activity-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 32px;
  bottom: -8px;
  width: 2px;
  background: var(--border-color);
}

.activity-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-cyan);
  flex-shrink: 0;
  margin-top: 3px;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
  position: relative;
  z-index: 1;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-text {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-1);
}

.activity-time {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* ============================================
   19. Team Overview Cards
   ============================================ */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
}

.team-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--transition-base);
  cursor: pointer;
  animation: slideUp 0.5s ease-out both;
}

.team-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow-cyan);
  border-color: rgba(0, 212, 255, 0.15);
}

.team-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: #fff;
  margin-bottom: var(--space-4);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.2);
}

.team-name {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.team-stats {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.team-progress {
  margin-top: var(--space-3);
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-teal));
  transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}

/* ============================================
   20. Task Cards
   ============================================ */
.task-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.task-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  animation: slideUp 0.4s ease-out both;
}

.task-card:hover {
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-md);
}

.task-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-color);
}

.task-card-body {
  padding: var(--space-4) var(--space-5);
}

.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid var(--border-color);
}

.task-number {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--accent-cyan);
  font-family: 'Inter', monospace;
}

.task-asset-type {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.task-asset-icon {
  font-size: 1.5rem;
  margin-right: var(--space-2);
}

.task-recipient {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.task-due-date {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ============================================
   21. Filter Bar
   ============================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.filter-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.filter-select {
  padding: var(--space-2) var(--space-3);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  outline: none;
  appearance: none;
  cursor: pointer;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%2394a3b8' d='M5 7.5L.29 2.79l.59-.58L5 6.33 9.12 2.21l.59.58z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.filter-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.08);
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-10);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: var(--font-size-base);
  pointer-events: none;
}

/* ============================================
   22. Empty State
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
  animation: fadeIn 0.6s ease-out;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: var(--space-6);
  opacity: 0.25;
  filter: grayscale(0.5);
}

.empty-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.empty-desc {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  max-width: 360px;
  line-height: var(--line-height-relaxed);
}

/* ============================================
   23. Progress Section
   ============================================ */
.progress-section {
  padding: var(--space-5) 0;
}

.progress-section .progress-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.progress-section .progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-teal));
  transition: width 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
}

.progress-section .progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  animation: shimmer 2s infinite;
}

.progress-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.progress-percentage {
  font-weight: var(--font-weight-bold);
  color: var(--accent-cyan);
}

/* ============================================
   24. Animations
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

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

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

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

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

/* ============================================
   25. Responsive Design
   ============================================ */

/* Tablet — max-width 1024px */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: var(--sidebar-collapsed-width);
  }

  .sidebar-link .label {
    display: none;
  }

  .sidebar-section-title {
    display: none;
  }

  .sidebar-link {
    justify-content: center;
    padding: var(--space-3);
  }

  .sidebar-link .icon {
    margin: 0;
  }

  .sidebar-link.active::before {
    left: -4px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .role-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile — max-width 768px */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }

  .sidebar.open {
    transform: translateX(0);
    width: 260px;
  }

  .sidebar.open .sidebar-link .label {
    display: inline;
  }

  .sidebar.open .sidebar-section-title {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: var(--space-4);
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }
  
  #sidebar-toggle {
    display: inline-flex !important;
  }

  .topbar-search {
    display: none !important;
  }

  .user-profile {
    border-left: none !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
  }

  .user-profile span {
    display: none;
  }
  
  .user-profile .btn-logout {
    padding: 4px 6px !important;
    font-size: 0.7rem !important;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    flex-wrap: wrap;
  }

  .search-input {
    min-width: unset;
    width: 100%;
  }

  .table-header {
    flex-direction: column;
    align-items: stretch;
  }

  .table-header .search-input {
    max-width: 100%;
  }

  .navbar-brand span {
    display: none;
  }

  .modal {
    width: 95%;
    max-height: 90vh;
  }

  .page-title {
    font-size: var(--font-size-xl);
  }

  .team-grid {
    grid-template-columns: 1fr;
  }

  .toast {
    min-width: unset;
    max-width: calc(100vw - 2rem);
  }
}

/* ============================================
   26. Utility Classes
   ============================================ */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* Margin Top */
.mt-1 { margin-top: var(--space-2); }
.mt-2 { margin-top: var(--space-4); }
.mt-3 { margin-top: var(--space-6); }
.mt-4 { margin-top: var(--space-8); }

/* Margin Bottom */
.mb-1 { margin-bottom: var(--space-2); }
.mb-2 { margin-bottom: var(--space-4); }
.mb-3 { margin-bottom: var(--space-6); }
.mb-4 { margin-bottom: var(--space-8); }

/* Gap */
.gap-1 { gap: var(--space-2); }
.gap-2 { gap: var(--space-4); }
.gap-3 { gap: var(--space-6); }

/* ============================================
   27. Settings View
   ============================================ */
.settings-container {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-top: var(--space-4);
  box-shadow: var(--shadow-lg);
}

.settings-tabs {
  display: flex;
  gap: var(--space-2);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-2);
}

.settings-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-4);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition-base);
}

.settings-tab-btn:hover {
  color: var(--text-primary);
  background: var(--border-color);
}

.settings-tab-btn.active {
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.1);
  border-bottom: 2px solid var(--accent-cyan);
}

.settings-section {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}

.settings-section.active {
  display: block;
}

.settings-section h3 {
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.settings-section p {
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.settings-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

#tab-database .settings-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 252, 0.98) 100%);
  border-color: rgba(148, 163, 184, 0.24);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

#tab-database .form-label,
#tab-database h4,
#tab-database p,
#tab-database h3 {
  color: #334155;
}

#tab-database .form-input,
#tab-database .form-select,
#tab-database .masterdata-input {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

#tab-database .form-input::placeholder,
#tab-database .masterdata-input::placeholder {
  color: #94a3b8;
}

#tab-database .form-input:focus,
#tab-database .form-select:focus,
#tab-database .masterdata-input:focus {
  background: #ffffff;
  color: #0f172a;
  border-color: #14b8a6;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
}

.form-group-inline {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.form-group-inline .form-label {
  margin-bottom: 0;
  min-width: 150px;
}

/* ==========================================================
   V86.45 — Mobile-first shell and navigation refinement
   Improves readability, touch targets and prevents horizontal overflow.
   ========================================================== */
@media (max-width: 768px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
  body { background: #f4f7fb; }

  .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
  }

  .topbar {
    height: 64px !important;
    min-height: 64px !important;
    padding: 0 10px !important;
    gap: 8px !important;
    background: rgba(255,255,255,.98) !important;
    box-shadow: 0 2px 12px rgba(15,23,42,.06);
  }

  .topbar-left { min-width: 0; gap: 8px !important; flex: 1; }
  #sidebar-toggle {
    display: inline-grid !important;
    place-items: center;
    flex: 0 0 44px;
    width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    border-radius: 13px !important;
    background: #fff !important;
    border: 1px solid #dbe4ef !important;
    font-size: 1.25rem !important;
  }
  #topbar-title {
    min-width: 0;
    max-width: 42vw;
    font-size: clamp(1rem, 5vw, 1.22rem) !important;
    line-height: 1.15 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-right { gap: 6px !important; flex: 0 0 auto; }
  .topbar-right > .btn-icon {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    border-radius: 12px !important;
  }
  .topbar-right > .btn-icon:nth-of-type(2) { display: none !important; }
  .user-profile { gap: 6px !important; margin-left: 0 !important; padding-left: 0 !important; }
  #user-profile-pic-container { width: 40px !important; height: 40px !important; flex: 0 0 40px; }
  .user-profile > div:nth-child(2) { display: none !important; }
  .user-profile .btn-logout { display: none !important; }

  .main-content {
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    padding: 14px 12px 92px !important;
    overflow-x: hidden !important;
  }

  .sidebar {
    width: min(86vw, 330px) !important;
    max-width: 330px !important;
    transform: translateX(-105%);
    box-shadow: 18px 0 48px rgba(15,23,42,.22);
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
  .sidebar.open { transform: translateX(0); width: min(86vw, 330px) !important; }
  .sidebar-brand {
    position: sticky;
    top: 0;
    z-index: 3;
    min-height: 78px;
    padding: 15px 18px !important;
    background: rgba(255,255,255,.98);
    backdrop-filter: blur(12px);
  }
  .sidebar-nav { padding: 4px 10px 28px !important; margin-top: 6px !important; overflow-y: auto; }
  .sidebar-link,
  .sidebar-title.toggle-menu {
    min-height: 48px;
    border-radius: 12px !important;
    padding: 11px 12px !important;
    margin: 2px 0 !important;
    font-size: .96rem !important;
  }
  .sidebar-link .label { display: inline !important; }
  .sidebar-section-title { display: block !important; padding: 12px 12px 5px !important; }
  .sidebar-mobile-overlay { background: rgba(15,23,42,.56); backdrop-filter: blur(3px); }

  .card, .glass-card, .dashboard-card, .settings-container {
    max-width: 100%;
  }
  img, canvas, video, svg { max-width: 100%; }
  table { max-width: 100%; }
}

@media (max-width: 430px) {
  #topbar-title { max-width: 34vw; }
  .topbar-right > .btn-icon { width: 38px !important; min-width: 38px !important; height: 38px !important; min-height: 38px !important; }
  #user-profile-pic-container { width: 38px !important; height: 38px !important; flex-basis: 38px; }
  .main-content { padding-inline: 10px !important; }
}


/* V99.0068 — Responsive Real-Time SharePoint loading screen */
.sp-sync-screen{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:clamp(14px,3vw,34px);box-sizing:border-box;background:radial-gradient(circle at 18% 10%,rgba(124,58,237,.14),transparent 35%),radial-gradient(circle at 88% 86%,rgba(59,130,246,.12),transparent 34%),linear-gradient(145deg,#f5f1ff 0%,#fbfaff 52%,#f3f1ff 100%);font-family:var(--font-family,Inter,"Noto Sans Thai",sans-serif);color:#1e2442}
.sp-sync-card{position:relative;width:min(690px,100%);overflow:hidden;border:1px solid rgba(145,126,226,.2);border-radius:24px;padding:22px;background:linear-gradient(145deg,rgba(255,255,255,.92),rgba(247,244,255,.9));box-shadow:0 20px 55px rgba(68,52,128,.15),inset 0 1px 0 rgba(255,255,255,.9);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.sp-sync-card:before,.sp-sync-card:after{content:"";position:absolute;border-radius:999px;pointer-events:none;filter:blur(2px)}
.sp-sync-card:before{width:210px;height:210px;right:-95px;top:-95px;background:radial-gradient(circle,rgba(113,88,246,.12),transparent 68%)}
.sp-sync-card:after{width:170px;height:170px;left:-80px;bottom:-95px;background:radial-gradient(circle,rgba(88,153,246,.12),transparent 70%)}
.sp-sync-badge{position:relative;z-index:1;display:inline-flex;align-items:center;gap:7px;padding:6px 10px;border-radius:9px;background:rgba(255,255,255,.72);box-shadow:0 5px 16px rgba(91,77,150,.1);font-size:.68rem;font-weight:800;letter-spacing:.045em;color:#6d56c7}
.sp-sync-dot{width:7px;height:7px;border-radius:50%;background:#8b5cf6;box-shadow:0 0 0 4px rgba(139,92,246,.12);animation:spSyncPulse 1.6s ease-in-out infinite}
.sp-sync-intro{position:relative;z-index:1;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:18px;margin:17px 0 20px}
.sp-sync-hourglass{width:78px;height:78px;border-radius:24px;display:grid;place-items:center;background:linear-gradient(145deg,#ffffff,#eee8ff);border:1px solid rgba(128,103,225,.25);box-shadow:0 10px 24px rgba(103,82,190,.16),inset 0 1px 0 #fff}
.sp-sync-hourglass span{font-size:2.7rem;filter:drop-shadow(0 5px 7px rgba(107,78,205,.22));animation:spHourglass 2.3s ease-in-out infinite}
.sp-sync-copy h2{margin:0;color:#17192c;font-size:clamp(1.38rem,3vw,2rem);line-height:1.2;font-weight:800;letter-spacing:-.025em}
.sp-sync-copy h2 strong{color:#6e54c7;font-weight:800}
.sp-sync-copy p{margin:8px 0 0;color:#65627c;font-size:.84rem;line-height:1.55}
.sp-sync-elapsed-card{min-width:112px;padding:13px 14px;border-radius:14px;border:1px solid rgba(132,111,215,.18);background:linear-gradient(145deg,rgba(255,255,255,.78),rgba(235,231,255,.85));box-shadow:0 8px 19px rgba(97,76,174,.09)}
.sp-sync-elapsed-card span,.sp-sync-metric small,.sp-sync-activity-card small{display:block;font-size:.62rem;font-weight:800;letter-spacing:.04em;color:#7a73a0}
.sp-sync-elapsed-card strong{display:block;margin-top:4px;font-size:1.35rem;color:#5f4ac7}
.sp-sync-metrics{position:relative;z-index:1;display:grid;grid-template-columns:.82fr 1fr 1.35fr 1fr;gap:10px;margin-bottom:17px}
.sp-sync-metric{min-width:0;display:flex;align-items:center;gap:9px;padding:12px 11px;border-radius:14px;border:1px solid rgba(137,120,201,.14);background:rgba(255,255,255,.68);box-shadow:0 7px 18px rgba(88,68,160,.07)}
.sp-sync-metric-icon{width:24px;height:24px;flex:0 0 24px;border-radius:8px;display:grid;place-items:center;background:#eee9ff;color:#795ee0;font-size:.85rem;font-weight:900}
.sp-sync-metric strong{display:block;margin-top:3px;color:#2b2942;font-size:1.05rem;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.sp-sync-progress-metric .sp-sync-metric-icon{animation:spMetricSpin 1.6s linear infinite}
.sp-sync-progress-wrap{position:relative;z-index:1;margin:2px 2px 16px}
.sp-sync-progress-track{height:7px;border-radius:999px;overflow:hidden;background:#e4def6;box-shadow:inset 0 1px 2px rgba(69,52,127,.08)}
.sp-sync-progress-bar{height:100%;width:0;border-radius:inherit;background:linear-gradient(90deg,#7255dd 0%,#987cf1 52%,#9b8cff 100%);box-shadow:0 0 14px rgba(112,83,222,.36);transition:width .28s ease}
.sp-sync-progress-meta{display:flex;justify-content:space-between;gap:14px;margin-top:9px;color:#66627a;font-size:.72rem;line-height:1.4}
#sp-loading-stage{font-weight:700;color:#4e496d}.sp-sync-progress-meta #sp-loading-tip{text-align:right}
.sp-sync-activity-card{position:relative;z-index:1;min-height:58px;padding:12px 45px 12px 14px;border-radius:14px;border:1px solid rgba(134,117,199,.15);background:rgba(255,255,255,.6);box-shadow:inset 0 1px 0 rgba(255,255,255,.85)}
.sp-sync-activity-card strong{display:block;margin-top:5px;color:#34304d;font-size:.82rem;line-height:1.45;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sp-sync-activity-pulse{position:absolute;right:17px;bottom:17px;width:7px;height:7px;border-radius:50%;background:#9180e8;box-shadow:0 0 0 0 rgba(145,128,232,.4);animation:spSyncPulseRing 1.7s infinite}
@keyframes spHourglass{0%,100%{transform:rotate(0deg) scale(1)}45%{transform:rotate(0deg) scale(1.05)}55%{transform:rotate(180deg) scale(1.05)}95%{transform:rotate(180deg) scale(1)}}
@keyframes spMetricSpin{to{transform:rotate(360deg)}}
@keyframes spSyncPulse{50%{opacity:.45;transform:scale(.78)}}
@keyframes spSyncPulseRing{0%{box-shadow:0 0 0 0 rgba(145,128,232,.38)}70%{box-shadow:0 0 0 8px rgba(145,128,232,0)}100%{box-shadow:0 0 0 0 rgba(145,128,232,0)}}
@media(max-width:720px){.sp-sync-screen{align-items:flex-start;padding:14px 10px;min-height:100dvh}.sp-sync-card{border-radius:20px;padding:17px 14px;margin:auto 0}.sp-sync-intro{grid-template-columns:62px 1fr;gap:12px;margin:14px 0 16px}.sp-sync-hourglass{width:62px;height:62px;border-radius:19px}.sp-sync-hourglass span{font-size:2.05rem}.sp-sync-copy h2{font-size:1.42rem}.sp-sync-copy p{font-size:.77rem}.sp-sync-elapsed-card{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;padding:10px 12px}.sp-sync-elapsed-card strong{margin:0;font-size:1.16rem}.sp-sync-metrics{grid-template-columns:1fr 1fr;gap:8px}.sp-sync-current-list{grid-column:1/-1}.sp-sync-metric{padding:10px}.sp-sync-progress-meta{display:grid;grid-template-columns:1fr;gap:5px}.sp-sync-progress-meta #sp-loading-tip{text-align:left}.sp-sync-activity-card strong{white-space:normal}.sp-sync-badge{font-size:.62rem}}
@media(max-width:390px){.sp-sync-card{padding:15px 11px}.sp-sync-intro{grid-template-columns:52px 1fr}.sp-sync-hourglass{width:52px;height:52px;border-radius:16px}.sp-sync-hourglass span{font-size:1.75rem}.sp-sync-copy h2{font-size:1.22rem}.sp-sync-metrics{grid-template-columns:1fr}.sp-sync-current-list{grid-column:auto}.sp-sync-metric strong{font-size:.96rem}}
@media(prefers-reduced-motion:reduce){.sp-sync-dot,.sp-sync-hourglass span,.sp-sync-progress-metric .sp-sync-metric-icon,.sp-sync-activity-pulse{animation:none}.sp-sync-progress-bar{transition:none}}
