* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f4f5f7;
  color: #1f2430;
  font-size: 15px;
}

#app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

header.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: #233;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

header.topbar .brand {
  font-weight: 700;
  letter-spacing: 0.04em;
}

header.topbar nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

header.topbar a {
  color: #dfe6f2;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
}

header.topbar a:hover,
header.topbar a.active {
  background: #3a4a63;
  color: #fff;
}

header.topbar .spacer {
  flex: 1;
}

header.topbar button {
  background: none;
  border: 1px solid #5a6b85;
  color: #dfe6f2;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

h1 {
  font-size: 20px;
  margin: 8px 0 12px;
}

h2 {
  font-size: 16px;
  margin: 16px 0 8px;
}

.login-card {
  max-width: 380px;
  margin: 8vh auto 0;
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.login-card h1 {
  margin-top: 0;
}

label {
  display: block;
  margin: 10px 0;
  font-size: 14px;
}

input,
select,
button {
  font: inherit;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
  padding: 6px 8px;
  border: 1px solid #b9c0cc;
  border-radius: 6px;
  width: 100%;
  background: #fff;
}

button {
  background: #2f54a0;
  border: none;
  color: #fff;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
}

button:hover {
  background: #24417c;
}

button.ghost {
  background: #e8ebf1;
  color: #1f2430;
}

button.ghost:hover {
  background: #d8dde6;
}

.error {
  color: #b3261e;
  background: #fdecea;
  border: 1px solid #f5c6c2;
  border-radius: 6px;
  padding: 8px 10px;
  margin: 10px 0;
}

.error:empty {
  display: none;
}

.week-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.week-head .week-label {
  font-size: 18px;
  font-weight: 700;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  background: #e8ebf1;
  color: #39414f;
}

.badge.submitted {
  background: #fff3cd;
  color: #7a5b00;
}

.badge.approved {
  background: #d4edda;
  color: #155724;
}

.badge.rejected {
  background: #fdecea;
  color: #b3261e;
}

.week-reason {
  color: #b3261e;
  font-size: 14px;
}

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.day {
  background: #fff;
  border-radius: 8px;
  padding: 8px;
  min-height: 130px;
  border: 1px solid #e2e5ea;
}

.day .day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: #5a6272;
  margin-bottom: 6px;
}

.day .day-total {
  font-weight: 700;
  color: #1f2430;
}

.day.holiday .day-head {
  color: #8a6d00;
}

.entry {
  border-top: 1px solid #edf0f4;
  padding: 6px 0 2px;
  font-size: 13px;
}

.entry .entry-times {
  font-weight: 600;
}

.entry .entry-meta {
  color: #5a6272;
  word-break: break-word;
}

.entry .entry-note {
  color: #39414f;
  word-break: break-word;
  white-space: pre-wrap;
}

.entry .entry-delete {
  float: right;
  background: none;
  color: #b3261e;
  padding: 0 4px;
  font-weight: 700;
}

.entry .entry-delete:hover {
  background: #fdecea;
}

.week-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.week-foot .week-total {
  font-size: 17px;
  font-weight: 700;
}

.add-form {
  background: #fff;
  border: 1px solid #e2e5ea;
  border-radius: 8px;
  padding: 12px;
  margin-top: 16px;
}

.add-form .fields {
  display: grid;
  grid-template-columns: repeat(5, 1fr) 2fr auto;
  gap: 8px;
  align-items: end;
}

.approvals {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.approval {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e2e5ea;
  border-radius: 8px;
  padding: 10px 12px;
  flex-wrap: wrap;
}

.approval .who {
  font-weight: 600;
  flex: 1;
  min-width: 140px;
}

.approval .mins {
  color: #5a6272;
}

.reject-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #fff;
  border: 1px solid #e2e5ea;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 12px;
}

.reject-bar input {
  flex: 1;
}

.report-controls {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid #e2e5ea;
  border-radius: 8px;
  padding: 12px;
}

.report-controls label {
  margin: 0;
  min-width: 130px;
}

.report-controls select {
  width: auto;
}

.report-rows {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.report-row {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1px solid #e2e5ea;
  border-radius: 8px;
  padding: 8px 12px;
  flex-wrap: wrap;
}

.report-row .who {
  flex: 1;
  min-width: 160px;
  font-weight: 600;
}

.report-row .num {
  font-variant-numeric: tabular-nums;
  min-width: 70px;
  text-align: right;
}

.report-row .ot {
  color: #7a5b00;
}

a {
  color: #2f54a0;
}

.muted {
  color: #5a6272;
  font-size: 14px;
}

@media (max-width: 900px) {
  .days {
    grid-template-columns: repeat(2, 1fr);
  }

  .add-form .fields {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  #app {
    padding: 8px;
  }

  .days {
    grid-template-columns: 1fr;
  }

  .day {
    min-height: 0;
  }

  .add-form .fields {
    grid-template-columns: 1fr;
  }

  header.topbar {
    gap: 8px;
  }

  .week-head {
    gap: 6px;
  }
}
