:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #66737d;
  --line: #d8e0e5;
  --panel: #ffffff;
  --wash: #f4f7f8;
  --accent: #0f766e;
  --accent-strong: #0b5d56;
  --danger: #b42318;
  --warning: #b7791f;
  --ok: #1f7a4d;
  --shadow: 0 18px 40px rgba(24, 39, 50, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.login-wrap {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
}

.login-panel,
.panel,
.metric,
.employee-home,
.setup-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel {
  width: min(420px, 100%);
  padding: 26px;
}

.brand-row,
.topbar,
.section-head,
.metric-grid,
.action-row,
.form-grid,
.status-row,
.shift-actions,
.employee-list,
.location-list {
  display: flex;
  gap: 12px;
}

.brand-row,
.topbar,
.section-head,
.status-row,
.shift-actions {
  align-items: center;
}

.topbar,
.section-head {
  justify-content: space-between;
}

.topbar {
  margin-bottom: 16px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 3px;
  font-size: 1.65rem;
}

h2 {
  margin-bottom: 0;
  font-size: 1.1rem;
}

h3 {
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.86rem;
}

.stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 11px;
}

textarea {
  min-height: 74px;
  resize: vertical;
}

.primary,
.secondary,
.danger,
.ghost {
  min-height: 42px;
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 700;
}

.primary {
  background: var(--accent);
  color: #ffffff;
}

.primary:hover {
  background: var(--accent-strong);
}

.secondary {
  border: 1px solid var(--line);
  background: #eef4f2;
  color: var(--accent-strong);
}

.danger {
  background: #fff0ed;
  color: var(--danger);
}

.ghost {
  background: transparent;
  color: var(--muted);
}

.wide {
  width: 100%;
}

.error {
  min-height: 1.2em;
  color: var(--danger);
  font-weight: 700;
}

.success {
  color: var(--ok);
  font-weight: 700;
}

.view-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.employee-home {
  padding: 18px;
}

.clock-state {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-radius: 8px;
  background: #eef8f5;
  border: 1px solid #cce9e2;
}

.clock-state.out {
  background: #fff8ed;
  border-color: #f1d7ac;
}

.clock-state strong {
  font-size: 1.25rem;
}

.punch-button {
  min-height: 66px;
  font-size: 1.2rem;
}

.panel {
  padding: 16px;
}

.metric-grid {
  flex-wrap: wrap;
}

.metric {
  flex: 1 1 190px;
  padding: 14px;
}

.metric-value {
  display: block;
  margin-top: 6px;
  font-size: 1.45rem;
  font-weight: 800;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  padding: 8px 12px;
  font-weight: 700;
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td input,
td select {
  min-width: 150px;
}

td .note-input {
  min-width: 220px;
}

tr:last-child td {
  border-bottom: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 800;
}

.pill.approved {
  background: #eaf7ef;
  color: var(--ok);
}

.pill.pending {
  background: #fff5df;
  color: var(--warning);
}

.pill.open {
  background: #eef4ff;
  color: #2556a3;
}

.form-grid {
  flex-wrap: wrap;
  align-items: end;
}

.form-grid > * {
  flex: 1 1 190px;
}

.form-grid .small-field {
  flex: 0 1 140px;
}

.setup-block {
  padding: 14px;
}

.employee-list,
.location-list {
  flex-direction: column;
}

.setup-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.3fr) minmax(110px, 0.7fr) auto auto;
  gap: 10px;
  align-items: end;
}

.location-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(180px, 1.2fr) auto auto;
  gap: 10px;
  align-items: end;
}

.checkbox-label {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-transform: none;
}

.checkbox-label input {
  width: auto;
  min-height: auto;
}

.today-list {
  display: grid;
  gap: 8px;
}

.today-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

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

  .topbar,
  .section-head,
  .action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .setup-row,
  .location-row {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    flex-direction: column;
  }

  .metric {
    flex: 1 1 auto;
  }

  .login-panel {
    padding: 20px;
  }
}
