/* Stammdaten V103d3y — Audit-aligned Tokens */

/* ============================================================
   Modal Dialog Container
   ============================================================ */
#brand-edit-modal.sd-stammdaten .modal-dialog,
#talent-edit-modal.sd-stammdaten .modal-dialog {
  max-width: 760px;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
  background: #ffffff;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   Modal Header
   ============================================================ */
#brand-edit-modal.sd-stammdaten .modal-header,
#talent-edit-modal.sd-stammdaten .modal-header {
  padding: 16px 22px 14px;
  border-bottom: 1px solid #e4e8f0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

#brand-edit-modal.sd-stammdaten .modal-header h2,
#talent-edit-modal.sd-stammdaten .modal-header h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 4px 0;
  color: #111827;
  line-height: 1.25;
}

#brand-edit-modal.sd-stammdaten .modal-header .modal-subtitle,
#talent-edit-modal.sd-stammdaten .modal-header .modal-subtitle {
  font-size: 12px;
  font-weight: 400;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
}

#brand-edit-modal.sd-stammdaten .modal-close,
#talent-edit-modal.sd-stammdaten .modal-close {
  background: transparent;
  border: none;
  font-size: 22px;
  color: #6b7280;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

#brand-edit-modal.sd-stammdaten .modal-close:hover,
#talent-edit-modal.sd-stammdaten .modal-close:hover {
  background: #f5f5f5;
  color: #111827;
}

/* ============================================================
   Tabs
   ============================================================ */
#brand-edit-modal.sd-stammdaten .sd-tabs,
#talent-edit-modal.sd-stammdaten .sd-tabs {
  border-bottom: 1px solid #e4e8f0;
  display: flex;
  gap: 0;
  padding: 0 22px;
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 2;
}

#brand-edit-modal.sd-stammdaten .sd-tab-btn,
#talent-edit-modal.sd-stammdaten .sd-tab-btn {
  border: none;
  background: transparent;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, background 0.15s, border-color 0.15s, font-weight 0.15s;
  letter-spacing: 0;
}

#brand-edit-modal.sd-stammdaten .sd-tab-btn:hover:not(.active),
#talent-edit-modal.sd-stammdaten .sd-tab-btn:hover:not(.active) {
  color: #374151;
  background: #fafafa;
}

#brand-edit-modal.sd-stammdaten .sd-tab-btn.active,
#talent-edit-modal.sd-stammdaten .sd-tab-btn.active {
  color: #111827;
  font-weight: 600;
  border-bottom-color: #2563eb;
}

/* ============================================================
   Modal Body & Tab Panels
   ============================================================ */
#brand-edit-modal.sd-stammdaten .modal-body,
#talent-edit-modal.sd-stammdaten .modal-body {
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

#brand-edit-modal.sd-stammdaten .sd-tab-panel,
#talent-edit-modal.sd-stammdaten .sd-tab-panel {
  padding: 18px 22px 8px;
  display: none;
}

#brand-edit-modal.sd-stammdaten .sd-tab-panel.active,
#talent-edit-modal.sd-stammdaten .sd-tab-panel.active {
  display: block;
}

/* ============================================================
   Rows / Grid Layout (180px Label / 1fr Value)
   ============================================================ */
#brand-edit-modal.sd-stammdaten .sd-row,
#talent-edit-modal.sd-stammdaten .sd-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

#brand-edit-modal.sd-stammdaten .sd-row.sd-row-double,
#talent-edit-modal.sd-stammdaten .sd-row.sd-row-double {
  grid-template-columns: 180px 1fr 1fr;
}

#brand-edit-modal.sd-stammdaten .sd-row.sd-row-full,
#talent-edit-modal.sd-stammdaten .sd-row.sd-row-full {
  grid-template-columns: 1fr;
}

#brand-edit-modal.sd-stammdaten .sd-row.sd-row-stack,
#talent-edit-modal.sd-stammdaten .sd-row.sd-row-stack {
  grid-template-columns: 1fr;
}

#brand-edit-modal.sd-stammdaten .sd-row.sd-row-stack .sd-label,
#talent-edit-modal.sd-stammdaten .sd-row.sd-row-stack .sd-label {
  margin-bottom: 4px;
}

/* ============================================================
   Labels
   ============================================================ */
#brand-edit-modal.sd-stammdaten .sd-label,
#talent-edit-modal.sd-stammdaten .sd-label {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  letter-spacing: 0.01em;
  padding-top: 9px;
  line-height: 1.3;
}

#brand-edit-modal.sd-stammdaten .sd-label.sd-label-required::after,
#talent-edit-modal.sd-stammdaten .sd-label.sd-label-required::after {
  content: "*";
  color: #d33;
  font-weight: 700;
  margin-left: 3px;
}

#brand-edit-modal.sd-stammdaten .sd-mini-label,
#talent-edit-modal.sd-stammdaten .sd-mini-label {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  letter-spacing: 0.02em;
  text-transform: none;
  margin: 0 0 4px 0;
}

/* ============================================================
   Fields (Input / Select)
   ============================================================ */
#brand-edit-modal.sd-stammdaten .sd-field,
#talent-edit-modal.sd-stammdaten .sd-field {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  color: #111827;
  background: #ffffff;
  line-height: 36px;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

#brand-edit-modal.sd-stammdaten .sd-field:focus,
#talent-edit-modal.sd-stammdaten .sd-field:focus {
  outline: none;
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

#brand-edit-modal.sd-stammdaten .sd-field::placeholder,
#talent-edit-modal.sd-stammdaten .sd-field::placeholder {
  color: #9ca3af;
}

#brand-edit-modal.sd-stammdaten .sd-field-group,
#talent-edit-modal.sd-stammdaten .sd-field-group {
  display: grid;
  gap: 8px;
}

/* V105z (Audit #22): .modal-overlay select{background:var(--tt-surface)!important} (shorthand)
   löschte das background-image → Dropdown-Pfeil verschwand. Chevron via background-image
   (NICHT shorthand) + !important zurückholen, damit der weiße Fill der Overlay-Regel bleibt. */
#brand-edit-modal.sd-stammdaten select.sd-field,
#talent-edit-modal.sd-stammdaten select.sd-field {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 4.5l3 3 3-3' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  padding-right: 30px !important;
}

/* V105z (Audit #23): .tt-fullpage-modal / v93 erzwingen display:grid (2 Spalten) auf
   #talent-form/#brand-form → der aktive Tab-Inhalt landete in Spalte 1, halbe Breite,
   rechte Hälfte leer. Auf Block zurückzwingen (höhere Spezifität: 2 IDs + 1 Klasse). */
#talent-edit-modal.sd-stammdaten #talent-form,
#brand-edit-modal.sd-stammdaten #brand-form {
  display: block !important;
  grid-template-columns: none !important;
  gap: 0 !important;
}

/* V105z (Audit #21): .tt-fullpage-modal/.modal-overlay textarea{min-height:74-80px!important}
   stauchte die Notizen. Nur das Notizfeld auf 160px zurückholen (kurze Adress-Felder unberührt). */
#brand-edit-modal.sd-stammdaten #brand-notes-input { min-height: 160px !important; }

/* ============================================================
   Textarea
   ============================================================ */
#brand-edit-modal.sd-stammdaten .sd-textarea,
#talent-edit-modal.sd-stammdaten .sd-textarea {
  width: 100%;
  min-height: 80px;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  color: #111827;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #ffffff;
}

#brand-edit-modal.sd-stammdaten .sd-textarea:focus,
#talent-edit-modal.sd-stammdaten .sd-textarea:focus {
  outline: none;
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

/* ============================================================
   Hint
   ============================================================ */
#brand-edit-modal.sd-stammdaten .sd-hint,
#talent-edit-modal.sd-stammdaten .sd-hint {
  font-size: 12px;
  font-weight: 400;
  color: #6b7280;
  margin-top: 4px;
  line-height: 1.4;
}

/* ============================================================
   Checkbox Card
   ============================================================ */
#brand-edit-modal.sd-stammdaten .sd-checkbox-card,
#talent-edit-modal.sd-stammdaten .sd-checkbox-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

#brand-edit-modal.sd-stammdaten .sd-checkbox-card:hover,
#talent-edit-modal.sd-stammdaten .sd-checkbox-card:hover {
  background: #f5f5f5;
}

#brand-edit-modal.sd-stammdaten .sd-checkbox-card input[type="checkbox"],
#talent-edit-modal.sd-stammdaten .sd-checkbox-card input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #111827;
  cursor: pointer;
  margin: 0;
}

/* ============================================================
   ID Display (monospace, subtle)
   ============================================================ */
#brand-edit-modal.sd-stammdaten .sd-id-display,
#talent-edit-modal.sd-stammdaten .sd-id-display {
  padding: 6px 10px;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 11px;
  color: #6b7280;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
  margin-bottom: 12px;
}

/* ============================================================
   Modal Footer (specificity boosted to win over admin.css)
   ============================================================ */
#brand-edit-modal.sd-stammdaten.sd-stammdaten .modal-footer,
#talent-edit-modal.sd-stammdaten.sd-stammdaten .modal-footer {
  padding: 14px 22px;
  border-top: 1px solid #e4e8f0;
  background: #fafafa;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-radius: 0 0 12px 12px;
}

#brand-edit-modal.sd-stammdaten.sd-stammdaten .modal-footer .btn-primary,
#talent-edit-modal.sd-stammdaten.sd-stammdaten .modal-footer .btn-primary {
  background: #111827;
  color: #ffffff;
  border: 1px solid #111827;
  height: 34px;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  line-height: 32px;
}

#brand-edit-modal.sd-stammdaten.sd-stammdaten .modal-footer .btn-primary:hover,
#talent-edit-modal.sd-stammdaten.sd-stammdaten .modal-footer .btn-primary:hover {
  background: #1f2937;
  border-color: #1f2937;
}

#brand-edit-modal.sd-stammdaten.sd-stammdaten .modal-footer .btn-secondary,
#talent-edit-modal.sd-stammdaten.sd-stammdaten .modal-footer .btn-secondary {
  background: #ffffff;
  color: #111827;
  border: 1px solid #d1d5db;
  height: 34px;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  line-height: 32px;
}

#brand-edit-modal.sd-stammdaten.sd-stammdaten .modal-footer .btn-secondary:hover,
#talent-edit-modal.sd-stammdaten.sd-stammdaten .modal-footer .btn-secondary:hover {
  background: #fafafa;
  border-color: #9ca3af;
}

#brand-edit-modal.sd-stammdaten.sd-stammdaten .sd-btn-danger-outline,
#talent-edit-modal.sd-stammdaten.sd-stammdaten .sd-btn-danger-outline {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  height: 34px;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 32px;
}

#brand-edit-modal.sd-stammdaten.sd-stammdaten .sd-btn-danger-outline:hover,
#talent-edit-modal.sd-stammdaten.sd-stammdaten .sd-btn-danger-outline:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

/* ============================================================
   Error message
   ============================================================ */
#brand-edit-modal.sd-stammdaten .sd-error,
#talent-edit-modal.sd-stammdaten .sd-error {
  color: #b91c1c;
  font-size: 13px;
  font-weight: 500;
  margin: 12px 22px 0;
  line-height: 1.4;
}

/* ============================================================
   Sub-section header (e.g. Agentur-Kontakt)
   ============================================================ */
#brand-edit-modal.sd-stammdaten .sd-section-header,
#talent-edit-modal.sd-stammdaten .sd-section-header {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 12px 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid #f0f0f0;
}

/* ============================================================
   Agency block (brand: shown only when agency-managed)
   ============================================================ */
#brand-edit-modal.sd-stammdaten .sd-agency-block,
#talent-edit-modal.sd-stammdaten .sd-agency-block {
  padding: 14px;
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 14px;
}

#brand-edit-modal.sd-stammdaten .sd-agency-block.hidden,
#talent-edit-modal.sd-stammdaten .sd-agency-block.hidden {
  display: none;
}

/* ============================================================
   Commission card (talent: calc preview)
   ============================================================ */
#brand-edit-modal.sd-stammdaten .sd-commission-card,
#talent-edit-modal.sd-stammdaten .sd-commission-card {
  padding: 16px;
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

#brand-edit-modal.sd-stammdaten .sd-commission-row,
#talent-edit-modal.sd-stammdaten .sd-commission-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: end;
}

#brand-edit-modal.sd-stammdaten .sd-commission-divider,
#talent-edit-modal.sd-stammdaten .sd-commission-divider {
  font-size: 18px;
  color: #9ca3af;
  padding-bottom: 10px;
}

#brand-edit-modal.sd-stammdaten .sd-commission-output,
#talent-edit-modal.sd-stammdaten .sd-commission-output {
  height: 36px;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  color: #6b7280;
  background: #ffffff;
  line-height: 36px;
  font-weight: 600;
  box-sizing: border-box;
}

/* ============================================================
   Account status pill (mint pastel)
   ============================================================ */
#brand-edit-modal.sd-stammdaten .sd-account-status,
#talent-edit-modal.sd-stammdaten .sd-account-status {
  display: inline-block;
  padding: 4px 10px;
  background: #BFE0BC;
  color: #1F5C2E;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

#brand-edit-modal.sd-stammdaten .sd-account-status[data-state="none"],
#talent-edit-modal.sd-stammdaten .sd-account-status[data-state="none"] {
  background: #f5f5f5;
  color: #6b7280;
}

/* ============================================================
   Responsive (mobile fallback)
   ============================================================ */
@media (max-width: 720px) {
  #brand-edit-modal.sd-stammdaten .sd-row,
  #talent-edit-modal.sd-stammdaten .sd-row,
  #brand-edit-modal.sd-stammdaten .sd-row.sd-row-double,
  #talent-edit-modal.sd-stammdaten .sd-row.sd-row-double {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  #brand-edit-modal.sd-stammdaten .sd-label,
  #talent-edit-modal.sd-stammdaten .sd-label {
    padding-top: 0;
    margin-bottom: 2px;
  }

  #brand-edit-modal.sd-stammdaten .modal-dialog,
  #talent-edit-modal.sd-stammdaten .modal-dialog {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  #brand-edit-modal.sd-stammdaten.sd-stammdaten .modal-footer,
  #talent-edit-modal.sd-stammdaten.sd-stammdaten .modal-footer {
    border-radius: 0;
  }

  #brand-edit-modal.sd-stammdaten .sd-tabs,
  #talent-edit-modal.sd-stammdaten .sd-tabs {
    padding: 0 14px;
    overflow-x: auto;
  }

  #brand-edit-modal.sd-stammdaten .sd-tab-panel,
  #talent-edit-modal.sd-stammdaten .sd-tab-panel {
    padding: 14px;
  }
}
