.smtp-page{
    padding:40px;
    width:100%;
    box-sizing:border-box;
}

.smtp-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:30px;
}

.smtp-title{
    font-size:42px;
    font-weight:700;
    color:#2f5fe3;
}

.add-smtp-btn{
    background:#2f5fe3;
    color:#fff;
    border:none;
    padding:14px 22px;
    border-radius:14px;
    font-size:16px;
    font-weight:700;
    cursor:pointer;
}

.add-smtp-btn:hover{
    opacity:0.9;
}

/* =========================
   TOP STATS
========================= */

.smtp-stats-grid{
    display:grid;
    grid-template-columns:repeat(4, 1fr);
    gap:18px;
    margin-bottom:24px;
}

.smtp-stat-card{
    background:#fff;
    border-radius:24px;
    padding:24px;
    box-shadow:0 8px 24px rgba(15,23,42,0.06);
    border:1px solid #e5e7eb;
    display:flex;
    flex-direction:column;
    gap:12px;
}

.smtp-stat-card span{
    color:#64748b;
    font-size:16px;
    font-weight:700;
}

.smtp-stat-card strong{
    color:#0f172a;
    font-size:38px;
    font-weight:900;
}

/* =========================
   TABLE CARD
========================= */

.smtp-card{
    background:#fff;
    border-radius:28px;
    box-shadow:0 8px 24px rgba(15,23,42,0.06);
    border:1px solid #e5e7eb;
    overflow:auto;
    max-height:620px;
}

/* =========================
   TABLE
========================= */

.smtp-table{
    width:100%;
    min-width:1100px;
    border-collapse:separate;
    border-spacing:0;
}

.smtp-table thead th{
    position:sticky;
    top:0;
    z-index:20;
    background:#fff;
    text-align:left;
    padding:18px;
    color:#64748b;
    font-size:14px;
    font-weight:800;
    border-bottom:1px solid #e5e7eb;
    white-space:nowrap;
}

.smtp-table tbody td{
    padding:20px 18px;
    font-size:15px;
    color:#0f172a;
    border-bottom:1px solid #f1f5f9;
    vertical-align:middle;
    white-space:nowrap;
}

.smtp-table tbody td small{
    display:block;
    margin-top:4px;
    color:#64748b;
    font-size:13px;
}

/* =========================
   STATUS BADGES
========================= */

.smtp-status{
    padding:8px 14px;
    border-radius:999px;
    font-size:13px;
    font-weight:800;
    display:inline-block;
    min-width:90px;
    text-align:center;
}

.smtp-new{
    background:#e5e7eb;
    color:#475569;
}

.smtp-active{
    background:#dcfce7;
    color:#15803d;
}

.smtp-failed{
    background:#fee2e2;
    color:#dc2626;
}

.smtp-warning{
    background:#fef3c7;
    color:#d97706;
}

.smtp-blocked{
    background:#fecaca;
    color:#991b1b;
}

/* =========================
   ACTION BUTTONS
========================= */

.smtp-actions-clean{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:nowrap;
}

.smtp-action-btn{
    border:none;
    padding:10px 12px;
    border-radius:10px;
    font-size:13px;
    font-weight:800;
    cursor:pointer;
    white-space:nowrap;
    min-width:68px;
}

.smtp-test-btn{
    background:#16a34a;
    color:#fff;
}

.smtp-health-btn{
    background:#2563eb;
    color:#fff;
}

.smtp-edit-btn{
    background:#facc15;
    color:#111827;
}

.smtp-delete-btn{
    background:#ef4444;
    color:#fff;
}

.smtp-action-btn:hover{
    opacity:0.9;
}

/* =========================
   HEALTH MODAL
========================= */

.smtp-health-box{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.smtp-health-email{
    background:#f8fafc;
    padding:14px;
    border-radius:12px;
    font-size:15px;
    font-weight:800;
    color:#0f172a;
    margin-bottom:8px;
}

.smtp-health-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:14px;
    border:1px solid #e2e8f0;
    border-radius:12px;
    background:#fff;
}

.smtp-health-row span{
    color:#64748b;
    font-size:14px;
    font-weight:700;
}

.smtp-health-row strong{
    color:#0f172a;
    font-size:15px;
    font-weight:900;
}

@media(max-width:1100px){
    .smtp-stats-grid{
        grid-template-columns:repeat(2, 1fr);
    }
}

@media(max-width:700px){
    .smtp-page{
        padding:24px;
    }

    .smtp-title{
        font-size:32px;
    }

    .smtp-stats-grid{
        grid-template-columns:1fr;
    }
}

.smtp-imap-btn{
    background:#7c3aed;
    color:#ffffff;
}

/* =========================
   SMTP MODAL INPUT FIX
========================= */

#smtpModal .modal-content{
    width:520px !important;
    max-width:90vw !important;
    max-height:78vh !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    padding:28px 32px !important;
    border-radius:24px !important;
    box-sizing:border-box !important;
}

#smtpModal .modal-header{
    display:flex !important;
    justify-content:space-between !important;
    align-items:center !important;
    margin-bottom:20px !important;
}

#smtpModal .modal-header h2{
    margin:0 !important;
    font-size:26px !important;
    font-weight:800 !important;
}

/* جميع الحقول */
#smtpModal input,
#smtpModal textarea{
    width:100% !important;
    display:block !important;
    box-sizing:border-box !important;
    margin-bottom:14px !important;
    border:1px solid #dbe3ee !important;
    border-radius:12px !important;
    font-size:15px !important;
    font-family:inherit !important;
    color:#0f172a !important;
    background:#ffffff !important;
    outline:none !important;
    box-shadow:none !important;
}

/* إصلاح ارتفاع الـ input */
#smtpModal input{
    height:50px !important;
    min-height:50px !important;
    padding:0 16px !important;
    line-height:50px !important;
}

/* تحسين placeholder */
#smtpModal input::placeholder,
#smtpModal textarea::placeholder{
    color:#94a3b8 !important;
    opacity:1 !important;
}

/* إصلاح textarea */
#smtpModal textarea{
    min-height:110px !important;
    padding:14px 16px !important;
    line-height:1.5 !important;
    resize:vertical !important;
}

/* زر الحفظ */
#smtpModal .save-user-btn{
    width:180px !important;
    height:48px !important;
    display:block !important;
    margin:10px auto 0 auto !important;
    border-radius:12px !important;
    font-size:14px !important;
    font-weight:800 !important;
}

/* زر الإغلاق */
#smtpModal .close-modal-btn{
    width:42px !important;
    height:42px !important;
    min-width:42px !important;
    border-radius:12px !important;
}

/* Scroll داخل المودال */
#smtpModal .modal-content::-webkit-scrollbar{
    width:8px;
}

#smtpModal .modal-content::-webkit-scrollbar-track{
    background:#f1f5f9;
    border-radius:10px;
}

#smtpModal .modal-content::-webkit-scrollbar-thumb{
    background:#cbd5e1;
    border-radius:10px;
}

#smtpModal .modal-content::-webkit-scrollbar-thumb:hover{
    background:#94a3b8;
}