*{
    box-sizing:border-box;
}

body{
    margin:0;
    padding:0;

    padding-top:70px;

    font-family:tahoma;

    direction:rtl;

    background:linear-gradient(135deg,#eef7f1,#f6f6f6);

    color:#333;
}

input[type="number"]{

    width:100%;

    padding:8px;

    border:1px solid #ddd;

    border-radius:8px;

    text-align:center;
}


/* ================= app ================= */
.app-header{
    text-align:center;
    margin-bottom:20px;
}

.app-title{
    font-size:26px;
    font-weight:bold;
    color:#1b7f4b;
}

.app-subtitle{
    font-size:18px;
    font-weight:bold;
    color:#555;
     margin-top:5px;
}
/* ================= TOPBAR ================= */

.topbar{

    position:fixed;

    top:0;
    right:0;
    left:0;

    height:60px;

    background:#1b7f4b;

    display:flex;

    align-items:center;

    justify-content:space-between;

    padding:0 15px;

    z-index:999;

    box-shadow:0 3px 10px rgba(0,0,0,.15);
}

.topbar-logo{

    color:white;

    font-size:18px;

    font-weight:bold;
}

.topbar-menu{

    display:flex;

    align-items:center;

    gap:12px;

    flex-wrap:wrap;
}

.topbar-menu span{

    color:white;

    font-weight:bold;

    font-size:14px;
}

.topbar-menu a{

    color:white;

    text-decoration:none;

    font-size:14px;

    padding:6px 10px;

    border-radius:8px;

    transition:.2s;
}

.topbar-menu a:hover{

    background:rgba(255,255,255,.15);
}

.topbar a{
    position: relative;
    z-index: 9999;
    display: inline-block;
}

/* ================= PAGE WRAPPER ================= */

.page{
    max-width:520px;
    margin:20px auto;
    padding:10px;
}

/* ================= CARD SYSTEM ================= */

.box{
    background:#fff;
    border-radius:16px;
    padding:16px;
    margin-bottom:12px;
    box-shadow:0 10px 25px rgba(0,0,0,0.08);
    overflow:hidden;
}

.card{
    background:#fff;
    border-radius:14px;
    padding:12px;
    margin:10px 0;
    box-shadow:0 6px 18px rgba(0,0,0,0.06);
}

/* ================= TITLES ================= */

h1,h2,h3{
    margin:0;
}

h2{
    margin:0;
    font-size:18px;
    font-weight:bold;
    text-align:center;
}

.page-title{
    text-align:center;
    font-size:18px;
    color:#1b7f4b;
    margin-bottom:12px;
}

/* ================= GRID SYSTEM ================= */

.stats-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:10px;
    margin:10px 0;
}

.stat-card{
    background:#f7f7f7;
    padding:10px;
    border-radius:12px;
    text-align:center;
       transition:0.2s;
}

.stat-title{
    font-size:12px;
    color:#777;
}


.stat-card:hover{
    transform:translateY(-2px);
}

.stat-card .icon-box{
    font-size:20px;
}

.stats-grid-pro{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:12px;
    margin:15px 0;
}

.stat-card-pro{
    background:#fff;
    border-radius:16px;
    padding:14px;
    box-shadow:0 6px 18px rgba(0,0,0,0.06);
    text-align:center;
    transition:0.2s;
}

.stat-card-pro:hover{
    transform:translateY(-3px);
}

.stat-icon{
    font-size:22px;
    margin-bottom:5px;
}

.stat-label{
    font-size:12px;
    color:#777;
}

.stat-value{
    font-size:15px;
    font-weight:bold;
    color:#1b7f4b;
}

/* ألوان الحالة */
.stat-card-pro.green .stat-value{color:#1b7f4b;}
.stat-card-pro.orange .stat-value{color:#f39c12;}
.stat-card-pro.red .stat-value{color:#e74c3c;}

/* موبايل */
@media(max-width:600px){
    .stats-grid-pro{
        grid-template-columns:1fr;
    }
}

/* ================= NOTES ================= */

        .note{

    background:#f4f7f2;

    border-right:4px solid #5f8f52;

    padding:14px;

    border-radius:10px;

    margin:15px 0;

    line-height:1.9;

    font-size:15px;

    color:#355;

}

/* عنوان صغير */

.note b{

    color:#274e13;

    font-size:16px;

}
        
    
      .container{
    width:100%;
}

     
/* ================= FORM ================= */

.ec-form{
    display:flex;
    gap:8px;
    margin:10px 0;
}

.input{
    flex:1;
    padding:10px;
    border-radius:10px;
    border:1px solid #ddd;
}

/* ================= BUTTONS ================= */

.btn{
    display:block;

    width:100%;

    padding:12px 16px;

    border:none;

    border-radius:10px;

    cursor:pointer;

    font-size:15px;

    font-weight:bold;

    color:#fff;

    background:#1b7f4b;

    text-align:center;
}

.btn:hover{
    opacity:.9;
}

.actions{
    display:flex;

    gap:10px;

    margin-top:15px;
}

.actions .btn{
    flex:1;
    font-size:14px;
    font-weight:bold;
}

/* ================= QUALITY ================= */

.quality{
    text-align:center;
    padding:10px;
    border-radius:12px;
    font-weight:bold;
    margin:10px 0;
}

.quality.good{background:#e9f9ef;color:#1b7f4b;}
.quality.medium{background:#fff6e5;color:#b8860b;}
.quality.bad{background:#ffe9e9;color:#b10000;}

/* ================= TABLE ================= */

table{
    width:100%;
    border-collapse:collapse;
    font-size:14px;
    margin-top:10px;
}

td,th{
    padding:10px;
    border-bottom:1px solid #eee;
    text-align:center;
}

/* ================= MOBILE FIX ================= */

@media(max-width:600px){

    .stats-grid{
        grid-template-columns:repeat(2,1fr);
    }

    .page{
        padding:8px;
    }

    .ec-form{
        flex-direction:column;
    }

    .actions{
        flex-direction:column;
    }
}


/* ================= materials ================= */

        .materials{
            margin-top:20px;
            display:grid;
            grid-template-columns: 1fr 1fr;
            gap:10px;
        }
        label{
            display:flex;
            align-items:center;
            gap:8px;
            background:#f9f9f9;
            padding:10px;
            border-radius:10px;
            border:1px solid #ddd;
            cursor:pointer;
            font-size:14px;
        }
        label:hover{
            border-color:#1b7f4b;
        }
        input[type="checkbox"]{
            width:18px;
            height:18px;
            cursor:pointer;
        }

/* ================= phone ================= */


.phone-row{

display:flex;

gap:10px;

}

.phone-row select{

width:40%;

min-width:120px;

padding:12px;

border:1px solid #ccc;

border-radius:10px;

font-size:14px;

background:#fff;

}

.phone-row input{

width:60%;

}


.welcome{
    text-align:center;
    font-size:16px;
    font-weight:bold;
    color:#1b7f4b;
    margin:10px 0;
}

.subtitle{

    text-align:center;

    color:#666;

    margin-bottom:15px;

    font-size:14px;
}

.table-wrap{
    overflow-x:auto;
    margin:10px 0;
}


/* ================= crops ================= */

.section{
    margin-bottom:15px;
}

.section h3{
    margin-bottom:8px;
    color:#1b7f4b;
    font-size:16px;
}

.section select,
.grid input,
.grid select{

    width:100%;

    padding:12px;

    border:1px solid #ddd;

    border-radius:10px;

    font-size:14px;
}

.grid{

    display:grid;

    gap:12px;

    margin:15px 0;
}

.msg{

    padding:12px;

    border-radius:10px;

    margin-bottom:15px;

    text-align:center;
}

.error{

    background:#ffe9e9;

    color:#b10000;
}

.warning-big{

    font-weight:bold;
}

.buttons{

    display:flex;

    gap:10px;

    flex-wrap:wrap;

    margin-top:20px;
}


/* ================= AUTH ================= */

.auth-page{

    min-height:100vh;

    display:flex;

    justify-content:center;

    align-items:center;

    padding:20px;
}

.auth-box{

    width:100%;

    max-width:500px;

    background:#fff;

    padding:20px;

    border-radius:16px;

    box-shadow:0 10px 25px rgba(0,0,0,.08);
}

.auth-box form{

    display:flex;

    flex-direction:column;

    gap:12px;
}

.auth-box input,
.auth-box select{

    width:100%;

    padding:12px;

    border:1px solid #ddd;

    border-radius:10px;

    font-size:15px;
}

.link,
.forgot{

    text-align:center;

    margin-top:15px;
}

.link a,
.forgot a{

    color:#1b7f4b;

    text-decoration:none;

    font-weight:bold;
}

.link a:hover,
.forgot a:hover{

    text-decoration:underline;
}


.msg.success{
    background:#d7ffe1;
    color:#0d6a32;
    border:1px solid #9fd8ad;
}

.dashboard-layout{
    display:flex;
    min-height:100vh;
}

/* ===== SIDEBAR ===== */
.sidebar{
    width:220px;
    background:#1b7f4b;
    color:#fff;
    padding:15px;
    position:fixed;
    top:0;
    bottom:0;
}

.sidebar h3{
    text-align:center;
    margin-bottom:20px;
}

.sidebar a{
    display:block;
    color:#fff;
    text-decoration:none;
    padding:10px;
    border-radius:8px;
    margin-bottom:8px;
    transition:0.2s;
}

.sidebar a:hover{
    background:rgba(255,255,255,0.15);
}

/* ===== CONTENT ===== */
.dashboard-content{
    margin-right:220px;
    padding:15px;
    width:100%;
}

/* ===== BADGES ===== */
.badge{
    display:inline-block;
    padding:4px 10px;
    border-radius:20px;
    font-size:12px;
    font-weight:bold;
    color:#fff;
}

.badge.green{background:#1b7f4b;}
.badge.orange{background:#f39c12;}
.badge.red{background:#e74c3c;}

/* ===== ICON BOX ===== */
.icon-box{
    font-size:22px;
    margin-bottom:5px;
}


.dashboard-wrap{
    background:#fff;
    border-radius:18px;
    padding:15px;
    box-shadow:0 10px 25px rgba(0,0,0,0.08);
}

/* ===== APP LAYOUT (موحد لكل الصفحات) ===== */

.page{
    width:100%;
    min-height:100vh;
    padding:15px;
    background:#f4f6f8;
    box-sizing:border-box;
}

.app-shell {
    width: 100%;
    max-width: 420px;   /* شكل موبايل ثابت حتى على الكمبيوتر */
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* كل المحتوى داخل الكارد */
.content {
    padding: 15px;
}


/* ===== admin ===== */


.admin-section{
    background:#f8faf8;
    border:1px solid #e5efe8;
    border-radius:14px;
    padding:15px;
    margin-bottom:15px;
}

.admin-section h3{
    margin:0 0 10px;
    color:#1b7f4b;
    font-size:18px;
}

.admin-item{
    padding:6px 0;
    border-bottom:1px solid #eee;
}

.admin-item:last-child{
    border-bottom:none;
}

/* ================= ADMIN TABLE ================= */

.admin-table{
    width:100%;
    border-collapse:collapse;
    margin-top:10px;
    font-size:14px;
}

.admin-table th{
    background:#1b7f4b;
    color:#fff;
    padding:12px 8px;
    text-align:center;
}

.admin-table td{
    padding:10px 8px;
    border-bottom:1px solid #e5e5e5;
    text-align:center;
}

.admin-table tr:last-child td{
    border-bottom:none;
}

.admin-table tr:hover{
    background:#f8faf9;
}

.status-premium{
    color:#1b7f4b;
    font-weight:bold;
}

.status-trial{
    color:#b8860b;
    font-weight:bold;
}

/* موبايل */

@media(max-width:768px){

    .admin-table{
        font-size:12px;
    }

    .admin-table th,
    .admin-table td{
        padding:8px 4px;
    }

}

/* ================= user TABLE ================= */


.users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-card {
    background: #fff;
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.user-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.user-name {
    font-weight: bold;
    font-size: 15px;
}

.user-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.user-badge.premium {
    background: #e9f9ef;
    color: #1b7f4b;
}

.user-badge.trial {
    background: #fff6e5;
    color: #b8860b;
}

.user-info {
    font-size: 13px;
    color: #444;
    line-height: 1.6;
    margin-bottom: 10px;
}

.user-actions {
    display: flex;
    gap: 8px;
}

button.btn.small {
    padding: 6px 10px;
    font-size: 12px;
}



button.btn.danger {
    background: #b10000 !important;
}

/* ================= training TABLE ================= */

.chapter-link{
    display:block;
    padding:12px;
    margin:8px 0;
    background:#f5f7f9;
    border:1px solid #e5e7eb;
    border-radius:12px;
    text-decoration:none;
    color:#1b7f4b;
    font-weight:600;
    transition:.2s;
}

.chapter-link:hover{
    background:#edf7f0;
}
.menu-btn{

    border:none;
    background:none;
    font-size:28px;
    cursor:pointer;
    color:#000;

}

/* تعديل موضع القائمة المنسدلة */
.mobile-menu {
    display: none;
    position: fixed;
    top: 60px; /* نفس ارتفاع الـ topbar */
    right: 0;
    left: 0;
    background: #fff;
    margin: 0;
    border-radius: 0;
    box-shadow: 0 8px 20px rgba(0,0,0,.15);
    overflow: hidden;
    z-index: 1000;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}

/* إضافة خلفية داكنة خلف القائمة عند فتحها */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.mobile-menu a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #eee;
    font-size: 16px;
    transition: .2s;
}

.mobile-menu a:hover {
    background: #f0f7f3;
    color: #1b7f4b;
    padding-right: 25px;
}

/* تحسين زر القائمة للجوال */
.menu-btn {
    border: none;
    background: none;
    font-size: 28px;
    cursor: pointer;
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: .2s;
}

.menu-btn:hover {
    background: rgba(255,255,255,.15);
}

/* إخفاء القائمة في الشاشات الكبيرة إذا أردت */
@media(min-width: 769px) {
    .mobile-menu {
        display: none !important;
    }
}

/* تجاوز التعارضات مع القائمة الجديدة */
.mobile-menu {
    display: none !important;
}

.menu-overlay {
    display: none !important;
}

body.menu-open {
    overflow: hidden;
}

/* التأكد من ظهور القائمة فوق كل شيء */
.side-menu,
.overlay-dark {
    position: fixed;
}