:root {
  --ink: #1b1f24;
  --ink-soft: #5b6470;
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e1e4e9;
  --teal: #0f6b5c;
  --teal-dark: #0b5044;
  --slate: #2d3742;
  --amber: #b8862c;
  --danger: #a5372c;
  --radius: 10px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

a { color: var(--teal-dark); }

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* --- Login --- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 32px;
  width: 100%;
  max-width: 360px;
}

.login-card h1 {
  font-size: 1.3rem;
  margin: 0 0 4px;
}

.login-card p.sub {
  color: var(--ink-soft);
  margin: 0 0 24px;
  font-size: 0.9rem;
}

/* --- Top bar --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--slate);
  color: #fff;
}

.topbar .who { font-size: 0.9rem; opacity: 0.85; }
.topbar a.logout {
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
}
.topbar a.logout:hover { background: rgba(255,255,255,0.1); }

.topbar .brand { font-weight: 600; letter-spacing: 0.01em; }

/* --- Form elements --- */
label {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
  margin-bottom: 16px;
  background: #fff;
  color: var(--ink);
}

button {
  font-family: inherit;
  font-size: 0.95rem;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
}

button.primary { background: var(--teal); color: #fff; }
button.primary:hover { background: var(--teal-dark); }

button.stop { background: var(--slate); color: #fff; }
button.stop:hover { background: #1e262f; }

button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
button.ghost:hover { background: #eef0f3; }

button:disabled { opacity: 0.5; cursor: not-allowed; }

button.wide { width: 100%; }

.error {
  background: #fbeceA;
  color: var(--danger);
  border: 1px solid #f0c9c3;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.hint {
  background: #eef6f3;
  color: var(--teal-dark);
  border: 1px solid #cfe6de;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

/* --- Clock card (employee dashboard) --- */
.clock-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  margin-bottom: 28px;
}

.clock-time {
  font-size: 2.6rem;
  font-weight: 600;
  margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
}

.clock-status {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 22px;
}

.clock-status.active { color: var(--teal-dark); font-weight: 600; }

/* --- Cards & sections --- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 24px;
}

.card h2 {
  font-size: 1.05rem;
  margin: 0 0 16px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-head h2 { margin: 0; }

/* --- Table --- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: none;
}

tr:last-child td { border-bottom: none; }

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

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge.active { background: #eef6f3; color: var(--teal-dark); }
.badge.inactive { background: #f2eeee; color: #8a8078; }
.badge.admin { background: #f5eee0; color: var(--amber); }
.badge.pending { background: #f5eee0; color: var(--amber); }
.badge.approved { background: #eef6f3; color: var(--teal-dark); }
.badge.rejected { background: #fbeceA; color: var(--danger); }

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 18px;
}
.filters > div { min-width: 160px; }
.filters label { margin-bottom: 4px; }
.filters input, .filters select { margin-bottom: 0; }

.empty-state {
  text-align: center;
  color: var(--ink-soft);
  padding: 28px 10px;
  font-size: 0.9rem;
}

.temp-pass {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  background: #f5eee0;
  padding: 2px 8px;
  border-radius: 5px;
}

.new-employee-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.new-employee-form > div { flex: 1; min-width: 160px; margin-bottom: 0; }
.new-employee-form input, .new-employee-form select { margin-bottom: 0; }
