/* ============================================================================
   send-to-brand.css — Admin Fullscreen-Modal für "Rechnung an Brand senden"
   Adaptiert aus dem KI-generierten Mockup, alle Selektoren scoped unter
   .send-to-brand-modal damit nichts mit dem Portal-CSS kollidiert.
   ============================================================================ */

.send-to-brand-modal {
  /* nutzt globale .modal-overlay als Basis, hier nur Layout-Anpassungen */
  align-items: stretch !important;
  padding: 24px !important;
}

.send-to-brand-modal .modal-dialog {
  background: #fff;
  border: 1px solid var(--tt-line, #e4e8f0);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  max-height: calc(100vh - 48px);
  overflow: hidden;
}

/* ─── Modal-Header ─────────────────────────────────────────────────────────── */

.send-to-brand-modal .panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--tt-line, #e4e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-shrink: 0;
}

.send-to-brand-modal .panel-title h2 {
  margin: 0 0 2px;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--tt-text, #111827);
}

.send-to-brand-modal .panel-title p {
  margin: 0;
  color: var(--tt-muted, #6b7280);
  font-size: 12.5px;
}

.send-to-brand-modal .panel-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.send-to-brand-modal .segmented {
  display: inline-flex;
  border: 1px solid var(--tt-line, #e4e8f0);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.send-to-brand-modal .segmented button {
  border: 0;
  background: transparent;
  height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 650;
  color: var(--tt-muted, #6b7280);
  cursor: pointer;
}

.send-to-brand-modal .segmented button.active {
  background: var(--tt-sidebar-bg, #151b2a);
  color: #fff;
}

.send-to-brand-modal .panel-close {
  width: 34px;
  height: 34px;
  /* V105w: padding:0 — sonst erbt der Button das globale button{padding:10px 18px}
     aus ui.css und das ✕ sitzt nicht mittig im Kästchen. */
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--tt-line, #e4e8f0);
  background: #fff;
  color: var(--tt-text, #111827);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}

.send-to-brand-modal .panel-close:hover {
  background: #f5f5f5;
}

/* ─── Modal-Body: 2-Spalten (PDF | Compose) ──────────────────────────────── */

.send-to-brand-modal .panel-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(430px, 0.92fr) minmax(520px, 1fr);
  overflow: hidden;
}

/* PDF-Side */
.send-to-brand-modal .pdf-side {
  min-height: 0;
  padding: 14px;
  border-right: 1px solid var(--tt-line, #e4e8f0);
  background: #f8fafc;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
}

.send-to-brand-modal .pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.send-to-brand-modal .pdf-toolbar-left,
.send-to-brand-modal .pdf-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.send-to-brand-modal .pdf-toolbar-label {
  font-size: 12px;
  color: var(--tt-muted, #6b7280);
  font-weight: 600;
}

.send-to-brand-modal .pdf-stage {
  min-height: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--tt-line, #e4e8f0);
  border-radius: 8px;
}

.send-to-brand-modal .pdf-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Compose-Side */
.send-to-brand-modal .compose-side {
  min-width: 0;
  min-height: 0;
  padding: 14px 18px 12px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
  overflow-y: auto;
}

.send-to-brand-modal .status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--tt-line, #e4e8f0);
}

.send-to-brand-modal .status-copy strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
  color: var(--tt-text, #111827);
}

.send-to-brand-modal .status-copy span {
  color: var(--tt-muted, #6b7280);
  font-size: 12px;
}

.send-to-brand-modal .admin-table-status {
  font-size: 10px !important;
  padding: 3px 9px !important;
  letter-spacing: 0.03em;
  line-height: 1;
}

.send-to-brand-modal .resend-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.send-to-brand-modal .form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  min-width: 0;
}

.send-to-brand-modal .form-field {
  min-width: 0;
}

.send-to-brand-modal .field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--tt-muted, #6b7280);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.send-to-brand-modal .source-note {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: #1e40af;
  font-size: 11px;
  white-space: nowrap;
}

/* V105z (Audit #2): common/portal-v87-fixes.css erzwingt via .modal-overlay input{}
   border-radius:6px + height:36px + padding mit !important — überstimmte das designte
   10px/38px. Hier mit !important zurückholen. */
.send-to-brand-modal input[type="text"],
.send-to-brand-modal input[type="email"],
.send-to-brand-modal textarea {
  width: 100%;
  border: 1px solid var(--tt-line-strong, #cfd6e2);
  background: #fff;
  color: var(--tt-text, #111827);
  border-radius: 10px !important;
  font: inherit;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}

.send-to-brand-modal input[type="text"],
.send-to-brand-modal input[type="email"] {
  height: 38px !important;
  padding: 0 11px !important;
}

.send-to-brand-modal textarea {
  min-height: 200px !important;
  resize: vertical;
  padding: 10px 11px !important;
  line-height: 1.55;
  font-family: inherit;
}

.send-to-brand-modal input:focus,
.send-to-brand-modal textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16);
}

.send-to-brand-modal .cc-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.send-to-brand-modal .cc-toggle {
  position: relative;
  width: 36px;
  height: 20px;
  flex: 0 0 auto;
  cursor: pointer;
}

.send-to-brand-modal .cc-toggle input {
  display: none;
}

.send-to-brand-modal .cc-toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d1d5db;
  transition: 0.16s ease;
}

.send-to-brand-modal .cc-toggle-track::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: 0.16s ease;
}

.send-to-brand-modal .cc-toggle input:checked + .cc-toggle-track {
  background: var(--tt-sidebar-bg, #151b2a);
}

.send-to-brand-modal .cc-toggle input:checked + .cc-toggle-track::before {
  transform: translateX(16px);
}

.send-to-brand-modal .attachment-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--tt-line, #e4e8f0);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 12.5px;
  color: #374151;
}

.send-to-brand-modal .attachment-line strong {
  font-weight: 650;
  color: var(--tt-text, #111827);
}

.send-to-brand-modal .pdf-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.04em;
  background: #ede9fe;
  color: #6d28d9;
}

/* ─── V105w #4: Admin-Zusatzanhänge ──────────────────────────────────────── */
.send-to-brand-modal .stb-extra {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.send-to-brand-modal .stb-extra-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.send-to-brand-modal .stb-extra-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.send-to-brand-modal .stb-extra-empty {
  color: var(--tt-muted, #6b7280);
  font-size: 11.5px;
  line-height: 1.4;
  padding: 2px 0;
}
.send-to-brand-modal .stb-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--tt-line, #e4e8f0);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 12.5px;
  color: #374151;
}
.send-to-brand-modal .stb-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--tt-text, #111827);
}
.send-to-brand-modal .stb-file-tag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.04em;
  background: #e0edff;
  color: #1e40af;
}
.send-to-brand-modal .stb-file-remove {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1px solid var(--tt-line, #e4e8f0);
  border-radius: 7px;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.send-to-brand-modal .stb-file-remove:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

/* ─── Modal-Footer ────────────────────────────────────────────────────────── */

.send-to-brand-modal .panel-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--tt-line, #e4e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  flex-shrink: 0;
}

.send-to-brand-modal .foot-meta {
  color: var(--tt-muted, #6b7280);
  font-size: 12px;
  min-width: 0;
}

.send-to-brand-modal .button-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.send-to-brand-modal .panel-foot .btn-primary {
  min-width: 168px;
  background: var(--tt-sidebar-bg, #151b2a);
  border-color: var(--tt-sidebar-bg, #151b2a);
  color: #fff;
}

.send-to-brand-modal .panel-foot .btn-primary[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ─── Mobile (Tabs) ───────────────────────────────────────────────────────── */

.send-to-brand-modal .mobile-tabs {
  display: none;
}

@media (max-width: 1023px) {
  .send-to-brand-modal {
    padding: 8px !important;
  }
  .send-to-brand-modal .modal-dialog {
    max-height: calc(100vh - 16px);
    border-radius: 12px;
  }
  .send-to-brand-modal .panel-grid {
    display: block;
    overflow-y: auto;
  }
  .send-to-brand-modal .mobile-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 8px 14px 0;
    gap: 6px;
    border-bottom: 1px solid var(--tt-line, #e4e8f0);
  }
  .send-to-brand-modal .mobile-tabs button {
    height: 34px;
    border: 1px solid var(--tt-line, #e4e8f0);
    background: #fff;
    border-radius: 10px;
    font-weight: 650;
    font-size: 12px;
    cursor: pointer;
  }
  .send-to-brand-modal .mobile-tabs button.active {
    background: var(--tt-sidebar-bg, #151b2a);
    color: #fff;
    border-color: var(--tt-sidebar-bg, #151b2a);
  }
  .send-to-brand-modal .pdf-side,
  .send-to-brand-modal .compose-side {
    border-right: none;
    overflow: visible;
  }
  .send-to-brand-modal .pdf-side[data-mobile-hidden="true"],
  .send-to-brand-modal .compose-side[data-mobile-hidden="true"] {
    display: none;
  }
  .send-to-brand-modal .pdf-stage {
    height: 420px;
  }
  .send-to-brand-modal .panel-foot {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .send-to-brand-modal .foot-meta {
    text-align: center;
  }
  .send-to-brand-modal .button-row {
    width: 100%;
    justify-content: stretch;
  }
  .send-to-brand-modal .button-row .btn-primary,
  .send-to-brand-modal .button-row .btn-secondary {
    flex: 1;
  }
}
