*{box-sizing:border-box}
body{font-family:Arial,sans-serif;background:#f4f6f8;direction:rtl;margin:0;color:#222}
.auth-page{display:flex;min-height:100vh;align-items:center;justify-content:center}
.login-box,.app{width:min(960px,100%);margin:0 auto;padding:20px}
.login-box{max-width:420px;background:#fff;border-radius:16px;box-shadow:0 6px 20px rgba(0,0,0,.08)}
h1{margin:0 0 16px}
h2{margin:28px 0 12px}
.muted{color:#666}
input,select,button{font:inherit}
input,select{width:100%;padding:12px;margin:8px 0 14px;border:1px solid #ddd;border-radius:10px;background:#fff}
button,.btn{display:inline-block;border:0;background:#1f6feb;color:#fff;padding:11px 16px;border-radius:10px;cursor:pointer;text-decoration:none}
button.secondary,.btn.secondary{background:#555}
button.danger{background:#a62626}
.primary{width:100%;margin-top:16px}
.error{color:#a62626;margin-top:10px}
.success{color:#177245;margin-top:10px}
.top-nav{position:sticky;top:0;background:#fff;padding:10px;display:flex;gap:8px;overflow-x:auto;border-bottom:1px solid #ddd;z-index:2}
.top-nav a,.top-nav button{white-space:nowrap;background:#eef2f7;color:#222;border-radius:999px;padding:9px 13px;text-decoration:none;border:0}
.top-nav button{background:#ffecec;color:#8a1d1d}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}
.cards{display:grid;gap:12px}
.card{background:#fff;border-radius:14px;padding:16px;box-shadow:0 2px 12px rgba(0,0,0,.06)}
.card h3{margin:0 0 8px}
.row{display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid #eee;padding:8px 0}
.row:last-child{border-bottom:0}
.badge{display:inline-block;padding:4px 9px;border-radius:999px;background:#eef2f7;font-size:13px}
.money{font-weight:bold;font-size:22px}
.cart-line{display:grid;grid-template-columns:1fr 90px 30px;gap:8px;align-items:center;padding:6px 0;border-bottom:1px solid #eee}
.product-card{display:grid;grid-template-columns:1fr 110px;gap:10px;align-items:center}
.qty-input{margin:0}
@media(max-width:600px){
.login-box,.app{padding:14px}
.product-card{grid-template-columns:1fr}
}
.form-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
}

.field{
    margin-bottom:8px;
}

.field label{
    display:block;
    font-weight:700;
    margin-bottom:6px;
    color:#333;
}

.field input,
.field select{
    width:100%;
    padding:12px;
    border:1px solid #dcdcdc;
    border-radius:10px;
    background:#fff;
    font-size:15px;
}

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

.card h2{
    margin-top:0;
    margin-bottom:16px;
}

.primary{
    width:100%;
    padding:14px;
    border:none;
    border-radius:12px;
    background:#1f6feb;
    color:#fff;
    font-size:16px;
    cursor:pointer;
}

#profile-message{
    margin-top:14px;
}

.success{
    color:#177245;
}

.error{
    color:#b42318;
}

@media(max-width:700px){

    .form-grid{
        grid-template-columns:1fr;
    }

}

.page-top-bar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:16px 20px 8px;
    background:#f4f6f8;
}

.welcome-box{
    display:flex;
    flex-direction:column;
    gap:4px;
}

#greeting-text{
    font-size:14px;
    color:#666;
}

#customer-top-name{
    font-size:22px;
    font-weight:700;
    color:#111;
}

.notification-btn{
    width:48px;
    height:48px;
    border:none;
    border-radius:50%;
    background:#fff;
    box-shadow:0 2px 10px rgba(0,0,0,0.08);
    cursor:pointer;
    font-size:22px;
}
.top-nav-wrapper{
    position:sticky;
    top:0;
    z-index:100;

    display:flex;
    align-items:center;
    justify-content:space-between;

    gap:20px;

    padding:12px 20px;

    background:#fff;

    border-bottom:1px solid #e5e7eb;

    box-shadow:0 2px 10px rgba(0,0,0,0.04);
}

.top-nav-right,
.top-nav-left{
    display:flex;
    align-items:center;
    gap:12px;
}

.top-nav-center{
    display:flex;
    align-items:center;
    gap:10px;

    flex-wrap:wrap;
}

.top-nav-center a{
    text-decoration:none;

    color:#222;

    background:#f3f4f6;

    padding:9px 14px;

    border-radius:999px;

    font-size:14px;

    transition:0.2s;
}

.top-nav-center a:hover{
    background:#e5e7eb;
}

.welcome-inline{
    display:flex;
    align-items:center;
    gap:8px;

    font-size:15px;
}

#greeting-text{
    color:#666;
}

#customer-top-name{
    font-weight:700;
    color:#111;
}

.notification-btn,
.logout-btn{
    border:none;

    cursor:pointer;

    border-radius:12px;

    padding:10px 14px;

    background:#f3f4f6;

    font-size:15px;
}

.notification-btn{
    width:44px;
    height:44px;

    display:flex;
    align-items:center;
    justify-content:center;

    padding:0;

    font-size:20px;
}

.logout-btn{
    background:#fee2e2;
    color:#991b1b;
}

@media(max-width:900px){

    .top-nav-wrapper{
        flex-direction:column;
        align-items:stretch;
    }

    .top-nav-center{
        justify-content:center;
    }

    .top-nav-right,
    .top-nav-left{
        justify-content:space-between;
    }

}
.sales-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    gap:16px;
}

.sale-card{
    background:#fff;
    border-radius:18px;
    overflow:hidden;
    box-shadow:0 2px 12px rgba(0,0,0,0.07);
    border:2px solid transparent;
}

.sale-open{
    border-color:#16a34a;
}

.sale-upcoming{
    border-color:#f59e0b;
}

.sale-closed{
    opacity:0.72;
    border-color:#d1d5db;
}

.sale-image{
    height:160px;
    background:#eef2f7;
    display:flex;
    align-items:center;
    justify-content:center;
}

.sale-image img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.sale-image-empty{
    color:#777;
    font-weight:700;
}

.sale-content{
    padding:16px;
}

.sale-status{
    display:inline-block;
    padding:5px 10px;
    border-radius:999px;
    background:#f3f4f6;
    font-size:13px;
    margin-bottom:10px;
}

.sale-open .sale-status{
    background:#dcfce7;
    color:#166534;
}

.sale-upcoming .sale-status{
    background:#fef3c7;
    color:#92400e;
}

.sale-closed .sale-status{
    background:#f3f4f6;
    color:#555;
}

.sale-content h2{
    margin:0 0 8px;
}

.sale-dates{
    display:grid;
    gap:6px;
    margin:12px 0;
    font-size:14px;
    color:#555;
}