:root {
  --ink: #172029;
  --muted: #66717d;
  --line: #dce3e8;
  --paper: #f5f7f8;
  --card: #ffffff;
  --brand: #0d6b62;
  --brand-dark: #074c46;
  --blue: #155eef;
  --danger: #b42318;
  --shadow: 0 18px 55px rgba(27, 39, 49, 0.09);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
  height: 72px;
  padding: 0 max(24px, calc((100vw - 1120px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .08em; }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 9px; background: var(--brand); color: white; letter-spacing: 0;
}
.text-button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 10px; }
.text-button:hover { color: var(--ink); }
.page-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 70px; }
.hero { display: grid; grid-template-columns: 1fr 420px; gap: 54px; align-items: center; }
.eyebrow { margin: 0 0 8px; color: var(--brand); font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2.25rem, 6vw, 4.4rem); line-height: .98; letter-spacing: -.055em; }
.intro { color: var(--muted); font-size: 1.06rem; max-width: 560px; }
.presence-card, .week-card, .login-card { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.presence-card { border-radius: 24px; padding: 24px; }
.status-line { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.status-line strong, .status-line small { display: block; }
.status-line small { color: var(--muted); margin-top: 2px; }
.status-dot { width: 12px; height: 12px; border-radius: 99px; background: #98a2b3; box-shadow: 0 0 0 5px #f0f2f4; }
.present .status-dot { background: #12b76a; box-shadow: 0 0 0 5px #e6f8ef; }
.punch-button {
  width: 100%; border: 0; border-radius: 16px; padding: 18px 20px; color: white;
  text-align: left; cursor: pointer; transition: transform .15s ease, opacity .15s ease;
}
.punch-button:hover { transform: translateY(-1px); }
.punch-button:disabled { opacity: .65; cursor: wait; transform: none; }
.punch-button span, .punch-button small { display: block; }
.punch-button span { font-size: 1.05rem; font-weight: 800; }
.punch-button small { opacity: .8; margin-top: 3px; }
.checkin { background: var(--brand); }
.checkout { background: var(--danger); }
.alert { margin: 28px 0 0; padding: 14px 16px; border-radius: 12px; border: 1px solid; }
.alert-info { color: #175cd3; background: #eff8ff; border-color: #b2ddff; }
.alert-error { color: #912018; background: #fef3f2; border-color: #fecdca; }
.history { margin-top: 70px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 22px; }
h2 { margin: 0; font-size: 2rem; letter-spacing: -.035em; }
.pager { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.pager a { color: var(--brand-dark); background: white; border: 1px solid var(--line); padding: 9px 12px; border-radius: 10px; text-decoration: none; font-weight: 650; }
.week-list { display: grid; gap: 18px; }
.week-card { border-radius: 20px; padding: 23px; box-shadow: 0 8px 30px rgba(27,39,49,.05); }
.week-card.current { border-color: #8dd7cd; box-shadow: 0 12px 38px rgba(13,107,98,.1); }
.week-summary { display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.week-label { color: var(--brand); font-weight: 800; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; }
.week-summary h3 { margin: 3px 0 0; font-size: 1.12rem; }
.week-total { text-align: right; }
.week-total strong, .week-total span { display: block; }
.week-total strong { font-size: 1.6rem; letter-spacing: -.04em; }
.week-total span { color: var(--muted); font-size: .82rem; }
.progress { height: 7px; background: #e8eeee; border-radius: 99px; overflow: hidden; margin: 18px 0 2px; }
.progress span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 20px; }
.day { padding: 12px 10px; border-radius: 12px; background: #f6f8f9; }
.day span, .day small, .day strong { display: block; }
.day span { font-size: .82rem; font-weight: 750; }
.day small { color: var(--muted); margin: 2px 0 11px; }
.day strong { font-size: .95rem; }
.day.muted { opacity: .55; }
.empty-state { padding: 30px; text-align: center; color: var(--muted); background: white; border: 1px dashed var(--line); border-radius: 16px; }
footer { text-align: center; color: var(--muted); font-size: .78rem; padding: 0 20px 34px; }

.login-body { min-height: 100vh; background: radial-gradient(circle at 20% 10%, #d7eee9, transparent 34%), var(--paper); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); padding: 38px; border-radius: 26px; }
.login-card .brand { margin-bottom: 42px; }
.login-card h1 { font-size: 3rem; }
.login-form { display: grid; gap: 9px; margin-top: 28px; }
.login-form label { margin-top: 9px; font-weight: 700; font-size: .88rem; }
.login-form input { border: 1px solid #cbd5dc; border-radius: 11px; padding: 13px 14px; background: white; }
.login-form input:focus { outline: 3px solid rgba(21,94,239,.16); border-color: var(--blue); }
.primary-button { margin-top: 15px; border: 0; border-radius: 12px; padding: 14px; background: var(--brand); color: white; font-weight: 800; cursor: pointer; }

@media (max-width: 820px) {
  .page-shell { width: min(100% - 28px, 680px); padding-top: 34px; }
  .hero { grid-template-columns: 1fr; gap: 30px; }
  .days { grid-template-columns: repeat(2, 1fr); }
  .day:last-child { grid-column: span 2; }
}
@media (max-width: 520px) {
  .topbar { height: 64px; padding: 0 16px; }
  .brand-mark { width: 30px; height: 30px; }
  .page-shell { width: min(100% - 22px, 480px); }
  .presence-card, .week-card { border-radius: 16px; padding: 18px; }
  .section-heading, .week-summary { align-items: stretch; flex-direction: column; }
  .week-total { text-align: left; }
  .pager { justify-content: flex-start; }
  .login-card { padding: 26px; }
}

