body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: #f7fafc;
  color: #1f2937;
}

.container {
  max-width: 960px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

h1,
h2,
h3 {
  margin-top: 0;
}

form {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

label {
  font-weight: 600;
}

input[type="file"] {
  padding: 0.5rem;
}

button {
  width: fit-content;
  padding: 0.85rem 1.4rem;
  border: none;
  background: #2563eb;
  color: white;
  border-radius: 0.75rem;
  cursor: pointer;
  font-size: 1rem;
}

button:hover {
  background: #1d4ed8;
}

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

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

.chart-card {
  background: #f8fafc;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid #e5e7eb;
}

.metric-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 1rem;
}

.small-card {
  min-height: 120px;
}

.stat-card {
  background: #f8fafc;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid #e5e7eb;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

thead {
  background: #e2e8f0;
}

th,
td {
  padding: 0.8rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: #2563eb;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.date-selector-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #eff6ff;
  border-radius: 0.75rem;
  border-left: 4px solid #2563eb;
}

.date-selector-section label {
  white-space: nowrap;
  margin: 0;
}

.date-selector-section select {
  flex: 1;
  max-width: 300px;
  padding: 0.65rem 0.85rem;
  border: 1px solid #bfdbfe;
  border-radius: 0.5rem;
  background: white;
  color: #1f2937;
  font-size: 0.95rem;
  cursor: pointer;
}

.date-selector-section select:hover {
  border-color: #2563eb;
}

.date-selector-section select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.current-date {
  white-space: nowrap;
  color: #4b5563;
  font-size: 0.9rem;
}

.secondary-button {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.75rem 1.2rem;
  border-radius: 0.85rem;
  border: 1px solid #2563eb;
  color: #2563eb;
  text-decoration: none;
  background: #eff6ff;
}

.secondary-button:hover {
  background: #dbeafe;
}

.error-table tbody tr.error-details {
  background: #f8fafc;
}

.error-details.hidden {
  display: none;
}

.error-details pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.details-button {
  padding: 0.55rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  background: white;
  color: #1f2937;
  cursor: pointer;
}

.filter-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f0fdf4;
  border-radius: 0.75rem;
  border-left: 4px solid #16a34a;
}

.filter-section label {
  white-space: nowrap;
  margin: 0;
  font-weight: 600;
}

.filter-section input[type="time"] {
  padding: 0.65rem 0.85rem;
  border: 1px solid #bbf7d0;
  border-radius: 0.5rem;
  background: white;
  color: #1f2937;
  font-size: 0.95rem;
}

.filter-section input[type="time"]:focus {
  outline: none;
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.filter-section button {
  margin: 0;
}

.filters-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f3f4f6;
  border-radius: 0.5rem;
  flex-wrap: wrap;
}

.filters-section label {
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
}

.filters-section input,
.filters-section select {
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  min-width: 120px;
}

.filters-section button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.25rem;
  background: #2563eb;
  color: white;
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
}

.filters-section button:hover {
  background: #1d4ed8;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.pagination-link {
  padding: 0.75rem 1.2rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  background: white;
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.pagination-link:hover {
  background: #eff6ff;
  border-color: #2563eb;
}

.pagination-info {
  color: #6b7280;
  font-size: 0.9rem;
}

.access-table {
  font-size: 0.85rem;
}

.access-table th,
.access-table td {
  padding: 0.6rem 0.5rem;
}

.details-button:hover {
  background: #eef2ff;
}
