* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f172a;
  color: #f1f5f9;
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  text-align: center;
}

h1 { margin-bottom: 24px; }
h2 { margin: 0 0 12px; }

/* ---------- Mitarbeiter-Grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}

.emp-card {
  background: #334155;
  border: none;
  border-radius: 14px;
  padding: 20px 10px;
  color: #f1f5f9;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.2s ease;
}

.emp-card:active { transform: scale(0.96); }
.emp-card.in { background: #16a34a; }
.emp-card.break { background: #ca8a04; }

.status-sub {
  display: block;
  font-weight: 400;
  font-size: 0.78rem;
  margin-top: 6px;
  opacity: 0.85;
}

/* ---------- Detail-Panel ---------- */

.detail {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #334155;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.detail-header h2 { margin: 0; }

.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  background: #334155;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.status {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 14px;
  border-radius: 12px;
  background: #1e293b;
  margin-bottom: 18px;
}

.status.state-IN { background: #16a34a; }
.status.state-ON_BREAK { background: #ca8a04; }
.status.state-OUT { background: #334155; }

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

button {
  padding: 14px 8px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: #3b82f6;
  color: white;
  cursor: pointer;
  font-family: inherit;
}

button:disabled { background: #1e293b; color: #64748b; cursor: not-allowed; }
button.secondary { background: #334155; }

.message {
  margin-top: 20px;
  min-height: 1.4em;
  font-size: 0.9rem;
  color: #94a3b8;
}

.message.error { color: #f87171; }
.message.success { color: #4ade80; }

.admin-link, .back-link {
  display: inline-block;
  margin-top: 32px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.85rem;
}

/* ---------- PIN-Modal ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10;
}

.overlay[hidden] { display: none; }

.modal {
  background: #1e293b;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.modal-title {
  font-size: 1rem;
  margin: 0 0 16px;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
}

.pin-dots .dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #475569;
  background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pin-dots .dot.filled {
  background: #3b82f6;
  border-color: #3b82f6;
}

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

.keypad button {
  padding: 18px 0;
  font-size: 1.3rem;
}

.keypad button.secondary {
  font-size: 1rem;
}

/* ---------- Admin ---------- */

.admin-container { max-width: 560px; margin: 0 auto; padding: 24px 20px 60px; }
.admin-container h1 { text-align: left; }

#month-picker {
  flex: 1;
  font-size: 1rem;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #f1f5f9;
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.month-nav button {
  flex-shrink: 0;
  width: 44px;
  padding: 10px 0;
  font-size: 1.2rem;
}

.admin-employee-list { display: flex; flex-direction: column; gap: 8px; }

.admin-emp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1e293b;
  border: none;
  border-left: 5px solid #334155;
  border-radius: 10px;
  padding: 14px 16px;
  color: #f1f5f9;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.admin-emp-row.state-IN { border-left-color: #16a34a; }
.admin-emp-row.state-ON_BREAK { border-left-color: #ca8a04; }
.admin-emp-row.state-OUT { border-left-color: #334155; }

.admin-emp-row.selected { outline: 2px solid #3b82f6; }
.admin-emp-row .total { color: #94a3b8; font-variant-numeric: tabular-nums; }

.intervals-section { margin-top: 28px; text-align: left; }
.intervals-section h2 { font-size: 1.05rem; }

.intervals-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.intervals-list li {
  background: #1e293b;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.intervals-list li.ongoing { border-left: 3px solid #16a34a; }
.intervals-list .duration { color: #94a3b8; white-space: nowrap; }
.empty-hint { color: #94a3b8; font-size: 0.9rem; margin-top: 12px; }
