:root {
  --bg: #f4f8fb;
  --card: #ffffff;
  --text: #0f1b2d;
  --muted: #5a6b7d;
  --navy: #0b2a4a;
  --ice: #d7eef9;
  --ice-strong: #2b8fc9;
  --ok: #0d7a4f;
  --ok-bg: #e6f7ef;
  --err: #b42318;
  --err-bg: #fdeceb;
  --border: #d4e0ea;
  --shadow: 0 8px 24px rgba(15, 27, 45, 0.08);
  --radius: 14px;
  --tap: 48px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: linear-gradient(180deg, #eaf5fb 0%, var(--bg) 40%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
}

.app {
  max-width: 440px;
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
}

.app.wide { max-width: 860px; }
.app.narrow { max-width: 400px; }

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.brand { display: flex; gap: 0.75rem; align-items: center; }
.brand-mark {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--ice);
  color: var(--navy);
  display: grid; place-items: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

h1 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.subtitle { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.9rem; }

.link-admin {
  color: var(--ice-strong);
  font-weight: 600;
  text-decoration: none;
  padding: 0.5rem;
  white-space: nowrap;
}
.link-admin:hover { text-decoration: underline; }

.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.inline { display: inline; }
.inline-form { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.15rem 1.25rem;
  margin-bottom: 1rem;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.section-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: var(--navy);
}

.section-title.mt, .mt { margin-top: 1rem; }

.stack { display: flex; flex-direction: column; gap: 0.85rem; }

.field { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 600; font-size: 0.92rem; }
.field.grow { flex: 1; min-width: 140px; }

input, select, button { font: inherit; }

input, select {
  min-height: var(--tap);
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  width: 100%;
}

input:focus, select:focus {
  outline: 2px solid var(--ice-strong);
  outline-offset: 1px;
  border-color: var(--ice-strong);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--tap);
  padding: 0.7rem 1.1rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.btn-block { width: 100%; }
.btn-xl {
  min-height: 64px;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}

.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #14385f; }

.btn-secondary {
  background: var(--ice);
  color: var(--navy);
  border-color: #b9dcea;
}
.btn-secondary:hover { background: #c9e8f5; }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--navy);
  min-height: 40px;
  padding: 0.4rem 0.75rem;
  font-weight: 600;
}

.btn-danger-ghost {
  background: transparent;
  border-color: #f0c4c0;
  color: var(--err);
  min-height: 40px;
  padding: 0.4rem 0.75rem;
  font-weight: 600;
}

.banner {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-weight: 600;
}
.banner.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #b7e4cd; }
.banner.err { background: var(--err-bg); color: var(--err); border: 1px solid #f3c1bc; }

.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 0.5rem 0 0; }
.status-hint { margin: 0; }

.summary-card .status-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.status-pill.in { background: #d9f5e8; color: var(--ok); }
.status-pill.out { background: #e8eef4; color: var(--muted); }

.hours-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.hours-box {
  background: var(--ice);
  border-radius: 12px;
  padding: 0.85rem;
}

.hours-label { font-size: 0.8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.hours-value { font-size: 1.6rem; font-weight: 800; color: var(--navy); line-height: 1.2; }
.hours-value .unit { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.hours-hint { font-size: 0.75rem; color: var(--muted); margin-top: 0.2rem; }

.last-punch { margin: 0 0 1rem; font-size: 0.95rem; }

.punch-list, .simple-list, .emp-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.punch-list li, .simple-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.punch-list li:last-child, .simple-list li:last-child { border-bottom: 0; }

.tag {
  display: inline-block;
  min-width: 2.6rem;
  text-align: center;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
}
.tag.in { background: #d9f5e8; color: var(--ok); }
.tag.out { background: #e8eef4; color: #3d4f63; }
.tag.muted-tag { background: #eee; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--border);
}
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }

.add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.emp-row {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.emp-row.inactive { opacity: 0.65; }
.emp-main { margin-bottom: 0.5rem; display: flex; gap: 0.5rem; align-items: center; }
.emp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.emp-actions input {
  min-height: 40px;
  width: auto;
  max-width: 160px;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 1.5rem;
}

@media (max-width: 480px) {
  .hours-value { font-size: 1.35rem; }
  .emp-actions input { max-width: 120px; }
}


.brand-logo {
  height: 48px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  border-radius: 8px;
  background: #000;
  flex-shrink: 0;
}
.brand-mark { display: none; }


.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.btn-row .btn-xl {
  width: 100%;
}
.btn-emphasis {
  box-shadow: 0 0 0 2px #7eb6cb;
}


.name-link {
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
}
.name-link:hover { text-decoration: underline; color: var(--ice-strong); }

.range-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}
.range-form .field { min-width: 140px; }

.btn-row-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.totals-row td {
  border-bottom: 0;
  padding-top: 0.85rem;
  background: #f7fbfd;
}
