* {
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  display: flex;
  justify-content: center;
  align-items: center;
}

.portal {
  width: 90%;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.12);
  padding: 28px;
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  text-align: center;
  backdrop-filter: blur(8px);
}

.logo {
  width: 160px;
  height: auto;
  margin-bottom: 14px;
  object-fit: contain;
  background: white;
  border-radius: 14px;
  padding: 8px;
}

h1 {
  margin: 0;
  color: white;
  font-size: 24px;
  line-height: 1.25;
}

.subtitle {
  color: #dbeafe;
  margin: 10px 0 24px;
  font-size: 15px;
}

input,
select {
  width: 100%;
  max-width: 300px;
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  margin-bottom: 16px;
  outline: none;
}

input:focus,
select:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}

button {
  width: 140px;
  padding: 13px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
}

button:hover {
  transform: translateY(-2px);
}

button:focus-visible {
  outline: 3px solid white;
  outline-offset: 3px;
}

.clock-in {
  background: #16a34a;
  color: white;
}

.clock-out {
  background: #dc2626;
  color: white;
}

#status {
  margin-top: 20px;
  color: white;
  font-weight: bold;
  min-height: 24px;
}

/* CLOCK CARD */

.clock-card {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 18px;
  color: white;
}

#liveTime {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 4px;
}

#liveDate {
  font-size: 14px;
  color: #dbeafe;
}

/* STATUS COLORS */

.success {
  color: #22c55e !important;
}

.error {
  color: #f87171 !important;
}

.processing {
  color: #facc15 !important;
}

/* MISSED CLOCK OUT BUTTON */

.missed-button {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 20px auto 0;
  padding: 13px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
  background: #facc15;
  color: black;
}

.missed-button:hover {
  transform: translateY(-2px);
  background: #eab308;
}

/* ADMIN LOGIN */

#loginPanel,
.admin-login {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

#loginPanel input,
.admin-login input {
  width: 100%;
  max-width: 320px;
  margin-bottom: 0;
}

.admin-unlock {
  width: 100%;
  max-width: 320px;
}

/* ADMIN DASHBOARD */

.admin-portal {
  max-width: 980px;
  max-height: 92vh;
  overflow-y: auto;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 6px 0 18px;
  color: white;
  text-align: left;
}

.dashboard-header h2,
.dashboard-header p {
  margin: 0;
}

.dashboard-header p {
  margin-top: 6px;
  color: #dbeafe;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 16px;
  color: white;
  text-align: left;
}

.stat-card h3 {
  margin: 0 0 8px;
  color: #dbeafe;
  font-size: 13px;
  font-weight: 600;
}

.stat-card span {
  font-size: 24px;
  font-weight: 700;
}

.admin-actions {
  margin-bottom: 18px;
}

.admin-small-button {
  width: auto;
  min-width: 180px;
  background: #2563eb;
  color: white;
}

.admin-grid,
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

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

.admin-card,
.admin-section {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 18px;
  color: white;
  text-align: left;
}

.admin-card h2,
.admin-section h2 {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 18px;
  color: white;
}

.admin-section > p {
  color: #dbeafe;
  line-height: 1.5;
}

.full-width-card {
  margin-top: 16px;
}

.admin-list {
  color: #e5e7eb;
  font-size: 14px;
  line-height: 1.6;
}

.admin-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 0;
}

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

.employee-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 12px;
  margin-bottom: 12px;
}

.employee-tools input,
.employee-tools select {
  max-width: none;
  margin-bottom: 0;
}

.employee-management-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.employee-management-row:last-child {
  border-bottom: none;
}

.employee-management-info {
  line-height: 1.55;
}

.employee-management-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.employee-management-actions button {
  min-width: 0;
}

.employee-active {
  color: #4ade80;
  font-weight: 700;
}

.employee-inactive {
  color: #fca5a5;
  font-weight: 700;
}

.empty-state {
  color: #dbeafe;
  padding: 8px 0;
}

.request-card {
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  padding: 12px 0;
}

.request-card:last-child {
  border-bottom: none;
}

.request-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.admin-approve,
.admin-reject {
  width: auto;
  padding: 9px 12px;
  font-size: 13px;
}

.admin-approve {
  background: #16a34a;
  color: white;
}

.admin-reject {
  background: #dc2626;
  color: white;
}

/* MOBILE */

@media (max-width: 720px) {
  .admin-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-header,
  .employee-management-row {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-header .admin-small-button {
    width: 100%;
  }

  .employee-tools {
    grid-template-columns: 1fr;
  }

  .employee-management-actions {
    justify-content: flex-start;
  }

  .admin-row {
    flex-direction: column;
    gap: 4px;
  }

  .admin-portal {
    max-height: none;
  }
}

@media (max-width: 480px) {
  body {
    padding: 16px;
  }

  .portal {
    width: 100%;
    max-width: 360px;
    padding: 24px 18px;
  }

  .admin-portal {
    max-width: 100%;
  }

  .logo {
    width: 140px;
  }

  h1 {
    font-size: 22px;
  }

  .subtitle {
    font-size: 14px;
  }

  input,
  select {
    max-width: 100%;
    font-size: 16px;
  }

  .buttons {
    gap: 10px;
  }

  .buttons button {
    width: 50%;
    font-size: 15px;
    padding: 14px 8px;
  }

  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .employee-management-actions button,
  .request-actions button {
    flex: 1 1 120px;
  }

  .missed-button {
    width: 100%;
    max-width: 300px;
    margin: 20px auto 0;
    padding: 14px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  button:hover,
  .missed-button:hover {
    transform: none;
  }
}
