:root{
  --bg:#0b1220;
  --panel:#0f1a33;
  --panel2:#101f3d;
  --text:#e7eefc;
  --muted:#b6c2e2;
  --line:#22335c;
  --good:#22c55e;
  --bad:#ef4444;
  --warn:#f59e0b;
  --accent:#60a5fa;
  --shadow:0 8px 32px rgba(0, 0, 0, 0.3);
  --transition:all 0.2s ease;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:linear-gradient(180deg, var(--bg), #070b14);
  color:var(--text);
  line-height:1.5;
  animation:pageLoad 0.6s ease-out;
}

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

/* Screen reader only - visually hidden but accessible */
.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0, 0, 0, 0);
  white-space:nowrap;
  border:0;
}

/* Skip links for keyboard navigation */
.skip-link {
  position:absolute;
  top:-100px;
  left:50%;
  transform:translateX(-50%);
  background:var(--accent);
  color:#000;
  padding:12px 24px;
  border-radius:0 0 8px 8px;
  z-index:10000;
  font-weight:700;
  text-decoration:none;
  transition:top 0.2s ease;
}

.skip-link:focus {
  top:0;
  outline:3px solid #fff;
  outline-offset:2px;
}

/* H3 style class for semantic headings */
.h3-style {
  margin:0 0 12px 0;
  font-size:1.125rem;
  font-weight:700;
}

a{color:inherit; text-decoration:none}
.container{display:flex; min-height:100vh}

/* Sidebar */
.sidebar{
  width:240px;
  background:rgba(15,26,51,.95);
  border-right:1px solid var(--line);
  padding:24px 16px;
  position:sticky; top:0; height:100vh;
  backdrop-filter:blur(10px);
  transition:var(--transition);
  animation:slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity:0;
    transform:translateX(-50px);
  }
  to {
    opacity:1;
    transform:translateX(0);
  }
}

.brand{
  font-weight:800;
  letter-spacing:.3px;
  margin-bottom:24px;
  font-size:1.25rem;
  background:linear-gradient(90deg, var(--accent), #93c5fd);
  background-size:200% 100%;
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  animation:brandFadeIn 0.8s ease-out 0.2s backwards, gradientSlide 8s ease-in-out infinite;
}

@keyframes brandFadeIn {
  from {
    opacity:0;
    transform:scale(0.9);
  }
  to {
    opacity:1;
    transform:scale(1);
  }
}

@keyframes gradientSlide {
  0%, 100% { background-position:0% 50%; }
  50% { background-position:100% 50%; }
}
.nav a{
  display:block;
  padding:12px 14px;
  border-radius:10px;
  color:var(--muted);
  margin:6px 0;
  transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight:500;
  position:relative;
  overflow:hidden;
}

.nav a::before {
  content:"";
  position:absolute;
  left:-100%;
  top:0;
  width:100%;
  height:100%;
  background:linear-gradient(90deg, transparent, rgba(96,165,250,.2), transparent);
  transition:left 0.5s ease;
}

.nav a:hover::before {
  left:100%;
}

.nav a.active, .nav a:hover{
  background:rgba(96,165,250,.15);
  color:var(--text);
  transform:translateX(6px) scale(1.02);
  box-shadow:0 4px 12px rgba(96,165,250,.2);
}
.nav button{
  width:100%;
  text-align:left;
  padding:12px 14px;
  border-radius:10px;
  color:var(--muted);
  margin:6px 0;
  transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight:500;
  background:rgba(239,68,68,.1);
  border:1px solid rgba(239,68,68,.2);
  cursor:pointer;
  font-family:inherit;
  font-size:inherit;
  position:relative;
}

.nav button:hover{
  background:rgba(239,68,68,.2);
  color:#ffd0d0;
  transform:translateX(6px) scale(1.02);
  box-shadow:0 4px 12px rgba(239,68,68,.3);
}

.nav button:active {
  transform:translateX(4px) scale(0.98);
}

/* Main */
.main{
  flex:1;
  padding:24px;
  animation:fadeInUp 0.6s ease-out 0.2s backwards;
}

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

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  background:rgba(15,26,51,.7);
  border:1px solid var(--line);
  padding:16px 20px;
  border-radius:16px;
  margin-bottom:24px;
  backdrop-filter:blur(10px);
  box-shadow:var(--shadow);
  animation:slideDown 0.5s ease-out 0.3s backwards;
  transition:all 0.3s ease;
}

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

.topbar:hover {
  box-shadow:0 12px 40px rgba(0, 0, 0, 0.4);
  border-color:rgba(96,165,250,.3);
}
.small{color:var(--muted); font-size:0.875rem}

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

.card{
  background:linear-gradient(145deg, rgba(15,26,51,.8), rgba(16,31,61,.9));
  border:1px solid var(--line);
  border-radius:16px;
  padding:20px;
  transition:all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:var(--shadow);
  position:relative;
  overflow:hidden;
}

.card::before {
  content:"";
  position:absolute;
  top:-50%;
  left:-50%;
  width:200%;
  height:200%;
  background:radial-gradient(circle, rgba(96,165,250,.15) 0%, transparent 70%);
  opacity:0;
  transition:opacity 0.5s ease, transform 0.5s ease;
  pointer-events:none;
}

.card:hover::before {
  opacity:1;
  transform:translate(10%, 10%);
}

.card:hover{
  transform:translateY(-6px) scale(1.02);
  border-color:rgba(96,165,250,.5);
  box-shadow:0 16px 48px rgba(96,165,250,.2), 0 0 80px rgba(96,165,250,.1);
}

.card h3{margin:0 0 12px 0; font-size:1.125rem; font-weight:700}
.card .muted{color:var(--muted); font-size:0.875rem}

.kpi{
  font-size:2.5rem;
  font-weight:800;
  margin:8px 0;
  background:linear-gradient(90deg, var(--text), var(--accent), var(--text));
  background-size:200% 100%;
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  animation:kpiShimmer 3s ease-in-out infinite, countUp 0.8s ease-out;
}

@keyframes kpiShimmer {
  0%, 100% { background-position:0% 50%; }
  50% { background-position:100% 50%; }
}

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

/* Status */
.status-dot{
  width:10px; height:10px; border-radius:50%;
  display:inline-block; margin-right:8px;
  box-shadow:0 0 8px currentColor;
}
.online{background:var(--good)}
.offline{background:var(--bad)}
.badge{
  padding:6px 12px;
  border-radius:999px;
  font-size:0.75rem;
  font-weight:700;
  border:1px solid var(--line);
  transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display:inline-flex;
  align-items:center;
  gap:6px;
  animation:badgePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgePop {
  0% {
    opacity:0;
    transform:scale(0.5);
  }
  60% {
    transform:scale(1.1);
  }
  100% {
    opacity:1;
    transform:scale(1);
  }
}

.badge:hover {
  transform:scale(1.05);
}

.badge.good{
  background:rgba(34,197,94,.2);
  color:#bff5d1;
  border-color:rgba(34,197,94,.4);
}

.badge.good:hover {
  box-shadow:0 4px 16px rgba(34,197,94,.3);
}

.badge.bad{
  background:rgba(239,68,68,.2);
  color:#ffd0d0;
  border-color:rgba(239,68,68,.4);
}

.badge.bad:hover {
  box-shadow:0 4px 16px rgba(239,68,68,.3);
}

/* Tables */
table{
  width:100%;
  border-collapse:collapse;
  overflow:hidden;
  border-radius:12px;
  background:rgba(15,26,51,.5);
  animation:tableSlideIn 0.6s ease-out;
}

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

th, td{
  text-align:left;
  padding:12px 16px;
  border-bottom:1px solid var(--line);
  color:var(--text);
  transition:all 0.3s ease;
}
th{
  color:var(--muted);
  font-weight:700;
  font-size:0.75rem;
  text-transform:uppercase;
  letter-spacing:0.5px;
  position:relative;
}

tr{
  transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

tr:hover{
  transform:scale(1.01);
}

tr:hover td{
  background:rgba(96,165,250,.15);
  box-shadow:inset 0 0 20px rgba(96,165,250,.1);
}

/* Forms & buttons */
input, select{
  width:100%;
  padding:12px;
  border-radius:10px;
  border:1px solid var(--line);
  background:rgba(16,31,61,.8);
  color:var(--text);
  outline:none;
  transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family:inherit;
}

input:hover, select:hover{
  border-color:rgba(96,165,250,.3);
  background:rgba(16,31,61,.95);
}

input:focus, select:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 4px rgba(96,165,250,.2), 0 4px 12px rgba(96,165,250,.3);
  transform:translateY(-2px);
  background:rgba(16,31,61,1);
}
.row{display:grid; grid-template-columns:repeat(12,1fr); gap:12px}
.btn{
  padding:12px 20px;
  border-radius:10px;
  border:1px solid var(--line);
  background:linear-gradient(135deg, rgba(96,165,250,.2), rgba(96,165,250,.3));
  color:var(--text);
  font-weight:700;
  cursor:pointer;
  transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family:inherit;
  font-size:0.875rem;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  position:relative;
  overflow:hidden;
}

.btn::before {
  content:"";
  position:absolute;
  top:50%;
  left:50%;
  width:0;
  height:0;
  border-radius:50%;
  background:rgba(255,255,255,.2);
  transform:translate(-50%, -50%);
  transition:width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
  width:300px;
  height:300px;
}

.btn:hover{
  transform:translateY(-4px) scale(1.05);
  box-shadow:0 12px 32px rgba(96,165,250,.3);
  border-color:var(--accent);
}

.btn:active {
  transform:translateY(-2px) scale(1.02);
  box-shadow:0 6px 16px rgba(96,165,250,.25);
}
.btn.danger{
  background:linear-gradient(135deg, rgba(239,68,68,.2), rgba(239,68,68,.3));
}
.btn.danger:hover{
  border-color:var(--bad);
  box-shadow:0 12px 32px rgba(239,68,68,.3);
  transform:translateY(-4px) scale(1.05);
}
.btn.danger:active {
  transform:translateY(-2px) scale(1.02);
}
.btn.secondary{
  background:linear-gradient(135deg, rgba(182,194,226,.1), rgba(182,194,226,.2));
}
.btn.secondary:hover{
  border-color:var(--muted);
  box-shadow:0 12px 32px rgba(182,194,226,.15);
  transform:translateY(-4px) scale(1.05);
}
.btn.secondary:active {
  transform:translateY(-2px) scale(1.02);
}

/* Password field with toggle */
.password-wrapper {
  position:relative;
  display:flex;
  align-items:center;
}

.password-wrapper input {
  padding-right:44px;
}

.password-toggle {
  position:absolute;
  right:8px;
  top:50%;
  transform:translateY(-50%);
  background:transparent;
  border:none;
  padding:6px;
  cursor:pointer;
  color:var(--muted);
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:6px;
  transition:var(--transition);
}

.password-toggle:hover {
  color:var(--accent);
  background:rgba(96,165,250,.1);
}

.password-toggle:focus {
  outline:2px solid var(--accent);
  outline-offset:2px;
}

.password-toggle svg {
  display:block;
}

/* Login page specific */
.login-container {
  max-width:420px;
  margin:80px auto;
  padding:40px;
  background:linear-gradient(145deg, rgba(15,26,51,.9), rgba(16,31,61,.95));
  border-radius:20px;
  border:1px solid var(--line);
  box-shadow:var(--shadow);
  animation:loginZoomIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes loginZoomIn {
  from {
    opacity:0;
    transform:scale(0.8) translateY(30px);
  }
  to {
    opacity:1;
    transform:scale(1) translateY(0);
  }
}
.login-container h1 {
  margin:0 0 8px 0;
  font-size:2rem;
  background:linear-gradient(90deg, var(--accent), #93c5fd, var(--accent));
  background-size:200% 100%;
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  animation:titleSlideIn 0.8s ease-out 0.2s backwards, titleGradient 3s ease-in-out infinite;
}

@keyframes titleSlideIn {
  from {
    opacity:0;
    transform:translateX(-30px);
  }
  to {
    opacity:1;
    transform:translateX(0);
  }
}

@keyframes titleGradient {
  0%, 100% { background-position:0% 50%; }
  50% { background-position:100% 50%; }
}
.login-container label {
  display:block;
  margin-bottom:16px;
  font-weight:500;
}
.login-container input {
  margin-top:6px;
}

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

.card {
  animation:fadeIn 0.5s ease-out;
  animation-fill-mode:backwards;
}

/* Stagger animation for multiple cards */
.grid .card:nth-child(1) { animation-delay:0.1s; }
.grid .card:nth-child(2) { animation-delay:0.15s; }
.grid .card:nth-child(3) { animation-delay:0.2s; }
.grid .card:nth-child(4) { animation-delay:0.25s; }
.grid .card:nth-child(5) { animation-delay:0.3s; }
.grid .card:nth-child(6) { animation-delay:0.35s; }
.grid .card:nth-child(7) { animation-delay:0.4s; }
.grid .card:nth-child(8) { animation-delay:0.45s; }
.grid .card:nth-child(9) { animation-delay:0.5s; }
.grid .card:nth-child(10) { animation-delay:0.55s; }

/* KPI card enhancements */
.card[style*="grid-column: span 3"] {
  position:relative;
  overflow:hidden;
}
.card[style*="grid-column: span 3"]::before {
  content:"";
  position:absolute;
  top:0;
  right:0;
  width:60px;
  height:60px;
  background:linear-gradient(135deg, rgba(96,165,250,.1), rgba(96,165,250,.05));
  border-radius:0 16px 0 60px;
  z-index:0;
}
.card[style*="grid-column: span 3"] > * {
  position:relative;
  z-index:1;
}

/* Status indicators enhancement */
.status-dot {
  position:relative;
}
.status-dot.online::after {
  content:"";
  position:absolute;
  top:-2px;
  left:-2px;
  right:-2px;
  bottom:-2px;
  border-radius:50%;
  background:var(--good);
  opacity:0.3;
  z-index:-1;
  animation:pulse 2s infinite;
}
.status-dot.offline::after {
  content:"";
  position:absolute;
  top:-2px;
  left:-2px;
  right:-2px;
  bottom:-2px;
  border-radius:50%;
  background:var(--bad);
  opacity:0.3;
  z-index:-1;
}

@keyframes pulse {
  0%, 100% { transform:scale(1); opacity:0.3; }
  50% { transform:scale(1.2); opacity:0.1; }
}

/* Responsive */
@media (max-width: 1024px) {
  .grid {
    grid-template-columns:repeat(6, 1fr);
  }
  .card[style*="grid-column: span"] {
    grid-column:span 6 !important;
  }
}
@media (max-width: 768px) {
  .container {
    flex-direction:column;
  }
  .sidebar {
    width:100%;
    height:auto;
    position:relative;
    padding:16px;
  }
  .nav {
    display:flex;
    flex-wrap:wrap;
    gap:8px;
  }
  .nav a, .nav button {
    flex:1;
    min-width:120px;
    text-align:center;
  }
  .main {
    padding:16px;
  }
  .topbar {
    flex-direction:column;
    gap:12px;
    align-items:flex-start;
  }
  .grid {
    grid-template-columns:repeat(1, 1fr);
  }
  .card[style*="grid-column: span"] {
    grid-column:span 1 !important;
  }
  .login-container {
    margin:40px 20px;
    padding:30px 24px;
  }
  .card[style*="grid-column: span 3"]::before {
    width:40px;
    height:40px;
  }
}

/* =====================================================
   SETTINGS PAGE STYLES
   ===================================================== */

/* Settings Group */
.settings-group {
  display:flex;
  flex-direction:column;
  gap:16px;
}

.setting-item {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:16px;
  background:rgba(16,31,61,.6);
  border:1px solid var(--line);
  border-radius:12px;
  gap:16px;
  transition:var(--transition);
}

.setting-item:hover {
  background:rgba(16,31,61,.8);
  border-color:rgba(96,165,250,.3);
}

.setting-info {
  flex:1;
}

.setting-label {
  font-weight:600;
  display:block;
  margin-bottom:4px;
  cursor:pointer;
}

.setting-description {
  color:var(--muted);
  font-size:0.875rem;
}

.setting-select {
  width:auto;
  min-width:160px;
  padding:10px 14px;
  font-size:0.875rem;
}

/* Toggle Switch */
.toggle-switch {
  position:relative;
  display:inline-block;
  width:52px;
  height:28px;
  flex-shrink:0;
}

.toggle-switch input {
  opacity:0;
  width:0;
  height:0;
}

.toggle-slider {
  position:absolute;
  cursor:pointer;
  top:0;
  left:0;
  right:0;
  bottom:0;
  background:rgba(16,31,61,.8);
  border:1px solid var(--line);
  transition:var(--transition);
  border-radius:28px;
}

.toggle-slider::before {
  position:absolute;
  content:"";
  height:20px;
  width:20px;
  left:3px;
  bottom:3px;
  background:var(--muted);
  transition:var(--transition);
  border-radius:50%;
}

.toggle-switch input:checked + .toggle-slider {
  background:rgba(96,165,250,.3);
  border-color:var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform:translateX(24px);
  background:var(--accent);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow:0 0 0 3px rgba(96,165,250,.3);
}

/* Keyboard key styling */
kbd {
  display:inline-block;
  padding:4px 8px;
  font-family:monospace;
  font-size:0.75rem;
  background:rgba(16,31,61,.8);
  border:1px solid var(--line);
  border-radius:6px;
  box-shadow:0 2px 0 var(--line);
  margin:0 2px;
}

/* Screen reader only class */
.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0, 0, 0, 0);
  white-space:nowrap;
  border:0;
}

/* =====================================================
   ACCESSIBILITY MODES
   ===================================================== */

/* High Contrast Mode */
html.high-contrast {
  --bg:#000000;
  --panel:#0a0a0a;
  --panel2:#111111;
  --text:#ffffff;
  --muted:#cccccc;
  --line:#444444;
  --good:#00ff00;
  --bad:#ff0000;
  --warn:#ffff00;
  --accent:#00bfff;
}

html.high-contrast body {
  background:#000000;
}

html.high-contrast .card,
html.high-contrast .sidebar,
html.high-contrast .topbar,
html.high-contrast .setting-item,
html.high-contrast input,
html.high-contrast select {
  background:#0a0a0a;
  border-color:#ffffff;
  border-width:2px;
}

html.high-contrast .brand,
html.high-contrast .kpi {
  background:none;
  -webkit-text-fill-color:#00bfff;
}

html.high-contrast a,
html.high-contrast .nav a {
  color:#00bfff;
  text-decoration:underline;
}

html.high-contrast .nav a.active,
html.high-contrast .nav a:hover {
  background:#ffffff;
  color:#000000;
}

html.high-contrast .btn {
  background:#000000;
  border:2px solid #ffffff;
  color:#ffffff;
}

html.high-contrast .btn:hover {
  background:#ffffff;
  color:#000000;
}

html.high-contrast .badge.good {
  background:#000000;
  color:#00ff00;
  border:2px solid #00ff00;
}

html.high-contrast .badge.bad {
  background:#000000;
  color:#ff0000;
  border:2px solid #ff0000;
}

/* Reduced Motion */
html.reduced-motion,
html.reduced-motion *,
html.reduced-motion *::before,
html.reduced-motion *::after {
  animation:none !important;
  transition:none !important;
}

html.reduced-motion body {
  animation:none !important;
}

html.reduced-motion .card:hover,
html.reduced-motion .btn:hover,
html.reduced-motion .nav a:hover,
html.reduced-motion .nav button:hover,
html.reduced-motion input:focus,
html.reduced-motion select:focus,
html.reduced-motion tr:hover {
  transform:none !important;
  box-shadow:none !important;
}

html.reduced-motion .status-dot.online::after,
html.reduced-motion .status-dot.offline::after {
  animation:none !important;
}

html.reduced-motion .card::before,
html.reduced-motion .btn::before,
html.reduced-motion .nav a::before {
  display:none !important;
}

/* Large Text Mode */
html.large-text {
  font-size:1.25rem;
}

html.large-text .small {
  font-size:1rem;
}

html.large-text .kpi {
  font-size:3rem;
}

/* Font Size Options */
html.font-small { font-size:14px; }
html.font-medium { font-size:16px; }
html.font-large { font-size:18px; }
html.font-xlarge { font-size:20px; }

/* Enhanced Focus Indicators */
html.enhanced-focus *:focus {
  outline:3px solid var(--accent) !important;
  outline-offset:3px !important;
}

html.enhanced-focus a:focus,
html.enhanced-focus button:focus,
html.enhanced-focus input:focus,
html.enhanced-focus select:focus,
html.enhanced-focus .toggle-switch input:focus + .toggle-slider {
  box-shadow:0 0 0 4px rgba(96,165,250,.5) !important;
}

/* Dyslexia-Friendly Font */
html.dyslexia-font {
  font-family:OpenDyslexic, Comic Sans MS, Arial, sans-serif;
  letter-spacing:0.05em;
  word-spacing:0.1em;
  line-height:1.8;
}

/* Color Themes */
html.theme-darker {
  --bg:#020204;
  --panel:#080810;
  --panel2:#0c0c14;
  --line:#1a1a2e;
  --text:#d0d0e0;
  --muted:#9090a0;
}

html.theme-darker body {
  background:linear-gradient(180deg, #020204, #000000);
}

html.theme-darker .sidebar {
  background:rgba(8,8,16,.98);
}

html.theme-darker .card,
html.theme-darker .topbar {
  background:linear-gradient(145deg, rgba(8,8,16,.9), rgba(12,12,20,.95));
}

html.theme-midnight {
  --bg:#0f0a1a;
  --panel:#1a1030;
  --panel2:#241848;
  --line:#3d2a6b;
  --accent:#8b5cf6;
  --good:#10b981;
  --text:#e8e0f8;
  --muted:#a090c0;
}

html.theme-midnight body {
  background:linear-gradient(180deg, #0f0a1a, #080510);
}

html.theme-midnight .sidebar {
  background:rgba(26,16,48,.98);
  border-color:#3d2a6b;
}

html.theme-midnight .card,
html.theme-midnight .topbar {
  background:linear-gradient(145deg, rgba(26,16,48,.8), rgba(36,24,72,.9));
  border-color:#3d2a6b;
}

html.theme-midnight .card:hover {
  border-color:rgba(139,92,246,.5);
  box-shadow:0 12px 40px rgba(139,92,246,.2);
}

html.theme-midnight .nav a.active,
html.theme-midnight .nav a:hover {
  background:rgba(139,92,246,.2);
}

html.theme-midnight .btn {
  background:linear-gradient(135deg, rgba(139,92,246,.2), rgba(139,92,246,.3));
}

html.theme-midnight .btn:hover {
  border-color:#8b5cf6;
  box-shadow:0 8px 20px rgba(139,92,246,.3);
}

html.theme-midnight .brand,
html.theme-midnight .kpi {
  background:linear-gradient(90deg, #8b5cf6, #a78bfa);
  -webkit-background-clip:text;
  background-clip:text;
}

html.theme-midnight .setting-item {
  background:rgba(26,16,48,.6);
  border-color:#3d2a6b;
}

html.theme-midnight .setting-item:hover {
  background:rgba(36,24,72,.8);
  border-color:rgba(139,92,246,.4);
}

html.theme-midnight .toggle-switch input:checked + .toggle-slider {
  background:rgba(139,92,246,.3);
  border-color:#8b5cf6;
}

html.theme-midnight .toggle-switch input:checked + .toggle-slider::before {
  background:#8b5cf6;
}

/* Skip Link (visible on focus) */
.skip-link {
  position:absolute;
  top:-100px;
  left:50%;
  transform:translateX(-50%);
  background:var(--accent);
  color:#000;
  padding:12px 24px;
  border-radius:0 0 8px 8px;
  z-index:10000;
  font-weight:700;
  transition:top 0.2s;
}

html.show-skip-links .skip-link:focus {
  top:0;
}

/* Responsive settings */
@media (max-width: 768px) {
  .setting-item {
    flex-direction:column;
    align-items:flex-start;
  }
  
  .setting-select {
    width:100%;
  }
  
  .toggle-switch {
    margin-top:8px;
  }
}

/* =====================================================
   LIGHT MODE THEME
   A beautiful, clean light theme with soft colors
   ===================================================== */

html.theme-light {
  --bg:#f8fafc;
  --panel:#ffffff;
  --panel2:#f1f5f9;
  --text:#1e293b;
  --muted:#64748b;
  --line:#e2e8f0;
  --good:#16a34a;
  --bad:#dc2626;
  --warn:#d97706;
  --accent:#3b82f6;
  --shadow:0 4px 20px rgba(0, 0, 0, 0.08);
}

html.theme-light body {
  background:linear-gradient(180deg, #f8fafc, #e2e8f0);
  color:var(--text);
}

html.theme-light .sidebar {
  background:rgba(255,255,255,.98);
  border-right:1px solid var(--line);
  box-shadow:2px 0 20px rgba(0, 0, 0, 0.05);
}

html.theme-light .brand {
  background:linear-gradient(90deg, #3b82f6, #1d4ed8);
  -webkit-background-clip:text;
  background-clip:text;
}

html.theme-light .nav a {
  color:var(--muted);
}

html.theme-light .nav a.active,
html.theme-light .nav a:hover {
  background:rgba(59,130,246,.1);
  color:var(--text);
}

html.theme-light .nav button {
  background:rgba(239,68,68,.08);
  border-color:rgba(239,68,68,.15);
  color:#b91c1c;
}

html.theme-light .nav button:hover {
  background:rgba(239,68,68,.15);
  color:#991b1b;
}

html.theme-light .topbar {
  background:rgba(255,255,255,.9);
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}

html.theme-light .card {
  background:linear-gradient(145deg, rgba(255,255,255,.95), rgba(241,245,249,.9));
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}

html.theme-light .card:hover {
  border-color:rgba(59,130,246,.4);
  box-shadow:0 8px 30px rgba(59, 130, 246, 0.12);
}

html.theme-light .kpi {
  background:linear-gradient(90deg, var(--text), #3b82f6);
  -webkit-background-clip:text;
  background-clip:text;
}

html.theme-light .small,
html.theme-light .muted {
  color:var(--muted);
}

html.theme-light .badge {
  border:1px solid var(--line);
}

html.theme-light .badge.good {
  background:rgba(22,163,74,.12);
  color:#15803d;
  border-color:rgba(22,163,74,.3);
}

html.theme-light .badge.bad {
  background:rgba(220,38,38,.12);
  color:#b91c1c;
  border-color:rgba(220,38,38,.3);
}

html.theme-light table {
  background:rgba(255,255,255,.8);
}

html.theme-light th {
  color:var(--muted);
  background:rgba(241,245,249,.8);
}

html.theme-light td {
  border-bottom:1px solid var(--line);
}

html.theme-light tr:hover td {
  background:rgba(59,130,246,.05);
}

html.theme-light input,
html.theme-light select {
  background:rgba(255,255,255,.9);
  border:1px solid var(--line);
  color:var(--text);
}

html.theme-light input:focus,
html.theme-light select:focus {
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(59,130,246,.15);
}

html.theme-light .btn {
  background:linear-gradient(135deg, rgba(59,130,246,.1), rgba(59,130,246,.2));
  border:1px solid rgba(59,130,246,.3);
  color:var(--text);
}

html.theme-light .btn:hover {
  background:linear-gradient(135deg, rgba(59,130,246,.2), rgba(59,130,246,.3));
  border-color:var(--accent);
  box-shadow:0 4px 12px rgba(59,130,246,.2);
}

html.theme-light .btn.danger {
  background:linear-gradient(135deg, rgba(220,38,38,.1), rgba(220,38,38,.15));
  border:1px solid rgba(220,38,38,.3);
}

html.theme-light .btn.danger:hover {
  border-color:var(--bad);
  box-shadow:0 4px 12px rgba(220,38,38,.15);
}

html.theme-light .btn.secondary {
  background:linear-gradient(135deg, rgba(100,116,139,.1), rgba(100,116,139,.15));
  border:1px solid rgba(100,116,139,.25);
}

html.theme-light .btn.secondary:hover {
  border-color:var(--muted);
  box-shadow:0 4px 12px rgba(100,116,139,.1);
}

html.theme-light .setting-item {
  background:rgba(248,250,252,.9);
  border:1px solid var(--line);
}

html.theme-light .setting-item:hover {
  background:rgba(241,245,249,.9);
  border-color:rgba(59,130,246,.3);
}

html.theme-light .toggle-slider {
  background:rgba(226,232,240,.9);
  border:1px solid var(--line);
}

html.theme-light .toggle-slider::before {
  background:var(--muted);
}

html.theme-light .toggle-switch input:checked + .toggle-slider {
  background:rgba(59,130,246,.25);
  border-color:var(--accent);
}

html.theme-light .toggle-switch input:checked + .toggle-slider::before {
  background:var(--accent);
}

html.theme-light kbd {
  background:rgba(241,245,249,.9);
  border:1px solid var(--line);
  box-shadow:0 2px 0 var(--line);
  color:var(--text);
}

html.theme-light .login-container {
  background:linear-gradient(145deg, rgba(255,255,255,.98), rgba(248,250,252,.95));
  border:1px solid var(--line);
  box-shadow:0 20px 60px rgba(0, 0, 0, 0.1);
}

html.theme-light .login-container h1 {
  background:linear-gradient(90deg, #3b82f6, #1d4ed8);
  -webkit-background-clip:text;
  background-clip:text;
}

html.theme-light .status-dot.online {
  background:var(--good);
  box-shadow:0 0 8px rgba(22,163,74,.5);
}

html.theme-light .status-dot.offline {
  background:var(--bad);
  box-shadow:0 0 8px rgba(220,38,38,.5);
}

html.theme-light .status-dot.online::after {
  background:var(--good);
}

html.theme-light .status-dot.offline::after {
  background:var(--bad);
}

html.theme-light .card[style*="grid-column: span 3"]::before {
  background:linear-gradient(135deg, rgba(59,130,246,.08), rgba(59,130,246,.03));
}

html.theme-light .skip-link {
  background:var(--accent);
  color:#ffffff;
}

html.theme-light .skip-link:focus {
  outline:3px solid var(--text);
}

/* =====================================================
   MODAL STYLES
   ===================================================== */

.modal-overlay {
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(0, 0, 0, 0.75);
  backdrop-filter:blur(4px);
  display:flex;
  justify-content:center;
  align-items:center;
  z-index:10000;
  padding:20px;
  animation:modalFadeIn 0.2s ease-out;
}

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

.modal-content {
  background:linear-gradient(145deg, rgba(15,26,51,.98), rgba(16,31,61,.99));
  border:1px solid var(--line);
  border-radius:20px;
  padding:32px;
  max-width:480px;
  width:100%;
  max-height:90vh;
  overflow-y:auto;
  position:relative;
  box-shadow:0 20px 60px rgba(0, 0, 0, 0.5);
  animation:modalSlideIn 0.3s ease-out;
}

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

.modal-content h2 {
  margin:0 0 8px 0;
  font-size:1.75rem;
  background:linear-gradient(90deg, var(--accent), #93c5fd);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
}

.modal-close {
  position:absolute;
  top:16px;
  right:16px;
  width:36px;
  height:36px;
  border:1px solid var(--line);
  border-radius:50%;
  background:rgba(16,31,61,.8);
  color:var(--muted);
  font-size:1.5rem;
  line-height:1;
  cursor:pointer;
  transition:var(--transition);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
}

.modal-close:hover {
  background:rgba(239,68,68,.2);
  border-color:var(--bad);
  color:var(--bad);
  transform:rotate(90deg);
}

.modal-close:focus {
  outline:3px solid var(--accent);
  outline-offset:2px;
}

/* reCAPTCHA styling */
.g-recaptcha {
  display:flex;
  justify-content:center;
  margin:8px 0;
}

/* Light theme modal styles */
html.theme-light .modal-overlay {
  background:rgba(0, 0, 0, 0.5);
}

html.theme-light .modal-content {
  background:linear-gradient(145deg, rgba(255,255,255,.99), rgba(248,250,252,.98));
  border:1px solid var(--line);
  box-shadow:0 20px 60px rgba(0, 0, 0, 0.15);
}

html.theme-light .modal-content h2 {
  background:linear-gradient(90deg, #3b82f6, #1d4ed8);
  -webkit-background-clip:text;
  background-clip:text;
}

html.theme-light .modal-close {
  background:rgba(241,245,249,.9);
  border:1px solid var(--line);
  color:var(--muted);
}

html.theme-light .modal-close:hover {
  background:rgba(220,38,38,.1);
  border-color:var(--bad);
  color:var(--bad);
}

/* Midnight theme modal styles */
html.theme-midnight .modal-content {
  background:linear-gradient(145deg, rgba(26,16,48,.98), rgba(36,24,72,.99));
  border-color:#3d2a6b;
}

html.theme-midnight .modal-content h2 {
  background:linear-gradient(90deg, #8b5cf6, #a78bfa);
  -webkit-background-clip:text;
  background-clip:text;
}

html.theme-midnight .modal-close {
  background:rgba(36,24,72,.9);
  border-color:#3d2a6b;
}

html.theme-midnight .modal-close:hover {
  border-color:#8b5cf6;
}

/* High contrast modal styles */
html.high-contrast .modal-content {
  background:#0a0a0a;
  border:2px solid #ffffff;
}

html.high-contrast .modal-content h2 {
  -webkit-text-fill-color:#00bfff;
}

html.high-contrast .modal-close {
  background:#000000;
  border:2px solid #ffffff;
  color:#ffffff;
}

html.high-contrast .modal-close:hover {
  background:#ffffff;
  color:#000000;
}

/* Responsive modal */
@media (max-width: 768px) {
  .modal-content {
    padding:24px;
    margin:16px;
    max-height:85vh;
  }
  
  .modal-content h2 {
    font-size:1.5rem;
    padding-right:32px;
  }
  
  .g-recaptcha {
    transform:scale(0.9);
    transform-origin:center;
  }
}

/* =====================================================
   WELCOME POPUP STYLES
   ===================================================== */

.welcome-popup {
  position:fixed;
  top:0;
  left:0;
  right:0;
  bottom:0;
  background:rgba(0, 0, 0, 0.7);
  backdrop-filter:blur(8px);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:10000;
  animation:welcomeFadeIn 0.4s ease-out;
}

@keyframes welcomeFadeIn {
  from { 
    opacity:0;
    backdrop-filter:blur(0px);
  }
  to { 
    opacity:1;
    backdrop-filter:blur(8px);
  }
}

.welcome-popup-content {
  background:linear-gradient(145deg, rgba(15,26,51,.98), rgba(16,31,61,.99));
  border:2px solid var(--accent);
  border-radius:24px;
  padding:48px 40px;
  max-width:500px;
  width:90%;
  position:relative;
  box-shadow:0 30px 80px rgba(96,165,250,.3), 0 0 100px rgba(96,165,250,.2);
  animation:welcomeSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align:center;
}

@keyframes welcomeSlideIn {
  0% { 
    opacity:0;
    transform:scale(0.8) translateY(-30px) rotate(-2deg);
  }
  60% {
    transform:scale(1.05) translateY(5px) rotate(1deg);
  }
  100% { 
    opacity:1;
    transform:scale(1) translateY(0) rotate(0deg);
  }
}

.welcome-popup-icon {
  width:80px;
  height:80px;
  margin:0 auto 24px;
  background:linear-gradient(135deg, var(--accent), #93c5fd);
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:40px;
  animation:welcomeIconPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s backwards;
  box-shadow:0 8px 32px rgba(96,165,250,.4);
  position:relative;
}

.welcome-popup-icon::before {
  content:"";
  position:absolute;
  top:-4px;
  left:-4px;
  right:-4px;
  bottom:-4px;
  border-radius:50%;
  background:linear-gradient(135deg, var(--accent), #93c5fd);
  opacity:0.3;
  animation:welcomeIconPulse 2s ease-in-out infinite;
  z-index:-1;
}

@keyframes welcomeIconPop {
  0% { 
    transform:scale(0) rotate(-180deg);
    opacity:0;
  }
  70% {
    transform:scale(1.15) rotate(10deg);
  }
  100% { 
    transform:scale(1) rotate(0deg);
    opacity:1;
  }
}

@keyframes welcomeIconPulse {
  0%, 100% { 
    transform:scale(1);
    opacity:0.3;
  }
  50% { 
    transform:scale(1.2);
    opacity:0.1;
  }
}

.welcome-popup-title {
  font-size:2rem;
  font-weight:800;
  margin:0 0 16px 0;
  background:linear-gradient(90deg, var(--accent), #93c5fd, var(--text));
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  animation:welcomeTitleSlide 0.7s ease-out 0.4s backwards;
  background-size:200% 100%;
  animation:welcomeTitleSlide 0.7s ease-out 0.4s backwards, welcomeGradientShift 3s ease-in-out infinite;
}

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

@keyframes welcomeGradientShift {
  0%, 100% { background-position:0% 50%; }
  50% { background-position:100% 50%; }
}

.welcome-popup-name {
  font-size:1.5rem;
  font-weight:700;
  color:var(--text);
  margin:0 0 12px 0;
  animation:welcomeNameFade 0.8s ease-out 0.5s backwards;
}

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

.welcome-popup-message {
  color:var(--muted);
  font-size:1rem;
  margin:0 0 32px 0;
  line-height:1.6;
  animation:welcomeMessageFade 0.8s ease-out 0.6s backwards;
}

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

.welcome-popup-button {
  padding:14px 32px;
  border-radius:12px;
  border:2px solid var(--accent);
  background:linear-gradient(135deg, rgba(96,165,250,.3), rgba(96,165,250,.4));
  color:var(--text);
  font-weight:700;
  font-size:1rem;
  cursor:pointer;
  transition:all 0.3s ease;
  font-family:inherit;
  animation:welcomeButtonBounce 0.8s ease-out 0.7s backwards;
  position:relative;
  overflow:hidden;
}

.welcome-popup-button::before {
  content:"";
  position:absolute;
  top:50%;
  left:50%;
  width:0;
  height:0;
  border-radius:50%;
  background:rgba(255,255,255,.2);
  transform:translate(-50%, -50%);
  transition:width 0.6s ease, height 0.6s ease;
}

.welcome-popup-button:hover::before {
  width:300px;
  height:300px;
}

.welcome-popup-button:hover {
  transform:translateY(-3px) scale(1.05);
  box-shadow:0 12px 32px rgba(96,165,250,.4);
  border-color:#93c5fd;
}

.welcome-popup-button:active {
  transform:translateY(-1px) scale(1.02);
}

@keyframes welcomeButtonBounce {
  0% { 
    opacity:0;
    transform:translateY(20px) scale(0.9);
  }
  60% {
    transform:translateY(-5px) scale(1.05);
  }
  100% { 
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

/* Confetti effect */
.welcome-confetti {
  position:fixed;
  width:10px;
  height:10px;
  background:var(--accent);
  opacity:0;
  animation:confettiFall 3s ease-in-out forwards;
  z-index:10001;
  pointer-events:none;
}

@keyframes confettiFall {
  0% {
    opacity:1;
    transform:translateY(0) rotate(0deg);
  }
  100% {
    opacity:0;
    transform:translateY(100vh) rotate(720deg);
  }
}

/* Light theme welcome popup */
html.theme-light .welcome-popup {
  background:rgba(0, 0, 0, 0.4);
}

html.theme-light .welcome-popup-content {
  background:linear-gradient(145deg, rgba(255,255,255,.99), rgba(248,250,252,.98));
  border-color:#3b82f6;
  box-shadow:0 30px 80px rgba(59,130,246,.3), 0 0 100px rgba(59,130,246,.15);
}

html.theme-light .welcome-popup-icon {
  background:linear-gradient(135deg, #3b82f6, #60a5fa);
  box-shadow:0 8px 32px rgba(59,130,246,.3);
}

html.theme-light .welcome-popup-icon::before {
  background:linear-gradient(135deg, #3b82f6, #60a5fa);
}

html.theme-light .welcome-popup-title {
  background:linear-gradient(90deg, #3b82f6, #1d4ed8, #1e293b);
  -webkit-background-clip:text;
  background-clip:text;
}

html.theme-light .welcome-popup-button {
  border-color:#3b82f6;
  background:linear-gradient(135deg, rgba(59,130,246,.2), rgba(59,130,246,.3));
}

html.theme-light .welcome-popup-button:hover {
  box-shadow:0 12px 32px rgba(59,130,246,.3);
  border-color:#1d4ed8;
}

/* Midnight theme welcome popup */
html.theme-midnight .welcome-popup-content {
  border-color:#8b5cf6;
  box-shadow:0 30px 80px rgba(139,92,246,.3), 0 0 100px rgba(139,92,246,.2);
}

html.theme-midnight .welcome-popup-icon {
  background:linear-gradient(135deg, #8b5cf6, #a78bfa);
  box-shadow:0 8px 32px rgba(139,92,246,.4);
}

html.theme-midnight .welcome-popup-icon::before {
  background:linear-gradient(135deg, #8b5cf6, #a78bfa);
}

html.theme-midnight .welcome-popup-title {
  background:linear-gradient(90deg, #8b5cf6, #a78bfa, #e8e0f8);
  -webkit-background-clip:text;
  background-clip:text;
}

html.theme-midnight .welcome-popup-button {
  border-color:#8b5cf6;
  background:linear-gradient(135deg, rgba(139,92,246,.3), rgba(139,92,246,.4));
}

html.theme-midnight .welcome-popup-button:hover {
  box-shadow:0 12px 32px rgba(139,92,246,.4);
  border-color:#a78bfa;
}

/* High contrast welcome popup */
html.high-contrast .welcome-popup-content {
  background:#0a0a0a;
  border:3px solid #00bfff;
}

html.high-contrast .welcome-popup-icon {
  background:#00bfff;
}

html.high-contrast .welcome-popup-title {
  -webkit-text-fill-color:#00bfff;
}

html.high-contrast .welcome-popup-button {
  background:#000000;
  border:3px solid #ffffff;
  color:#ffffff;
}

html.high-contrast .welcome-popup-button:hover {
  background:#ffffff;
  color:#000000;
}

/* Reduced motion for welcome popup */
html.reduced-motion .welcome-popup,
html.reduced-motion .welcome-popup-content,
html.reduced-motion .welcome-popup-icon,
html.reduced-motion .welcome-popup-title,
html.reduced-motion .welcome-popup-name,
html.reduced-motion .welcome-popup-message,
html.reduced-motion .welcome-popup-button {
  animation:none !important;
}

html.reduced-motion .welcome-popup-icon::before {
  animation:none !important;
}

html.reduced-motion .welcome-confetti {
  display:none;
}

/* Responsive welcome popup */
@media (max-width: 768px) {
  .welcome-popup-content {
    padding:36px 28px;
    width:95%;
  }
  
  .welcome-popup-icon {
    width:64px;
    height:64px;
    font-size:32px;
    margin-bottom:20px;
  }
  
  .welcome-popup-title {
    font-size:1.5rem;
  }
  
  .welcome-popup-name {
    font-size:1.25rem;
  }
  
  .welcome-popup-message {
    font-size:0.9rem;
    margin-bottom:24px;
  }
  
  .welcome-popup-button {
    padding:12px 24px;
    font-size:0.9rem;
  }
}

/* =====================================================
   ADDITIONAL MICRO-ANIMATIONS & EFFECTS
   ===================================================== */

/* Floating animation for important elements */
@keyframes float {
  0%, 100% {
    transform:translateY(0px);
  }
  50% {
    transform:translateY(-10px);
  }
}

/* Breathing glow effect */
@keyframes breathe {
  0%, 100% {
    box-shadow:0 0 20px rgba(96,165,250,.2);
  }
  50% {
    box-shadow:0 0 40px rgba(96,165,250,.4);
  }
}

/* Slide in from right */
@keyframes slideInRight {
  from {
    opacity:0;
    transform:translateX(50px);
  }
  to {
    opacity:1;
    transform:translateX(0);
  }
}

/* Rotate in */
@keyframes rotateIn {
  from {
    opacity:0;
    transform:rotate(-180deg) scale(0.5);
  }
  to {
    opacity:1;
    transform:rotate(0deg) scale(1);
  }
}

/* Bounce attention */
@keyframes bounceAttention {
  0%, 20%, 50%, 80%, 100% {
    transform:translateY(0);
  }
  40% {
    transform:translateY(-10px);
  }
  60% {
    transform:translateY(-5px);
  }
}

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

/* Text shimmer effect */
@keyframes textShimmer {
  0% {
    background-position:0% 50%;
  }
  100% {
    background-position:200% 50%;
  }
}

/* Enhanced focus ring animation */
@keyframes focusRing {
  0%, 100% {
    box-shadow:0 0 0 0 rgba(96,165,250,.7);
  }
  50% {
    box-shadow:0 0 0 8px rgba(96,165,250,.0);
  }
}

/* Icon bounce on hover - utility class */
.icon-bounce:hover {
  animation:bounceAttention 0.8s ease;
}

/* Smooth reveal for hidden elements */
.reveal {
  opacity:0;
  transform:translateY(30px);
  animation:revealElement 0.6s ease-out forwards;
}

@keyframes revealElement {
  to {
    opacity:1;
    transform:translateY(0);
  }
}

/* Attention seeker pulse */
.pulse-attention {
  animation:pulseAttention 2s ease-in-out infinite;
}

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

/* Success checkmark animation */
@keyframes checkmark {
  0% {
    stroke-dashoffset:100;
  }
  100% {
    stroke-dashoffset:0;
  }
}

/* Error shake animation */
@keyframes shake {
  0%, 100% { transform:translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform:translateX(-5px); }
  20%, 40%, 60%, 80% { transform:translateX(5px); }
}

.shake-error {
  animation:shake 0.5s ease;
}

/* Smooth color transition */
.smooth-color-transition {
  transition:color 0.4s ease, background-color 0.4s ease, border-color 0.4s ease;
}

/* Scale on click */
.scale-click:active {
  transform:scale(0.95);
  transition:transform 0.1s ease;
}

/* Glow on focus */
*:focus-visible {
  outline:none;
  animation:focusRing 1.5s ease-in-out;
  box-shadow:0 0 0 4px rgba(96,165,250,.3);
}

/* Stagger fade in for list items */
.stagger-list > * {
  opacity:0;
  animation:fadeIn 0.5s ease-out forwards;
}

.stagger-list > *:nth-child(1) { animation-delay:0.05s; }
.stagger-list > *:nth-child(2) { animation-delay:0.1s; }
.stagger-list > *:nth-child(3) { animation-delay:0.15s; }
.stagger-list > *:nth-child(4) { animation-delay:0.2s; }
.stagger-list > *:nth-child(5) { animation-delay:0.25s; }
.stagger-list > *:nth-child(6) { animation-delay:0.3s; }
.stagger-list > *:nth-child(7) { animation-delay:0.35s; }
.stagger-list > *:nth-child(8) { animation-delay:0.4s; }
.stagger-list > *:nth-child(9) { animation-delay:0.45s; }
.stagger-list > *:nth-child(10) { animation-delay:0.5s; }

/* Smooth hover transition for all interactive elements */
a, button, input, select, .card, .badge {
  transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Add slight elevation on hover for clickable items */
[role="button"]:hover,
[onclick]:hover,
[href]:hover {
  transform:translateY(-2px);
  transition:transform 0.2s ease;
}

/* Backdrop blur animation */
@keyframes backdropBlur {
  from {
    backdrop-filter:blur(0px);
    opacity:0;
  }
  to {
    backdrop-filter:blur(8px);
    opacity:1;
  }
}

/* Smooth scroll behavior */
html {
  scroll-behavior:smooth;
}

/* Loading state animation */
.loading {
  position:relative;
  pointer-events:none;
  opacity:0.6;
}

.loading::after {
  content:"";
  position:absolute;
  top:50%;
  left:50%;
  width:20px;
  height:20px;
  margin:-10px 0 0 -10px;
  border:3px solid var(--accent);
  border-radius:50%;
  border-top-color:transparent;
  animation:spin 0.8s linear infinite;
}

/* Skeleton loading animation */
@keyframes skeleton {
  0% {
    background-position:200% 0;
  }
  100% {
    background-position:-200% 0;
  }
}

.skeleton {
  background:linear-gradient(90deg, rgba(15,26,51,.8) 25%, rgba(96,165,250,.2) 50%, rgba(15,26,51,.8) 75%);
  background-size:200% 100%;
  animation:skeleton 1.5s ease-in-out infinite;
  border-radius:8px;
}

/* Notification slide in */
@keyframes notificationSlide {
  from {
    transform:translateX(400px);
    opacity:0;
  }
  to {
    transform:translateX(0);
    opacity:1;
  }
}

.notification {
  animation:notificationSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tooltip fade */
@keyframes tooltipFade {
  from {
    opacity:0;
    transform:translateY(-5px);
  }
  to {
    opacity:1;
    transform:translateY(0);
  }
}

[title]:hover::after {
  animation:tooltipFade 0.2s ease-out;
}

/* Reduced motion overrides */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration:0.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:0.01ms !important;
    animation-delay:0s !important;
  }
  
  body,
  .main,
  .sidebar,
  .topbar,
  .card,
  .btn,
  .badge,
  .kpi,
  .nav a,
  .brand {
    animation:none !important;
  }
  
  .card:hover,
  .btn:hover,
  .nav a:hover,
  input:focus,
  tr:hover {
    transform:none !important;
  }
  
  .welcome-confetti,
  .card::before,
  .btn::before,
  .nav a::before,
  .status-dot::after {
    display:none !important;
  }
}
