@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  --dark: #111827;
  --yellow: #F4C542;
  --peach: #FFC4B2;
  --gray: #6B7280;
  --cream: #F9F6F1;
  --radius: 18px;
  --shadow: 0 2px 8px rgba(17, 24, 39, 0.06);
  --shadow-hover: 0 12px 28px rgba(17, 24, 39, 0.14);
}

* { box-sizing: border-box; }

body {
  font-family: 'Montserrat', -apple-system, sans-serif;
  background: var(--cream);
  color: var(--dark);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  animation: fadeSlideIn 0.5s ease both;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Header / logo ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.brand-mark {
  height: 44px;
  width: auto;
  flex-shrink: 0;
}

.logout-link {
  margin-left: auto;
  color: var(--gray);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}
.logout-link:hover { color: var(--dark); }

.brand h1 {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
}
.brand h1 .accent { color: var(--yellow); }

.tagline {
  color: var(--gray);
  font-size: 13px;
  font-weight: 500;
  margin: 0 0 36px 0;
  letter-spacing: 0.02em;
}

/* ---------- Waveform divider ---------- */
.waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  margin: 0 0 32px 0;
}
.waveform span {
  width: 3px;
  border-radius: 2px;
  background: var(--yellow);
  animation: wave 1.2s ease-in-out infinite;
}
.waveform span:nth-child(odd) { background: var(--peach); animation-delay: 0.15s; }
@keyframes wave {
  0%, 100% { height: 4px; }
  50% { height: 18px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn:hover { transform: translateY(-2px) scale(1.02); box-shadow: var(--shadow-hover); }
.btn:active { transform: translateY(0) scale(0.99); }

.btn-primary { background: var(--yellow); color: var(--dark); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-dark { background: var(--dark); color: var(--cream); }
.btn-ghost { background: #fff; color: var(--dark); box-shadow: var(--shadow); }

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

.card-link { display: block; text-decoration: none; color: inherit; }
.card-link-inline { display: block; text-decoration: none; color: inherit; min-width: 0; flex: 1; }

.card-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title { font-weight: 700; font-size: 15px; margin: 0 0 4px 0; }
.card-sub { color: var(--gray); font-size: 12px; margin: 0; }

.card-marked-done { opacity: 0.5; }
.card-marked-done .card-title { text-decoration: line-through; }

.card-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* ---------- Checkbox toggle ---------- */
.check-toggle { position: relative; display: inline-block; width: 24px; height: 24px; cursor: pointer; flex-shrink: 0; }
.check-toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.check-box {
  position: absolute; inset: 0;
  border: 2px solid #E9E5DC;
  border-radius: 7px;
  background: #fff;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.check-toggle input:checked ~ .check-box {
  background: var(--yellow);
  border-color: var(--yellow);
}
.check-box::after {
  content: "";
  position: absolute;
  left: 7px; top: 3px;
  width: 5px; height: 10px;
  border: solid var(--dark);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s ease;
}
.check-toggle input:checked ~ .check-box::after { transform: rotate(45deg) scale(1); }
.check-toggle input:active ~ .check-box { transform: scale(0.9); }

/* ---------- Pagination ---------- */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 28px;
}
.page-btn {
  color: var(--dark); font-weight: 700; font-size: 13px; text-decoration: none;
  padding: 8px 14px; border-radius: 999px; background: #fff; box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.page-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.page-btn.disabled { opacity: 0.35; pointer-events: none; }
.page-info { color: var(--gray); font-size: 12.5px; font-weight: 600; }

/* ---------- Status badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-progress { background: #FFF4D6; color: #92680B; }
.badge-progress .badge-dot { animation: pulse 1s ease-in-out infinite; }
.badge-review { background: #FFE4DB; color: #B4502E; }
.badge-done { background: #E3F5E9; color: #1E7A46; }
.badge-error { background: #FBE1E1; color: #B23434; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.new-dot {
  display: inline-block;
  background: var(--yellow);
  color: var(--dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 999px;
  margin-right: 6px;
  vertical-align: middle;
  animation: newPulse 1.6s ease-in-out infinite;
}
@keyframes newPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244, 197, 66, 0.5); }
  50% { box-shadow: 0 0 0 4px rgba(244, 197, 66, 0); }
}

/* ---------- Forms ---------- */
label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin: 22px 0 8px;
  color: var(--dark);
}
label:first-child { margin-top: 0; }
.hint { font-weight: 500; color: var(--gray); font-size: 12px; margin-top: -4px; display: block; }

.label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.label-row label { margin: 0; }
.btn-regen {
  background: var(--peach); color: var(--dark); border: none; border-radius: 999px;
  padding: 6px 14px; font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn-regen:hover { transform: translateY(-1px) scale(1.03); filter: brightness(1.05); }
.btn-regen:active { transform: scale(0.97); }

input[type=text], input[type=password], input[type=email], textarea, select {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid #E9E5DC;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type=text]:focus, input[type=password]:focus, input[type=email]:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 0 4px rgba(244, 197, 66, 0.25);
}
textarea { resize: vertical; min-height: 70px; }
textarea.mono { font-family: 'SF Mono', monospace; font-size: 12px; min-height: 220px; }

/* ---------- File drop zones ---------- */
.dropzone {
  position: relative;
  border: 2px dashed #E9E5DC;
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  background: #fff;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--yellow); background: #FFFBF0; }
.dropzone input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.dropzone .icon { font-size: 26px; margin-bottom: 6px; }
.dropzone .fname { font-size: 12px; color: var(--gray); margin-top: 6px; word-break: break-all; }

.dropzone-sm { padding: 14px; font-size: 12px; }
.dropzone-sm .icon { font-size: 18px; margin-bottom: 4px; }

.asset-row { display: flex; gap: 16px; margin-top: 22px; }
.asset-box { flex: 1; min-width: 0; }
.asset-ok {
  background: #E3F5E9; color: #1E7A46; font-size: 11.5px; font-weight: 700;
  padding: 6px 10px; border-radius: 8px; margin: 6px 0; word-break: break-all;
}

@media (max-width: 520px) {
  .asset-row { flex-direction: column; }
}

/* ---------- Misc ---------- */
.btnrow { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.back-link { display: inline-block; margin-top: 32px; color: var(--gray); font-size: 13px; font-weight: 600; text-decoration: none; }
.back-link:hover { color: var(--dark); }

.empty { color: var(--gray); font-size: 13px; padding: 20px 0; }

pre.log {
  background: var(--dark);
  color: #d6dae3;
  padding: 16px;
  border-radius: 14px;
  font-size: 11.5px;
  overflow-x: auto;
  max-height: 280px;
  margin-top: 8px;
}

.processing-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFF4D6;
  color: #7A5A0B;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
}
.safe-to-close {
  font-weight: 500;
  font-size: 11.5px;
  opacity: 0.85;
  margin-top: 4px;
}
.error-reason {
  font-weight: 500;
  font-size: 12px;
  margin-top: 6px;
  font-family: monospace;
  word-break: break-word;
}
.error-reason a { color: inherit; text-decoration: underline; }
.spinner {
  width: 16px; height: 16px;
  border: 2.5px solid rgba(122, 90, 11, 0.25);
  border-top-color: #7A5A0B;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-track {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: rgba(122, 90, 11, 0.15);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #7A5A0B;
  border-radius: 999px;
  transition: width 0.2s ease;
}
.banner-error { background: #FBE1E1; color: #B23434; }
.banner-error .spinner { display: none; }
.banner-error .progress-track { display: none; }

/* ---------- Schedule ---------- */
.schedule-block {
  margin-top: 12px;
  padding-top: 20px;
  border-top: 1.5px dashed #E9E5DC;
}
.schedule-manual-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.schedule-manual-row input[type=datetime-local] {
  flex: 1;
  min-width: 200px;
  padding: 13px 16px;
  border: 1.5px solid #E9E5DC;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
}
.schedule-manual-row input[type=datetime-local]:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 0 4px rgba(244, 197, 66, 0.25);
}

/* ---------- Responsive ---------- */
@media (max-width: 520px) {
  .wrap { padding: 32px 18px 60px; }
  .card-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .badge { align-self: flex-start; }
  .brand h1 { font-size: 19px; }
}
