* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
.page { max-width: 1100px; margin: 0 auto; padding: 40px 20px; }
.page.narrow { max-width: 420px; }
.page.medium { max-width: 520px; }
.page.wide { max-width: 1200px; }

.text-center { text-align: center; }
.muted { color: #64748b; }
.title { font-size: 30px; font-weight: 800; margin: 0 0 8px; }
.subtitle { font-size: 15px; color: #64748b; margin: 0 0 32px; }

.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  padding: 24px;
}

/* Kiosk grid */
.kiosk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.employee-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 24px 16px;
  text-align: center;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.employee-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,.08);
  border-color: #cbd5e1;
}
.avatar {
  width: 60px; height: 60px;
  border-radius: 999px;
  background: #1e293b;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
  margin: 0 auto 12px;
}
.employee-name { font-weight: 600; color: #1e293b; }
.employee-role { font-size: 13px; color: #64748b; margin-top: 2px; }

/* Buttons */
.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn-primary { background: #1e293b; color: #fff; }
.btn-secondary { background: #e2e8f0; color: #334155; }
.btn-success { background: #16a34a; color: #fff; }
.btn-danger-link { color: #ef4444; background: none; padding: 0; font-weight: 500; }
.btn-danger-link:hover { color: #b91c1c; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-row { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }
.btn-row.left { justify-content: flex-start; }
.hidden { display: none !important; }

/* Nav */
.nav {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-links { display: flex; gap: 24px; font-size: 14px; font-weight: 600; }
.nav-links a { color: #64748b; }
.nav-links a.active { color: #1e293b; }
.nav-user { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.nav-user .muted { font-size: 14px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: #475569; margin-bottom: 6px; }
.form-input, .form-select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}
.alert-error {
  background: #fef2f2;
  color: #dc2626;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* Table */
.table-wrap { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead { background: #f8fafc; color: #64748b; text-align: left; }
th, td { padding: 12px 16px; }
tbody tr { border-top: 1px solid #f1f5f9; }
.text-right { text-align: right; }
.thumb { width: 40px; height: 40px; border-radius: 8px; object-cover: cover; object-fit: cover; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-active { background: #dcfce7; color: #15803d; }
.badge-inactive { background: #e2e8f0; color: #64748b; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header h1 { margin: 0; }

/* Kiosk capture screen */
.employee-title { font-size: 20px; font-weight: 700; margin: 0; }
.action-label { font-size: 17px; font-weight: 700; margin: 4px 0 0; }
.action-in { color: #16a34a; }
.action-out { color: #d97706; }
.camera-wrap {
  margin-top: 16px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  position: relative;
}
.camera-wrap video, .camera-wrap canvas { width: 100%; display: block; }
.status-msg { font-size: 13px; color: #64748b; margin-top: 10px; min-height: 18px; }
.back-link { font-size: 14px; color: #64748b; }

/* Attendance photo lightbox */
.thumb-btn {
  border: none;
  background: none;
  padding: 0;
  cursor: zoom-in;
  border-radius: 8px;
  line-height: 0;
}
.thumb-btn:hover .thumb { opacity: .85; }
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: zoom-out;
}
.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 32px;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
}
