/* ===== PANEL KONFIGURACJI ===== */

.config-panel {
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  overflow-y: auto;
  border-right: 1px solid var(--border-light);
  background: #fff;
  padding: 1.2rem;
}

@media (min-width: 901px) {
  .config-panel {
    position: static;
    top: auto;
    height: auto;
    overflow: visible;
  }
}

.config-panel::-webkit-scrollbar {
  width: 6px;
}

.config-panel::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.panel-heading {
  color: var(--navy);
  font-family: var(--font-serif);
  font-size: 1.24rem;
  border-bottom: 2px solid var(--navy-ghost);
  padding-bottom: 0.7rem;
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.label-hint {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  color: var(--text-muted);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
  transition: border-color var(--transition);
}

.form-input,
.form-select {
  height: 41px;
  padding: 0 0.82rem;
}

.form-textarea {
  min-height: 86px;
  resize: vertical;
  padding: 0.65rem 0.82rem;
  line-height: 1.6;
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235b647b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.72rem center;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--navy-light);
}

.form-input[readonly] {
  background: #f7f9ff;
  color: var(--text-secondary);
  font-weight: 600;
}

.field-help {
  margin-top: 0.45rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* ===== DZIAŁY ===== */

.dzialy-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
}

.dzialy-list::-webkit-scrollbar {
  width: 4px;
}

.dzialy-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.dzialy-actions {
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.separator {
  color: var(--text-muted);
}

/* ===== CHECKBOXY ===== */

.checkbox-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.45;
  user-select: none;
  padding: 2px 0;
}

.option-main {
  display: inline-block;
  padding-top: 1px;
}

.option-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: 1px solid #cfd6e8;
  border-radius: 50%;
  background: #fff;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  margin-top: 1px;
}

.option-tooltip::before,
.option-tooltip::after {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  position: absolute;
  z-index: 40;
}

.option-tooltip::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #24324c;
  bottom: calc(100% + 4px);
  left: 8px;
  transform: translateY(4px) rotate(45deg);
  border: 0;
}

.option-tooltip::after {
  content: attr(data-tooltip);
  bottom: calc(100% + 8px);
  left: 0;
  width: 240px;
  max-width: min(240px, 72vw);
  background: #24324c;
  color: #fff;
  border-radius: 7px;
  padding: 7px 8px;
  font-size: 0.76rem;
  line-height: 1.35;
  letter-spacing: normal;
  text-transform: none;
  font-weight: 500;
  box-shadow: 0 8px 18px rgba(10, 18, 42, 0.22);
  transform: translateY(4px);
}

.option-tooltip:hover::before,
.option-tooltip:focus::before {
  opacity: 1;
  transform: translateY(0) rotate(45deg);
}

.option-tooltip:hover::after,
.option-tooltip:focus::after {
  opacity: 1;
  transform: translateY(0);
}

.option-tooltip:focus {
  outline: 2px solid #4f883d;
  outline-offset: 1px;
}

.checkbox-option input[type='checkbox'] {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  min-width: 17px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: #fff;
  margin-top: 1px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.checkbox-option input[type='checkbox']:checked {
  border-color: var(--navy);
  background: var(--navy);
}

.checkbox-option input[type='checkbox']:checked::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 10px;
  left: 4px;
  top: 0px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}

.checkbox-option input[type='checkbox']:disabled {
  background: #f2f4fa;
  border-color: #d5dbea;
  cursor: not-allowed;
}

.checkbox-option--dzial {
  font-size: 0.84rem;
  border-radius: 6px;
  padding: 4px 5px;
}

.checkbox-option--dzial:hover {
  background: var(--bg-panel);
}

/* ===== STEPPER ===== */

.number-input-wrapper {
  width: 145px;
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.number-btn {
  width: 38px;
  height: 38px;
  border: none;
  background: var(--bg-panel);
  color: var(--navy);
  font-size: 1.16rem;
  font-weight: 700;
  cursor: pointer;
}

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

.number-input {
  width: 69px;
  border: none;
  border-left: 1.5px solid var(--border);
  border-right: 1.5px solid var(--border);
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  -moz-appearance: textfield;
}

.number-input:disabled {
  background: #f7f9ff;
}

.number-input::-webkit-outer-spin-button,
.number-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.generator-pdf-note {
  margin-top: 0.72rem;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.62rem 0.72rem;
  border: 1px solid #dce3f2;
  border-radius: 8px;
  background: linear-gradient(135deg, #f6f9ff 0%, #eef6ff 100%);
  color: #3f4a67;
  font-size: 0.83rem;
  line-height: 1.4;
}

.generator-pdf-note__icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #4f883d;
  color: #fff;
  box-shadow: 0 4px 10px rgba(79, 136, 61, 0.25);
}

.generator-pdf-note__icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

/* ===== MOBILE ===== */

@media (max-width: 900px) {
  .config-panel {
    position: static;
    top: auto;
    height: auto;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }
}
