* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  background-image: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
                    radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.12) 0px, transparent 50%);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.navbar {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-online {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.pulse {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  width: 100%;
  flex: 1;
}

.hero {
  margin-bottom: 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 3.5rem;
  font-weight: 800;
  margin: 0.8rem 0 0.3rem;
  line-height: 1;
}

.stat-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.card-inside .stat-value {
  background: var(--inside-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card-entry .stat-value {
  background: var(--entry-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card-exit .stat-value {
  background: var(--exit-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.occupancy-bar-container {
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 9999px;
  height: 10px;
  overflow: hidden;
}

.occupancy-bar {
  height: 100%;
  width: 0%;
  background: var(--primary-gradient);
  transition: width 0.5s ease;
}

.details-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 868px) {
  .details-section {
    grid-template-columns: 1fr;
  }
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.log-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.log-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.tag-entry { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.tag-exit { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.tag-reset { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.action-btn {
  background: var(--primary-gradient);
  border: none;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  width: 100%;
  margin-top: 1rem;
}

.action-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.action-btn.secondary {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.action-btn.secondary:hover {
  background: rgba(239, 68, 68, 0.3);
}

footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--card-border);
}
