:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --ink: #17202a;
  --muted: #60717c;
  --panel: #ffffff;
  --line: #d9e3e0;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --amber: #b45309;
  --coral: #c2410c;
  --ok: #15803d;
  --bad: #b91c1c;
  --shadow: 0 18px 50px rgba(28, 43, 54, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.hidden {
  display: none !important;
}

.login-view {
  display: grid;
  align-content: center;
  min-height: calc(100vh - 48px);
  gap: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  color: white;
  background: linear-gradient(135deg, var(--teal), #2563eb);
  font-size: 34px;
  font-weight: 800;
  box-shadow: var(--shadow);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 17px;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
  line-height: 1.45;
}

.panel,
.status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 16px;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid #c8d6d2;
  border-radius: 8px;
  padding: 14px 13px;
  color: var(--ink);
  background: #fbfdfc;
  font-size: 16px;
  outline: none;
}

input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

.primary-button,
.icon-button,
.text-button,
.punch-button {
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  min-height: 50px;
  border-radius: 8px;
  color: white;
  background: var(--teal);
}

.primary-button:disabled,
.punch-button:disabled {
  cursor: progress;
  opacity: 0.65;
}

.message {
  min-height: 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.message.error {
  color: var(--bad);
}

.message.success {
  color: var(--ok);
}

.app-view {
  display: grid;
  gap: 16px;
}

.topbar,
.section-heading,
.status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  padding-top: 8px;
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.icon-button,
.text-button {
  min-height: 40px;
  border-radius: 8px;
  color: var(--teal-dark);
  background: #dff3ef;
  padding: 0 12px;
  text-decoration: none;
}

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  font-size: 13px;
}

.status-card {
  padding: 14px;
}

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--teal-dark);
  background: #dff3ef;
  font-size: 12px;
  font-weight: 900;
}

.punch-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.punch-button {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 120px;
  border-radius: 8px;
  padding: 16px 10px;
  color: white;
  text-align: center;
}

.punch-button span {
  font-size: 23px;
  line-height: 1;
}

.punch-button small {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.88;
}

.punch-button.in {
  background: linear-gradient(135deg, var(--teal), #166534);
}

.punch-button.out {
  background: linear-gradient(135deg, var(--coral), var(--amber));
}

.punch-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.empty {
  color: var(--muted);
  font-size: 14px;
}

.punch-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfc;
}

.punch-item strong {
  display: block;
}

.punch-item span {
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  align-self: start;
  border-radius: 999px;
  padding: 5px 8px;
  color: white;
  background: var(--ok);
  font-size: 11px;
  font-weight: 900;
}

.status-pill.rejected {
  background: var(--bad);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.summary-box {
  border-radius: 8px;
  padding: 12px 8px;
  background: #f0f5f3;
  text-align: center;
}

.summary-box strong {
  display: block;
  font-size: 22px;
}

.summary-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 360px) {
  .app-shell {
    padding-inline: 12px;
  }

  .punch-actions {
    grid-template-columns: 1fr;
  }
}
