/* ── Optimizer page styles ─────────────────────────────────── */

.opt-main {
  padding: var(--sp-4);
  max-width: 600px;
  margin: 0 auto;
}
@media(max-width:767px) {
  .opt-main { padding-bottom: var(--sp-4); }
}

/* Input card */
.opt-input-card {
  background: var(--surface);
  border: 1.5px solid var(--accent-light);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  box-shadow: var(--sh-sm);
}

.opt-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: var(--sp-3);
}

.opt-day-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.opt-day-row label {
  font-size: 13px;
  color: var(--text-2);
  flex: 1;
}

.opt-stepper {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--accent-light);
  border-radius: var(--r-md);
  overflow: hidden;
}

.opt-stepper button {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  transition: background var(--transition);
}

.opt-stepper button:hover { background: var(--accent); color: #fff; }

.opt-stepper-val {
  width: 44px;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  background: var(--surface);
}

.opt-toggle-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.opt-toggle-row label {
  font-size: 13px;
  color: var(--text-2);
  flex: 1;
  cursor: pointer;
}

.opt-toggle {
  width: 44px;
  height: 26px;
  border-radius: var(--r-full);
  background: var(--border);
  border: none;
  position: relative;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}

.opt-toggle::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

.opt-toggle[aria-checked="true"] {
  background: var(--accent);
}

.opt-toggle[aria-checked="true"]::after {
  transform: translateX(18px);
}

/* Date range info bar */
.opt-date-info {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: var(--sp-3);
}

.opt-date-info .material-symbols-outlined {
  font-size: 16px;
  color: var(--accent);
}

.opt-date-info strong { color: var(--accent); }

/* Results header */
.opt-results-header {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: var(--sp-2);
  padding: 0 var(--sp-1);
}

/* Result items */
.opt-result-item {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--sp-3);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.opt-result-item.empfohlen {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.opt-result-item.exceeds-budget {
  opacity: 0.5;
}

.opt-result-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
}

.opt-days-bubble {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  background: var(--accent-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.exceeds-budget .opt-days-bubble {
  background: #fee2e2;
}

.opt-days-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.exceeds-budget .opt-days-num { color: #dc2626; }

.opt-days-lbl {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
}

.opt-result-info { flex: 1; min-width: 0; }

.opt-result-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.opt-result-meta {
  font-size: 12px;
  color: var(--muted);
}

.opt-result-meta .vac-days { color: var(--accent); font-weight: 600; }
.opt-result-meta .exceeds { color: #dc2626; font-weight: 600; }

.opt-result-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-1);
}

.opt-badge-empfohlen {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r-full);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.opt-expand-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.opt-expand-btn:hover { background: var(--accent-light); color: var(--accent); }

/* Breakdown (collapsed by default) */
.opt-breakdown {
  display: none;
  padding: 0 var(--sp-4) var(--sp-3);
  border-top: 1px solid var(--border-subtle);
}

.opt-result-item.expanded .opt-breakdown { display: block; }

.opt-breakdown-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: var(--sp-2) 0 var(--sp-2);
}

.opt-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
}

.opt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.opt-dot-weekend { background: var(--muted); }
.opt-dot-feiertag { background: var(--feiertag-b); }
.opt-dot-schulferien { background: var(--ferien-b); }
.opt-dot-urlaub { background: var(--accent); }

.opt-bd-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-1) 0;
  border-bottom: 1px dashed var(--border-subtle);
  font-size: 12px;
}

.opt-bd-row:last-child { border-bottom: none; }

.opt-bd-label { flex: 1; color: var(--text-2); }
.opt-bd-count { font-weight: 600; color: var(--text); flex-shrink: 0; }

/* Empty state */
.opt-empty {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  color: var(--muted);
  font-size: 14px;
}


/* Dark mode adjustments */
[data-theme="dark"] .opt-days-bubble { background: rgba(37,99,168,.25); }
[data-theme="dark"] .opt-badge-empfohlen { background: var(--accent); }
