:root {
  --bg-primary: #0D0D0D;
  --bg-surface: #1A1A1A;
  --bg-elevated: #242424;
  --bg-row-alt: #141414;
  --bg-hover: #1E1E1E;
  --text-primary: #F5F5F5;
  --text-secondary: #C4C4C4;
  --text-tertiary: #8A8A8A;
  --border: #2E2E2E;
  --green: #00704A;
  --green-bright: #00A86B;
  --yellow: #FFC72C;
  --red: #E53935;
}

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

body {
  font-family: 'SUIT Variable', 'Rokkitt', -apple-system, sans-serif;
  letter-spacing: -0.025em;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 15px;
}

.font-en, .metric-value, code {
  font-family: 'Rokkitt', 'SUIT Variable', monospace;
}

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

header {
  text-align: left;
  margin-bottom: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-size: 23px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

header .subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 16px;
}

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

.section-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Buttons */
.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: -0.025em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  height: 36px;
  line-height: 1;
}

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

.btn-primary {
  background: var(--green);
  color: #FFFFFF;
}
.btn-primary:hover:not(:disabled) { background: #008657; }

.btn-action {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  min-width: 130px;
}
.btn-action:hover:not(:disabled) { border-color: var(--green); }

.btn-success { background: var(--green-bright); color: #0D0D0D; }
.btn-success:hover:not(:disabled) { background: #00c47c; }

.btn-danger { background: transparent; color: var(--red); border: 1px solid var(--red); }
.btn-danger:hover:not(:disabled) { background: var(--red); color: #FFFFFF; }

.btn-warning { background: var(--yellow); color: #1A1A1A; }
.btn-warning:hover:not(:disabled) { background: #e6b327; }

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--text-secondary); }

.btn-small { padding: 6px 10px; font-size: 12px; height: 28px; }

.action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Table */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
}

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

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

th {
  background: var(--bg-surface);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: -0.025em;
}

tbody tr { background: var(--bg-primary); }
tbody tr:nth-child(even) { background: var(--bg-row-alt); }
tbody tr:hover { background: var(--bg-hover); }
tbody tr:last-child td { border-bottom: none; }

.col-checkbox { width: 36px; text-align: center; }
.col-id { width: 110px; color: var(--text-secondary); }
.col-name { width: 160px; }
.col-campaign { min-width: 180px; }
.col-status { width: 130px; }

.empty-message {
  text-align: center;
  color: var(--text-tertiary);
  padding: 32px !important;
  font-size: 13px;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.status-pending {
  background: transparent;
  color: var(--text-tertiary);
  border-color: var(--border);
}
.status-before {
  background: transparent;
  color: var(--yellow);
  border-color: var(--yellow);
}
.status-after {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--text-primary);
}
.status-complete {
  background: var(--green);
  color: #FFFFFF;
}
.status-error {
  background: var(--red);
  color: #FFFFFF;
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-secondary);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--green);
}

/* Progress */
.progress-container { text-align: center; }

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

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

.progress-text {
  font-size: 14px;
  color: var(--text-secondary);
}

.progress-current {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.loading {
  opacity: 0.4;
  pointer-events: none;
}

/* ========== Scheduler Section ========== */
.scheduler-section {
  border-left: 2px solid var(--green);
}

.scheduler-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.status-indicator.status-running { background: var(--green-bright); }
.status-indicator.status-stopped { background: var(--text-tertiary); animation: none; }
.status-indicator.status-error { background: var(--red); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.scheduler-info {
  display: flex;
  gap: 24px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-label {
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0;
}

.info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'Rokkitt', 'SUIT Variable', monospace;
}

.scheduler-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.help-text {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ========== Reservation Scheduler Section ========== */
.reservation-section {
  border-left: 2px solid var(--yellow);
}

.time-selector select {
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  letter-spacing: -0.025em;
}

.time-selector select:disabled {
  background: var(--bg-surface);
  cursor: not-allowed;
  color: var(--text-tertiary);
}

.scheduled-tasks {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.scheduled-tasks h3 {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
}

.task-summary {
  display: flex;
  gap: 20px;
  margin-bottom: 8px;
}

.task-item {
  font-size: 13px;
  color: var(--text-secondary);
}

.task-item strong {
  color: var(--text-primary);
  font-weight: 700;
  font-family: 'Rokkitt', monospace;
}

/* ========== Spreadsheet Management Section ========== */
.spreadsheet-section {
  border-left: 2px solid var(--text-primary);
}

/* Service Account Notice */
.service-account-notice {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--yellow);
  border-radius: 4px;
  margin-bottom: 16px;
}

.notice-icon {
  font-size: 18px;
  color: var(--yellow);
  line-height: 1.3;
}

.notice-content { flex: 1; }

.notice-content strong {
  color: var(--yellow);
  font-size: 14px;
  font-weight: 700;
}

.notice-content p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 4px 0 8px;
}

.notice-content code {
  display: inline-block;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 2px;
  font-size: 12px;
  color: var(--text-primary);
  word-break: break-all;
  max-width: 100%;
}

.btn-copy {
  margin-left: 8px;
  padding: 6px 10px;
  font-size: 12px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.15s ease;
  font-family: inherit;
  letter-spacing: -0.025em;
}

.btn-copy:hover { border-color: var(--green); }

.reservation-manage-section {
  border-left: 2px solid var(--green-bright);
}

/* 준비중 섹션 */
.coming-soon {
  border-left-color: var(--text-tertiary) !important;
}
.coming-soon .section-header h2 { color: var(--text-secondary); }
.coming-soon-badge {
  display: inline-block;
  padding: 2px 8px;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #0D0D0D;
  background: var(--yellow);
  border-radius: 2px;
  letter-spacing: 0;
  vertical-align: middle;
}
.coming-soon-notice {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.coming-soon-inner {
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
  filter: grayscale(0.3);
}

.coming-soon-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 32px 0 16px;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.coming-soon-divider::before,
.coming-soon-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Scheduler Control */
.scheduler-control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.scheduler-info-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scheduler-info-inline .info-label {
  font-size: 13px;
  color: var(--text-tertiary);
  text-transform: none;
}

.scheduler-info-inline .info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Form Group */
.form-group {
  margin-bottom: 16px;
}

.input-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 150px;
}

.input-field label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0;
}

.input-field input,
.input-field select,
input, select, textarea {
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: inherit;
  letter-spacing: -0.025em;
  height: 36px;
}

.input-field input:focus,
.input-field select:focus,
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green-bright);
  box-shadow: 0 0 0 2px rgba(0, 168, 107, 0.5);
}

.btn:focus-visible,
.btn-copy:focus-visible,
.btn-delete:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--green-bright);
  outline-offset: 2px;
}

/* forced-colors / high-contrast 모드: box-shadow 억제 대비 OS outline 유지 */
@media (forced-colors: active) {
  input:focus, select:focus, textarea:focus,
  input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }
}

.input-field select:disabled,
select:disabled {
  background: var(--bg-surface);
  cursor: not-allowed;
  color: var(--text-tertiary);
}

/* List Container */
.list-container { margin-top: 16px; }

.list-container h3 {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
}

.item-list {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.item-list .empty-text {
  text-align: center;
  color: var(--text-tertiary);
  padding: 16px;
  font-size: 13px;
}

/* List Item */
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 2px;
  margin-bottom: 6px;
  gap: 8px;
}

.list-item:last-child { margin-bottom: 0; }
.list-item-info { flex: 1; min-width: 0; }
.list-item-name, .list-item-detail { overflow-wrap: anywhere; }

.list-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.list-item-detail {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  font-family: 'Rokkitt', monospace;
}

.list-item-actions {
  display: flex;
  gap: 6px;
}

.btn-delete {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  letter-spacing: -0.025em;
}

.btn-delete:hover {
  background: var(--red);
  border-color: var(--red);
  color: #FFFFFF;
}

/* Reservation Item */
.reservation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 2px;
  margin-bottom: 6px;
  gap: 8px;
  flex-wrap: wrap;
}

.reservation-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.reservation-item-title { overflow-wrap: anywhere; }

.reservation-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.reservation-item-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.reservation-item-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Rokkitt', monospace;
}

/* Scrollbar (dark) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* Responsive */
@media (max-width: 768px) {
  .container { padding: 16px 12px; }
  .input-row { flex-direction: column; gap: 8px; }
  .input-field { min-width: 100%; }
  .input-row .btn { width: 100%; }
  .scheduler-control { flex-direction: column; align-items: stretch; }
  .list-item, .reservation-item { flex-wrap: wrap; }
  .reservation-item-meta { flex-wrap: wrap; }
}
