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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

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

.login-card {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 400px;
}

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

.login-header h1 {
  color: #333;
  font-size: 24px;
  margin-bottom: 10px;
}

.login-header p {
  color: #666;
  font-size: 14px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: #667eea;
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: #5568d3;
  transform: translateY(-2px);
}

.btn-secondary {
  background: #e0e0e0;
  color: #333;
}

.btn-secondary:hover {
  background: #d0d0d0;
}

.btn-success {
  background: #48bb78;
  color: white;
  margin-top: 15px;
}

.btn-success:hover {
  background: #38a169;
}

.btn-info {
  background: #4299e1;
  color: white;
}

.btn-info:hover {
  background: #3182ce;
}

.error-message {
  color: #e53e3e;
  font-size: 14px;
  margin-top: 15px;
  text-align: center;
}

/* Dashboard */
.navbar {
  background: white;
  padding: 15px 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand h2 {
  color: #333;
  font-size: 20px;
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-info {
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat-icon {
  font-size: 40px;
}

.stat-content h3 {
  font-size: 32px;
  margin-bottom: 5px;
}

.stat-content p {
  color: #666;
  font-size: 14px;
}

.stat-primary {
  border-left: 4px solid #667eea;
}
.stat-success {
  border-left: 4px solid #48bb78;
}
.stat-danger {
  border-left: 4px solid #e53e3e;
}
.stat-info {
  border-left: 4px solid #4299e1;
}

.crb-stats {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-around;
  margin-bottom: 30px;
}

.crb-stat {
  text-align: center;
}

.crb-label {
  color: #666;
  font-size: 14px;
  display: block;
  margin-bottom: 5px;
}

.crb-value {
  color: #333;
  font-size: 24px;
  font-weight: bold;
}

.upload-section {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.upload-section h3 {
  color: #333;
  margin-bottom: 20px;
}
.section-description {
  color: #666;
  font-size: 14px;
  margin-bottom: 15px;
}

.button-group {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.button-group button {
  flex: 1;
  min-width: 150px;
}
.upload-area {
  border: 2px dashed #e0e0e0;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
}

.upload-area:hover {
  border-color: #667eea;
  background: #f7fafc;
}

.upload-area.drag-over {
  border-color: #667eea;
  background: #ebf4ff;
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.upload-area p {
  color: #666;
  margin-bottom: 15px;
}

.file-info {
  margin-top: 15px;
  padding: 15px;
  background: #f7fafc;
  border-radius: 8px;
  display: none;
}

.file-info.show {
  display: block;
}

.upload-progress {
  margin-top: 15px;
  padding: 15px;
  background: #ebf4ff;
  border-radius: 8px;
  color: #4299e1;
  font-weight: 500;
  display: none;
}

.upload-progress.show {
  display: block;
}

.submissions-section {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.submissions-section h3 {
  color: #333;
  margin-bottom: 20px;
}

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

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

thead {
  background: #f7fafc;
}

th {
  padding: 12px;
  text-align: left;
  color: #666;
  font-weight: 600;
  font-size: 14px;
}

td {
  padding: 12px;
  border-bottom: 1px solid #e0e0e0;
  color: #333;
  font-size: 14px;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.status-success {
  background: #c6f6d5;
  color: #22543d;
}

.status-failed {
  background: #fed7d7;
  color: #742a2a;
}

.status-pending {
  background: #feebc8;
  color: #7c2d12;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

.message-cell {
  max-width: 400px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 0;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 15px 25px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  position: relative;
  bottom: -2px;
}

.tab-btn:hover {
  color: #eae166;
  background: rgba(102, 126, 234, 0.05);
}

.tab-btn.active {
  color: #fff;
  border-bottom-color: #eae166;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

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

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

  .crb-stats {
    flex-direction: column;
    gap: 15px;
  }

  .navbar {
    flex-direction: column;
    gap: 15px;
  }

  .message-cell {
    max-width: 200px;
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    padding: 12px 15px;
    font-size: 14px;
    white-space: nowrap;
  }
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

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

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

.modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 20px;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

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

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(80vh - 80px);
}

.modal-field {
  margin-bottom: 20px;
}

.modal-field strong {
  display: block;
  color: #666;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.modal-field span,
.modal-message,
.modal-response {
  display: block;
  color: #333;
  font-size: 15px;
  line-height: 1.6;
}

.modal-message {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid #667eea;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.modal-response {
  background: #fff3cd;
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
  border-left: 4px solid #ffc107;
  font-family: monospace;
}

/* SMS Controls */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.section-header h3 {
  margin: 0;
  color: #fff;
  font-size: 24px;
}

.sms-controls,
.submissions-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.search-input {
  padding: 10px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  width: 250px;
  transition: border-color 0.3s;
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
}

.filter-select {
  padding: 10px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  transition: border-color 0.3s;
  min-width: 150px;
}

.filter-select:focus {
  outline: none;
  border-color: #667eea;
}

/* CRB Badges */
.crb-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.crb-metropol {
  background: #e3f2fd;
  color: #1976d2;
}

.crb-transunion {
  background: #f3e5f5;
  color: #7b1fa2;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.pagination button {
  min-width: 100px;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#smsPageInfo,
#submissionsPageInfo,
.page-info {
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  min-width: 200px;
  text-align: center;
}

/* Button Sizes */
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 4px;
}

/* Responsive Modal */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-input,
  .filter-select {
    width: 100%;
  }

  .sms-controls,
  .submissions-controls {
    width: 100%;
  }

  .pagination {
    flex-direction: column;
    gap: 10px;
  }

  .pagination button {
    width: 100%;
  }
}
