body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8f9fa;
  color: #333;
}

/* Modern Welcome Screen */
.welcome-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  margin: 0;
  padding: 0;
}

.welcome-content {
  text-align: center;
  color: white;
  max-width: 500px;
  width: 90%;
}

.welcome-header h1 {
  font-size: 2.5rem;
  font-weight: 300;
  margin: 0 0 0.5rem 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.welcome-header p {
  font-size: 1.1rem;
  margin: 0 0 3rem 0;
  opacity: 0.9;
}

.auth-card {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  color: #333;
}

.auth-step {
  display: none;
}

.auth-step.active {
  display: block;
}

.auth-step h3 {
  color: #0066cc;
  font-size: 1.3rem;
  margin: 0 0 1rem 0;
  font-weight: 600;
}

.auth-step p {
  color: #666;
  margin: 0 0 2rem 0;
  line-height: 1.5;
}

.auth-card .form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.auth-card label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #495057;
}

.auth-card input {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.auth-card input:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0,102,204,0.25);
}

.auth-button {
  width: 100%;
  background: #0066cc;
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  margin-top: 1rem;
}

.auth-button:hover {
  background: #0056b3;
  transform: translateY(-1px);
}

.auth-button:active {
  transform: translateY(0);
}

.auth-error {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #fee;
  border: 1px solid #fcc;
  color: #c00;
  border-radius: 6px;
  display: none;
}

.auth-error:not(:empty) {
  display: block;
}

/* Modern Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-content {
  text-align: center;
  color: white;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 2rem auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-content h2 {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
  font-weight: 300;
}

.loading-content p {
  margin: 0;
  opacity: 0.8;
  font-size: 1rem;
}

/* Empty State for Tables */
.table-holder:empty::after {
  content: "";
  display: block;
  width: 40px;
  height: 40px;
  margin: 3rem auto;
  border: 3px solid #e9ecef;
  border-top: 3px solid #0066cc;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.reports-section:has(.table-holder:empty) h2::after {
  content: " - Loading...";
  font-weight: normal;
  color: #6c757d;
  font-size: 0.9em;
}

/* Table Styling */
.table-holder {
  margin: 1rem 0;
  background: white;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  overflow: hidden;
}

.table-holder:empty {
  display: none;
}

.table-holder button {
  padding: 6px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid #ced4da;
  background-color: #fff;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.table-holder button:hover {
  background-color: #f8f9fa;
}

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

.table-holder th,
.table-holder td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
}

.table-holder th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #495057;
  border-bottom: 2px solid #dee2e6;
}

.table-holder tr:hover {
  background-color: #f8f9fa;
}

/* Modern Tab Navigation */
.tab-navigation {
  background: white;
  border-bottom: 2px solid #e9ecef;
  padding: 0;
  margin: 0;
  display: flex;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tab-button {
  background: none;
  border: none;
  padding: 1rem 2rem;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #6c757d;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  position: relative;
}

.tab-button:hover {
  color: #495057;
  background-color: #f8f9fa;
}

.tab-button.active {
  color: #0066cc;
  border-bottom-color: #0066cc;
  background-color: white;
}

.admin-only {
  margin-left: auto;
}
/* Legacy styles for edit tables */
label {
  display: block;
  margin-top: 1rem;
  font-weight: bold;
}
input {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.25rem;
}

/* Tab Content */
.tab-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}

.tab-panel {
  display: none;
  padding: 2rem;
  background: #f8f9fa;
  min-height: calc(100vh - 80px);
}

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

/* Configuration Tab Styles */
.config-section {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.config-section h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: #343a40;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 0.5rem;
}

.config-section h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #495057;
  font-size: 1.1em;
}

.config-form .form-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.config-form .form-group {
  flex: 1;
}

.config-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #495057;
}

.config-form input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.config-form input:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0,102,204,0.25);
}

.run-section {
  text-align: center;
  padding: 2rem;
}

.run-button {
  background: #0066cc;
  color: white;
  border: none;
  padding: 1rem 3rem;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.run-button:hover {
  background: #0056b3;
}

/* Date Range Section */
.date-range-section {
  background: #e8f4f8;
  border-left: 4px solid #0066cc;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.date-range-form {
  display: flex;
  align-items: end;
  gap: 2rem;
}

.date-inputs {
  display: flex;
  gap: 1.5rem;
}

.date-inputs .form-group {
  flex: 1;
  min-width: 150px;
}

.date-inputs label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #495057;
}

.date-inputs input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.run-reports-btn {
  background: #0066cc;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
}

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

.run-reports-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

/* Reports Tab Styles */
.reports-section {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.reports-section h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: #343a40;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 0.5rem;
}

/* Admin Tab Styles */
.admin-note {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
  padding: 0.75rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.edit-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.edit-table th, .edit-table td {
  border: 1px solid #ccc;
  padding: 6px 8px;
  text-align: left;
  vertical-align: middle;
}

.edit-table th {
  background-color: #f8f8f8;
  font-weight: 600;
}

.edit-table input {
  width: 100%;
  padding: 4px 6px;
  font-family: inherit;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.edit-table .tight {
  width: 100px; /* For fixed-width fields like IDs */
  max-width: 100px;
  white-space: nowrap;
}

.edit-table .hiddenColumn {
  display: none;
}

.edit-table .actions {
  width: 50px;
  text-align: center;
}

.edit-table .remove-btn {
  background: transparent;
  border: none;
  color: #d33;
  font-size: 1.1rem;
  cursor: pointer;
}

.edit-table .remove-btn:hover {
  color: #a00;
}

