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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  font-size: 14px;
}

/* Login */
#login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  background: #fff;
  padding: 2.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 380px;
}

.login-card h1 {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: #1a1a1a;
}

#login-form input {
  display: block;
  width: 100%;
  padding: 0.7rem 0.8rem;
  margin-bottom: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.95rem;
}

#login-form input:focus {
  outline: none;
  border-color: #4a90d9;
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

#login-form button {
  display: block;
  width: 100%;
  padding: 0.7rem;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 0.5rem;
}

#login-form button:hover {
  background: #3a7bc8;
}

.error {
  color: #d32f2f;
  font-size: 0.85rem;
  margin-top: 0.8rem;
  text-align: center;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.2rem;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

header h1 {
  font-size: 1.2rem;
}

#logout-btn {
  padding: 0.4rem 1rem;
  background: #e0e0e0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

#logout-btn:hover {
  background: #d0d0d0;
}

/* Filters */
#filter-area {
  padding: 0.8rem 1.2rem;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

#filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  min-width: 140px;
}

.filter-group label {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-group input,
.filter-group select {
  padding: 0.35rem 0.5rem;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 0.85rem;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: #4a90d9;
}

.filter-actions {
  margin-top: 0.6rem;
}

#clear-filters-btn {
  padding: 0.35rem 0.8rem;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8rem;
}

#clear-filters-btn:hover {
  background: #e0e0e0;
}

/* Stats */
#stats-bar {
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  color: #666;
  background: #fafafa;
  border-bottom: 1px solid #eee;
}

/* Table */
#table-wrapper {
  overflow-x: auto;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

#data-table {
  width: max-content;
  border-collapse: collapse;
  font-size: 0.82rem;
}

#data-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

#data-table th {
  background: #f0f0f0;
  border: 1px solid #ddd;
  padding: 0.5rem 0.6rem;
  text-align: left;
  white-space: nowrap;
  font-weight: 600;
}

#data-table td {
  border: 1px solid #eee;
  padding: 0.35rem 0.6rem;
  white-space: nowrap;
}

/* Sticky first column */
#data-table th:first-child,
#data-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: inherit;
}

#data-table th:first-child {
  z-index: 3;
}

/* Zebra stripes */
#data-table tbody tr:nth-child(even) {
  background: #fafafa;
}

#data-table tbody tr:nth-child(odd) {
  background: #fff;
}

#data-table tbody tr:hover {
  background: #e8f0fe;
}

/* Loading */
#app-container[data-loading="true"]::after {
  content: "Loading data...";
  display: block;
  text-align: center;
  padding: 2rem;
  color: #999;
  font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .filter-group {
    min-width: 120px;
    flex: 1;
  }

  header {
    padding: 0.6rem 0.8rem;
  }

  #filter-area {
    padding: 0.6rem 0.8rem;
  }
}
