:root {
  --bg-dark: #090d16;
  --card-bg: rgba(17, 25, 40, 0.78);
  --card-border: rgba(255, 255, 255, 0.09);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.35);
  --emerald: #10b981;
  --danger: #f43f5e;
  --radius-lg: 22px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  min-height: 100vh;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow-x: hidden;
  position: relative;
}

.ambient-glow {
  position: fixed;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.16) 0%, rgba(16, 185, 129, 0.08) 45%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

.container {
  width: 100%;
  max-width: 520px;
  position: relative;
  z-index: 1;
}

.glass-panel {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.pulse-dot.active {
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  animation: pulse 2s infinite;
}

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

h1 {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

input[type="text"],
input[type="date"] {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  color-scheme: dark;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #04101d;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.9rem 1.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.btn-primary:hover {
  opacity: 0.94;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary.small {
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.dash-header .brand-badge {
  margin-bottom: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: rgba(56, 189, 248, 0.2);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
}

.btn-ghost:hover {
  color: var(--text-primary);
}

.hero-metric {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.5rem;
}

.hero-headline {
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-primary);
}

.count-highlight {
  display: inline-block;
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--emerald);
  padding: 0 0.2rem;
}

.date-highlight {
  color: var(--accent);
  font-weight: 600;
}

.sync-meta {
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.filter-panel {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.15rem;
}

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

.filter-title {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.date-controls {
  margin-top: 1rem;
}

.date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.date-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.error-text {
  color: var(--danger);
  font-size: 0.84rem;
  margin-bottom: 1rem;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.25);
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
}

.hidden {
  display: none !important;
}

.spin {
  animation: rotate 0.8s linear infinite;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(4, 16, 29, 0.3);
  border-top-color: #04101d;
  border-radius: 50%;
  animation: rotate 0.7s linear infinite;
}

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

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

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

@media (max-width: 480px) {
  .glass-panel {
    padding: 1.5rem;
  }
  .hero-headline {
    font-size: 1.25rem;
  }
  .count-highlight {
    font-size: 1.85rem;
  }
  .date-grid,
  .date-actions {
    grid-template-columns: 1fr;
  }
}
