/* WorkCheck In — plain CSS, mobile-first, high contrast, accessible. */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #16202b;
  --muted: #5b6b7b;
  --line: #dfe5ec;
  --brand: #14406b;
  --brand-dark: #0e2c4b;
  --ok: #1c7a3d;
  --warn: #b45309;
  --danger: #b3261e;
  --focus: #005fcc;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 30, 45, 0.1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 0.9em; }
code { background: #eef2f7; padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.9em; word-break: break-all; }
.muted { color: var(--muted); }
.fine-print { color: var(--muted); font-size: 0.85rem; }

a { color: var(--brand); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- buttons ---------- */
.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  font: inherit;
  font-weight: 600;
  color: var(--brand);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65em 1.1em;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
button.primary, .button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-size: 1.05rem;
}
button.primary:hover, .button.primary:hover { background: var(--brand-dark); }
button.secondary, .button.secondary { background: #eef2f7; border-color: #d6dee7; }
button.warn, .button.warn { color: var(--danger); border-color: #efcfcc; }
button.ghost, .button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.small, .button.small { min-height: 34px; padding: 0.35em 0.8em; font-size: 0.88rem; }
.button-row { display: flex; flex-wrap: wrap; gap: 0.6em; align-items: center; }
button[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; margin: 0.9em 0 0.35em; }
input, select {
  font: inherit;
  color: var(--ink);
  width: 100%;
  padding: 0.75em 0.9em;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  min-height: 48px;
}
input[type="checkbox"] { min-height: auto; width: auto; margin-right: 0.5em; accent-color: var(--brand); }
input[type="date"], input[type="search"] { min-height: 44px; }
form .primary, form button.primary { margin-top: 1.1em; width: 100%; }
.inline-form { display: inline-flex; gap: 0.4em; align-items: center; margin: 0; }
.inline-form input { min-height: 36px; width: auto; }
.inline-form button { margin: 0; }

/* ---------- worker UI ---------- */
.worker-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 1rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem;
  width: 100%;
  max-width: 480px;
}
.card.center { text-align: center; }
.card h1 { margin-bottom: 0.25em; }
.hint { color: var(--muted); }
.who { font-size: 1.15rem; margin: 0.9em 0; }
.big-time { font-size: 2.2rem; font-weight: 700; margin: 0.3em 0 0.4em; }
.big-check { color: var(--ok); }
.card.success h1 { color: var(--ok); }

.notice {
  text-align: left;
  background: #fff8e7;
  border: 1px solid #f2d98c;
  border-radius: 10px;
  padding: 0.9em 1em;
  margin: 1.1em 0 0.6em;
}
.notice h2 { font-size: 1rem; }
.notice p { font-size: 0.95rem; margin-bottom: 0.6em; }
.ack { display: flex; align-items: flex-start; gap: 0.5em; font-weight: 500; margin: 0; }
.ack input { margin-right: 0; margin-top: 0.2em; }

.alert { border-radius: 10px; padding: 0.75em 1em; margin: 0.9em 0; }
.alert.error { background: #fdeceb; border: 1px solid #f2b8b5; color: #7a1f1a; }
.alert.success { background: #e8f6ec; border: 1px solid #b7e0c4; color: var(--ok); }

.wifi-ok {
  display: inline-block;
  background: #e2f3e7;
  color: var(--ok);
  border: 1px solid #b7e0c4;
  border-radius: 999px;
  padding: 0.35em 0.9em;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0.2em 0 0.9em;
}

.close-note {
  margin: 1em 0 0.4em;
  font-weight: 600;
  color: var(--ink);
}

/* ---------- admin UI ---------- */
.admin-topbar { background: var(--brand); color: #fff; }
.topbar-inner { max-width: 1080px; margin: 0 auto; padding: 0.6rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand { font-weight: 700; color: #fff; }
.logout-form { margin: 0; display: inline-flex; }
.logout-form button { color: #dbe7f4; min-height: 34px; padding: 0.2em 0.7em; }

.admin-shell { max-width: 1080px; margin: 0 auto; padding: 1rem; display: grid; grid-template-columns: 200px 1fr; gap: 1.2rem; }
.admin-nav { display: flex; flex-direction: column; gap: 0.2rem; }
.nav-link { padding: 0.55em 0.9em; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; }
.nav-link:hover { background: #e8edf4; }
.nav-link.active { background: var(--brand); color: #fff; }
.admin-main { min-width: 0; }

@media (max-width: 760px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { flex-direction: row; overflow-x: auto; gap: 0.4rem; padding-bottom: 0.3rem; }
  .nav-link { white-space: nowrap; }
}

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; margin-bottom: 1.1rem; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.8rem; margin-bottom: 1.1rem; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; text-decoration: none; color: var(--ink); display: block; }
.stat-value { display: block; font-size: 1.9rem; font-weight: 700; color: var(--brand); }
.stat-label { color: var(--muted); font-size: 0.9rem; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.data-table th, .data-table td { text-align: left; padding: 0.6em 0.75em; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: none; }
.data-table .actions { white-space: nowrap; }
.data-table-wrap { overflow-x: auto; }
.panel > .data-table-wrap, .panel > .data-table { display: block; width: 100%; overflow-x: auto; }

.badge { display: inline-block; padding: 0.15em 0.6em; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: #e8edf4; color: var(--muted); }
.badge.ok { background: #e2f3e7; color: var(--ok); }
.badge.warn { background: #fdf0dc; color: var(--warn); }

.search-row, .filter-row { display: flex; flex-wrap: wrap; gap: 0.7em; align-items: flex-end; margin-bottom: 0.8rem; }
.search-row input { flex: 1; min-width: 220px; }
.filter-row label { margin: 0; }
.filter-row input, .filter-row select { width: auto; min-width: 150px; margin-top: 0.25em; display: block; }

.pagination { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-top: 1rem; }
.page { display: inline-flex; min-width: 2.2em; height: 2.2em; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; padding: 0 0.5em; }
.page.current { background: var(--brand); color: #fff; border-color: var(--brand); }

.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 0.35em 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: none; }

.login-card { max-width: 380px; margin: 0 auto; }
.login-card button { width: 100%; }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}