.campaigns-page{

padding:40px;

width:100%;

box-sizing:border-box;

overflow-x:hidden;

}

/* =========================
   HEADER
========================= */

.campaigns-header{

display:flex;

justify-content:space-between;

align-items:center;

margin-bottom:30px;

}

.campaigns-title{

font-size:42px;

font-weight:700;

color:#2f5fe3;

}

.create-campaign-btn{

background:#2f5fe3;

color:#fff;

border:none;

padding:14px 22px;

border-radius:14px;

font-size:16px;

font-weight:700;

cursor:pointer;

transition:0.2s;

}

.create-campaign-btn:hover{

opacity:0.9;

transform:translateY(-2px);

}

/* =========================
   MAIN CARD
========================= */

.campaigns-card{

background:#fff;

border-radius:30px;

padding:30px;

box-shadow:
0 10px 30px rgba(15,23,42,0.05);

}

/* =========================
   CAMPAIGNS LIST
========================= */

.campaigns-list{

display:flex;

flex-direction:column;

gap:18px;

}

/* =========================
   CAMPAIGN ROW
========================= */

.campaign-row{

background:#fff;

border-radius:24px;

padding:24px;

display:grid;

grid-template-columns:
2fr
1fr
1.5fr
2fr;

gap:20px;

align-items:center;

border:1px solid #e2e8f0;

transition:0.25s;

box-shadow:
0 8px 20px rgba(15,23,42,0.04);

}

.campaign-row:hover{

transform:translateY(-2px);

box-shadow:
0 12px 24px rgba(15,23,42,0.08);

}

/* =========================
   CAMPAIGN INFO
========================= */

.campaign-info{

display:flex;

flex-direction:column;

gap:6px;

}

.campaign-row-name{

font-size:22px;

font-weight:700;

color:#0f172a;

}

.campaign-row-sub{

font-size:14px;

color:#64748b;

}

/* =========================
   STATUS
========================= */

.campaign-status-badge{

display:inline-flex;

align-items:center;

justify-content:center;

padding:10px 18px;

border-radius:999px;

font-size:13px;

font-weight:700;

width:max-content;

}

.status-running{

background:#dcfce7;

color:#15803d;

}

.status-paused{

background:#fef3c7;

color:#b45309;

}

.status-new{

background:#e2e8f0;

color:#475569;

}

.status-completed{

background:#dbeafe;

color:#2563eb;

}

/* =========================
   PROGRESS
========================= */

.progress-wrapper{

display:flex;

flex-direction:column;

gap:10px;

}

.progress-modern{

height:12px;

background:#e2e8f0;

border-radius:999px;

overflow:hidden;

}

.progress-modern-fill{

height:100%;

background:linear-gradient(
90deg,
#2f5fe3,
#60a5fa
);

border-radius:999px;

transition:0.3s;

}

.progress-modern-text{

font-size:13px;

font-weight:700;

color:#475569;

}

/* =========================
   ACTIONS
========================= */

.campaign-actions{

display:flex;

gap:10px;

justify-content:flex-end;

flex-wrap:wrap;

}

.start-btn{

background:#16a34a;

color:#fff;

border:none;

padding:11px 16px;

border-radius:12px;

font-weight:700;

cursor:pointer;

transition:0.2s;

}

.start-btn:hover{

transform:translateY(-2px);

opacity:0.9;

}

.pause-btn{

background:#f59e0b;

color:#fff;

border:none;

padding:11px 16px;

border-radius:12px;

font-weight:700;

cursor:pointer;

transition:0.2s;

}

.pause-btn:hover{

transform:translateY(-2px);

opacity:0.9;

}

.delete-btn{

background:#dc2626;

color:#fff;

border:none;

padding:11px 16px;

border-radius:12px;

font-weight:700;

cursor:pointer;

transition:0.2s;

}

.delete-btn:hover{

transform:translateY(-2px);

opacity:0.9;

}

.logs-btn{

background:#e2e8f0;

color:#0f172a;

border:none;

padding:11px 16px;

border-radius:12px;

font-weight:700;

cursor:pointer;

transition:0.2s;

}

.logs-btn:hover{

background:#cbd5e1;

}

.details-btn{

background:#2563eb;

color:#fff;

border:none;

padding:11px 16px;

border-radius:12px;

font-weight:700;

cursor:pointer;

transition:0.2s;

}

.details-btn:hover{

transform:translateY(-2px);

opacity:0.9;

}

/* =========================
   DETAILS SECTION
========================= */

.campaign-details{

display:none;

margin-top:14px;

background:#f8fafc;

border-radius:20px;

padding:24px;

border:1px solid #e2e8f0;

grid-template-columns:
repeat(auto-fit,minmax(220px,1fr));

gap:18px;

}

.campaign-details.active{

display:grid;

}

.detail-box{

background:#fff;

padding:18px;

border-radius:16px;

}

.detail-title{

font-size:13px;

color:#64748b;

margin-bottom:8px;

}

.detail-value{

font-size:22px;

font-weight:700;

color:#0f172a;

}

/* =========================
   LOGS
========================= */

.logs-stats{

display:grid;

grid-template-columns:
repeat(auto-fit,minmax(180px,1fr));

gap:14px;

margin-bottom:20px;

}

.logs-stats div{

background:#f8fafc;

padding:16px;

border-radius:16px;

font-size:14px;

color:#334155;

}

.logs-divider{

margin:20px 0;

border:none;

height:1px;

background:#e2e8f0;

}

.logs-list{

max-height:420px;

overflow-y:auto;

display:flex;

flex-direction:column;

gap:12px;

}

.log-item{

background:#f8fafc;

padding:14px 16px;

border-radius:14px;

font-size:14px;

color:#334155;

border:1px solid #e2e8f0;

}

/* =========================
   RESPONSIVE
========================= */

@media(max-width:1200px){

.campaign-row{

grid-template-columns:1fr;

}

.campaign-actions{

justify-content:flex-start;

}

}

/* =========================
   SMART CAMPAIGN BUILDER
========================= */

.campaign-modal{

position:fixed;

top:0;
left:0;

width:100%;
height:100%;

background:rgba(15,23,42,0.55);

display:flex;

align-items:center;
justify-content:center;

z-index:99999;

backdrop-filter:blur(6px);

padding:20px;

box-sizing:border-box;

}

.campaign-modal-content{

width:100%;
max-width:1050px;

max-height:92vh;

overflow-y:auto;

background:#ffffff;

border-radius:32px;

padding:36px;

box-sizing:border-box;

box-shadow:
0 25px 60px rgba(15,23,42,0.25);

position:relative;

animation:modalFade 0.25s ease;

}

@keyframes modalFade{

from{

opacity:0;
transform:translateY(20px);

}

to{

opacity:1;
transform:translateY(0);

}

}

.campaign-builder-title{

font-size:42px;

font-weight:800;

color:#0f172a;

margin-bottom:35px;

}

/* =========================
   CLOSE BUTTON
========================= */

.close-campaign-modal{

position:absolute;

top:24px;
right:24px;

width:46px;
height:46px;

border:none;

border-radius:16px;

background:#f1f5f9;

font-size:22px;

cursor:pointer;

transition:0.2s;

}

.close-campaign-modal:hover{

background:#e2e8f0;

transform:rotate(90deg);

}

/* =========================
   INPUTS
========================= */

.builder-label{

font-size:15px;

font-weight:700;

color:#334155;

}

.builder-input,
.builder-select{

width:100%;

padding:18px 20px;

border-radius:18px;

border:1px solid #dbe2ea;

background:#fff;

font-size:15px;

outline:none;

transition:0.2s;

box-sizing:border-box;

}

.builder-input:focus,
.builder-select:focus{

border-color:#2f5fe3;

box-shadow:
0 0 0 4px rgba(47,95,227,0.1);

}

/* =========================
   SELECT BOXES
========================= */

.selection-box{

background:#f8fafc;

border:1px solid #e2e8f0;

border-radius:22px;

padding:22px;

display:flex;

flex-direction:column;

gap:16px;

max-height:300px;

overflow-y:auto;

}

.selection-header{

display:flex;

justify-content:space-between;

align-items:center;

}

.selection-title{

font-size:18px;

font-weight:800;

color:#0f172a;

}

.select-all-btn{

background:#2f5fe3;

color:#fff;

border:none;

padding:10px 16px;

border-radius:12px;

font-size:13px;

font-weight:700;

cursor:pointer;

transition:0.2s;

}

.select-all-btn:hover{

opacity:0.9;

transform:translateY(-2px);

}

/* =========================
   CHECK ITEMS
========================= */

.check-item{

display:flex;

align-items:flex-start;

gap:14px;

background:#fff;

padding:16px;

border-radius:18px;

border:1px solid #e2e8f0;

transition:0.2s;

cursor:pointer;

}

.check-item:hover{

border-color:#2f5fe3;

transform:translateY(-2px);

}

.check-item input{

width:18px;
height:18px;

margin-top:3px;

accent-color:#2f5fe3;

}

.check-content{

display:flex;

flex-direction:column;

gap:5px;

}

.check-title{

font-size:15px;

font-weight:700;

color:#0f172a;

}

.check-sub{

font-size:13px;

color:#64748b;

}

/* =========================
   FOLLOWUPS
========================= */

.followups-wrapper{

display:flex;

flex-direction:column;

gap:18px;

}

.followup-card{
    background:#f8fafc;
    border:1px solid #e2e8f0;
    border-radius:20px;
    padding:22px;
    position:relative;
}

.followup-row{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:30px;
    margin-top:16px;
}

.followup-number{

font-size:18px;

font-weight:800;

color:#0f172a;

}

.remove-followup{

position:absolute;

top:18px;
right:18px;

width:36px;
height:36px;

border:none;

border-radius:12px;

background:#fee2e2;

color:#dc2626;

font-size:18px;

cursor:pointer;

transition:0.2s;

}

.remove-followup:hover{

transform:scale(1.08);

}

.add-followup-btn{

background:#0f172a;

color:#fff;

border:none;

padding:14px 18px;

border-radius:16px;

font-weight:700;

cursor:pointer;

width:max-content;

transition:0.2s;

}

.add-followup-btn:hover{

transform:translateY(-2px);

}

/* =========================
   SAVE BUTTON
========================= */

/* التنسيق الموحد لزر الحفظ */
.save-campaign-btn {
    display: block;
    width: 60%; 
    margin: 30px auto 10px auto; /* هذا الجزء هو المسؤول عن التوسيط */
    padding: 18px;
    border: none;
    border-radius: 22px;
    background: linear-gradient(135deg, #2f5fe3, #2563eb);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    transition: 0.3s;
}

.save-campaign-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

/* =========================
   RESPONSIVE
========================= */

@media(max-width:900px){

.builder-grid{

grid-template-columns:1fr;

}

.schedule-box{

grid-template-columns:1fr;

}

.campaign-modal-content{

padding:24px;

}

}

.schedule-options input[type="radio"]{

    width:18px !important;

    height:18px !important;

    margin:0 !important;

    cursor:pointer;

}

.builder-item{

display:flex;

justify-content:space-between;

align-items:center;

padding:12px;

border-radius:10px;

cursor:pointer;

margin-bottom:8px;

border:1px solid #eef2f7;

transition:0.2s;

}

.builder-item:hover{

background:#f8fafc;

}

.builder-item.selected{

background:#e8f0ff;

border-color:#2f5fe3;

}

.dropdown-header{

display:flex;

justify-content:space-between;

align-items:center;

padding:14px 18px;

background:#f8fafc;

border:1px solid #dbe2ea;

border-radius:14px;

cursor:pointer;

font-weight:700;

margin-bottom:0px;

}

.hidden{

display:none !important;

}

/* SMART CAMPAIGN BUILDER CLEAN */

.builder-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:24px;
    margin-bottom:30px;
}

.builder-section{
    width:100%;
    margin-top:25px;
}

.schedule-box{
    background:#f8fafc;
    border:1px solid #e2e8f0;
    border-radius:18px;
    padding:20px;
    margin-top:20px;
}

.schedule-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
}

.save-campaign-btn{
    width:100%;
    margin-top:30px;
    padding:18px;
    border:none;
    border-radius:18px;
    background:#2f5fe3;
    color:#fff;
    font-size:18px;
    font-weight:700;
    cursor:pointer;
}

@media(max-width:900px){

    .builder-grid{
        grid-template-columns:1fr;
    }

    .followup-row{
        grid-template-columns:1fr;
    }

    .schedule-grid{
        grid-template-columns:1fr;
    }
}

#followupsContainer{
    display:flex;
    flex-direction:column;
    gap:15px;
    margin-top:20px;
}

.modal{
    position:fixed;
    inset:0;
    background:rgba(15,23,42,.55);
    display:flex;
    justify-content:center;
    align-items:center;
    z-index:99999;
    backdrop-filter:blur(6px);
}

.modal-content{
    width:100%;
    max-width:1050px;
    max-height:92vh;
    overflow-y:auto;
    background:#fff;
    border-radius:32px;
    padding:36px;
    box-sizing:border-box;
}

/* =========================
   DROPDOWNS OVERLAY
========================= */

.builder-section{
    position:relative;
}

.dropdown-body{
    position:absolute;
    top:100%;
    left:0;
    width:100%;
    z-index:99999;
}

#smtpDropdown,
#leadsDropdown,
#templatesList{

    background:#fff;

    border:1px solid #dbe2ea;

    border-radius:14px;

    box-shadow:0 12px 30px rgba(0,0,0,.15);

    max-height:300px;

    overflow-y:auto;

    margin-top:8px;
}

.followup-header{

    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
}

.schedule-options{

    display:flex !important;

    flex-direction:row !important;

    align-items:center !important;

    gap:50px !important;

    margin:10px 0 20px 0 !important;

}

.schedule-options label{

    display:flex !important;

    align-items:center !important;

    gap:10px !important;

    cursor:pointer;

    font-size:16px;

    font-weight:500;

    white-space:nowrap;

}

.schedule-grid{

    display:grid !important;

    grid-template-columns:1fr 1fr !important;

    gap:30px !important;

    margin-top:15px;
}

.followup-grid{

    display:grid;

    grid-template-columns:1fr 1fr;

    gap:24px;

    margin-top:16px;
}

.remove-followup-btn{

    width:40px;
    height:40px;

    border:none;

    border-radius:10px;

    background:#fee2e2;

    color:#dc2626;

    display:flex;
    align-items:center;
    justify-content:center;

    cursor:pointer;

    font-size:20px;
}

.remove-followup-btn:hover{

    background:#fecaca;

}

.remove-followup-btn i{

    color:#dc2626 !important;

    font-size:18px;

}