/* =========================================================
   MARALORA CLIENT PORTAL
   Complete Main Stylesheet
   ========================================================= */


/* =========================================================
   LOCAL FONTS
   ========================================================= */

@font-face{
    font-family:'Vazirmatn';
    src:url('/assets/fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight:400;
    font-style:normal;
    font-display:swap;
}

@font-face{
    font-family:'Vazirmatn';
    src:url('/assets/fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight:500;
    font-style:normal;
    font-display:swap;
}

@font-face{
    font-family:'Vazirmatn';
    src:url('/assets/fonts/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight:600;
    font-style:normal;
    font-display:swap;
}

@font-face{
    font-family:'Vazirmatn';
    src:url('/assets/fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight:700;
    font-style:normal;
    font-display:swap;
}

@font-face{
    font-family:'Vazirmatn';
    src:url('/assets/fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
    font-weight:800;
    font-style:normal;
    font-display:swap;
}


/* =========================================================
   VARIABLES
   ========================================================= */

:root{
    --navy:#091329;
    --navy-2:#111d36;
    --navy-3:#17233f;

    --gold:#D4AF37;
    --gold-dark:#b89424;
    --gold-soft:rgba(212,175,55,.12);

    --bg:#f5f6f9;
    --surface:#ffffff;

    --text:#172033;
    --muted:#6b7280;

    --line:#e5e7eb;
    --line-dark:#d7dbe3;

    --success:#17633a;
    --success-bg:#ecfdf3;

    --danger:#9f1239;
    --danger-bg:#fff1f2;

    --warning:#806300;
    --warning-bg:#fff7dc;

    --sidebar-width:260px;
    --header-height:68px;

    --radius-sm:10px;
    --radius:14px;
    --radius-lg:18px;

    --shadow:
        0 8px 30px rgba(9,19,41,.055);

    --font:
        'Vazirmatn',
        Tahoma,
        Arial,
        sans-serif;
}


/* =========================================================
   RESET
   ========================================================= */

*{
    box-sizing:border-box;
}

html{
    direction:rtl;
    -webkit-text-size-adjust:100%;
}

html,
body,
button,
input,
select,
textarea,
option{
    font-family:var(--font) !important;
}

body{
    margin:0;
    min-height:100%;

    background:var(--bg);
    color:var(--text);

    direction:rtl;

    font-size:14px;
    font-weight:400;
    line-height:1.8;

    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
}

body.sidebar-open{
    overflow:hidden;
}

button,
input,
select,
textarea{
    font:inherit;
}

a{
    text-decoration:none;
    color:inherit;
}

img{
    max-width:100%;
    height:auto;
}


/* =========================================================
   PORTAL LAYOUT
   ========================================================= */

.portal-layout{
    min-height:100vh;
    background:var(--bg);
}

.portal-main{
    min-height:100vh;

    margin-right:var(--sidebar-width);

    transition:
        margin .25s ease;
}

.portal-content{
    min-height:calc(100vh - var(--header-height));
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.portal-sidebar{
    width:var(--sidebar-width);
    height:100vh;

    position:fixed;
    top:0;
    right:0;

    z-index:1000;

    background:
        linear-gradient(
            180deg,
            #091329 0%,
            #0d1830 100%
        );

    color:#fff;

    border-left:
        1px solid rgba(255,255,255,.06);

    box-shadow:
        -8px 0 30px rgba(9,19,41,.08);
}

.sidebar-inner{
    height:100%;

    display:flex;
    flex-direction:column;

    padding:16px 14px;
}


/* =========================================================
   SIDEBAR BRAND
   ========================================================= */

.sidebar-brand{
    display:flex;
    align-items:center;
    justify-content:space-between;

    gap:10px;

    padding:5px 3px 17px;

    border-bottom:
        1px solid rgba(255,255,255,.08);
}

.sidebar-brand-link{
    display:flex;
    align-items:center;

    min-width:0;

    gap:11px;
}

.sidebar-brand-mark{
    width:42px;
    height:42px;

    flex:0 0 42px;

    display:flex;
    align-items:center;
    justify-content:center;

    border-radius:13px;

    background:var(--gold);
    color:var(--navy);

    font-size:19px;
    font-weight:800;

    box-shadow:
        0 6px 18px rgba(212,175,55,.16);
}

.sidebar-brand-text{
    display:flex;
    flex-direction:column;

    min-width:0;

    line-height:1.4;
}

.sidebar-brand-text strong{
    color:#fff;

    font-size:16px;
    font-weight:800;
}

.sidebar-brand-text span{
    margin-top:2px;

    color:#8e97aa;

    font-size:10px;
}

.sidebar-close{
    display:none;

    width:38px;
    height:38px;

    border:0;
    border-radius:10px;

    background:rgba(255,255,255,.07);
    color:#fff;

    font-size:25px;
    line-height:1;

    cursor:pointer;
}


/* =========================================================
   SIDEBAR USER
   ========================================================= */

.sidebar-user{
    display:flex;
    align-items:center;

    gap:10px;

    padding:15px 8px;

    margin:13px 0 4px;

    border-radius:13px;

    background:
        rgba(255,255,255,.045);
}

.sidebar-user-avatar{
    width:38px;
    height:38px;

    flex:0 0 38px;

    display:flex;
    align-items:center;
    justify-content:center;

    border-radius:50%;

    background:rgba(212,175,55,.15);
    color:#f2d46d;

    font-size:15px;
    font-weight:700;
}

.sidebar-user-info{
    min-width:0;

    display:flex;
    flex-direction:column;

    line-height:1.45;
}

.sidebar-user-info strong{
    overflow:hidden;

    color:#f9fafb;

    font-size:12px;
    font-weight:700;

    text-overflow:ellipsis;
    white-space:nowrap;
}

.sidebar-user-info span{
    margin-top:3px;

    color:#8e97aa;

    font-size:10px;
}


/* =========================================================
   SIDEBAR NAV
   ========================================================= */

.sidebar-nav{
    flex:1;

    overflow-y:auto;

    padding:3px 0 15px;
}

.sidebar-section-title{
    padding:14px 11px 7px;

    color:#657087;

    font-size:10px;
    font-weight:600;
}

.sidebar-section-account{
    margin-top:10px;
}

.sidebar-link{
    position:relative;

    min-height:43px;

    display:flex;
    align-items:center;

    gap:10px;

    margin-bottom:4px;
    padding:8px 10px;

    border-radius:11px;

    color:#c9cfda;

    font-size:12px;
    font-weight:500;

    transition:
        background-color .18s ease,
        color .18s ease,
        transform .18s ease;
}

.sidebar-link:hover{
    background:rgba(255,255,255,.055);
    color:#fff;
}

.sidebar-link.active{
    background:var(--gold);
    color:var(--navy);

    font-weight:700;

    box-shadow:
        0 6px 18px rgba(212,175,55,.12);
}

.sidebar-link.active::before{
    content:"";

    position:absolute;

    right:-14px;

    width:3px;
    height:26px;

    border-radius:4px 0 0 4px;

    background:#f0d366;
}

.sidebar-icon{
    width:25px;

    flex:0 0 25px;

    display:inline-flex;
    align-items:center;
    justify-content:center;

    font-size:16px;
}


/* =========================================================
   SIDEBAR BOTTOM
   ========================================================= */

.sidebar-bottom{
    padding-top:12px;

    border-top:
        1px solid rgba(255,255,255,.08);
}

.sidebar-logout{
    min-height:42px;

    display:flex;
    align-items:center;

    gap:10px;

    padding:8px 10px;

    border-radius:11px;

    color:#f0b8be;

    font-size:12px;
    font-weight:600;

    transition:
        background-color .18s ease,
        color .18s ease;
}

.sidebar-logout:hover{
    background:rgba(180,40,55,.13);
    color:#fff;
}


/* =========================================================
   PORTAL HEADER
   ========================================================= */

.portal-header{
    height:var(--header-height);

    position:sticky;
    top:0;

    z-index:800;

    display:flex;
    align-items:center;
    justify-content:space-between;

    gap:15px;

    padding:0 25px;

    background:
        rgba(255,255,255,.94);

    border-bottom:1px solid var(--line);

    backdrop-filter:blur(12px);

    box-shadow:
        0 4px 15px rgba(9,19,41,.035);
}

.portal-header-start{
    display:flex;
    align-items:center;

    min-width:0;

    gap:12px;
}

.portal-page-title{
    min-width:0;

    color:var(--navy);

    font-size:15px;
    font-weight:700;
}

.portal-page-title span{
    overflow:hidden;
    display:block;

    text-overflow:ellipsis;
    white-space:nowrap;
}

.portal-header-end{
    display:flex;
    align-items:center;
}

.header-user{
    display:flex;
    align-items:center;

    gap:9px;
}

.header-user-text{
    display:flex;
    flex-direction:column;

    line-height:1.4;

    text-align:left;
}

.header-user-text strong{
    color:var(--navy);

    font-size:11px;
    font-weight:700;
}

.header-user-text span{
    color:var(--muted);

    font-size:9px;
}

.header-user-avatar{
    width:36px;
    height:36px;

    display:flex;
    align-items:center;
    justify-content:center;

    border-radius:50%;

    background:var(--navy);
    color:var(--gold);

    font-size:13px;
    font-weight:700;
}


/* =========================================================
   SIDEBAR TOGGLE
   ========================================================= */

.sidebar-toggle{
    width:42px;
    height:42px;

    display:none;
    align-items:center;
    justify-content:center;
    flex-direction:column;

    gap:4px;

    padding:0;

    border:1px solid var(--line);
    border-radius:11px;

    background:#fff;

    cursor:pointer;
}

.sidebar-toggle span{
    width:18px;
    height:2px;

    display:block;

    border-radius:99px;

    background:var(--navy);
}


/* =========================================================
   SIDEBAR OVERLAY
   ========================================================= */

.sidebar-overlay{
    display:none;

    position:fixed;
    inset:0;

    z-index:950;

    background:rgba(6,13,29,.48);

    opacity:0;

    visibility:hidden;

    transition:
        opacity .2s ease,
        visibility .2s ease;
}

.sidebar-overlay.is-visible{
    opacity:1;
    visibility:visible;
}


/* =========================================================
   PAGE WRAP
   ========================================================= */

.wrap{
    width:100%;
    max-width:1480px;

    margin:0 auto;
    padding:26px 28px;
}


/* =========================================================
   TYPOGRAPHY
   ========================================================= */

h1,
h2,
h3,
h4,
h5,
h6{
    color:var(--navy);
    line-height:1.55;
}

h1{
    margin:0 0 22px;

    font-size:26px;
    font-weight:800;
}

h2{
    margin:0 0 16px;

    font-size:21px;
    font-weight:800;
}

h3{
    margin:0 0 15px;

    font-size:17px;
    font-weight:700;
}

h4{
    margin:0 0 10px;

    font-size:15px;
    font-weight:700;
}

p{
    margin-top:0;
}

strong,
b{
    font-weight:700;
}

.muted{
    color:var(--muted);

    font-size:13px;
    line-height:1.9;
}


/* =========================================================
   GRID
   ========================================================= */

.grid{
    display:grid;
    gap:18px;
}

.g2{
    grid-template-columns:
        repeat(2,minmax(0,1fr));
}

.g3{
    grid-template-columns:
        repeat(3,minmax(0,1fr));
}


/* =========================================================
   CARD
   ========================================================= */

.card{
    min-width:0;

    background:var(--surface);

    border:1px solid var(--line);

    border-radius:var(--radius-lg);

    padding:20px;

    box-shadow:var(--shadow);
}


/* =========================================================
   FORMS
   ========================================================= */

label{
    display:block;

    margin:14px 0 6px;

    color:var(--navy);

    font-size:13px;
    font-weight:700;
}

input,
select,
textarea{
    width:100%;

    padding:11px 13px;

    border:1px solid var(--line-dark);
    border-radius:11px;

    background:#fff;
    color:var(--text);

    font-size:13px;
    font-weight:400;

    outline:none;

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background-color .2s ease;
}

input,
select{
    min-height:44px;
}

textarea{
    resize:vertical;
    line-height:1.9;
}

input:hover,
select:hover,
textarea:hover{
    border-color:#c6cad3;
}

input:focus,
select:focus,
textarea:focus{
    border-color:var(--gold);

    box-shadow:
        0 0 0 3px rgba(212,175,55,.12);
}

input::placeholder,
textarea::placeholder{
    color:#a0a6b1;
}

input[type="number"],
input[type="date"],
input[type="email"]{
    direction:ltr;
    text-align:right;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.btn{
    min-height:42px;

    display:inline-flex;
    align-items:center;
    justify-content:center;

    gap:6px;

    padding:9px 16px;

    border:0;
    border-radius:11px;

    background:var(--navy);
    color:#fff;

    font-size:13px;
    font-weight:600;

    cursor:pointer;

    transition:
        transform .15s ease,
        background-color .2s ease,
        box-shadow .2s ease;
}

.btn:hover{
    background:var(--navy-2);

    box-shadow:
        0 5px 15px rgba(9,19,41,.12);
}

.btn:active{
    transform:translateY(1px);
}

.btn.gold{
    background:var(--gold);
    color:var(--navy);

    font-weight:700;
}

.btn.gold:hover{
    background:var(--gold-dark);
}

.btn.danger{
    background:#8b1e2d;
    color:#fff;
}

.btn.danger:hover{
    background:#741824;
}

.btn.light{
    background:#eef1f5;
    color:var(--navy);
}


/* =========================================================
   ALERTS
   ========================================================= */

.alert{
    padding:12px 14px;

    border-radius:12px;

    margin:12px 0;

    font-size:13px;
    line-height:1.9;
}

.alert.ok,
.ok{
    background:var(--success-bg);
    color:var(--success);
}

.alert.err,
.err{
    background:var(--danger-bg);
    color:var(--danger);
}


/* =========================================================
   TABLE
   ========================================================= */

table{
    width:100%;

    border-collapse:collapse;

    background:#fff;
}

th,
td{
    padding:12px 11px;

    border-bottom:1px solid var(--line);

    text-align:right;
    vertical-align:middle;

    font-size:13px;
    line-height:1.75;
}

th{
    color:var(--navy);

    background:#fafbfc;

    font-size:12px;
    font-weight:700;

    white-space:nowrap;
}

td{
    color:#30394b;
}

tr:last-child td{
    border-bottom:0;
}

tbody tr{
    transition:
        background-color .15s ease;
}

tbody tr:hover{
    background:#fafbfc;
}


/* =========================================================
   BADGE / STATUS
   ========================================================= */

.badge{
    display:inline-flex;
    align-items:center;

    padding:5px 9px;

    border-radius:999px;

    background:#eef1f7;

    font-size:11px;
    font-weight:600;
}


/* =========================================================
   PROGRESS
   ========================================================= */

.progress{
    width:100%;
    height:9px;

    overflow:hidden;

    background:#edf0f4;

    border-radius:999px;
}

.progress i{
    display:block;

    height:100%;

    background:var(--gold);

    border-radius:999px;
}


/* =========================================================
   STAT
   ========================================================= */

.stat{
    margin-top:4px;

    color:var(--navy);

    font-size:30px;
    font-weight:800;

    line-height:1.4;
}


/* =========================================================
   DETAILS
   ========================================================= */

details{
    border-radius:12px;
}

summary{
    cursor:pointer;

    color:var(--navy);

    font-weight:700;

    user-select:none;
}


/* =========================================================
   FILE INPUT
   ========================================================= */

input[type="file"]{
    padding:8px 10px;
}

input[type="file"]::file-selector-button{
    margin-left:10px;

    border:0;
    border-radius:9px;

    padding:8px 12px;

    background:var(--navy);
    color:#fff;

    font-weight:600;

    cursor:pointer;
}


/* =========================================================
   PUBLIC / LOGIN PAGES
   ========================================================= */

.public-layout{
    min-height:100vh;

    display:flex;
    flex-direction:column;

    background:
        linear-gradient(
            180deg,
            #f7f8fa 0%,
            #f4f5f8 100%
        );
}

.public-header{
    height:70px;

    display:flex;
    align-items:center;
    justify-content:center;

    background:var(--navy);
}

.public-brand{
    display:flex;
    flex-direction:column;

    text-align:center;

    line-height:1.3;
}

.public-brand strong{
    color:var(--gold);

    font-size:18px;
    font-weight:800;
}

.public-brand span{
    color:#a6afc0;

    font-size:10px;
}

.public-content{
    flex:1;
}


/* =========================================================
   SCROLLBAR
   ========================================================= */

::-webkit-scrollbar{
    width:8px;
    height:8px;
}

::-webkit-scrollbar-track{
    background:#f1f2f5;
}

::-webkit-scrollbar-thumb{
    background:#c8ccd5;
    border-radius:999px;
}

::-webkit-scrollbar-thumb:hover{
    background:#aeb4c0;
}


/* =========================================================
   TABLET / MOBILE SIDEBAR
   ========================================================= */

@media(max-width:1000px){

    .portal-main{
        margin-right:0;
    }

    .portal-sidebar{
        transform:translateX(110%);

        transition:
            transform .24s ease;
    }

    .portal-sidebar.is-open{
        transform:translateX(0);
    }

    .sidebar-overlay{
        display:block;
    }

    .sidebar-close{
        display:flex;
        align-items:center;
        justify-content:center;
    }

    .sidebar-toggle{
        display:flex;
    }

    .portal-header{
        padding:0 18px;
    }

    .wrap{
        padding:22px 20px;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media(max-width:800px){

    .g2,
    .g3{
        grid-template-columns:1fr;
    }

    .portal-header{
        height:62px;

        padding:0 13px;
    }

    .portal-page-title{
        font-size:13px;
    }

    .header-user-text{
        display:none;
    }

    .header-user-avatar{
        width:34px;
        height:34px;
    }

    .sidebar-toggle{
        width:38px;
        height:38px;
    }

    .wrap{
        padding:15px;
    }

    h1{
        font-size:22px;
    }

    h2{
        font-size:19px;
    }

    .card{
        padding:16px;
        border-radius:15px;
    }

    /*
    | جدول‌ها در موبایل
    */

    .card{
        overflow-x:auto;
    }

    table{
        min-width:650px;
    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media(max-width:480px){

    :root{
        --sidebar-width:280px;
    }

    body{
        font-size:13px;
    }

    .portal-sidebar{
        width:min(
            var(--sidebar-width),
            calc(100vw - 38px)
        );
    }

    .sidebar-inner{
        padding:13px 11px;
    }

    .wrap{
        padding:11px;
    }

    .portal-header{
        padding:0 10px;
    }

    .portal-page-title{
        max-width:160px;
    }

    .card{
        padding:14px;
    }

    .btn{
        min-height:40px;

        padding:8px 13px;
    }

}