* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; margin: 0; background: #f4f6f8; color: #1a1a1a; }
.container { max-width: 900px; margin: 0 auto; padding: 1rem; }
.topbar { background: var(--brand-color, #1e3a5f); color: #fff; }
.topbar .container.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.topbar-left { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; min-width: 0; }
.topbar-brand { white-space: nowrap; }
.topbar-nav { display: flex; flex-wrap: wrap; align-items: center; }
.topbar a { color: #fff; margin-left: 1rem; text-decoration: none; }
.topbar-user { margin: 0; font-size: .9rem; color: #e8eef5; white-space: nowrap; }
.card { background: #fff; padding: 1.25rem; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
label { display: block; margin-top: .75rem; font-weight: 600; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { width: 100%; margin-top: .25rem; padding: .5rem; }
select[multiple] { min-height: 8rem; }
button:not(.password-toggle):not(.link-button):not(.tox-tbtn):not(.action-link):not(.recipients-import-toggle), .button { display: inline-block; width: auto; margin-top: .25rem; padding: .6rem 1rem; background: var(--brand-color, #1e3a5f); color: #fff; border: 0; border-radius: 6px; cursor: pointer; text-decoration: none; transition: background-color .15s ease, transform .1s ease, box-shadow .15s ease, opacity .15s ease; }
button:not(.password-toggle):not(.link-button):not(.tox-tbtn):not(.action-link):not(.recipients-import-toggle):hover:not(:disabled),
.button:hover:not(:disabled) {
    background: color-mix(in srgb, var(--brand-color, #1e3a5f) 82%, #000);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}
button:not(.password-toggle):not(.link-button):not(.tox-tbtn):not(.action-link):not(.recipients-import-toggle):active:not(:disabled),
.button:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: none;
    background: color-mix(in srgb, var(--brand-color, #1e3a5f) 70%, #000);
}
button:not(.password-toggle):not(.link-button):not(.tox-tbtn):not(.action-link):not(.recipients-import-toggle):disabled,
.button:disabled {
    opacity: .45;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
.button-secondary { background: #6c757d; margin-left: .5rem; }
.button-secondary:hover:not(:disabled) { background: #5a6268; }
.button-secondary:active:not(:disabled) { background: #495057; }
/* TinyMCE-Toolbar: nicht von globalen Button-Styles überschreiben */
.tox-tinymce button.tox-tbtn {
    margin-top: 0;
    padding: 0;
    background: transparent;
    color: #222f3e;
    border-radius: 3px;
    min-width: 34px;
    min-height: 34px;
}
.tox-tinymce button.tox-tbtn:hover {
    background: #dee0e2;
    color: #222f3e;
}
.tox-tinymce button.tox-tbtn--enabled,
.tox-tinymce button.tox-tbtn--enabled:hover {
    background: #c8cbcf;
    color: #222f3e;
}
.tox-tinymce button.tox-tbtn svg {
    fill: #222f3e;
}
.label-checkbox {
    display: flex; align-items: flex-start; gap: .5rem;
    font-weight: normal; cursor: pointer;
}
.label-checkbox input[type="checkbox"] {
    width: 1.1rem; height: 1.1rem; margin: .15rem 0 0; padding: 0; flex-shrink: 0;
}
.label-checkbox span { flex: 1; }
.label-radio {
    display: flex; align-items: flex-start; gap: .5rem;
    font-weight: normal; cursor: pointer; margin: .35rem 0;
}
.label-radio input[type="radio"] {
    width: 1.1rem; height: 1.1rem; margin: .15rem 0 0; padding: 0; flex-shrink: 0;
}
.label-radio span { flex: 1; }
.signature-logo-position { margin: .5rem 0 1rem; }
.alert { padding: .75rem 1rem; border-radius: 6px; margin: 1rem 0; }
.alert-error { background: #fde8e8; color: #9b1c1c; }
.alert-success { background: #e6f6ea; color: #0f5132; }
@keyframes alert-saved-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}
.alert-success.alert-saved-blink {
    animation: alert-saved-blink 0.45s ease-in-out 3;
    animation-fill-mode: forwards;
}
button.button-save.is-submitting,
button.button-save:disabled,
input.button-save.is-submitting,
input.button-save:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #8a96a3 !important;
}
.alert-debug { background: #fff8e6; color: #664d03; font-family: monospace; font-size: .9rem; }
.hint { color: #555; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { border: 1px solid #ddd; padding: .5rem; text-align: left; }
.actions { white-space: normal; min-width: 11rem; vertical-align: top; }
.action-links { display: flex; flex-direction: column; gap: .4rem; }
.action-group { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .45rem; font-size: .875rem; line-height: 1.4; }
.action-link {
    background: none; border: 0; padding: 0; margin: 0;
    color: var(--brand-color, #1e3a5f); cursor: pointer; text-decoration: none;
    font: inherit; font-size: inherit; line-height: inherit;
}
a.action-link:hover, button.action-link:hover { text-decoration: underline; }
.action-link--primary { font-weight: 600; }
.action-link--danger { color: #9b1c1c; }
.action-sep { color: #bbb; user-select: none; }
.actions form.inline-form { display: inline; margin: 0; }
.link-button { background: none; border: 0; color: #9b1c1c; cursor: pointer; padding: 0; text-decoration: underline; }
.password-field { position: relative; margin-top: .25rem; }
.password-field input { width: 100%; margin-top: 0; padding-right: 2.75rem; }
.password-reset-form .password-field {
    width: 32ch;
    max-width: 100%;
}
.password-special-chars-input {
    width: 20rem;
    max-width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.password-toggle {
    position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
    width: 2rem; height: 2rem; margin: 0; padding: 0;
    background: transparent; border: 0; cursor: pointer; color: #555;
    z-index: 2;
}
.password-toggle:hover { color: var(--brand-color, #1e3a5f); }
.icon-eye-open, .icon-eye-closed {
    display: block; width: 1.25rem; height: 1.25rem; margin: 0 auto;
    background-color: currentColor;
    mask-size: contain; mask-repeat: no-repeat; mask-position: center;
    -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center;
}
.icon-eye-open {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}
.password-toggle.is-visible .icon-eye-open {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M17.94 17.94A10.94 10.94 0 0 1 12 20c-7 0-11-8-11-8a21.77 21.77 0 0 1 5.06-6.94M9.9 4.24A10.94 10.94 0 0 1 12 4c7 0 11 8 11 8a21.8 21.8 0 0 1-4.87 6.83'/%3E%3Cpath d='M1 1l22 22'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M17.94 17.94A10.94 10.94 0 0 1 12 20c-7 0-11-8-11-8a21.77 21.77 0 0 1 5.06-6.94M9.9 4.24A10.94 10.94 0 0 1 12 4c7 0 11 8 11 8a21.8 21.8 0 0 1-4.87 6.83'/%3E%3Cpath d='M1 1l22 22'/%3E%3C/svg%3E");
}
.menu { list-style: none; padding: 0; }
.menu li { margin: .5rem 0; }
.button-small { padding: .3rem .65rem; font-size: .875rem; margin: 0 .35rem; vertical-align: middle; }
.text-ok { color: #0f5132; }
.text-error { color: #9b1c1c; }
.badge { display: inline-block; padding: .15rem .5rem; border-radius: 4px; font-size: .85rem; }
.badge-ok { background: #e6f6ea; color: #0f5132; }
.badge-error { background: #fde8e8; color: #9b1c1c; }
.row-invalid { background: #fff5f5; }
.row-inactive { opacity: .55; }
.row-inactive .recipient-email { color: #666; }
.col-active { width: 4.5rem; text-align: center; }
.recipient-active-label { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.recipient-active { width: 1.1rem; height: 1.1rem; cursor: pointer; }
.recipients-toggle-cell { text-align: left; white-space: nowrap; }
.recipient-toggle-all-label { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: normal; cursor: pointer; white-space: nowrap; }
.recipients-bulk-actions { text-align: right; white-space: nowrap; }
.recipients-delete-all { color: #9b1c1c; font-size: .85rem; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal.hidden { display: none; }
.modal-content { max-width: 560px; width: 90%; }
.modal-content .label-checkbox { margin-top: .85rem; }
.hidden { display: none; }
pre.alert-debug { white-space: pre-wrap; word-break: break-word; max-height: 20rem; overflow: auto; }
#recipients-table { font-size: .85rem; }
#recipients-table th,
#recipients-table td { padding: .15rem .35rem; vertical-align: middle; line-height: 1.25; }
#recipients-table thead th { padding: .28rem .35rem; font-size: .8rem; }
#recipients-table input.recipient-email {
    width: 100%;
    margin: 0;
    padding: .15rem .3rem;
    font-size: .85rem;
    line-height: 1.2;
}
#recipients-table .badge { padding: .05rem .3rem; font-size: .72rem; }
#recipients-table .link-button { font-size: .8rem; }
#recipients-table .recipient-status { white-space: nowrap; }
#recipients-table .recipient-active { width: 1rem; height: 1rem; }
.recipients-toggle-row td { padding-top: .15rem; padding-bottom: .15rem; border-top: 0; background: #f8f9fb; }
.recipients-toolbar { margin: .4rem 0; padding: .5rem .75rem; }
.recipients-toolbar-row { display: flex; flex-wrap: wrap; gap: .45rem .75rem; align-items: flex-end; justify-content: space-between; }
.recipients-toolbar-left { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; min-width: 0; flex: 1 1 auto; }
.recipients-count-label { margin: 0; font-weight: 600; font-size: .9rem; }
.recipients-toolbar-pager { display: inline-flex; align-items: center; gap: .4rem; }
.recipients-toolbar-pager .recipients-page-label {
    white-space: nowrap;
    font-size: .85rem;
    color: #555;
}
.recipients-page-btn {
    width: 1.9rem;
    height: 1.9rem;
    margin: 0;
    padding: 0;
    border-radius: 999px;
    line-height: 1;
    font-size: .95rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.recipients-toolbar-controls { display: flex; flex-wrap: wrap; gap: .45rem .75rem; align-items: center; }
.recipients-search-label, .recipients-per-page-label { display: flex; flex-direction: column; gap: .1rem; font-size: .8rem; margin: 0; }
.recipients-search { min-width: 200px; margin: 0; padding: .25rem .4rem; }
.recipients-per-page { width: auto; min-width: 5.5rem; margin: 0; padding: .25rem .4rem; }
.recipients-search-hint { margin: .35rem 0 0; }
.recipients-pagination { display: flex; flex-wrap: wrap; gap: .4rem .65rem; align-items: center; margin: .45rem 0 .75rem; }
.recipients-pagination .button,
.recipients-pagination button {
    margin-top: 0;
    margin-left: 0;
    padding: .3rem .65rem;
    font-size: .85rem;
}
.recipients-page-label { color: #555; font-size: .85rem; }
.recipients-import-hint {
    display: inline;
    margin-left: .25rem;
    font-size: .85rem;
    font-weight: 500;
    color: #666;
}
.site-footer { margin-top: 2.5rem; padding: 1.5rem 0 2rem; border-top: 1px solid #dde3ea; color: #555; font-size: .9rem; }
.site-footer-slogan { margin: 0 0 .75rem; font-weight: 600; color: #333; }
.site-footer-impressum { margin: 0 0 .75rem; line-height: 1.5; }
.site-footer-legal { margin: 0; }
.billing-summary { margin: 1rem 0; }
.billing-total { font-size: 1.1rem; margin: 0 0 .5rem; }
.billing-total-amount { font-size: 1.35rem; font-weight: 700; color: #9b1c1c; }
.billing-table { width: 100%; margin: 1rem 0; }
.billing-table th, .billing-table td { vertical-align: top; }
.billing-amount { white-space: nowrap; font-weight: 600; }
.billing-book-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #e8ecf1; }
.billing-admin { margin-top: 1.5rem; }
#billing { scroll-margin-top: 1rem; }
.recipients-loading-row td, .recipients-empty-row td { text-align: center; }
.page-recipients h1 { margin: .25rem 0 .45rem; font-size: 1.45rem; line-height: 1.2; }
.page-recipients .wizard-nav { padding: .55rem .85rem; margin-bottom: .55rem; }
.page-recipients .wizard-nav ol { margin: 0 0 .25rem; gap: .75rem; }
.page-recipients .wizard-nav .hint { margin: 0; font-size: .9rem; }
.page-recipients .alert { margin: .45rem 0; padding: .55rem .75rem; }
.page-recipients > .card,
.page-recipients .recipients-continue { margin: 0 0 .55rem; padding: .75rem .9rem; }
.page-recipients h2 { margin: .45rem 0 .4rem; font-size: 1.1rem; line-height: 1.25; }
.page-recipients .recipients-footer-nav { margin: .65rem 0 .25rem; }
.recipients-import-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.recipients-import-head h2 { margin: 0; }
.recipients-import.is-collapsed { padding-top: .55rem; padding-bottom: .55rem; }
.recipients-import-body { margin-top: .55rem; }
.recipients-import-body .hint { margin: 0 0 .5rem; }
.recipients-import-body textarea { margin-top: 0; min-height: 6rem; }
.recipients-import-toggle {
    flex-shrink: 0;
    width: 1.85rem;
    height: 1.85rem;
    margin: 0;
    padding: 0;
    border: 1px solid #c5ced8;
    border-radius: 6px;
    background: #f4f6f8;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
    font-weight: 600;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.recipients-import-toggle:hover {
    background: #e8ecf1;
    border-color: #9aa8b6;
    color: #111;
}
.recipients-import-toggle:active {
    background: #dce3ea;
    transform: translateY(1px);
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.wizard-nav { background: #fff; padding: 1rem; border-radius: 8px; margin-bottom: 1rem; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.wizard-nav ol { list-style: none; padding: 0; margin: 0 0 .5rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.wizard-nav li a { text-decoration: none; color: var(--brand-color, #1e3a5f); font-weight: 600; }
.wizard-nav li.active a { text-decoration: underline; }
.send-log-run-select { margin: 1rem 0; }
.send-log-run-select select { width: auto; min-width: 20rem; }
.send-log-panel { margin-top: 1rem; }
.send-log-progress { height: 6px; background: #e9ecef; border-radius: 3px; overflow: hidden; margin-bottom: .75rem; }
.send-log-progress-bar { height: 100%; background: var(--brand-color, #1e3a5f); transition: width .4s ease; }
.send-log-stats { margin: 0 0 .5rem; }
.send-log-summary {
    margin: 1rem 0 0; padding: 1rem 1.1rem;
    background: #f8fafc; border: 1px solid #d8e2ec; border-radius: 8px;
}
.send-log-summary.hidden { display: none; }
.send-log-summary-title { margin: 0 0 .5rem; font-size: 1.05rem; }
.send-log-summary-ok { margin: 0; color: #0f5132; font-weight: 600; }
.send-log-summary-headline { margin: 0 0 .5rem; font-weight: 600; }
.send-log-summary-list { margin: 0 0 .75rem; padding-left: 1.25rem; }
.send-log-summary-list li { margin: .35rem 0; }
.send-log-summary-actions { margin-bottom: .5rem; }
.send-log-summary-report {
    margin: 0; padding: .75rem;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 4px;
    font-family: ui-monospace, Consolas, monospace; font-size: .8rem;
    white-space: pre-wrap; word-break: break-word;
}
.send-log-active { margin: 0 0 .75rem; color: var(--brand-color, #1e3a5f); font-weight: 600; }
.send-log-entries { max-height: 28rem; overflow-y: auto; border: 1px solid #e0e0e0; border-radius: 6px; background: #fafbfc; }
.send-log-entry { border-bottom: 1px solid #ececec; padding: .45rem .65rem; font-size: .875rem; }
.send-log-entry:last-child { border-bottom: 0; }
.send-log-entry-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .5rem; }
.send-log-entry-icon { width: 1rem; flex-shrink: 0; }
.send-log-entry-summary { flex: 1; min-width: 12rem; }
.send-log-entry-time { color: #777; font-size: .8rem; }
.send-log-entry--ok .send-log-entry-icon { color: #0f5132; }
.send-log-entry--error .send-log-entry-icon { color: #9b1c1c; }
.send-log-entry--active { background: #f0f6ff; }
.send-log-entry--active .send-log-entry-icon { color: var(--brand-color, #1e3a5f); }
.send-log-dialog {
    margin: .5rem 0 0 1.25rem; padding: .65rem .75rem;
    background: #1a1d21; color: #d4d4d4; border-radius: 4px;
    font-family: ui-monospace, Consolas, monospace; font-size: .78rem;
    white-space: pre-wrap; word-break: break-word; max-height: 14rem; overflow: auto;
}
.send-log-error-detail { margin: .25rem 0 0 1.25rem; color: #9b1c1c; font-size: .82rem; }
.send-log-toggle { font-size: .8rem; margin-left: auto; }
.signature-logo-preview { max-width: 220px; height: auto; display: block; margin: .5rem 0; border: 1px solid #ddd; border-radius: 4px; }
.signature-preview { margin-top: 1rem; }
.signature-preview-inner { padding: 1rem; background: #fafbfc; border: 1px solid #e0e0e0; border-radius: 6px; }
.email-template-placeholders ul { margin: .5rem 0 0; padding-left: 1.25rem; }
.email-template-placeholders li { margin: .35rem 0; }
.email-template-placeholders code { font-size: .9em; }

.topbar-right { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.topbar-logo-link { display: flex; align-items: center; margin-right: .25rem; text-decoration: none; }
.topbar-logo { display: block; width: auto; height: auto; max-height: 48px; object-fit: contain; }
.topbar-help-toggle {
    margin-top: 0;
    padding: .4rem .95rem;
    background: transparent;
    color: #fff;
    border: 1px solid #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: .9rem;
    line-height: 1.2;
}
.topbar-help-toggle:hover,
.topbar-help-toggle--active {
    background: rgba(255, 255, 255, .15);
    border-color: #fff;
}
.container--with-help.container--help-open { max-width: 1220px; }
.page-shell { display: block; }
.page-shell--help-open {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}
.page-main { flex: 1; min-width: 0; }
.page-help-panel { width: 300px; flex-shrink: 0; }
.page-help-panel[hidden] { display: none; }
.page-help-panel-inner { position: sticky; top: 1rem; margin-top: 0; }
.page-help-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.page-help-title { margin: 0; font-size: 1.05rem; }
.page-help-close {
    margin-top: 0;
    padding: 0 .4rem;
    min-width: 2rem;
    background: transparent;
    color: #666;
    border: 0;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}
.page-help-close:hover { color: #1a1a1a; }
.page-help-body { font-size: .92rem; line-height: 1.5; color: #333; }
.page-help-admin-link { margin: 1rem 0 0; padding-top: .75rem; border-top: 1px solid #e8ecf1; font-size: .85rem; }
.terms-document-body { line-height: 1.55; }
.branding-color-row { display: flex; gap: .75rem; align-items: center; margin-top: .25rem; }
.branding-color-row input[type="color"] { width: 3.5rem; height: 2.5rem; padding: .15rem; margin: 0; flex-shrink: 0; }
.branding-color-row input[type="text"] { flex: 1; margin: 0; }
.branding-logo-preview { display: block; height: auto; max-width: 100%; border: 1px solid #ddd; border-radius: 4px; background: #fff; }
.provider-active-toggle { margin: 0; font-weight: normal; }
.provider-active-toggle span { font-size: .9rem; }
@media (max-width: 960px) {
    .page-shell--help-open { flex-direction: column; }
    .page-help-panel { width: 100%; }
    .page-help-panel-inner { position: static; }
}
