/* Substitution (Vertretung) self-service modal + header button.
   Self-contained styles (no Tailwind dependency) — the modal is injected on
   every Unfold admin page. Theme vars come from /theme-admin.css. */

.docdoors-sub-modal {
    position: fixed;
    inset: 0;
    z-index: 9990; /* below intro.js layers, above Unfold chrome */
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(1px);
}

.docdoors-sub-modal.show {
    display: flex;
}

.docdoors-sub-modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 34rem;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    font-family: var(--theme-font, inherit);
}

.docdoors-sub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.docdoors-sub-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--theme-text, #1f2937);
    margin: 0;
}

.docdoors-sub-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.docdoors-sub-iconbtn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #6b7280;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    line-height: 1;
    padding: 0;
}

.docdoors-sub-iconbtn:hover {
    background: #f3f4f6;
    color: #374151;
}

.docdoors-sub-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--theme-text, #1f2937);
    margin: 18px 0 8px;
}

.docdoors-sub-row {
    margin-bottom: 12px;
}

.docdoors-sub-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--theme-text, #374151);
    margin-bottom: 4px;
}

.docdoors-sub-input,
.docdoors-sub-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #fff;
    color: #1f2937;
    box-sizing: border-box;
}

.docdoors-sub-input:disabled {
    opacity: 0.5;
    background: #f9fafb;
}

.docdoors-sub-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.85rem;
    color: #374151;
    cursor: pointer;
}

.docdoors-sub-check input {
    margin-top: 2px;
}

.docdoors-sub-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.docdoors-sub-btn-primary {
    padding: 8px 18px;
    border: none;
    border-radius: 9999px;
    background: var(--theme-primary, #3b82f6);
    color: var(--theme-button-text, #fff);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.docdoors-sub-btn-primary:hover {
    background: var(--theme-primary-hover, #2563eb);
}

.docdoors-sub-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.docdoors-sub-btn-danger {
    padding: 4px 12px;
    border: none;
    border-radius: 9999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}

.docdoors-sub-btn-danger:hover {
    background: #b91c1c;
}

.docdoors-sub-btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.docdoors-sub-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #1f2937;
}

.docdoors-sub-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.docdoors-sub-badge-active {
    background: #dcfce7;
    color: #166534;
}

.docdoors-sub-badge-upcoming {
    background: #e0f2fe;
    color: #075985;
}

.docdoors-sub-badge-own {
    background: #fef3c7;
    color: #92400e;
}

.docdoors-sub-muted {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Toast fallback for pages without the calendar's window.showToast —
   mirrors the calendar toast look exactly. */
.docdoors-sub-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.docdoors-sub-toast {
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.docdoors-sub-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.docdoors-sub-toast-success {
    background-color: #16a34a;
}

.docdoors-sub-toast-error {
    background-color: #dc2626;
}
