/* ===== Layout ===== */

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: #111827;
  background: #f3f4f6;
}

.topbar {
  background: #111827;
  color: #f9fafb;
  padding: 0.5rem 1rem;
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar h1 {
  margin: 0;
  font-size: 1.1rem;
}

main {
  max-width: 1100px;
  margin: 1rem auto 2rem;
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
  padding: 1rem 1.25rem 1.5rem;
}

/* ===== Nav ===== */

.main-nav {
  max-width: 1100px;
  margin: 0.5rem auto 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.main-nav button {
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.main-nav button.active {
  background: #111827;
  color: #f9fafb;
}

/* ===== Generic form controls ===== */

input,
select,
button,
textarea {
  font-family: inherit;
  font-size: 0.85rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.78rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  padding: 0.25rem 0.4rem;
}

button {
  border-radius: 0.375rem;
  border: 1px solid transparent;
  padding: 0.3rem 0.7rem;
}

button.btn-sm {
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
}

button.secondary {
  background: #f9fafb;
  border-color: #d1d5db;
}

/* ===== Tables ===== */

.data-grid,
.compact-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.data-grid th,
.data-grid td,
.compact-grid th,
.compact-grid td {
  border: 1px solid #e5e7eb;
  padding: 0.25rem 0.4rem;
}

.data-grid th,
.compact-grid th {
  background: #f9fafb;
  text-align: left;
}

.scroll-x {
  overflow-x: auto;
}

/* ===== Grid helper ===== */

.grid {
  display: grid;
}

/* ===== Status badges ===== */

.badge-status {
  display: inline-block;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-status.draft {
  background: #e5e7eb;
  color: #374151;
}

.badge-status.submitted {
  background: #bfdbfe;
  color: #1d4ed8;
}

.badge-status.approved {
  background: #bbf7d0;
  color: #166534;
}

.badge-status.rejected {
  background: #fecaca;
  color: #b91c1c;
}

/* ===== Timesheet grid ===== */

.timesheet-grid {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}

.timesheet-grid th,
.timesheet-grid td {
  border: 1px solid #e5e7eb;
  padding: 0.25rem 0.4rem;
  white-space: nowrap;
}

.timesheet-grid th {
  background: #f8fafc;
}

.timesheet-grid input[type="number"] {
  width: 4rem;
  text-align: right;
}

.timesheet-grid .proj-col {
  min-width: 220px;
}

.timesheet-grid .total-col {
  min-width: 5rem;
  text-align: right;
  font-weight: 600;
}
