/* Corporate color palette */
:root {
  --gold: #F5C451;
  --gold-muted: #D4B86A;
  --gold-light: #FBF6E9;
  --gold-dark: #8B7030;
  
  --coral: #D95F4E;
  --coral-muted: #C98B82;
  --coral-light: #FBEAE8;
  --coral-dark: #8B3D35;
  
  --navy: #3D5A9B;
  --navy-muted: #5A6E94;
  --navy-light: #E8ECF4;
  --navy-dark: #2A3F6B;
  
  --mint: #94C9B8;
  --mint-muted: #7BAA9A;
  --mint-light: #EBF5F2;
  --mint-dark: #4A7566;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--navy-light);
  color: #333;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 32px;
}

/* Main tabs */
.main-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--navy-muted);
  padding-bottom: 0;
}

.main-tab {
  padding: 12px 24px;
  background: transparent;
  border: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--navy-muted);
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: all 0.2s ease;
}

.main-tab:hover {
  background: rgba(61, 90, 155, 0.1);
  color: var(--navy-dark);
}

.main-tab.active {
  background: white;
  color: var(--navy);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

.main-panel {
  background: white;
  border-radius: 0 12px 12px 12px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.main-panel.hidden {
  display: none;
}

/* Header */
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

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

h1 {
  margin: 0 0 2px 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--navy-dark);
}

.subtitle {
  margin: 0;
  color: var(--navy-muted);
  font-size: 14px;
}

/* Buttons */
button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

button.primary {
  background: var(--navy);
  color: white;
}

button.primary:hover:not(:disabled) {
  background: var(--navy-dark);
}

button.secondary {
  background: var(--navy-light);
  color: var(--navy-dark);
}

button.secondary:hover:not(:disabled) {
  background: #d0d8e8;
}

/* Input grid */
.input-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.file-inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-row label {
  width: 60px;
  font-weight: 500;
  color: var(--navy-dark);
}

.file-input {
  width: 0;
  height: 0;
  opacity: 0;
  position: absolute;
}

.file-row .file-name {
  flex: 1;
  padding: 10px 14px;
  background: var(--navy-light);
  border: 1px solid #d0d8e8;
  border-radius: 6px;
  font-size: 13px;
  color: var(--navy-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-row .file-name:hover {
  border-color: var(--navy);
  background: white;
}

.file-row .file-name.has-file {
  color: var(--navy-dark);
  background: white;
}

/* Options */
.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.option-row label {
  width: 70px;
  font-weight: 500;
  color: var(--navy-dark);
}

.option-row select,
.option-row input[type="text"] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #d0d8e8;
  border-radius: 6px;
  font-size: 13px;
  background: white;
}

.custom-url-row.hidden {
  display: none;
}

/* Progress */
.progress-container {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--navy-light) 0%, #f0f4fa 100%);
  border: 1px solid var(--navy-muted);
  border-radius: 8px;
  padding: 14px 20px;
  margin: 16px 0;
}

.progress-container.hidden {
  display: none;
}

.progress-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--navy-light);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.progress-message {
  font-size: 15px;
  color: var(--navy-dark);
  font-weight: 500;
}

/* Status */
.status {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.status:empty {
  display: none;
}

.status.error {
  background: var(--coral-light);
  color: var(--coral-dark);
  border: 1px solid var(--coral-muted);
}

.status.success {
  background: var(--mint-light);
  color: var(--mint-dark);
  border: 1px solid var(--mint-muted);
}

/* Results */
.results {
  margin-top: 20px;
}

.results.hidden {
  display: none;
}

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

.exec-summary {
  font-size: 18px;
  font-weight: 600;
}

.exec-summary.pass {
  color: var(--mint-dark);
}

.exec-summary.fail {
  color: var(--coral-dark);
}

.download-btn {
  background: var(--gold);
  color: var(--gold-dark);
}

.download-btn:hover {
  background: var(--gold-muted);
}

/* Summary cards */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.card {
  padding: 16px;
  background: var(--navy-light);
  border-radius: 8px;
  text-align: center;
}

.card-title {
  font-size: 13px;
  color: var(--navy-muted);
  margin-bottom: 8px;
}

.card-stats {
  font-size: 14px;
}

.card-stats .pass-count {
  color: var(--mint-dark);
  font-weight: 600;
}

.card-stats .fail-count {
  color: var(--coral-dark);
  font-weight: 600;
}

/* Search */
.global-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.global-search input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #d0d8e8;
  border-radius: 6px;
  font-size: 14px;
}

.search-count {
  font-size: 13px;
  color: var(--navy-muted);
}

.search-clear {
  padding: 6px 10px;
  background: transparent;
  border: 1px solid #d0d8e8;
  border-radius: 4px;
  font-size: 12px;
}

.search-clear.hidden {
  display: none;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 16px;
}

.tab {
  padding: 10px 16px;
  background: transparent;
  border: none;
  font-size: 13px;
  color: var(--navy-muted);
  cursor: pointer;
  border-radius: 6px 6px 0 0;
}

.tab:hover {
  background: var(--navy-light);
}

.tab.active {
  background: var(--navy-light);
  color: var(--navy);
  font-weight: 500;
}

.tab-content {
  min-height: 200px;
}

.tab-content.hidden {
  display: none;
}

/* Output */
.output {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 16px;
  border-radius: 8px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 12px;
  overflow: auto;
  max-height: 400px;
}

.output.hidden {
  display: none;
}

/* Batch testing */
.batch-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e0e0e0;
}

.batch-sites {
  display: flex;
  gap: 16px;
}

.batch-sites label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
}

.batch-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.batch-actions input {
  padding: 8px 12px;
  border: 1px solid #d0d8e8;
  border-radius: 6px;
  font-size: 13px;
  width: 200px;
}

#batch-selected-count {
  font-size: 13px;
  color: var(--navy-muted);
  margin-left: 8px;
}

.batch-scenario-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 16px;
}

.batch-loading {
  padding: 40px;
  text-align: center;
  color: var(--navy-muted);
}

.batch-scenario-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.2s ease;
}

.batch-scenario-item:hover {
  background: var(--navy-light);
}

.batch-scenario-item input {
  width: 16px;
  height: 16px;
}

.scenario-client-name {
  flex: 1;
  font-weight: 500;
  color: var(--navy-dark);
}

.scenario-name {
  flex: 2;
  font-size: 13px;
  color: var(--navy-muted);
}

.scenario-site {
  width: 60px;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--navy-muted);
}

.scenario-status {
  width: 24px;
  text-align: center;
}

.scenario-status.ready {
  color: var(--mint-dark);
}

.scenario-status.missing {
  color: var(--coral-muted);
}

/* Batch progress */
.batch-progress {
  margin-bottom: 16px;
}

.batch-progress.hidden {
  display: none;
}

.batch-progress-bar {
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.batch-progress-fill {
  height: 100%;
  background: var(--navy);
  transition: width 0.3s ease;
}

.batch-progress-stats {
  display: flex;
  gap: 16px;
  font-size: 14px;
}

.batch-progress-stats .pass {
  color: var(--mint-dark);
}

.batch-progress-stats .fail {
  color: var(--coral-dark);
}

/* Batch results */
.batch-results.hidden {
  display: none;
}

.batch-results-summary {
  padding: 16px;
  background: var(--navy-light);
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 15px;
}

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

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

.batch-results-table th {
  background: var(--navy-light);
  font-weight: 500;
  font-size: 13px;
  color: var(--navy-muted);
}

.batch-results-table tr:hover {
  background: #f8f9fa;
}

/* Results table */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

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

.results-table th {
  background: var(--navy-light);
  font-weight: 500;
  color: var(--navy-dark);
  position: sticky;
  top: 0;
}

.results-table tr.pass td:first-child {
  border-left: 3px solid var(--mint);
}

.results-table tr.fail td:first-child {
  border-left: 3px solid var(--coral);
}

.results-table tr.fail {
  background: var(--coral-light);
}

/* Toast notifications */
.toast-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

.toast-notification.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-notification.toast-success {
  background: var(--mint);
  color: white;
}

.toast-notification.toast-error {
  background: var(--coral);
  color: white;
}

.toast-notification.toast-info {
  background: var(--navy);
  color: white;
}

/* Responsive */
@media (max-width: 900px) {
  .input-grid {
    grid-template-columns: 1fr;
  }
  
  .summary-cards {
    grid-template-columns: 1fr;
  }
  
  .batch-controls {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .batch-actions {
    flex-wrap: wrap;
  }
}
