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

:root {
  --primary: #1a56db;
  --primary-dark: #1e40af;
  --secondary: #374151;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --bg: #111827;
  --bg-card: #1f2937;
  --bg-input: #374151;
  --text: #f9fafb;
  --text-dim: #9ca3af;
  --border: #374151;
  --radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 80px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.header h1 {
  font-size: 18px;
  font-weight: 600;
}

.header .role-badge {
  font-size: 12px;
  padding: 4px 8px;
  background: var(--primary);
  border-radius: var(--radius);
}

.header .logout-btn {
  font-size: 12px;
  padding: 6px 12px;
  background: var(--secondary);
  border: none;
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

/* Forms */
.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Buttons */
.btn {
  display: block;
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: opacity 0.2s;
}

.btn:active {
  opacity: 0.8;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-secondary {
  background: var(--secondary);
  color: var(--text);
}

.btn-accent {
  background: var(--accent);
  color: #000;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 13px;
}

.btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

/* Status badges */
.status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.status-staged { background: var(--accent); color: #000; }
.status-pending { background: var(--primary); color: white; }
.status-cleared { background: var(--success); color: white; }
.status-assigned { background: var(--primary); color: white; }
.status-in_progress { background: var(--accent); color: #000; }
.status-completed { background: var(--success); color: white; }

/* List items */
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.list-item:last-child {
  border-bottom: none;
}

.list-item-info {
  flex: 1;
}

.list-item-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.list-item-sub {
  font-size: 13px;
  color: var(--text-dim);
}

.list-item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Empty state */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
}

/* Nav tabs */
.nav-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.nav-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  background: var(--secondary);
  border: none;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
}

.nav-tab.active {
  background: var(--primary);
  color: white;
}

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
  flex: 1;
  min-width: 100px;
  padding: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
}

/* Login page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-box {
  width: 100%;
  max-width: 320px;
}

.login-box h1 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 20px;
}

.login-box .btn {
  margin-top: 16px;
}

.login-error {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  margin-bottom: 12px;
}

/* Page header */
.page-header {
  margin-bottom: 16px;
}

.page-header h2 {
  font-size: 20px;
  margin-bottom: 4px;
}

.page-header p {
  color: var(--text-dim);
  font-size: 13px;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-card);
  padding: 12px;
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid var(--border);
}

.stat-card .value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .label {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Checkbox list */
.checkbox-list {
  max-height: 300px;
  overflow-y: auto;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-input);
  border-radius: var(--radius);
  margin-bottom: 6px;
  cursor: pointer;
}

.checkbox-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.checkbox-item.selected {
  background: rgba(26, 86, 219, 0.2);
  border: 1px solid var(--primary);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  background: var(--success);
  color: white;
  border-radius: var(--radius);
  font-size: 14px;
  z-index: 1000;
  animation: fadeIn 0.3s;
}

.toast.error {
  background: var(--danger);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
}

/* Hidden */
.hidden {
  display: none !important;
}
