.aep-dashboard{
    display:flex;
    gap:24px;
    width:100%;
    max-width:100%;
    margin:0;
    align-items:flex-start;
    direction:rtl;
}

.aep-sidebar{
    width:260px;
    min-width:260px;
    position:sticky;
    top:20px;
    background:#111827;
    border-radius:20px;
    padding:24px 18px;
    box-shadow:0 10px 30px rgba(0,0,0,.08);
}

.aep-sidebar h2{
    color:#fff;
    margin:0 0 22px;
    font-size:24px;
}

.aep-sidebar a{
    display:block;
    padding:14px 16px;
    margin-bottom:10px;
    border-radius:14px;
    color:#e5e7eb;
    text-decoration:none;
    transition:.2s ease;
    font-size:15px;
    font-weight:600;
}

.aep-sidebar a:hover{
    background:#2563eb;
    color:#fff;
}

.aep-content{
    flex:1;
    width:calc(100% - 284px);
    margin-top:0;
}

.aep-card,
.aep-box,
.aep-auth-box{
    background:#fff;
    border-radius:22px;
    padding:28px;
    margin-bottom:24px;
    box-shadow:0 10px 35px rgba(15,23,42,.06);
    overflow:hidden;
}

.aep-dynamic-panel:first-child,
.aep-order-page{
    margin-top:0;
}

.aep-page-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-bottom:18px;
}

.aep-page-header h2,
.aep-card h2,
.aep-box h2,
.aep-auth-box h2{
    margin:0;
    font-size:28px;
    color:#111827;
}

.aep-back-btn{
    background:#eff6ff;
    color:#1d4ed8;
    padding:12px 18px;
    border-radius:12px;
    text-decoration:none;
    font-weight:700;
}

.aep-grid-two{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:18px;
}

.aep-order-form,
.aep-card form,
.aep-auth-box form{
    display:flex;
    flex-direction:column;
    gap:18px;
}

.aep-order-form input,
.aep-order-form select,
.aep-card input,
.aep-card select,
.aep-auth-box input,
.aep-auth-box select{
    width:100%;
    min-height:58px;
    border:1px solid #d1d5db;
    border-radius:14px;
    padding:14px 16px;
    font-size:16px;
    background:#f9fafb;
    box-sizing:border-box;
}

.aep-order-form button,
.aep-card button,
.aep-auth-box button{
    min-height:56px;
    border:none;
    border-radius:14px;
    background:#2563eb;
    color:#fff;
    font-size:17px;
    font-weight:700;
    cursor:pointer;
}

.aep-stats{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:18px;
}

.aep-mini{
    background:#f8fafc;
    border-radius:18px;
    padding:22px;
}

.aep-mini h4{
    margin:0 0 12px;
    color:#475569;
}

.aep-mini p{
    margin:0;
    font-size:26px;
    font-weight:700;
}

.aep-table,
.widefat{
    width:100%;
    border-collapse:separate;
    border-spacing:0;
    table-layout:auto;
    overflow:hidden;
}

.aep-table thead,
.aep-table tbody,
.aep-table tr{
    width:100%;
}

.aep-table th,
.aep-table td,
.widefat th,
.widefat td{
    padding:18px 16px;
    white-space:nowrap;
    border-bottom:1px solid #e5e7eb;
    text-align:right;
    font-size:15px;
}

.aep-table th,
.widefat th{
    background:#f8fafc;
    color:#0f172a;
    font-weight:800;
}

.aep-table tr:hover td,
.widefat tr:hover td{
    background:#fafafa;
}

.aep-success,
.aep-error{
    padding:16px 18px;
    border-radius:14px;
    margin-bottom:18px;
    font-weight:700;
}

.aep-success{background:#ecfdf5;color:#047857;}
.aep-error{background:#fef2f2;color:#b91c1c;}

body .site,
body .content,
body .container,
body .woocommerce{
    max-width:100% !important;
}

@media(max-width:991px){
    .aep-dashboard{
        flex-direction:column;
    }

    .aep-sidebar,
    .aep-content{
        width:100%;
        min-width:100%;
        position:relative;
        top:auto;
    }
}

@media(max-width:767px){
    .aep-grid-two,
    .aep-page-header{
        grid-template-columns:1fr;
        flex-direction:column;
        align-items:stretch;
    }

    .aep-card,
    .aep-box,
    .aep-auth-box{
        padding:18px;
    }

    .aep-table{
        display:block;
        overflow-x:auto;
    }
}

/* Professional dashboard layout improvements */
.aep-dashboard{
    gap:12px;
    align-items:stretch;
    padding:0;
}

.aep-sidebar{
    width:230px;
    min-width:230px;
    margin:0 !important;
    border-radius:0 20px 20px 0;
    min-height:100vh;
    padding:18px 12px;
}

.aep-content{
    width:calc(100% - 230px);
    padding:0 10px 0 0;
}

.aep-card,
.aep-box,
.aep-auth-box{
    margin-top:14px;
    padding:20px;
}

.aep-order-page,
.aep-dynamic-panel,
.aep-withdraw-page,
.aep-account-page,
.aep-stats-page{
    margin-top:18px !important;
}

.aep-stats{
    grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
    gap:14px;
}

.aep-mini{
    padding:16px;
    border:1px solid #e5e7eb;
}

.aep-mini h4{
    font-size:13px;
    color:#64748b;
}

.aep-mini p{
    font-size:20px;
    color:#0f172a;
}

.aep-table-wrapper,
.table-responsive{
    overflow-x:auto;
    width:100%;
}

.aep-table,
.widefat{
    min-width:1100px;
    background:#fff;
}

.aep-table th,
.aep-table td,
.widefat th,
.widefat td{
    padding:16px 18px;
    font-size:14px;
}

.aep-table td{
    color:#1e293b;
}

.aep-page-header{
    margin-bottom:10px;
}

body .site,
body .content,
body .container,
body .woocommerce,
body .site-content{
    max-width:100% !important;
    width:100% !important;
    padding-left:0 !important;
    padding-right:0 !important;
}

@media(max-width:991px){
  .aep-sidebar{
      width:100%;
      min-width:100%;
      border-radius:18px;
      min-height:auto;
  }

  .aep-content{
      width:100%;
      padding:0;
  }

  .aep-table,
  .widefat{
      min-width:900px;
  }
}


/* Order page top alignment fix */
.aep-order-page,
.aep-order-form-wrapper,
.aep-create-order,
.aep-order-section{
    margin-top:-18px !important;
    padding-top:0 !important;
}

.aep-content > .aep-card:first-child{
    margin-top:0 !important;
}

.order-create-wrapper{margin-top:-25px!important}.order-title{margin-bottom:0!important}


.aep-withdraw-balance{
margin-bottom:25px;
}

.aep-actions{
display:flex;
gap:14px;
flex-wrap:wrap;
margin:20px 0 25px;
}

.aep-btn{
display:inline-flex;
align-items:center;
justify-content:center;
padding:14px 22px;
border-radius:14px;
background:#eef2ff;
color:#1e3a8a;
font-weight:700;
text-decoration:none;
min-width:190px;
transition:.2s ease;
}

.aep-btn:hover{
transform:translateY(-2px);
}

.aep-btn-primary{
background:linear-gradient(135deg,#2952cc,#0f1f52);
color:#fff;
}


.aep-btn{display:inline-flex!important;align-items:center;justify-content:center;padding:12px 22px!important;background:#111827!important;color:#fff!important;border-radius:10px!important;text-decoration:none!important;font-weight:700!important;margin:8px 8px 8px 0!important;border:none!important;transition:all .2s ease!important}.aep-btn:hover{opacity:.9;transform:translateY(-1px)}.aep-btn-primary{background:#2563eb!important;color:#fff!important}.aep-actions{margin-top:20px;margin-bottom:15px}.aep-back-btn{display:inline-flex!important;padding:12px 20px!important;background:#111827!important;color:#fff!important;border-radius:10px!important;text-decoration:none!important;font-weight:700!important;margin-bottom:15px!important}

/* Withdraw Buttons Final Fix */
.withdraw-btn{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;padding:12px 22px!important;background:#2563eb!important;color:#fff!important;border-radius:10px!important;text-decoration:none!important;font-weight:700!important;transition:all .25s ease!important;margin:8px 10px 8px 0!important;border:none!important;line-height:1.2!important}.withdraw-btn:hover{background:#1d4ed8!important;color:#fff!important;transform:translateY(-1px)!important}.aep-actions{display:flex!important;flex-wrap:wrap!important;gap:10px!important}

/* Withdraw pages fixes */
.page-slug-agent-withdraw .entry-title,
.page-slug-agent-withdraw-request .entry-title,
.page-slug-agent-withdraw-history .entry-title,
.page-slug-agent-withdraw h1,
.page-slug-agent-withdraw-request h1,
.page-slug-agent-withdraw-history h1{
    display:none !important;
}

.page-slug-agent-withdraw .site-main,
.page-slug-agent-withdraw-request .site-main,
.page-slug-agent-withdraw-history .site-main{
    padding-top:0 !important;
    margin-top:0 !important;
}

.page-slug-agent-withdraw .aep-card,
.page-slug-agent-withdraw-request .aep-card,
.page-slug-agent-withdraw-history .aep-card{
    margin-top:0 !important;
}

.page-slug-agent-withdraw .entry-content,
.page-slug-agent-withdraw-request .entry-content,
.page-slug-agent-withdraw-history .entry-content{
    margin-top:0 !important;
    padding-top:0 !important;
}


.page-slug-agent-withdraw-request .entry-title,
.page-slug-agent-withdraw-request h1{
display:none!important;
}

.page-slug-agent-withdraw-request .site-main,
.page-slug-agent-withdraw-request .entry-content{
margin-top:0!important;
padding-top:0!important;
}

.page-slug-agent-withdraw-request .aep-card{
margin-top:0!important;
padding-top:20px!important;
}

.page-slug-agent-withdraw-request input,
.page-slug-agent-withdraw-request select{
height:62px!important;
border-radius:18px!important;
}

.page-slug-agent-withdraw-request .aep-actions{
display:flex!important;
justify-content:space-between!important;
margin-bottom:15px!important;
}




/* =========================
   Withdraw Request Page Final Clean Fix
========================= */

.page-slug-agent-withdraw-request .site-main,
.page-slug-agent-withdraw-request .entry-content{
    margin-top:0 !important;
    padding-top:0 !important;
}

.page-slug-agent-withdraw-request .aep-card.aep-withdraw-modern{
    margin-top:-35px !important;
    padding-top:0 !important;
}

/* Available Balance Card */
.page-slug-agent-withdraw-request .aep-withdraw-balance{
    padding:10px 18px !important;
    min-height:auto !important;
    margin-bottom:12px !important;
    border-radius:16px !important;
}

/* amount beside title */
.page-slug-agent-withdraw-request .aep-withdraw-balance .aep-mini{
    display:flex !important;
    flex-direction:row-reverse !important;
    align-items:center !important;
    justify-content:center !important;
    gap:12px !important;
    padding:10px 14px !important;
}

/* text */
.page-slug-agent-withdraw-request .aep-withdraw-balance .aep-mini h4,
.page-slug-agent-withdraw-request .aep-withdraw-balance .aep-mini p{
    margin:0 !important;
    line-height:1 !important;
    color:#fff !important;
}

.page-slug-agent-withdraw-request .aep-withdraw-balance .aep-mini h4{
    font-size:18px !important;
}

.page-slug-agent-withdraw-request .aep-withdraw-balance .aep-mini p{
    font-size:18px !important;
    font-weight:700 !important;
}



/* =========================
   Withdraw Request Page Only
========================= */

.aep-withdraw-modern{
    margin-top:-45px !important;
    padding-top:0 !important;
}

.aep-withdraw-modern .aep-stats{
    display:block !important;
    margin-bottom:10px !important;
}

.aep-withdraw-modern .aep-withdraw-balance{
    margin-bottom:14px !important;
}

.aep-withdraw-modern .aep-withdraw-balance .aep-mini{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    flex-direction:row-reverse !important;
    gap:12px !important;
    padding:12px 18px !important;
    border-radius:16px !important;
    min-height:auto !important;
}

.aep-withdraw-modern .aep-withdraw-balance h4,
.aep-withdraw-modern .aep-withdraw-balance p{
    margin:0 !important;
    line-height:1 !important;
    color:#fff !important;
}

.aep-withdraw-modern .aep-withdraw-balance h4{
    font-size:18px !important;
}

.aep-withdraw-modern .aep-withdraw-balance p{
    font-size:18px !important;
    font-weight:700 !important;
}



#aepDynamicStats .aep-mini{
min-width:150px!important;
padding:10px 14px!important;
border-radius:14px!important;
}
#aepDynamicStats .aep-mini h4{font-size:18px!important}
#aepDynamicStats .aep-mini p{font-size:16px!important;margin-top:6px!important}

.aep-agent-orders-page .aep-orders-tools{display:flex!important;align-items:center!important;gap:10px!important;flex-wrap:nowrap!important}
.aep-agent-orders-page .aep-orders-tools>div:first-of-type{margin-top:0!important}
.aep-agent-orders-page #aep-orders-search{flex:1!important}
.aep-orders-fixed-stats>div,.aep-orders-filter-stats>div{background:#fff;padding:10px 14px;border-radius:10px;border:1px solid #dfe5ff;min-width:150px;text-align:center;flex:1}

.aep-agent-orders-page .aep-orders-tools{display:flex!important;align-items:end!important;gap:12px!important;flex-wrap:nowrap!important}
.aep-agent-orders-page .aep-orders-length{width:100px;flex:0 0 100px}
.aep-agent-orders-page #aep-orders-search{flex:1}
.aep-orders-fixed-stats{display:grid!important;grid-template-columns:repeat(3,minmax(180px,1fr))!important;gap:12px!important}
.aep-orders-fixed-stats>div{text-align:center}


/* Orders page targeted layout only */
.aep-agent-orders-page .aep-orders-top-wrap{display:flex;gap:20px;align-items:stretch;margin:15px 0}
.aep-agent-orders-page .aep-orders-fixed-stats-wrap{flex:1}
.aep-agent-orders-page .aep-orders-tools-side{width:260px;display:flex;flex-direction:column;justify-content:center;gap:14px}
.aep-agent-orders-page .aep-orders-tools-side #aep-orders-search{width:100%}
.aep-agent-orders-page .aep-orders-tools-side .aep-orders-length{width:100%;margin-top:0!important}

#aep-orders-search{min-height:42px!important;height:42px!important;}


/* Final orders page spacing tweaks */
.aep-agent-orders-page{
margin-top:0!important;
padding-top:0!important;
}
.aep-agent-orders-page .aep-page-header{
margin-top:0!important;
padding-top:0!important;
margin-bottom:8px!important;
}
.aep-content>.aep-card:first-child{
margin-top:0!important;
}
#aep-orders-search{
height:40px!important;
min-height:40px!important;
padding:8px 12px!important;
}
#aep-pagination{
display:flex!important;
justify-content:center!important;
align-items:center!important;
margin-top:8px!important;
margin-bottom:8px!important;
}
.aep-orders-filter-stats{
margin-top:0!important;
}


/* orders fixes */
#aep-orders-search{height:42px !important; min-height:42px !important; padding:8px 12px !important;}
.aep-orders-length select,#aep-per-page{height:42px !important;}
#aep-pagination{justify-content:center !important; width:100% !important;}
.aep-orders-filter-stats{justify-content:center !important;}

#aep-orders-search{height:42px!important;min-height:42px!important;}
#aep-pagination{margin-top:8px!important;margin-bottom:8px!important;}
.aep-orders-filter-stats{justify-content:center!important;margin-top:8px!important;}

.aep-advanced-stats,.aep-order-counts{display:flex;gap:20px;flex-wrap:wrap;justify-content:center;margin-bottom:20px}
.aep-order-counts .aep-mini,.aep-advanced-stats .aep-mini{text-align:center}
.aep-order-counts .aep-mini p,.aep-advanced-stats .aep-mini p{display:block;text-align:center}

.aep-sidebar a{display:flex!important;justify-content:center!important;align-items:center!important;text-align:center!important;padding:14px 28px!important;}
