* {
  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;
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}

.container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  padding: 40px;
  max-width: 720px;
  width: 100%;
  align-self: flex-start;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 28px;
  text-align: center;
  color: #16213e;
}

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

.header-row h1 {
  margin-bottom: 0;
}

.logout-btn {
  padding: 6px 14px;
  background: none;
  border: 1px solid #ccc;
  border-radius: 6px;
  color: #666;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  border-color: #c62828;
  color: #c62828;
}

/* Login page */
.login-container {
  max-width: 400px;
}

.text-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
}

.text-input:focus {
  outline: none;
  border-color: #16213e;
}

.login-error {
  margin-top: 12px;
  color: #c62828;
  font-size: 0.85rem;
  text-align: center;
}

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

.form-group > label:first-child {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

input[type="file"] {
  display: none;
}

.form-group:has(input[type="file"]) > label:first-child {
  display: inline-block;
  padding: 10px 20px;
  background: #16213e;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.form-group:has(input[type="file"]) > label:first-child:hover {
  background: #0f3460;
}

.file-name {
  display: inline-block;
  margin-left: 12px;
  color: #666;
  font-size: 0.85rem;
}

select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  background: #fff;
  cursor: pointer;
}

.radio-group {
  display: flex;
  gap: 20px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
}

input[type="range"] {
  width: 100%;
  accent-color: #16213e;
}

button[type="submit"] {
  width: 100%;
  padding: 12px;
  background: #16213e;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

button[type="submit"]:hover {
  background: #0f3460;
}

button[type="submit"]:disabled {
  background: #999;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

/* Progress section */
#progress {
  margin-top: 24px;
}

#progress h2 {
  font-size: 1.1rem;
  margin-bottom: 0;
}

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

.csv-btn {
  padding: 6px 14px;
  background: #2e7d32;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.csv-btn:hover {
  background: #1b5e20;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 16px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: #16213e;
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Results table */
#resultsTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

#resultsTable th {
  text-align: left;
  padding: 8px 10px;
  background: #f5f5f5;
  border-bottom: 2px solid #ddd;
  font-weight: 600;
}

#resultsTable td {
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.file-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-pending {
  background: #e0e0e0;
  color: #666;
}

.badge-processing {
  background: #fff3e0;
  color: #e65100;
}

.badge-done {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge-error {
  background: #ffebee;
  color: #c62828;
}

/* Result cell links and buttons */
.result-link {
  font-family: monospace;
  font-size: 0.8rem;
  word-break: break-all;
}

.copy-btn-sm {
  padding: 2px 8px;
  font-size: 0.75rem;
  background: #16213e;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 4px;
}

.download-btn-sm {
  display: inline-block;
  padding: 4px 12px;
  background: #16213e;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.download-btn-sm:hover {
  background: #0f3460;
}

.drive-link-sm {
  font-size: 0.75rem;
  color: #0f3460;
}
