:root {
  --background: 210 33% 98%;
  --foreground: 220 32% 14%;
  --primary: 214 84% 44%;
  --secondary: 168 58% 40%;
  --muted: 210 18% 92%;
  --destructive: 0 73% 52%;
  --border: 214 22% 84%;
  --card: 0 0% 100%;
  --shadow-sm: 0 1px 2px hsla(220, 30%, 10%, 0.08);
  --shadow-md: 0 12px 30px hsla(220, 30%, 10%, 0.10);
  --shadow-lg: 0 18px 48px hsla(220, 30%, 10%, 0.18);
  --transition-fast: 120ms ease;
  --transition-smooth: 240ms ease;
  --radius-sm: 0.5rem;
  --radius-md: 0.9rem;
  --radius-lg: 1.35rem;
}

.dark {
  --background: 223 28% 10%;
  --foreground: 210 20% 96%;
  --primary: 212 92% 62%;
  --secondary: 167 65% 46%;
  --muted: 223 18% 18%;
  --destructive: 0 80% 62%;
  --border: 220 16% 24%;
  --card: 223 24% 14%;
  --shadow-sm: 0 1px 2px hsla(0, 0%, 0%, 0.28);
  --shadow-md: 0 14px 34px hsla(0, 0%, 0%, 0.35);
  --shadow-lg: 0 24px 60px hsla(0, 0%, 0%, 0.48);
}

* {
  box-sizing: border-box;
}

html, body, #root {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

a, button {
  -webkit-tap-highlight-color: transparent;
}

.tap {
  touch-action: manipulation;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top left, hsla(214, 84%, 44%, 0.08), transparent 28%),
    radial-gradient(circle at top right, hsla(168, 58%, 40%, 0.08), transparent 30%),
    hsl(var(--background));
  color: hsl(var(--foreground));
}

button, input, select, textarea {
  font: inherit;
}

button:disabled, input:disabled, select:disabled, textarea:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

::selection {
  background: hsla(214, 84%, 44%, 0.18);
}

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

.card-glow {
  position: relative;
  overflow: hidden;
}

.card-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, hsla(214, 84%, 44%, 0.08), transparent 38%, hsla(168, 58%, 40%, 0.08));
  pointer-events: none;
}

.card-glow > * {
  position: relative;
  z-index: 1;
}

.grid-dots {
  background-image: radial-gradient(hsla(214, 22%, 64%, 0.2) 1px, transparent 1px);
  background-size: 18px 18px;
}

input:focus, select:focus, textarea:focus, button:focus, a:focus {
  outline: 2px solid hsla(214, 84%, 44%, 0.28);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

.fade-in {
  animation: fadeIn 0.28s ease;
}

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

.skeleton {
  position: relative;
  overflow: hidden;
  background: hsl(var(--muted));
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, hsla(0, 0%, 100%, 0.55), transparent);
  animation: shimmer 1.6s infinite;
}

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

.table-responsive {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Mobile Polish */
@media (max-width: 767px) {
  h1 { font-size: 1.5rem !important; line-height: 2rem !important; }
  h2 { font-size: 1.25rem !important; line-height: 1.75rem !important; }
  h3 { font-size: 1.125rem !important; line-height: 1.5rem !important; }
  
  .tap-target {
    min-height: 44px;
    min-width: 44px;
  }
  
  .mobile-card-stack > * + * {
    margin-top: 1rem;
  }

  .mobile-hide {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .print-only {
    display: block !important;
  }
  
  header {
    position: static !important;
    border-bottom: 1px solid #eee !important;
    background: white !important;
  }
  
  main {
    padding: 0 !important;
  }
  
  .card {
    border: 1px solid #eee !important;
    box-shadow: none !important;
  }
}

.no-print {
  /* Placeholder for no-print utility if not using tailwind print:hidden */
}

.print-only {
  display: none;
}
