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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f8f8f8;
  min-height: 100vh;
  color: #1a1a1a;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 30px;
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 0 32px;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 30px;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-name {
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -1px;
  color: #1a1a1a;
}

header h1 {
  font-size: 2rem;
  font-weight: 400;
  color: #1a1a1a;
  letter-spacing: -0.5px;
  text-align: center;
}

.subtitle {
  color: #666;
  font-size: 1rem;
  font-weight: 300;
  text-align: center;
}

.credit {
  font-size: 0.75rem;
  color: #999;
  font-weight: 300;
  text-align: center;
}

.input-section {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 28px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 24px;
  align-items: start;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 0.75rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.input-group input {
  padding: 14px 16px;
  font-size: 1rem;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  background: #fff;
  color: #1a1a1a;
  transition: all 0.2s ease;
}

.input-group input:focus {
  outline: none;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 1px #1a1a1a;
}

.input-group input::placeholder {
  color: #666;
}

.input-group input[readonly] {
  background: #f5f5f5;
  border-color: #e0e0e0;
  cursor: default;
}

.input-group input[readonly].filled {
  background: #f0f7f0;
  border-color: #4a9d5b;
  color: #2d6a3a;
}

.lookup-status {
  font-size: 0.7rem;
  margin-top: 6px;
  height: 16px;
  font-weight: 500;
}

.lookup-status.found {
  color: #2d6a3a;
}

.lookup-status.not-found {
  color: #c44;
}

.lookup-status.searching {
  color: #666;
}

.button-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 24px;
  align-items: stretch;
}

.action-btn {
  padding: 28px 24px;
  font-size: 1.1rem;
  font-weight: 500;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 2px;
  min-height: 100px;
}

.action-btn:first-child {
  border-radius: 4px 0 0 4px;
}

.action-btn:last-child {
  border-radius: 0 4px 4px 0;
}

.action-btn:active {
  transform: scale(0.98);
}

.btn-icon {
  font-size: 1.5rem;
  margin-bottom: 4px;
  font-weight: 300;
}

.btn-subtitle {
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.5px;
  opacity: 0.85;
}

.check-in {
  background: #1a1a1a;
  color: #fff;
}

.check-in:hover {
  background: #333;
}

.check-out {
  background: #c44;
  color: #fff;
}

.check-out:hover {
  background: #a33;
}

.register-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 24px;
}

.register-btn {
  width: 100%;
  padding: 12px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid #d0d0d0;
  border-radius: 0;
  background: #fff;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
  text-align: center;
}

.register-btn:first-child {
  border-radius: 4px 0 0 4px;
  border-right: none;
}

.register-btn:last-child {
  border-radius: 0 4px 4px 0;
}

.register-btn:hover {
  border-color: #1a1a1a;
  color: #1a1a1a;
}

.status-message {
  padding: 16px 20px;
  border-radius: 4px;
  margin-bottom: 24px;
  font-size: 1rem;
  text-align: center;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.status-message.success {
  background: #f0f7f0;
  border: 1px solid #4a9d5b;
  color: #2d6a3a;
}

.status-message.error {
  background: #fef2f2;
  border: 1px solid #c44;
  color: #a33;
}

.status-message.hidden {
  display: none;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 24px;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  overflow: hidden;
}

.tab-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 48px;
  padding: 0 16px;
  font-size: 0.9rem;
  font-weight: 500;
  background: #fafafa;
  border: none;
  border-right: 1px solid #e5e5e5;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
}

.tab-btn:last-child {
  border-right: none;
}

.tab-btn:hover {
  color: #1a1a1a;
  background: #f0f0f0;
}

.tab-btn.active {
  color: #1a1a1a;
  background: #fff;
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.tab-content h2 {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 20px;
  color: #1a1a1a;
  letter-spacing: 0.5px;
}

.status-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  align-items: stretch;
}

.summary-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 120px;
}

.summary-card.in {
  border-left: 3px solid #4a9d5b;
}

.summary-card.out {
  border-left: 3px solid #c44;
}

.summary-card.clickable-card {
  cursor: pointer;
  transition: all 0.2s ease;
}

.summary-card.clickable-card:hover {
  background: #fafafa;
  border-color: #c44;
}

.card-hint {
  display: block;
  font-size: 0.7rem;
  color: #555;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.summary-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 300;
  color: #1a1a1a;
}

.summary-card.in .summary-number {
  color: #2d6a3a;
}

.summary-card.out .summary-number {
  color: #c44;
}

.summary-label {
  font-size: 0.7rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
}

.data-table th {
  background: #fafafa;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #666;
  font-weight: 600;
  border-bottom: 1px solid #e5e5e5;
}

.data-table td {
  border-top: 1px solid #f0f0f0;
  color: #333;
  font-size: 0.9rem;
}

.data-table tbody tr:hover {
  background: #fafafa;
}

.data-table tbody tr.clickable-row {
  cursor: pointer;
  transition: all 0.2s ease;
}

.data-table tbody tr.clickable-row:hover {
  background: #fff5f5;
}

.data-table tbody tr.clickable-row:hover td {
  color: #1a1a1a;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.in {
  background: #f0f7f0;
  color: #1e5128;
}

.status-badge.out {
  background: #fef2f2;
  color: #a33;
}

#statusTable th:nth-child(2),
#statusTable td:nth-child(2),
#historyTable th:nth-child(2),
#historyTable td:nth-child(2),
#dailyActivityTable th:nth-child(2),
#dailyActivityTable td:nth-child(2) {
  text-align: center;
}

#missingTable th:nth-child(4),
#missingTable td:nth-child(4) {
  text-align: center;
}

.data-table th:first-child,
.data-table td:first-child,
.data-table th:last-child,
.data-table td:last-child {
  white-space: nowrap;
}

.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;
  animation: fadeIn 0.2s ease;
}

.modal.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: #fff;
  border-radius: 8px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e5e5;
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 500;
  color: #1a1a1a;
  margin: 0;
  letter-spacing: 0.5px;
}

.modal-close {
  background: none;
  border: none;
  color: #999;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #1a1a1a;
}

.modal-body {
  padding: 24px;
}

.modal-body p {
  color: #666;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.modal-input-group {
  margin-bottom: 16px;
}

.modal-input-group label {
  display: block;
  font-size: 0.7rem;
  color: #666;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.modal-input-group input {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  background: #fff;
  color: #1a1a1a;
  transition: all 0.2s ease;
}

.modal-input-group input:focus {
  outline: none;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 1px #1a1a1a;
}

.modal-input-group input[readonly] {
  background: #f5f5f5;
  color: #666;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 24px;
}

.modal-btn {
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
}

.modal-btn.cancel {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #d0d0d0;
}

.modal-btn.cancel:hover {
  background: #eee;
  color: #1a1a1a;
}

.modal-btn.confirm {
  background: #1a1a1a;
  color: #fff;
}

.modal-btn.confirm:hover {
  background: #333;
}

.details-modal .modal-body {
  padding: 20px 24px;
}

.details-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: #f8f8f8;
  border-radius: 4px;
}

.detail-item.highlight {
  background: #fef2f2;
  border-left: 3px solid #c44;
}

.detail-label {
  font-size: 0.65rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.detail-value {
  font-size: 1rem;
  color: #1a1a1a;
  font-weight: 400;
}

.detail-value.user-name {
  color: #922;
  font-size: 1.2rem;
  font-weight: 500;
}

.checked-out-modal .modal-body {
  padding: 16px 24px;
  max-height: 400px;
  overflow-y: auto;
}

.checked-out-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkout-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #f8f8f8;
  border-radius: 4px;
  border-left: 3px solid #c44;
}

.checkout-user {
  font-size: 1rem;
  font-weight: 500;
  color: #1a1a1a;
}

.checkout-scanner {
  font-size: 0.85rem;
  color: #666;
  background: #fff;
  padding: 4px 12px;
  border-radius: 3px;
  border: 1px solid #e5e5e5;
}

.checkout-date {
  font-size: 0.8rem;
  color: #555;
  min-width: 70px;
  text-align: right;
}

.no-checkouts {
  text-align: center;
  padding: 30px;
  color: #1e5128;
  font-size: 1rem;
}

.clickable {
  color: #1a1a1a;
  cursor: pointer;
  text-decoration: underline;
}

.clickable:hover {
  color: #666;
}

.report-controls {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.date-picker-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.date-picker-group label {
  font-size: 0.9rem;
  color: #1a1a1a;
  font-weight: 500;
}

.date-picker-group input[type="date"] {
  padding: 10px 14px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
}

.report-btn {
  padding: 10px 20px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.report-btn:hover {
  background: #333;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  align-items: stretch;
}

.report-stat {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 120px;
  gap: 6px;
}

.report-stat.warning {
  border-color: #c73333;
  background: #fef7f7;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 600;
  color: #1a1a1a;
}

.report-stat.warning .stat-number {
  color: #922;
}

.stat-label {
  font-size: 0.85rem;
  color: #666;
}

.report-section {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.report-section h3 {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: #1a1a1a;
}

.report-hint {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 16px;
}

tr.overdue {
  background: #fef7f7;
}

tr.overdue td {
  color: #922;
}

@media (max-width: 600px) {
  header h1 {
    font-size: 1.5rem;
  }
  
  .button-section {
    grid-template-columns: 1fr;
  }
  
  .status-summary {
    grid-template-columns: 1fr;
  }
  
  .report-summary {
    grid-template-columns: 1fr;
  }
  
  .date-picker-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .data-table {
    font-size: 0.8rem;
  }
  
  .data-table th,
  .data-table td {
    padding: 10px 8px;
  }
}
