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

:root {
  --bg: #f5f5f4;
  --surface: #ffffff;
  --border: #e2e2e0;
  --text: #1a1a18;
  --muted: #6b6b68;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --green: #16a34a;
  --green-light: #dcfce7;
  --red: #dc2626;
  --red-light: #fee2e2;
  --yellow-light: #fef9c3;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  margin-bottom: 32px;
}

header .inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

header h1 { font-size: 18px; font-weight: 600; }
header a.home { color: var(--muted); font-size: 13px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.card h2 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }

/* Buttons */
button, .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; color: #fff; }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: transparent;
  padding: 4px 8px;
  font-size: 13px;
}
.btn-danger:hover { background: var(--red-light); }

.btn-sm { padding: 4px 10px; font-size: 13px; }

/* Forms */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--muted);
}

input, select {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
}

input:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.form-group { flex: 1; min-width: 140px; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
}

td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* Availability grid */
.grid-wrap { overflow-x: auto; }

.avail-grid {
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}

.avail-grid th {
  padding: 5px 6px;
  font-size: 11px;
  font-weight: 500;
}

.avail-grid td {
  padding: 4px 6px;
  text-align: center;
  border: 1px solid var(--border);
}

.avail-grid .name-cell {
  text-align: left;
  font-weight: 500;
  padding: 4px 10px 4px 4px;
  min-width: 120px;
}

.cell-available { background: var(--green-light); color: var(--green); font-weight: 600; }
.cell-unavailable { background: #f5f5f4; color: #ccc; }
.cell-empty { background: var(--yellow-light); color: #aaa; }
.cell-assigned { background: var(--green); color: #fff; font-weight: 600; }
.cell-understaffed { background: var(--red-light); }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-senior { background: #fef3c7; color: #92400e; }
.badge-standard { background: #e0f2fe; color: #0369a1; }
.badge-junior { background: #f3f4f6; color: #374151; }
.badge-forced { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }

.submitted-check { color: var(--green); font-weight: 700; }
.not-submitted { color: var(--muted); font-size: 13px; }

/* Project list */
.project-list { list-style: none; }
.project-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.project-list li:last-child { border-bottom: none; }
.project-list .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Tabs */
.tabs { display: flex; gap: 2px; margin-bottom: 20px; border-bottom: 2px solid var(--border); }
.tab-btn {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  color: var(--muted);
}
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Alerts */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 14px;
}
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warn { background: var(--yellow-light); color: #854d0e; border: 1px solid #fde68a; }
.alert-success { background: var(--green-light); color: var(--green); border: 1px solid #86efac; }
.alert-error { background: var(--red-light); color: var(--red); border: 1px solid #fca5a5; }

/* Availability form (installer view) */
.day-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.day-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}
.day-item:hover { background: var(--bg); }
.day-item.available { background: var(--green-light); border-color: #86efac; }
.day-item input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--green); }
.day-label { font-size: 14px; }
.day-label .dow { font-weight: 600; }
.day-label .date-str { color: var(--muted); font-size: 13px; }

/* Action bar */
.action-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  align-items: center;
}

/* Empty state */
.empty { color: var(--muted); font-size: 14px; padding: 24px 0; text-align: center; }

/* Project status badges */
.badge-status-open { background: #dcfce7; color: #166534; }
.badge-status-scheduled { background: #dbeafe; color: #1e40af; }
.badge-status-closed { background: #f3f4f6; color: #6b7280; }

/* Enroll link row in project list */
.enroll-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.enroll-label { font-size: 12px; color: var(--muted); }
.enroll-link { font-size: 12px; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Radio group */
.radio-group { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.radio-label { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 400; color: var(--text); cursor: pointer; }
.radio-label input[type=radio] { width: auto; }

/* Stat label */
.stat-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* Budget stats bar */
.budget-stats {
  font-size: 14px;
  padding: 10px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  margin-bottom: 16px;
  color: #1e40af;
}

/* Responsive */
@media (max-width: 600px) {
  .form-row { flex-direction: column; }
  .form-group { min-width: 100%; }
  .action-bar { flex-direction: column; align-items: flex-start; }
  .enroll-row { flex-direction: column; align-items: flex-start; }
}
