/* Cards */
.card {
  background: var(--warm);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 14px;
}

.card-header {
  background: var(--navy);
  padding: 13px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header.care {
  background: #1a4a2e;
}

.card-header h3 {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  font-weight: 400;
}

/* Badges */
.badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 2px;
  letter-spacing: 0.5px;
}

.badge-gold {
  background: rgba(201, 168, 76, 0.2);
  color: var(--gold);
}

.badge-red {
  background: rgba(180, 40, 40, 0.25);
  color: #f99;
}

.badge-green {
  background: rgba(30, 90, 50, 0.35);
  color: #8ee8a8;
}

.badge-muted {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.45);
}

.card-body {
  padding: 20px;
}

/* Fields */
.field {
  margin-bottom: 14px;
}

.field:last-child {
  margin-bottom: 0;
}

.field-row {
  display: flex;
  gap: 12px;
}

.field-row .field {
  flex: 1;
}

.field-row .field.narrow {
  flex: 0.45;
}

label.fl {
  display: block;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
  margin-bottom: 5px;
  text-transform: uppercase;
}

input[type=text],
select,
textarea {
  width: 100%;
  border: 1px solid var(--mid);
  border-radius: 3px;
  padding: 9px 11px;
  font-family: 'Alata', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}

input[type=text]:focus,
select:focus,
textarea:focus {
  border-color: var(--navy);
}

textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.55;
}

/* Upload zone */
.upload-zone {
  border: 1.5px dashed var(--mid);
  border-radius: 4px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  background: var(--white);
  transition: all 0.2s;
  margin-bottom: 10px;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--navy);
  background: #f0f4f9;
}

.upload-zone.zone-outlier {
  border-color: rgba(211, 84, 0, 0.4);
  background: #fffbf6;
}

.upload-zone.zone-care {
  border-color: rgba(30, 90, 50, 0.4);
  background: #f6fbf8;
}

.upload-zone.zone-prev {
  border-color: rgba(201, 168, 76, 0.4);
  background: #fdfbf5;
}

.upload-zone input[type=file] {
  display: none;
}

.upload-icon {
  font-size: 20px;
  margin-bottom: 5px;
}

.upload-text {
  font-size: 13px;
  color: var(--muted);
}

.upload-text strong {
  color: var(--navy);
}

.upload-hint {
  font-size: 11px;
  color: #aaa;
  margin-top: 3px;
}

/* File lists */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #eef4fb;
  border: 1px solid #c5d9ee;
  border-radius: 3px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--navy);
}

.file-item.processing {
  background: #fff9ee;
  border-color: #f0c870;
}

.file-item.done {
  background: #eef6ee;
  border-color: #90c090;
}

.fn {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fs {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.file-remove {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
}

.file-remove:hover {
  color: #c0392b;
}

.prev-status {
  background: #f7f4ef;
  border: 1px solid #c5d9ee;
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--navy);
  display: none;
  margin-top: 8px;
}

.prev-status.loaded {
  display: block;
  background: #eef6ee;
  border-color: #90c090;
}

.prev-status.error {
  display: block;
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.prev-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.pstat {
  font-size: 11px;
  color: var(--muted);
}

.pstat strong {
  color: var(--navy);
}

/* Section checklist focus grid */
.focus-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.focus-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--mid);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.focus-toggle.active {
  background: #eef4fb;
  border-color: var(--blue);
}

.focus-toggle input {
  display: none;
}

.fcheck {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--mid);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.15s;
}

.focus-toggle.active .fcheck {
  background: var(--navy);
  border-color: var(--navy);
}

.fcheck::after {
  content: '';
  display: none;
  width: 4px;
  height: 7px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

.focus-toggle.active .fcheck::after {
  display: block;
}

.focus-label {
  font-size: 13px;
  color: var(--text);
  line-height: 1.3;
}

.focus-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* Action runners */
.btn-run {
  width: 100%;
  padding: 15px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 4px;
  font-family: 'Alata', sans-serif;
  font-size: 15px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 6px;
}

.btn-run:hover {
  background: var(--blue);
}

.btn-gold {
  padding: 8px 18px;
  background: none;
  border: 1px solid rgba(201, 168, 76, 0.4);
  color: var(--gold);
  border-radius: 3px;
  font-family: 'Alata', sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-gold:hover {
  background: rgba(201, 168, 76, 0.1);
}

.btn-navy {
  padding: 8px 18px;
  background: var(--navy);
  border: 1px solid var(--navy);
  color: var(--white);
  border-radius: 3px;
  font-family: 'Alata', sans-serif;
  font-size: 12px;
  cursor: pointer;
}

.btn-navy:hover {
  background: var(--blue);
}

.error-box {
  display: none;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 3px;
  padding: 11px 14px;
  font-size: 13px;
  color: #991b1b;
  margin-bottom: 14px;
}

/* Spinner and generating panel */
.generating {
  display: none;
  text-align: center;
  padding: 60px 20px;
}

.gen-ring {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(201, 168, 76, 0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 18px;
}

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

.generating p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
}

.gen-status {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  color: var(--gold);
  font-size: 16px;
  margin-top: 8px;
}

/* Report Panel */
.report {
  display: none;
}

.report-header {
  background: var(--dark);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 6px;
  padding: 18px 22px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.report-header h2 {
  font-size: 20px;
  color: var(--white);
  font-weight: 400;
}

.report-header .meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 3px;
}

.report-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.report-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rsection {
  background: var(--warm);
  border-radius: 5px;
  overflow: hidden;
  border-left: 3px solid var(--navy);
}

.rsection.urgent {
  border-left-color: #c0392b;
}

.rsection-title {
  background: var(--white);
  padding: 11px 16px;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--navy);
  text-transform: uppercase;
  border-bottom: 1px solid var(--mid);
}

.rsection-body {
  padding: 15px 16px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}

.outlier-banner {
  background: rgba(211, 84, 0, 0.1);
  border: 1px solid rgba(211, 84, 0, 0.3);
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 12px;
  color: rgba(255, 200, 150, 0.9);
  margin-bottom: 12px;
  display: none;
}

.outlier-banner.show {
  display: block;
}

@media(max-width:580px) {
  .focus-grid {
    grid-template-columns: 1fr;
  }
}
