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

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

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

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 20px;
  background: #1a1a2e;
  color: white;
  border-radius: 8px;
}

header h1 {
  font-size: 1.5rem;
}

.api-key-section {
  display: flex;
  gap: 8px;
}

.api-key-section input {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  width: 200px;
  font-size: 0.9rem;
}

.api-key-section button {
  padding: 8px 16px;
  background: #4361ee;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

.actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.actions-left {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.start-all-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.start-all-hint {
  font-size: 0.72rem;
  color: #888;
  max-width: 220px;
  line-height: 1.3;
}

.status-count {
  font-size: 0.9rem;
  color: #666;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.85;
}

.btn-primary {
  background: #4361ee;
  color: white;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-success {
  background: #2ec4b6;
  color: white;
}

.btn-danger {
  background: #e63946;
  color: white;
}

.btn-warning {
  background: #f77f00;
  color: white;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}

/* Form Modal */
.modal-form {
  max-width: 600px;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.form-group {
  flex: 1;
  min-width: 180px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #555;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.field-hint {
  font-size: 0.72rem;
  color: #888;
  margin-top: 2px;
  display: block;
}

/* Table */
table {
  width: 100%;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border-collapse: collapse;
}

thead {
  background: #1a1a2e;
  color: white;
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 500;
}

td {
  padding: 10px 16px;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}

tr:hover {
  background: #f8f9fa;
}

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

/* Status badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-running {
  background: #d4edda;
  color: #155724;
}

.badge-stopped {
  background: #e2e3e5;
  color: #383d41;
}

.badge-error {
  background: #f8d7da;
  color: #721c24;
}

.actions-cell {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.error-text {
  max-width: 200px;
  font-size: 0.8rem;
  color: #e63946;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-type {
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.8rem;
}

/* Filter buttons */
.filter-btn {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  background: #e2e3e5;
  color: #555;
  margin-right: 6px;
  transition: background 0.2s, color 0.2s;
}

.filter-btn:hover {
  background: #d0d1d3;
}

.filter-btn.active {
  background: #4361ee;
  color: white;
}

.btn-stop-all {
  background: #e63946 !important;
  color: white !important;
}

.btn-stop-all:hover {
  background: #c1121f !important;
}

/* Disabled bank row */
.row-disabled {
  opacity: 0.5;
  background: #f9f9f9;
}

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

.missing-info {
  font-size: 0.7rem;
  color: #e63946;
  font-weight: 500;
}

/* Settings */
.settings-section {
  background: white;
  padding: 20px 24px;
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.settings-section h2 {
  margin-bottom: 14px;
  font-size: 1.2rem;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.settings-row label {
  font-weight: 500;
  color: #555;
}

.settings-row input[type="date"] {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.date-preview {
  font-size: 0.85rem;
  color: #4361ee;
  font-weight: 500;
}

/* CSV Upload */
.csv-upload-section {
  background: white;
  padding: 24px;
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.csv-upload-section h2 {
  margin-bottom: 16px;
  font-size: 1.2rem;
}

.csv-select-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.csv-select-row label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #555;
}

.csv-select-row select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
}

.drop-area {
  border: 2px dashed #ccc;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.drop-area:hover,
.drop-area.highlight {
  background: #f0f2f5;
  border-color: #4361ee;
}

.drop-text {
  font-size: 1.2rem;
  color: #555;
  margin-bottom: 8px;
}

.drop-sub {
  font-size: 0.9rem;
  color: #999;
}

#uploadStatus {
  margin-top: 16px;
  font-weight: 600;
  font-size: 0.95rem;
}

#uploadStatus.success {
  color: #155724;
}

#uploadStatus.error {
  color: #e63946;
}

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

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow: auto;
}

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

.modal-header h3 {
  font-size: 1.1rem;
}

.modal-body {
  padding: 16px 20px;
  text-align: center;
}

.modal-body img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.modal-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid #eee;
}

.modal-footer label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #555;
}

.modal-footer input {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
}

.no-screenshot {
  color: #999;
  padding: 40px;
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  .form-row {
    flex-direction: column;
  }
  table {
    font-size: 0.8rem;
  }
  th, td {
    padding: 8px;
  }
}
