* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #f5f5f5;
  color: #333;
}

.logo-container {
  text-align: center;
  margin-bottom: 20px;
}

.logo {
  width: 120px;      /* adjust size */
  height: auto;
  display: block;
  margin: 0 auto 10px auto;
}

/* Login Page */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-container h1 {
  margin-bottom: 30px;
  font-size: 2.5em;
}

.login-form, .register-form {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 400px;
}

.login-form input, .register-form input {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
}

.login-form button, .register-form button {
  width: 100%;
  padding: 12px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  margin-bottom: 10px;
}

.login-form button:hover, .register-form button:hover {
  background: #0056b3;
}

.error {
  color: #dc3545;
  margin-top: 10px;
  font-size: 14px;
}

.register-link, .register-form a {
  margin-top: 15px;
  text-align: center;
  display: block;
}

.register-form {
  margin-top: 20px;
}

.register-form h3 {
  margin-bottom: 20px;
}

.hidden {
  display: none !important;
}

/* Dashboard */
header {
  background: white;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

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

.header-right {
  display: flex;
  gap: 10px;
}

.date-display {
  text-align: center;
  margin: 20px 0;
}

.date-display h2 {
  color: #666;
  margin-bottom: 10px;
}

.stats {
  font-size: 1.2em;
  color: #007bff;
  font-weight: bold;
}

.btn-emergency {
  width: 100%;
  padding: 20px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.5em;
  font-weight: bold;
  cursor: pointer;
  margin-top: 20px;
  transition: transform 0.2s;
}

.btn-emergency:hover {
  background: #c82333;
  transform: scale(1.02);
}

.btn-secondary {
  padding: 10px 20px;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #545b62;
}

.btn-primary {
  padding: 10px 20px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.btn-primary:hover {
  background: #0056b3;
}

.search-bar {
  padding: 0 20px 20px;
}

.search-bar input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
}

.attendance-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 0 20px;
}

.column {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.column h3 {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}

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

.employee-card {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.employee-card:hover {
  background: #e9ecef;
  transform: translateX(5px);
}

.employee-card.checked-in {
  background: #d4edda;
  border-left: 4px solid #28a745;
}

.employee-name {
  font-weight: 500;
}

.check-time {
  font-size: 0.85em;
  color: #666;
}

/* Emergency Mode */
#emergencyMode {
  background: #dc3545;
  color: white;
  min-height: 100vh;
  padding: 20px;
}

.emergency-header {
  text-align: center;
  margin-bottom: 30px;
}

.emergency-header h1 {
  font-size: 3em;
  margin-bottom: 10px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.btn-end-emergency {
  padding: 15px 40px;
  background: white;
  color: #dc3545;
  border: none;
  border-radius: 5px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  margin-top: 20px;
}

.btn-end-emergency:hover {
  background: #f8f9fa;
}

.emergency-stats {
  display: flex;
  justify-content: center;
  margin: 30px 0;
}

.stat-box {
  background: rgba(255,255,255,0.2);
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  min-width: 200px;
}

.stat-number {
  font-size: 4em;
  font-weight: bold;
}

.stat-label {
  font-size: 1.2em;
  margin-top: 10px;
}

.emergency-employee-list {
  background: rgba(255,255,255,0.9);
  color: #333;
  padding: 20px;
  border-radius: 10px;
  max-width: 800px;
  margin: 0 auto;
}

.emergency-employee {
  padding: 15px;
  background: white;
  margin-bottom: 10px;
  border-radius: 5px;
  border-left: 4px solid #dc3545;
  font-size: 1.1em;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 10px;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  width: 90%;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  color: #666;
}

.close-modal:hover {
  color: #333;
}

.settings-section {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section h3 {
  margin-bottom: 15px;
}

.employee-form, .email-form {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.employee-form input, .email-form input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.management-list, .email-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.management-item, .email-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 5px;
}

.btn-delete {
  padding: 5px 10px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.9em;
}

.btn-delete:hover {
  background: #c82333;
}

#historyDisplay {
  margin-top: 15px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 5px;
}

.history-item {
  padding: 10px;
  border-bottom: 1px solid #dee2e6;
}

.history-item:last-child {
  border-bottom: none;
}

/* Responsive */
@media (max-width: 768px) {
  .attendance-container {
    grid-template-columns: 1fr;
  }
  
  .header-content {
    flex-direction: column;
    gap: 10px;
  }
  
  .employee-form, .email-form {
    flex-direction: column;
  }
}
