:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f8fafc;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 24px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

h1 { font-size: 1.5rem; margin: 0; }

.header-actions { display: flex; align-items: center; gap: 10px; }

.btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: var(--primary-dark); }
.btn.secondary { background: #64748b; }
.btn.secondary:hover { background: #475569; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

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

.toolbar {
  display: flex;
  gap: 10px;
  margin: 16px 0;
  flex-wrap: wrap;
}

#searchBox {
  flex: 1;
  min-width: 240px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}

#sortSelect {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}

.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.progress-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: #dbeafe;
  width: 0%;
  transition: width 0.3s ease;
  z-index: 0;
}
#progressText { position: relative; z-index: 1; font-size: 0.9rem; }

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

thead th {
  text-align: left;
  padding: 10px 14px;
  background: #f1f5f9;
  font-size: 0.85rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

tbody tr { cursor: pointer; }
tbody tr:hover { background: #f8fafc; }

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.login-box {
  background: white;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 300px;
}

.login-box h1 { text-align: center; margin-bottom: 8px; }
.login-box input { padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.error { color: #dc2626; font-size: 0.9rem; margin: 0; }

@media (max-width: 600px) {
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  tbody tr { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; padding: 8px; }
  tbody td { border: none; padding: 4px 6px; }
  tbody td:first-child { font-weight: 600; }
}
