/* ═══════════════════════════════════════════════════════════
   Modal — extracted from TNonline (Shared/Modal)
   Centered dialog with backdrop, header (title + close), and
   body. On small screens it becomes a full-height sheet.
   ═══════════════════════════════════════════════════════════ */

.tn-modal-container {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: tnModalFadeIn 0.15s ease;
}

@keyframes tnModalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.tn-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

.tn-modal-dialog {
    background: var(--tn-bg-card);
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: tnModalSlideUp 0.2s ease;
}

@keyframes tnModalSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tn-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--tn-border);
}

.tn-modal-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--tn-text-primary);
}

.tn-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: var(--tn-radius);
    cursor: pointer;
    color: var(--tn-text-muted);
    transition: all var(--tn-transition);
}

.tn-modal-close:hover {
    background: var(--tn-bg-page);
    color: var(--tn-text-primary);
}

.tn-modal-body {
    padding: 22px;
}

.tn-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--tn-space-sm);
    padding: 16px 22px;
    border-top: 1px solid var(--tn-border);
}

@media (max-width: 768px) {
    .tn-modal-container {
        padding: 0;
        align-items: flex-end;
    }

    .tn-modal-dialog {
        max-width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
    }
}
