/* =====================================================
   Hajmi — App dialogs (confirm / alert modals)
   ===================================================== */

body.admin-dialog-open {
    overflow: hidden !important;
}

.admin-app-dialog {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10650;
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-app-dialog.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-dialog-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(2px);
}

.admin-dialog-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    margin: auto;
}

html[data-theme-mode="dark"] .admin-dialog-panel {
    background: #1a2030;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
}

.admin-dialog-close {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    padding: 0;
    z-index: 2;
    transition: background 0.15s, color 0.15s;
}

.admin-dialog-close:hover {
    background: rgba(148, 163, 184, 0.12);
    color: #64748b;
}

html[data-theme-mode="dark"] .admin-dialog-close {
    color: #94a3b8;
}

html[data-theme-mode="dark"] .admin-dialog-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

.admin-dialog-body {
    padding: 32px 28px 20px;
    text-align: center;
}

.admin-dialog-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fef2f2;
}

.admin-dialog-icon-wrap--danger {
    background: #fef2f2;
}

.admin-dialog-icon-wrap--danger .admin-dialog-icon {
    color: #ef4444;
    font-size: 28px;
}

.admin-dialog-icon-wrap--warning {
    background: #fffbeb;
}

.admin-dialog-icon-wrap--warning .admin-dialog-icon {
    color: #f59e0b;
    font-size: 28px;
}

.admin-dialog-icon-wrap--info,
.admin-dialog-icon-wrap--primary {
    background: #eff6ff;
}

.admin-dialog-icon-wrap--info .admin-dialog-icon,
.admin-dialog-icon-wrap--primary .admin-dialog-icon {
    color: #3b82f6;
    font-size: 28px;
}

.admin-dialog-icon-wrap--success {
    background: #f0fdf4;
}

.admin-dialog-icon-wrap--success .admin-dialog-icon {
    color: #22c55e;
    font-size: 28px;
}

html[data-theme-mode="dark"] .admin-dialog-icon-wrap--danger {
    background: rgba(239, 68, 68, 0.15);
}

html[data-theme-mode="dark"] .admin-dialog-icon-wrap--warning {
    background: rgba(245, 158, 11, 0.15);
}

html[data-theme-mode="dark"] .admin-dialog-icon-wrap--info,
html[data-theme-mode="dark"] .admin-dialog-icon-wrap--primary {
    background: rgba(59, 130, 246, 0.15);
}

html[data-theme-mode="dark"] .admin-dialog-icon-wrap--success {
    background: rgba(34, 197, 94, 0.15);
}

.admin-dialog-title {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.6;
    color: #1e293b;
}

html[data-theme-mode="dark"] .admin-dialog-title {
    color: #f1f5f9;
}

.admin-dialog-subtext {
    margin: 0;
    font-size: 13px;
    line-height: 1.7;
    color: #64748b;
    font-weight: 500;
}

html[data-theme-mode="dark"] .admin-dialog-subtext {
    color: #94a3b8;
}

.admin-dialog-subtext:empty {
    display: none;
}

.admin-dialog-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px 20px;
    border-top: 1px solid #e8ecf1;
}

html[data-theme-mode="dark"] .admin-dialog-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.admin-dialog-footer--single {
    justify-content: center;
}

.admin-dialog-footer--single .admin-dialog-btn {
    min-width: 140px;
}

.admin-dialog-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    transition: filter 0.15s, background 0.15s;
    line-height: 1.3;
}

.admin-dialog-btn--cancel {
    background: #ffffff;
    color: #334155;
    border-color: #e2e8f0;
}

.admin-dialog-btn--cancel:hover {
    background: #f8fafc;
}

html[data-theme-mode="dark"] .admin-dialog-btn--cancel {
    background: transparent;
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.14);
}

html[data-theme-mode="dark"] .admin-dialog-btn--cancel:hover {
    background: rgba(255, 255, 255, 0.06);
}

.admin-dialog-btn--confirm {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

.admin-dialog-btn--confirm:hover {
    filter: brightness(0.95);
}

.admin-dialog-btn--danger {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.admin-dialog-btn--danger:hover {
    filter: brightness(0.95);
}

.admin-dialog-btn--warning {
    background: #f59e0b;
    color: #ffffff;
    border-color: #f59e0b;
}

/* ---- Shared modal-overlay (employee forms etc.) ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(2px);
}

.modal-overlay .modal-box {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
}

html[data-theme-mode="dark"] .modal-overlay .modal-box {
    background: #1a2030;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
}

.modal-overlay .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px 0;
    border-bottom: none;
}

.modal-overlay .modal-header h4 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
}

html[data-theme-mode="dark"] .modal-overlay .modal-header h4 {
    color: #f1f5f9;
}

.modal-overlay .modal-close {
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.modal-overlay .modal-close:hover {
    background: rgba(148, 163, 184, 0.12);
    color: #64748b;
}

.modal-overlay .modal-body {
    padding: 16px 22px;
}

.modal-overlay .modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px 20px;
    border-top: 1px solid #e8ecf1;
}

html[data-theme-mode="dark"] .modal-overlay .modal-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.modal-overlay .modal-footer .btn {
    flex: 1;
    min-height: 42px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
}

.modal-overlay .modal-footer .btn-secondary {
    background: #ffffff;
    color: #334155;
    border: 1px solid #e2e8f0;
}

html[data-theme-mode="dark"] .modal-overlay .modal-footer .btn-secondary {
    background: transparent;
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.14);
}

.modal-overlay .modal-footer .btn-primary {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.modal-overlay .modal-footer .btn-danger {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

@media (max-width: 480px) {
    .admin-dialog-body {
        padding: 28px 20px 16px;
    }

    .admin-dialog-title {
        font-size: 15px;
    }

    .admin-dialog-subtext {
        font-size: 12px;
    }

    .admin-dialog-footer {
        flex-direction: column-reverse;
        padding: 14px 16px 18px;
    }

    .admin-dialog-btn {
        width: 100%;
    }
}
