:root {
  color-scheme: light;
  --ink: #102a2a;
  --muted: #64748b;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --surface: #ffffff;
  --line: #dbe4e6;
  --danger: #b91c1c;
  --warning: #92400e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: #eef5f4;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(16px, env(safe-area-inset-top)) 18px 14px;
  background: var(--brand);
  color: white;
}

.topbar h1 { margin: 0; font-size: 1.35rem; }
.topbar .eyebrow { color: #ccfbf1; }
.portal-link {
  display: inline-block;
  margin-bottom: 8px;
  color: #d9fffa;
  font-size: .75rem;
  text-decoration: none;
}

main { width: min(760px, 100%); margin: 0 auto; padding: 16px 14px 48px; }

.card {
  margin-bottom: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(15, 118, 110, 0.06);
}

.card h2 { margin: 0 0 10px; font-size: 1.1rem; }
.card p { line-height: 1.6; }
.hidden { display: none !important; }

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.message {
  margin-bottom: 14px;
  padding: 13px 15px;
  border-radius: 10px;
  background: #dcfce7;
  color: #166534;
  line-height: 1.5;
}
.message.error { background: #fee2e2; color: #991b1b; }
.message.warn { background: #fef3c7; color: var(--warning); }

.field-message {
  margin: 10px 0 0;
  padding: 11px 12px;
  border: 2px solid #f59e0b;
  border-radius: 9px;
  background: #fef3c7;
  color: var(--warning);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.5;
}

.field-error { border-color: #f59e0b; outline: 3px solid rgba(245, 158, 11, 0.2); }

label, legend {
  display: block;
  margin: 12px 0 6px;
  color: #334155;
  font-size: 0.83rem;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #b9c8cc;
  border-radius: 9px;
  background: white;
  color: var(--ink);
}

textarea { resize: vertical; }

.primary, .secondary {
  border: 0;
  border-radius: 9px;
  padding: 11px 15px;
  font-weight: 700;
}
.primary { width: 100%; margin-top: 14px; background: var(--brand); color: white; }
.secondary { background: #dff4f1; color: var(--brand-dark); }
.text-button { border: 0; background: transparent; color: white; text-decoration: underline; }

.fine-print { color: var(--muted); font-size: 0.78rem; }
.profile-card, .section-heading { display: flex; justify-content: space-between; align-items: center; }
.profile-card h2 { margin: 0; }
.badge { padding: 5px 9px; border-radius: 999px; background: #ccfbf1; color: var(--brand-dark); font-size: 0.76rem; font-weight: 700; }

.clock-card { text-align: center; }
.today { margin: 0; color: var(--muted); }
.clock { margin: 4px 0; font-size: clamp(3rem, 15vw, 5.5rem); font-weight: 800; letter-spacing: -0.05em; color: var(--brand-dark); }
.schedule { margin: 0; color: var(--muted); font-size: 0.86rem; }

.status-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.status-item { padding: 11px; border-radius: 10px; background: #f1f5f9; }
.status-item span { display: block; color: var(--muted); font-size: 0.72rem; }
.status-item strong { display: block; margin-top: 3px; font-size: 1.08rem; }

fieldset { margin: 14px 0; padding: 0; border: 0; }
.radio-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 8px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}
.radio-option input { width: auto; margin-top: 3px; }
.radio-option label { margin: 0; font-size: 0.9rem; }
.radio-option small { display: block; margin-top: 3px; color: var(--muted); font-weight: 400; }

.location-box {
  display: flex;
  gap: 10px;
  margin: 16px 0;
  padding: 12px;
  border-radius: 10px;
  background: #f1f5f9;
  font-size: 0.82rem;
}
.location-box p { margin: 2px 0 0; color: var(--muted); }

.punch-button {
  width: 100%;
  min-height: 64px;
  border: 0;
  border-radius: 13px;
  background: var(--brand);
  color: white;
  font-size: 1.15rem;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.22);
}
.punch-button.out { background: #1d4ed8; }
.punch-button:disabled { background: #94a3b8; box-shadow: none; cursor: not-allowed; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
th, td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap; }
th { color: #475569; background: #f8fafc; }
.muted { color: var(--muted); }

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
  margin: 14px 0;
}
.filters label { margin-top: 0; }
.filters .secondary { min-height: 45px; }

.site-manager {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.site-manager h3 { margin: 0; font-size: 1rem; }
.site-form {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr .8fr;
  gap: 8px;
}
.site-form label { margin-top: 4px; }
.site-actions { display: flex; gap: 8px; margin-top: 10px; }
.site-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.site-chip {
  padding: 6px 9px;
  border: 1px solid #99d5ce;
  border-radius: 999px;
  background: white;
  color: var(--brand-dark);
  font-size: .76rem;
}

code { padding: 2px 5px; border-radius: 4px; background: #e2e8f0; }
a { color: var(--brand-dark); }

@media (max-width: 520px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .secondary { grid-column: 1 / -1; }
  .status-panel { grid-template-columns: 1fr 1fr; }
  .site-form { grid-template-columns: 1fr 1fr; }
}
