@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f8fafc;
  color: #0f172a;
  line-height: 1.6;
}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
}

/* ---------------- AUTH PAGES ---------------- */

.auth-body {
  min-height: 100vh;
  background: linear-gradient(180deg, #eef4ff 0%, #f8fbff 100%);
}

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card-new {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 24px;
  padding: 32px 24px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.10);
  text-align: center;
}

.auth-logo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  margin: 0 auto 16px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
}

.admin-gradient {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
}

.employee-gradient {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
}

.auth-title {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 700;
  color: #0f172a;
}

.auth-subtitle {
  margin: 8px 0 0;
  font-size: 15px;
  color: #64748b;
}

.auth-form {
  margin-top: 24px;
  text-align: left;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.form-group input {
  width: 100%;
  height: 48px;
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  padding: 0 14px;
  font-size: 15px;
  outline: none;
  background: #ffffff;
  color: #0f172a;
}

.form-group input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.10);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 86px;
}

.toggle-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  height: 34px;
  min-width: 64px;
  border: none;
  border-radius: 10px;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 12px;
}

.auth-submit-btn {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}

.auth-footer-link {
  margin-top: 18px;
  text-align: center;
}

.auth-footer-link a {
  color: #2563eb;
  font-weight: 700;
  font-size: 14px;
}

/* ---------------- COMMON ---------------- */

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin-top: 16px;
  font-size: 14px;
  text-align: left;
}

.alert.error {
  background: #fee2e2;
  color: #991b1b;
}

.alert.success {
  background: #dcfce7;
  color: #166534;
}

.hidden {
  display: none !important;
}

.hidden-file {
  display: none !important;
}

.muted-text {
  color: #64748b;
  font-size: 13px;
}

/* ---------------- EMPLOYEE DASHBOARD ---------------- */

.mobile-page {
  padding: 16px;
}

.page-header {
  text-align: center;
  margin-bottom: 24px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.page-subtitle {
  font-size: 14px;
  color: #64748b;
  margin: 4px 0 0;
}

.checkin-btn {
  width: 100%;
  height: 56px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 24px;
}

.checkin-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.status-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  text-align: center;
}

.status-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px;
}

.status-value {
  font-size: 28px;
  font-weight: 700;
  color: #2563eb;
  margin: 0;
}

.location-display {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
  text-align: center;
}

.location-text {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 8px;
}

.location-link {
  color: #2563eb;
  font-weight: 700;
  text-decoration: none;
}

.location-link:hover {
  text-decoration: underline;
}

.photo-upload {
  margin-top: 16px;
}

.upload-btn {
  width: 100%;
  height: 48px;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.upload-btn:hover {
  border-color: #2563eb;
  background: #eef2ff;
  color: #2563eb;
}

.upload-btn.has-file {
  border-color: #10b981;
  background: #f0fdf4;
  color: #166534;
}

.photo-preview {
  margin-top: 16px;
  text-align: center;
}

.preview-img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ---------------- ADMIN PAGES ---------------- */

.admin-attendance-page {
  background: linear-gradient(135deg, #f5f7ff 0%, #f8fafc 100%);
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
  margin-bottom: 24px;
  border: 1px solid #e0e7ff;
}

.topbar div:first-child strong {
  font-size: 24px;
  color: #1e293b;
  display: block;
  margin-bottom: 4px;
}

.topbar .muted-text {
  color: #64748b;
  font-size: 14px;
}

.topbar div:last-child {
  display: flex;
  gap: 12px;
}

.nav-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
  color: #4f46e5;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s;
  border: 1px solid #e0e7ff;
}

.nav-btn:hover {
  background: linear-gradient(135deg, #e0e7ff 0%, #f0f4ff 100%);
  color: #4338ca;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
  border-color: #c7d2fe;
}

.logout-btn {
  padding: 10px 20px;
  background: #dc2626;
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s;
  border: 1px solid #dc2626;
}

.logout-btn:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

.card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid #e0e7ff;
}

.attendance-date-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attendance-date-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
  border: 1px solid #e0e7ff;
  border-radius: 8px;
  text-decoration: none;
  color: #334155;
  transition: all 0.2s;
}

.attendance-date-link:hover {
  background: linear-gradient(135deg, #e0e7ff 0%, #f0f4ff 100%);
  border-color: #c7d2fe;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.attendance-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.attendance-detail-header strong {
  font-size: 18px;
  color: #1e293b;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead {
  background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
}

th {
  padding: 16px 12px;
  text-align: left;
  font-weight: 700;
  color: #4f46e5;
  border-bottom: 2px solid #e0e7ff;
}

td {
  padding: 16px 12px;
  border-bottom: 1px solid #f0f4ff;
  vertical-align: top;
}

tbody tr:hover {
  background: #f8fafc;
}

.visit-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.visit-chip {
  padding: 6px 12px;
  background: linear-gradient(135deg, #e0e7ff 0%, #f0f4ff 100%);
  color: #4f46e5;
  border: 1px solid #c7d2fe;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.visit-chip.active {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: #ffffff;
  border-color: #4338ca;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.visit-chip:hover {
  background: linear-gradient(135deg, #c7d2fe 0%, #e0e7ff 100%);
  border-color: #a5b4fc;
  transform: translateY(-1px);
}

.visit-detail-wrap {
  max-width: 100%;
}

.visit-detail-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e0e7ff;
  border-radius: 16px;
  padding: 0;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
  overflow: hidden;
}

/* Clock In/Out Section */
.clock-section {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 32px;
  background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
  border-bottom: 1px solid #e0e7ff;
}

.clock-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  padding: 20px;
  background: #ffffff;
  border-radius: 12px;
  border: 2px solid #e0e7ff;
  transition: all 0.3s ease;
}

.clock-item:hover {
  border-color: #6366f1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.check-in-item {
  border-left: 4px solid #10b981;
}

.check-out-item {
  border-left: 4px solid #ef4444;
}

.clock-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: #1e293b;
  min-width: 120px;
}

.clock-icon {
  font-size: 24px;
  display: inline-flex;
  align-items: center;
}

.clock-text {
  min-width: 80px;
  letter-spacing: 0.5px;
}

.clock-details {
  text-align: right;
  flex: 1;
}

.clock-time {
  font-size: 28px;
  font-weight: 800;
  color: #1e293b;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.8px;
  line-height: 1.2;
}

.clock-date {
  font-size: 13px;
  color: #64748b;
  margin-top: 6px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.geo-badge {
  font-size: 20px;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 6px;
  background: #f0f4ff;
}

.geo-badge:hover {
  opacity: 1;
  background: #e0e7ff;
  transform: scale(1.1);
}

.clock-divider {
  width: 3px;
  height: 100px;
  background: linear-gradient(180deg, transparent 0%, #6366f1 50%, transparent 100%);
  border-radius: 2px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Photos Section */
.photos-section {
  padding: 40px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 3px solid #e0e7ff;
  letter-spacing: 0.3px;
}

.no-photo {
  font-size: 15px;
  color: #94a3b8;
  padding: 50px 30px;
  background: linear-gradient(135deg, #f0f4ff 0%, #f8fafc 100%);
  border-radius: 12px;
  text-align: center;
  border: 2px dashed #c7d2fe;
  font-weight: 500;
}

.map-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
  padding: 0 32px;
}

.map-card {
  border: 1px solid #e0e7ff;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.06);
  transition: all 0.3s ease;
}

.map-card:hover {
  border-color: #6366f1;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.12);
}

.map-title {
  padding: 16px;
  background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
  font-weight: 700;
  color: #1e293b;
  font-size: 14px;
  border-bottom: 1px solid #e0e7ff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-frame {
  width: 100%;
  height: 280px;
  border: none;
  display: block;
}

.cleaning-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
  margin-top: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e2e8f0;
}

.cleaning-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 0;
}

.cleaning-photo-card {
  border: 2px solid #e0e7ff;
  border-radius: 14px;
  padding: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
  display: flex;
  flex-direction: column;
}

.cleaning-photo-card:hover {
  border-color: #6366f1;
  box-shadow: 0 16px 32px rgba(99, 102, 241, 0.2);
  transform: translateY(-8px);
  background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
}

.cleaning-photo-card .muted-text {
  display: block;
  margin-bottom: 14px;
  font-weight: 700;
  color: #1e293b;
  font-size: 14px;
  letter-spacing: 0.3px;
}

.cleaning-photo-card > div:last-child {
  font-size: 15px;
  color: #94a3b8;
  padding: 50px 25px;
  background: linear-gradient(135deg, #f0f4ff 0%, #f8fafc 100%);
  border-radius: 10px;
  border: 2px dashed #c7d2fe;
  font-weight: 500;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cleaning-photo-link-wrapper {
  display: block;
  margin-bottom: 14px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
  border: 2px solid #c7d2fe;
  padding: 2px;
}

.thumb-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  border: none;
  border-radius: 8px;
}

.cleaning-photo-card a .thumb-img {
  transition: transform 0.3s ease;
}

.cleaning-photo-card a:hover .thumb-img {
  transform: scale(1.05);
}

.thumb-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e0e7ff;
}

.tiny-link {
  font-size: 12px;
  color: #4f46e5;
  text-decoration: none;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
  display: inline-block;
}

.tiny-link:hover {
  background: #f0f4ff;
  text-decoration: underline;
  color: #4338ca;
}

.tiny-remove-btn {
  padding: 4px 8px;
  background: #dc2626;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
}

.tiny-remove-btn:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.delete-log-btn {
  padding: 10px 16px;
  background: #dc2626;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
}

.delete-log-btn:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

.inline-form {
  display: inline;
}

.geo-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.geo-link:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .map-grid {
    grid-template-columns: 1fr;
  }

  .cleaning-photo-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .visit-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .page {
    padding: 12px;
  }

  .topbar {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .topbar div:first-child strong {
    font-size: 20px;
  }

  .topbar div:last-child {
    justify-content: center;
    flex-wrap: wrap;
  }

  .nav-btn,
  .logout-btn {
    padding: 8px 16px;
    font-size: 13px;
  }

  .card {
    padding: 16px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .grid-2 .card {
    padding: 24px;
  }

  .month-filter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .month-filter-form input,
  .small-btn {
    width: 100%;
  }

  .visit-detail-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .visit-detail-grid div {
    font-size: 12px;
  }

  .map-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .map-frame {
    height: 250px;
  }

  .cleaning-photo-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .cleaning-photo-card {
    padding: 12px;
  }

  .thumb-img {
    height: 160px;
  }

  .table-wrap {
    font-size: 13px;
  }

  th, td {
    padding: 8px 6px;
  }

  .visit-detail-wrap {
    max-width: 100%;
  }

  .attendance-date-link {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .cleaning-title {
    font-size: 16px;
    margin-top: 16px;
  }

  .thumb-actions {
    gap: 4px;
  }

  .tiny-link,
  .tiny-remove-btn {
    font-size: 10px;
    padding: 4px 8px;
  }
}

@media (max-width: 480px) {
  .page {
    padding: 8px;
  }

  .topbar {
    padding: 12px 16px;
  }

  .card {
    padding: 12px;
    margin-bottom: 16px;
  }

  .topbar div:first-child strong {
    font-size: 18px;
  }

  .topbar div:last-child {
    flex-direction: column;
    gap: 8px;
  }

  .nav-btn,
  .logout-btn {
    width: 100%;
    padding: 10px 12px;
    font-size: 12px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .big-number {
    font-size: 38px;
  }

  .grid-2 .card {
    padding: 20px;
  }

  .grid-2 .card h3 {
    font-size: 13px;
  }

  table {
    font-size: 11px;
  }

  th, td {
    padding: 6px 4px;
  }

  .cleaning-photo-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .thumb-img {
    height: 140px;
  }

  .visit-chip {
    font-size: 11px;
    padding: 4px 8px;
  }

  .map-frame {
    height: 200px;
  }

  .visit-detail-card {
    padding: 12px;
  }

  .muted-text {
    font-size: 12px;
  }
}

.mobile-page {
  min-height: 100vh;
  padding: 18px;
  padding-bottom: 170px;
  background: linear-gradient(180deg, #eef4ff 0%, #f8fbff 100%);
}

.mobile-card {
  max-width: 520px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(28, 60, 120, 0.12);
}

.header-box {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.title {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

.subtitle {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}

.logout-chip {
  text-decoration: none;
  background: #e2e8f0;
  color: #0f172a;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
}

.status-box {
  background: linear-gradient(135deg, #ee3e80, #f472b6);
  color: #ffffff;
  padding: 16px;
  border-radius: 18px;
  margin-bottom: 16px;
  box-shadow: 0 12px 28px rgba(238, 62, 128, 0.24);
}

.status-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
}

.status-value {
  font-size: 24px;
  font-weight: 700;
  margin-top: 6px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(131, 24, 62, 0.18);
}

.status-box .muted-text {
  margin-top: 6px;
  color: rgba(255, 245, 249, 0.95);
}

.step-text {
  position: fixed;
  left: 50%;
  bottom: 78px;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 500px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  border-radius: 14px;
  padding: 14px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  z-index: 7;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.step-text.visible {
  opacity: 1;
}

.geo-box {
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  color: #155e75;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
  font-size: 13px;
}

.camera-panel {
  /* position: sticky; */
  top: 10px;
  z-index: 5;
  background: #ffffff;
  border-radius: 18px;
  padding-top: 2px;
}

video,
.preview {
  width: 100%;
  border-radius: 18px;
  background: #cbd5e1;
  margin-top: 12px;
}

.main-action-btn,
.submit-btn,
.done-btn {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 15px;
  color: white;
  font-size: 16px;
  font-weight: 700;
  margin-top: 14px;
  cursor: pointer;
}

.main-action-btn {
  background: linear-gradient(135deg, #ee3e80, #d61f69);
  box-shadow: 0 12px 24px rgba(238, 62, 128, 0.24);
}

.main-action-btn:hover,
.main-action-btn:focus-visible {
  background: linear-gradient(135deg, #f05190, #c81e63);
}

.main-action-btn:focus-visible,
.submit-btn:focus-visible,
.done-btn:focus-visible {
  outline: 3px solid rgba(238, 62, 128, 0.24);
  outline-offset: 3px;
}

.submit-btn {
  background: linear-gradient(135deg, #16a34a, #15803d);
}

.done-btn {
  background: #64748b;
}

.main-action-btn,
.submit-btn {
  position: sticky;
  bottom: 10px;
  z-index: 3;
}

/* ---------------- ADMIN PAGES ---------------- */

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.nav-btn,
.logout-btn {
  display: inline-block;
  background: #111827;
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  margin-left: 6px;
}

.card {
  background: #ffffff;
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.grid-full {
  grid-column: 1 / -1;
}

.card label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
}

.card input {
  width: 100%;
  height: 46px;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  padding: 0 14px;
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th,
table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

table th {
  background: #f8fafc;
  font-weight: 700;
}

.status-pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
}

.status-active {
  background: #dcfce7;
  color: #166534;
}

.status-inactive {
  background: #fee2e2;
  color: #991b1b;
}

.inline-reset-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
}

.small-btn {
  width: auto;
  display: inline-block;
  padding: 8px 12px;
  border: none;
  border-radius: 10px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

.thumb-wrap {
  min-width: 96px;
}

.thumb-img {
  width: 160px;
  height: 203px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  border: 1px solid #dbeafe;
  background: #e2e8f0;
}

.thumb-actions {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tiny-link {
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
}

/* ---------------- RESPONSIVE ---------------- */

@media (max-width: 768px) {
  .auth-card-new {
    padding: 20px 14px;
  }

  .auth-title {
    font-size: 24px;
  }

  .mobile-page {
    padding: 10px;
    padding-bottom: 150px;
  }

  .mobile-card {
    width: 100%;
    border-radius: 16px;
    padding: 14px;
  }

  .title {
    font-size: 20px;
  }

  .status-value {
    font-size: 20px;
  }

  .step-text {
    width: calc(100% - 16px);
    bottom: 66px;
    font-size: 15px;
  }

  .grid-form {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar .nav-btn,
  .topbar .logout-btn {
    margin: 6px 6px 0 0;
  }

  .page {
    padding: 12px;
  }

  .card {
    padding: 14px;
  }

  table th,
  table td {
    font-size: 12px;
    padding: 8px;
  }

  .camera-modal {
    padding: 8px;
  }

  .camera-modal-inner {
    padding: 8px;
    border-radius: 12px;
  }
}
.map-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-frame {
  width: 100%;
  max-width: 320px;
  height: 140px;
  border: 0;
  border-radius: 10px;
}

.small-select {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 6px 10px;
  background: #fff;
  margin-bottom: 8px;
}


.visit-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 170px;
}

.visit-chip {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.visit-chip.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.visit-detail-wrap {
  min-width: 350px;
}

.visit-detail-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
}

.visit-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.cleaning-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.cleaning-photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
}

.cleaning-photo-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
}


.inline-form {
  display: inline;
}

.tiny-remove-btn {
  border: none;
  background: #dc2626;
  color: #ffffff;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}

.tiny-remove-btn:hover {
  background: #b91c1c;
}

.admin-attendance-page {
  background: linear-gradient(135deg, #f8f5ff 0%, #eefbff 45%, #fff8ef 100%);
}

.admin-attendance-page .topbar,
.admin-attendance-page .card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #e8e7ff;
  box-shadow: 0 16px 28px rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(4px);
}

.admin-attendance-page .nav-btn,
.admin-attendance-page .logout-btn {
  background: linear-gradient(135deg, #1d4ed8, #4338ca);
  border: 1px solid #c7d2fe;
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.22);
}

.admin-attendance-page .visit-detail-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-color: #dbeafe;
}

.admin-attendance-page .cleaning-photo-card,
.admin-attendance-page .map-card {
  background: linear-gradient(180deg, #ffffff 0%, #fdf4ff 100%);
  border: 1px solid #e9d5ff;
  border-radius: 12px;
  padding: 10px;
}

.admin-attendance-page .visit-chip {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.admin-attendance-page .visit-chip.active {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border-color: #4f46e5;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.map-title {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.geo-link {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}


.single-col-form {
  grid-template-columns: 1fr;
}

.admin-users-page {
  background: #f8fafc;
}

.compact-card {
  padding-top: 12px;
}

.accordion-wrap {
  display: grid;
  gap: 10px;
}

.accordion-wrap details {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 8px 12px;
}

.accordion-wrap summary {
  cursor: pointer;
  font-weight: 700;
  color: #0f172a;
  padding: 6px 0;
}

.accordion-wrap details[open] summary {
  margin-bottom: 8px;
}

.accordion-wrap details form {
  margin-top: 4px;
}

.month-filter-form {
  margin-bottom: 28px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.month-filter-form input {
  padding: 10px 16px;
  border: 2px solid #e0e7ff;
  border-radius: 8px;
  background: #ffffff;
  color: #1e293b;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.month-filter-form input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.small-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.small-btn:hover {
  background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* ADMIN DASHBOARD PAGE */
.admin-dashboard-page {
  background: linear-gradient(135deg, #f5f7ff 0%, #f8fafc 100%);
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
} */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.grid-2 .card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid #e0e7ff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.grid-2 .card:hover {
  border-color: #6366f1;
  box-shadow: 0 16px 32px rgba(99, 102, 241, 0.15);
  transform: translateY(-8px);
}

.grid-2 .card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4f46e5, #6366f1);
}

.grid-2 .card h3 {
  margin: 0 0 20px;
  font-size: 16px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.big-number {
  font-size: 52px;
  font-weight: 900;
  color: #4f46e5;
  line-height: 1;
  font-family: 'Courier New', monospace;
}

.calendar-report-table th,
.calendar-report-table td {
  white-space: nowrap;
  text-align: center;
  padding: 14px 10px;
  font-size: 13px;
}

.calendar-report-table th {
  background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
  font-weight: 700;
  color: #4f46e5;
  border-bottom: 3px solid #e0e7ff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calendar-report-table td {
  border-bottom: 1px solid #f0f4ff;
  color: #334155;
}

.calendar-report-table tbody tr:hover {
  background: linear-gradient(90deg, transparent 0%, #f0f4ff 50%, transparent 100%);
  transition: background 0.2s ease;
}

.calendar-report-table td:first-child,
.calendar-report-table th:first-child {
  text-align: left;
  min-width: 200px;
  position: sticky;
  left: 0;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  z-index: 10;
  padding-right: 20px;
}

.employee-name-link {
  display: block;
  color: #1e293b;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.employee-name-link:hover {
  background: linear-gradient(135deg, #e0e7ff 0%, #f0f4ff 100%);
  border-left-color: #4f46e5;
  color: #4f46e5;
}

.employee-name-link strong {
  color: inherit;
  font-weight: 700;
}

.calendar-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.calendar-pill.present {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border-color: #6ee7b7;
}

.calendar-pill.present:hover {
  background: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 100%);
  transform: scale(1.1);
}

.calendar-pill.absent {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #7f1d1d;
  border-color: #fca5a5;
}

.calendar-pill.absent:hover {
  background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
  transform: scale(1.1);
}


.install-app-btn {
  border: none;
  border-radius: 10px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
}

.dashboard-install-btn {
  padding: 8px 12px;
  margin-right: 8px;
}

.danger-btn {
  background: #b91c1c;
  color: #ffffff;
}

.inline-actions-wrap {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}


.attendance-date-accordion {
  display: grid;
  gap: 12px;
}

.attendance-date-item {
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #ffffff;
  padding: 8px;
}

.attendance-date-item > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
  padding: 6px 8px;
}

.attendance-date-item[open] > summary {
  margin-bottom: 8px;
}

.attendance-date-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #ffffff;
  padding: 14px 16px;
  font-weight: 700;
  text-decoration: none;
  color: #0f172a;
}

.attendance-date-link:hover {
  background: #eff6ff;
}

.attendance-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 10px;
  flex-wrap: wrap;
}

.calendar-log-item {
  display: inline-block;
}

.calendar-log-item > summary {
  cursor: pointer;
  list-style: none;
}

.calendar-log-item > summary::-webkit-details-marker {
  display: none;
}

.calendar-log-card {
  margin-top: 8px;
  min-width: 220px;
  background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
  border: 2px solid #e0e7ff;
  border-radius: 12px;
  padding: 16px;
  text-align: left;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
  z-index: 100;
  position: relative;
}

.calendar-log-row {
  font-size: 13px;
  line-height: 1.6;
  padding: 8px 0;
  border-bottom: 1px solid #e0e7ff;
  color: #475569;
}

/* ---------------- GLOBAL BRAND OVERRIDES ---------------- */

:root {
  --brand-pink: #ee3e80;
  --brand-pink-dark: #d61f69;
  --brand-pink-soft: #fff1f7;
  --brand-text: #0f172a;
}

html,
body,
button,
input,
select,
textarea {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  text-align: center;
}

.mobile-card,
.auth-card-new,
.card,
.topbar,
.page-header,
.header-box,
.status-box,
.geo-box,
.attendance-detail-header,
.month-filter-form,
.accordion-wrap details,
.calendar-log-card,
.location-display,
.photo-preview,
.table-wrap {
  text-align: center;
}

.header-box,
.topbar,
.attendance-detail-header,
.month-filter-form,
.inline-actions-wrap,
.thumb-actions,
.visit-chip-list {
  justify-content: center;
}

.header-box,
.topbar {
  align-items: center;
}

.topbar div:last-child,
.header-box > div:last-child {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-form,
.form-group,
.card label,
.inline-reset-form,
.grid-form,
.visit-detail-wrap,
.clock-details,
.calendar-log-row,
.employee-name-link,
.map-title,
.cleaning-title {
  text-align: center;
}

table th,
table td,
th,
td,
.calendar-report-table th,
.calendar-report-table td,
.calendar-report-table td:first-child,
.calendar-report-table th:first-child {
  text-align: center;
}

.attendance-date-link,
.clock-item,
.clock-label,
.map-wrap,
.map-card,
.cleaning-photo-card,
.visit-detail-card {
  text-align: center;
}

.clock-item,
.attendance-date-link,
.attendance-detail-header {
  justify-content: center;
}

.clock-details {
  flex: initial;
}

.employee-name-link {
  border-left: none;
}

.employee-name-link:hover {
  border-left-color: transparent;
}

.auth-submit-btn,
.toggle-btn,
.checkin-btn,
.main-action-btn,
.submit-btn,
.done-btn,
.small-btn,
.nav-btn,
.logout-btn,
.logout-chip,
.install-app-btn,
.dashboard-install-btn,
.danger-btn,
.tiny-remove-btn,
.delete-log-btn,
.visit-chip.active {
  background: linear-gradient(135deg, var(--brand-pink), var(--brand-pink-dark)) !important;
  color: #ffffff !important;
  border-color: var(--brand-pink) !important;
  box-shadow: 0 12px 24px rgba(238, 62, 128, 0.22);
}

.auth-submit-btn:hover,
.toggle-btn:hover,
.checkin-btn:hover,
.main-action-btn:hover,
.submit-btn:hover,
.small-btn:hover,
.nav-btn:hover,
.logout-btn:hover,
.logout-chip:hover,
.install-app-btn:hover,
.dashboard-install-btn:hover,
.danger-btn:hover,
.tiny-remove-btn:hover,
.delete-log-btn:hover,
.visit-chip:hover,
.visit-chip.active:hover {
  background: linear-gradient(135deg, #f15695, #c91b63) !important;
  color: #ffffff !important;
  border-color: var(--brand-pink-dark) !important;
}

.visit-chip,
.toggle-btn {
  border-color: rgba(238, 62, 128, 0.2);
}

.status-box,
.grid-2 .card::before {
  background: linear-gradient(135deg, var(--brand-pink), #f472b6);
}

.big-number,
.page-title,
.auth-footer-link a,
.tiny-link,
.geo-link,
.location-link,
.status-value {
  color: var(--brand-pink-dark);
}

.small-select:focus,
.form-group input:focus,
.card input:focus,
.month-filter-form input:focus {
  border-color: var(--brand-pink);
  box-shadow: 0 0 0 4px rgba(238, 62, 128, 0.12);
}

.status-pill.status-active {
  background: #ffe4ef;
  color: var(--brand-pink-dark);
}

.status-pill.status-inactive {
  background: #ffe9ef;
  color: #a11a4f;
}

.admin-dashboard-page,
.admin-users-page,
.admin-attendance-page,
.auth-body,
.mobile-page {
  background: linear-gradient(180deg, #fff5f9 0%, #fffafe 48%, #fdf2f8 100%);
}

.calendar-log-row strong {
  color: #4f46e5;
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

.calendar-log-row:last-child {
  border-bottom: none;
}

/* Admin attendance calendar view */
.attendance-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.attendance-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.attendance-calendar-weekday {
  text-align: center;
  font-weight: 700;
  color: #475569;
  font-size: 13px;
  padding: 8px 4px;
}

.attendance-calendar-cell {
  min-height: 92px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: space-between;
}

.attendance-calendar-cell.empty {
  border-color: transparent;
  background: transparent;
}

.attendance-calendar-cell.has-log {
  text-decoration: none;
  color: #0f172a;
  background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
  border-color: #c7d2fe;
  transition: all 0.2s ease;
}

.attendance-calendar-cell.has-log:hover {
  transform: translateY(-2px);
  border-color: #6366f1;
  box-shadow: 0 8px 18px rgba(99, 102, 241, 0.18);
}

.attendance-calendar-cell .day-number {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.attendance-calendar-cell .day-count {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

@media (max-width: 768px) {
  .attendance-calendar-grid {
    gap: 8px;
  }

  .attendance-calendar-cell {
    min-height: 80px;
    padding: 8px;
  }

  .attendance-calendar-cell .day-number {
    font-size: 18px;
  }

  .attendance-calendar-cell .day-count {
    font-size: 11px;
  }
}
