:root {
  --navy: #0f3a5f;
  --navy-2: #14507f;
  --orange: #f2711c;
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #1c2733;
  --muted: #6b7885;
  --line: #e3e8ee;
  --ok: #1f9d55;
  --err: #c0392b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 42, 67, .08), 0 6px 18px rgba(16, 42, 67, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--navy); color: #fff; padding: 10px 16px;
}
.brand { color: #fff; text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: .3px; }
.brand span { color: var(--orange); }
.nav { display: flex; gap: 14px; margin-left: 8px; }
.nav a { color: #cfe0ee; text-decoration: none; font-weight: 600; font-size: 14px; }
.nav a:hover { color: #fff; }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 14px; }
.who .name { color: #cfe0ee; }
.inline { display: inline; margin: 0; }

/* ---------- layout ---------- */
.wrap { max-width: 880px; margin: 20px auto; padding: 0 16px 60px; }
h1 { font-size: 22px; margin: 4px 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; color: var(--navy); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.r { text-align: right; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px;
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 720px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: 13px; color: #33414f; margin-bottom: 10px; }
label small { color: var(--muted); font-weight: 400; }
input, select, textarea {
  width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit;
  border: 1px solid #cbd5df; border-radius: 8px; background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy-2); border-color: var(--navy-2); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: auto; margin: 0; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.grid .full { grid-column: 1 / -1; }
.grid.mini { margin-top: 10px; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

button {
  font: inherit; font-weight: 700; cursor: pointer; border: 1px solid transparent;
  border-radius: 8px; padding: 10px 16px; background: #e7edf3; color: var(--ink);
}
button:hover { filter: brightness(.97); }
.primary { background: var(--navy); color: #fff; }
.danger { background: #fff; color: var(--err); border-color: #e6b9b3; }
button.danger:hover { background: #fdece9; }
.ghost { background: transparent; border-color: transparent; color: inherit; padding: 6px 8px; }
.who .ghost { color: #cfe0ee; }
.block { width: 100%; }
.big { padding: 16px; font-size: 18px; }
.small { padding: 6px 10px; font-size: 13px; }

/* ---------- auth ---------- */
.auth { max-width: 380px; margin: 8vh auto 0; }
.auth h1 { text-align: center; margin-bottom: 2px; }
.auth .accent { color: var(--orange); }
.auth .sub { text-align: center; color: var(--muted); margin: 0 0 18px; }

/* ---------- flash ---------- */
.flash { border-radius: 8px; padding: 12px 16px; margin: 14px auto; max-width: 880px; font-size: 14px; }
.flash.ok, .flash:not(.err) { background: #e7f6ec; color: #1c6b3c; border: 1px solid #bfe4cd; }
.flash.err { background: #fdecea; color: #932b21; border: 1px solid #f2c2bc; }
main .flash { margin-left: 0; margin-right: 0; }

/* ---------- stats ---------- */
.stats { display: flex; gap: 14px; margin-bottom: 18px; }
.stat { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; }
.stat .k { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.stat .v { display: block; font-size: 24px; font-weight: 800; color: var(--navy); }

/* ---------- clocked-in ---------- */
.clocked-in { border-top: 4px solid var(--ok); }
.ci-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.ci-head h2 { font-size: 20px; margin: 6px 0 0; color: var(--ink); }
.elapsed { text-align: right; }
.elapsed .timer { display: block; font-size: 26px; font-weight: 800; color: var(--ok); font-variant-numeric: tabular-nums; }
.elapsed .since { font-size: 12px; color: var(--muted); }
.notes-form.compact input, .notes-form.compact textarea { margin-bottom: 6px; }
.clockout { margin-top: 12px; }
.clockin .big, .clockout .big { margin-top: 8px; }

.save-hint { display: inline-block; font-size: 12px; height: 16px; margin: 2px 0 8px; }
.save-hint.ok { color: var(--ok); }
.save-hint.locked { color: var(--muted); }

/* ---------- badges ---------- */
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .4px; }
.badge.live { background: #e7f6ec; color: var(--ok); }
.badge.open { background: #e7f6ec; color: var(--ok); }
.badge.done { background: #eef1f4; color: var(--muted); }
.badge.lock { background: #fff3e6; color: #b3600f; }
.badge.admin { background: #e6eef7; color: var(--navy-2); }

/* ---------- entries list (employee) ---------- */
.entries { list-style: none; padding: 0; margin: 0; }
.entry { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.entry.open { border-color: #bfe4cd; }
.entry-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; }
.entry-head .times { color: var(--muted); font-size: 13px; }
.entry .dur { color: var(--navy-2); font-weight: 600; }
.entry .ro { margin: 6px 0 0; font-size: 14px; }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.tbl tr.done td, .tbl tr.inactive td, .tbl tr.approved td { background: #fafbfc; }
.tbl .actions { white-space: nowrap; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tbl details summary { cursor: pointer; }
.tbl .nw div { margin-bottom: 3px; }
.entries-tbl td { font-size: 13px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.filters label { margin: 0; }
.filters .grand { margin-left: auto; align-self: center; color: var(--navy); }

/* horizontal scroll safety on small screens */
@media (max-width: 620px) {
  .card { overflow-x: auto; }
}
