:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #687385;
  --line: #dfe4ea;
  --brand: #256f67;
  --brand-strong: #15564f;
  --accent: #c77726;
  --danger: #b42318;
  --warning: #a15c07;
  --ok: #067647;
  --info: #225a9f;
  --shadow: 0 18px 50px rgba(18, 28, 45, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
button, input, select, textarea { font: inherit; }
button {
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  padding: 0.7rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
button.secondary { background: #eef2f4; color: var(--ink); }
button.danger { background: var(--danger); }
button.ghost { background: transparent; color: var(--brand); padding: 0.35rem 0.45rem; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  background:
    linear-gradient(115deg, rgba(37, 111, 103, 0.9), rgba(199, 119, 38, 0.45)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='700'%3E%3Crect width='900' height='700' fill='%23eff4f3'/%3E%3Cg opacity='.55'%3E%3Crect x='90' y='100' width='250' height='120' rx='8' fill='%23ffffff'/%3E%3Crect x='380' y='100' width='420' height='120' rx='8' fill='%23ffffff'/%3E%3Crect x='90' y='270' width='710' height='70' rx='8' fill='%23ffffff'/%3E%3Crect x='90' y='370' width='330' height='170' rx='8' fill='%23ffffff'/%3E%3Crect x='460' y='370' width='340' height='170' rx='8' fill='%23ffffff'/%3E%3C/g%3E%3C/svg%3E") center/cover;
}
.login-copy {
  color: #fff;
  align-self: end;
  padding: 4rem;
  max-width: 780px;
}
.login-copy h1 { font-size: clamp(2.5rem, 7vw, 5.4rem); line-height: 0.95; margin: 0 0 1rem; letter-spacing: 0; }
.login-copy p { font-size: 1.1rem; max-width: 55ch; }
.login-panel {
  background: rgba(255, 255, 255, 0.96);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow);
}
.sample-logins { display: grid; gap: 0.5rem; margin-top: 1rem; }
.sample-logins button { text-align: left; background: #f3f6f7; color: var(--ink); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.sidebar {
  background: #111f24;
  color: #e9f1f2;
  padding: 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.brand { display: flex; align-items: center; gap: 0.65rem; padding: 0.7rem; font-weight: 900; font-size: 1.1rem; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: #1b1308; }
.nav { display: grid; gap: 0.25rem; margin-top: 1rem; }
.nav a {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.72rem;
  border-radius: 8px;
  color: #c9d5d8;
}
.nav a.active, .nav a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.4rem;
  background: rgba(246, 247, 249, 0.92);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--line);
}
.content { padding: 1.3rem; max-width: 1480px; width: 100%; margin: 0 auto; }
.mobile-nav { display: none; }
.page-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.page-title h1 { font-size: 1.65rem; margin: 0; letter-spacing: 0; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 1rem; }
.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two { grid-template-columns: 1.2fr 0.8fr; }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 1rem;
}
.card h2, .card h3 { margin: 0 0 0.8rem; letter-spacing: 0; }
.metric strong { display: block; font-size: 2rem; line-height: 1; margin-bottom: 0.35rem; }
.clock-card { display: grid; gap: 1rem; }
.clock-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.clock-actions button { min-height: 82px; font-size: 1.1rem; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; background: #fff; }
th, td { padding: 0.72rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; background: #f8fafb; }
tr:hover td { background: #fbfcfd; }
.toolbar { display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.field { display: grid; gap: 0.35rem; margin-bottom: 0.8rem; }
.field label { color: var(--muted); font-size: 0.84rem; font-weight: 700; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.68rem 0.75rem;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 86px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}
.badge.ok, .badge.approved, .badge.complete, .badge.clocked-in { color: var(--ok); background: #e7f6ed; }
.badge.pending, .badge.needs-review { color: var(--warning); background: #fff3dc; }
.badge.denied, .badge.missing, .badge.missing-clock-out, .badge.missing-clock-in { color: var(--danger); background: #fde8e7; }
.badge.clocked-out, .badge.cancelled { color: var(--muted); background: #eef1f4; }
.badge.pto, .badge.on-pto { color: var(--info); background: #e8f1fb; }
.tabs { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs button { background: #e9eef1; color: var(--ink); }
.tabs button.active { background: var(--brand); color: #fff; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: auto; background: #fff; }
.day { min-height: 138px; border-right: 1px solid var(--line); padding: 0.7rem; }
.day:last-child { border-right: 0; }
.shift, .pto-chip {
  margin-top: 0.45rem;
  padding: 0.45rem;
  border-left: 4px solid var(--brand);
  background: #eef8f6;
  border-radius: 6px;
  font-size: 0.84rem;
}
.shift.conflict { border-left-color: var(--danger); background: #fff0ef; }
.pto-chip { border-left-color: var(--info); background: #edf5ff; }
.empty { color: var(--muted); padding: 1rem; text-align: center; border: 1px dashed var(--line); border-radius: 8px; background: #fff; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 20, 25, 0.52);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 10;
}
.modal { width: min(760px, 100%); max-height: 90vh; overflow: auto; background: #fff; border-radius: 8px; padding: 1rem; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
#toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: 380px;
  z-index: 20;
}
.toast {
  background: #111f24;
  color: #fff;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-top: 0.5rem;
}
.danger-text { color: var(--danger); }
.row-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bar { height: 10px; border-radius: 999px; background: #e8edf0; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand); }

@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-copy { padding: 2rem; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav { display: block; }
  .topbar { align-items: stretch; flex-direction: column; }
  .metrics, .two, .three, .report-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .content { padding: 1rem; }
  .page-title { flex-direction: column; }
  .calendar { grid-template-columns: 1fr; }
  .day { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 560px) {
  .clock-actions { grid-template-columns: 1fr; }
  .login-panel { padding: 1.2rem; }
  .login-copy h1 { font-size: 2.4rem; }
}
