* {
  box-sizing: border-box;
}

/* 2026-05-27: Keep native hidden semantics deterministic for modal state toggles. */
[hidden] {
  display: none !important;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(circle at top, #f0fbff, #e4f2ff 55%, #d9e1ff);
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
}

.card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 1.2rem;
  padding: 2rem;
  width: min(480px, 90vw);
  box-shadow: 0 25px 80px rgba(20, 41, 74, 0.15);
  text-align: center;
}

/* 2026-08-16: index.html layout — "currently IN" (left) / camera card (middle) / "recently OUT" (right). */
.app-layout {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.active-list-panel {
  width: 320px;
  max-width: 90vw;
  height: 600px;
  max-height: 80vh;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 1.2rem;
  box-shadow: 0 25px 80px rgba(20, 41, 74, 0.15);
  overflow: hidden;
}

#activeListPanel {
  order: -1;
}

#outListPanel {
  order: 1;
}

.active-list-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@media (max-width: 1180px) {
  .app-layout {
    flex-direction: column;
    align-items: center;
  }

  .active-list-panel {
    width: min(480px, 90vw);
    height: 420px;
  }

  #activeListPanel {
    order: 1;
  }

  #outListPanel {
    order: 2;
  }
}

h1 {
  margin-top: 0;
  margin-bottom: 0.25rem;
  color: #0f172a;
}

.lead {
  color: #334155;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1rem;
}

.button {
  border: none;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  background: #0ea5e9;
  color: white;
  cursor: pointer;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.button.secondary {
  background: #e2e8f0;
  color: #0f172a;
}

.button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.preview {
  position: relative;
  min-height: 220px;
  border-radius: 1rem;
  border: 2px dashed #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  margin-bottom: 1rem;
}

.preview img,
.preview video {
  max-width: 100%;
  max-height: 320px;
  border-radius: 1rem;
}

#status {
  margin: 0;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 0.95rem;
}

.match-info {
  margin: 0.35rem 0 0.9rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

.form-grid {
  display: grid;
  gap: 0.75rem;
  text-align: left;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: #475569;
}

.form-grid input,
.form-grid textarea {
  border-radius: 0.5rem;
  border: 1px solid #cbd5f5;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  outline: none;
  transition: border 0.2s ease;
}

.form-grid input:focus,
.form-grid textarea:focus {
  border-color: #0ea5e9;
}

.upload-button {
  position: relative;
  cursor: pointer;
}

.upload-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.submit-button {
  width: 100%;
  justify-self: stretch;
}

.mode-label {
  margin: 0.5rem 0 0.9rem;
  font-size: 0.95rem;
  color: #475569;
}

.control-button {
  min-width: 160px;
}

.capture-btn {
  margin-bottom: 0;
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab {
  flex: 1;
  padding: 0.65rem 0;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  background: #e2e8f0;
  color: #0f172a;
  transition: background 0.2s ease, color 0.2s ease;
}

.tab.active {
  background: #0ea5e9;
  color: #fff;
}

.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 20;
}

.login-overlay.visible {
  display: flex;
}

.login-card {
  background: #fff;
  border-radius: 1rem;
  padding: 2rem;
  width: min(420px, 90vw);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  text-align: center;
}

.login-card form {
  display: grid;
  gap: 0.75rem;
  text-align: left;
}

.login-card label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 600;
  color: #0f172a;
}

.login-card input {
  border-radius: 0.5rem;
  border: 1px solid #cbd5f5;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
}

.status-text {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #0f172a;
}

.status-text.status-error {
  color: #b91c1c;
}

.status-text.status-ok {
  color: #047857;
}

/* 2026-05-27: Attendance confirm modal for delayed IN/OUT submit on mobile. */
.attendance-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 30;
}

.attendance-modal-overlay.visible {
  display: flex;
}

.attendance-modal {
  background: #fff;
  border-radius: 1rem;
  width: min(420px, 94vw);
  padding: 1.15rem 1rem 1.25rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
}

.attendance-modal-close {
  border: none;
  background: transparent;
  color: #334155;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 auto 0.35rem;
  display: block;
  cursor: pointer;
}

.recognition-error-modal {
  position: relative;
}

.recognition-error-modal .attendance-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  margin: 0;
}

.recognition-error-text {
  color: #d00;
  font-weight: 600;
  margin: 0.5rem 0.25rem 0;
}

#attendanceModalName {
  margin: 0.2rem 0 0.7rem;
  font-size: 1.4rem;
  color: #0f172a;
}

#attendanceModalImage {
  width: 100%;
  max-height: 250px;
  object-fit: cover;
  border-radius: 0.9rem;
  border: 1px solid #cbd5e1;
}

.attendance-time-line {
  margin: 0.5rem 0 0;
  color: #334155;
  font-weight: 600;
}

.attendance-action-btn {
  width: 100%;
  margin-top: 0.8rem;
  font-size: 1.05rem;
  padding: 0.85rem 1rem;
}

.attendance-in-btn {
  background: #16a34a;
}

.attendance-out-btn {
  background: #dc2626;
}

/* 2026-06-29: "Employees currently IN" report table */
/* Report page is wider (2x the standard card) to use the available space. */
body[data-page="report"] .card {
  width: min(960px, 95vw);
}

.report-table-wrap {
  overflow-y: auto;
  max-height: 60vh;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.report-table th,
.report-table td {
  padding: 0.6rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 700;
}

.report-table th {
  color: #475569;
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 1;
}

.report-table tbody tr:hover {
  background: #f1f5f9;
}

.report-table td:first-child,
.report-table th:first-child {
  width: 2.5rem;
  color: #94a3b8;
}

/* 2026-08-16: compact styling when reportemployeelist.html is embedded (index.html side panel). */
body.embedded {
  display: block;
  min-height: 0;
  background: none;
}

body.embedded .card {
  width: 100%;
  padding: 0.85rem;
  box-shadow: none;
  border-radius: 0;
  text-align: left;
}

body.embedded h1 {
  font-size: 1rem;
  margin-bottom: 0.15rem;
}

body.embedded .lead {
  font-size: 0.8rem;
  margin-bottom: 0.6rem;
}

body.embedded .controls {
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

body.embedded .report-table {
  font-size: 0.85rem;
}

body.embedded .report-table-wrap {
  max-height: calc(100vh - 7rem);
}

