/* =========================================================
   GLOBAL RESET
========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: clamp(15px, 1.1vw, 18px);
    width: 100%;
    max-width: 100%;
}

body {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;

    overflow-x: hidden;

    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    background: #f5f7fb;
    color: #172033;
    line-height: 1.7;
}

img {
    max-width: 100%;
}


/* =========================================================
   HEADER
========================================================= */

.top {
    width: 100%;
    min-height: clamp(62px, 5vw, 72px);

    background: #173b67;
    color: #fff;

    display: flex;
    align-items: center;

    padding: 0 clamp(10px, 2.5vw, 24px);

    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);

    position: relative;
    z-index: 1000;
}

.top-inner {
    width: 100%;
    max-width: 1180px;
    min-width: 0;

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;
}

.brand {
    min-width: 0;
    max-width: 100%;

    color: #fff;
    text-decoration: none;

    font-size: clamp(15px, 1.5vw, 18px);
    font-weight: 700;

    white-space: nowrap;

    display: flex;
    align-items: center;

    gap: 8px;

    overflow: hidden;
}

.brand-icon {
    flex: 0 0 auto;
    font-size: clamp(18px, 1.8vw, 21px);
}


/* =========================================================
   NAVIGATION
========================================================= */

.main-nav {
    display: flex;
    align-items: center;

    gap: 4px;

    min-width: 0;
    flex: 0 0 auto;
}

.main-nav a {
    color: #fff;
    text-decoration: none;

    padding:
        clamp(8px, 1vw, 10px)
        clamp(10px, 1.2vw, 14px);

    border-radius: 8px;

    font-size: clamp(13px, 1vw, 15px);
    font-weight: 500;

    transition:
        background .2s ease,
        opacity .2s ease;

    display: flex;
    align-items: center;

    gap: 6px;

    white-space: nowrap;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, .12);
}

.main-nav .logout-link {
    margin-right: 6px;
    background: rgba(255, 255, 255, .08);
}

.main-nav .logout-link:hover {
    background: rgba(255, 255, 255, .16);
}


/* =========================================================
   MOBILE MENU BUTTON
========================================================= */

.menu-toggle {
    display: none;

    flex: 0 0 auto;

    border: 0;
    outline: none;

    background: transparent;
    color: #fff;

    font-size: 28px;
    line-height: 1;

    cursor: pointer;

    padding: 6px 8px;

    border-radius: 8px;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, .10);
}


/* =========================================================
   MAIN CONTAINER
========================================================= */

.container {
    width: 100%;
    max-width: 1180px;
    min-width: 0;

    margin:
        clamp(16px, 2.5vw, 28px)
        auto;

    padding:
        0
        clamp(10px, 1.5vw, 16px);
}


/* =========================================================
   CARDS
========================================================= */

.card {
    width: 100%;
    min-width: 0;

    background: #fff;

    border: 1px solid #e3e8ef;
    border-radius: clamp(10px, 1.2vw, 14px);

    padding: clamp(14px, 2vw, 22px);

    margin-bottom: clamp(14px, 1.8vw, 18px);

    box-shadow: 0 3px 14px rgba(0, 0, 0, .04);
}

.card h2,
.card h3 {
    margin-top: 0;
}

.card h2 {
    font-size: clamp(19px, 2vw, 25px);
}

.card h3 {
    font-size: clamp(17px, 1.7vw, 21px);
}


/* =========================================================
   GRIDS
========================================================= */

.grid {
    width: 100%;
    min-width: 0;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: clamp(12px, 1.5vw, 16px);
}

.grid3 {
    width: 100%;
    min-width: 0;

    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: clamp(12px, 1.5vw, 16px);
}


/* =========================================================
   FORMS
========================================================= */

.field {
    width: 100%;
    min-width: 0;

    margin-bottom: 14px;
}

.field label {
    display: block;

    font-size: clamp(13px, 1vw, 15px);
    font-weight: 500;

    margin-bottom: 7px;

    color: #536078;
}

.field input,
.field select,
.field textarea {
    display: block;

    width: 100%;
    max-width: 100%;
    min-width: 0;

    padding: clamp(10px, 1vw, 12px);

    border: 1px solid #ccd4df;
    border-radius: 9px;

    font-family: inherit;
    font-size: clamp(14px, 1.1vw, 17px);

    background: #fff;
    color: #172033;

    outline: none;

    transition:
        border-color .2s,
        box-shadow .2s;
}

.field textarea {
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: #1769aa;

    box-shadow:
        0 0 0 3px rgba(23, 105, 170, .10);
}


/* =========================================================
   SIZE EXAMPLE
========================================================= */

.size-example {
    cursor: pointer;

    text-decoration: underline;
    font-weight: 600;

    padding: 2px 3px;

    border-radius: 4px;

    transition: opacity .15s;
}

.size-example:hover {
    opacity: .65;
}

.size-example:active {
    opacity: .45;
}


/* =========================================================
   SIZE PRESETS
   سایزهای آماده زیر فیلد سایز
========================================================= */

.size-presets {
    width: 100%;

    display: flex;
    flex-wrap: wrap;

    gap: 6px;

    margin-top: 7px;
}

.size-preset {
    flex: 0 0 auto;

    border: 1px solid #d2d7df;
    background: #f7f8fa;
    color: #333;

    border-radius: 6px;

    padding: 5px 10px;

    font-family: inherit;
    font-size: 13px;
    line-height: 1.2;

    cursor: pointer;

    transition:
        background .15s ease,
        border-color .15s ease,
        transform .1s ease;
}

.size-preset:hover {
    background: #eef1f5;
    border-color: #c4ccd7;
}

.size-preset:active {
    transform: scale(.97);
}


/* =========================================================
   BUTTONS
========================================================= */

.btn {
    border: 0;
    border-radius: 9px;

    padding:
        clamp(10px, 1vw, 12px)
        clamp(14px, 1.5vw, 18px);

    background: #1769aa;
    color: #fff;

    cursor: pointer;

    text-decoration: none;

    display: inline-block;

    font-family: inherit;
    font-size: clamp(14px, 1.1vw, 16px);
    font-weight: 500;

    transition:
        opacity .2s,
        transform .1s;
}

.btn:hover {
    opacity: .92;
}

.btn:active {
    transform: translateY(1px);
}

.btn.secondary {
    background: #eef2f7;
    color: #1d2a3d;
}

.btn.green {
    background: #2f855a;
}


/* =========================================================
   TABS
========================================================= */

.tabs {
    width: 100%;
    min-width: 0;

    display: flex;

    gap: clamp(6px, .8vw, 8px);

    margin-bottom: 18px;

    flex-wrap: wrap;
}

.tab {
    padding:
        clamp(9px, 1vw, 11px)
        clamp(12px, 1.5vw, 18px);

    border: 1px solid #ccd4df;

    background: #f5f7fb;

    border-radius: 10px;

    cursor: pointer;

    font-family: inherit;
    font-size: clamp(14px, 1.1vw, 16px);
}

.tab.active {
    background: #173b67;
    color: #fff;
}


/* =========================================================
   RESULT / NOTICE
========================================================= */

.result {
    width: 100%;
    min-width: 0;

    background: #eef8f1;

    border: 1px solid #c9e7d2;
    border-radius: 12px;

    padding: clamp(13px, 1.5vw, 17px);

    font-size: clamp(15px, 1.2vw, 17px);
}

.notice {
    width: 100%;

    padding: clamp(11px, 1.2vw, 14px);

    border-radius: 9px;

    background: #fff7e6;

    margin-bottom: 16px;

    font-size: clamp(14px, 1.1vw, 16px);
}

.muted {
    color: #6b7280;
}

.danger {
    color: #b42318;
}

.big {
    font-size: clamp(21px, 2vw, 28px);
    font-weight: 700;
}


/* =========================================================
   TABLES
========================================================= */

.table-wrap {
    width: 100%;
    max-width: 100%;

    overflow-x: auto;
    overflow-y: visible;

    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    max-width: 100%;

    border-collapse: collapse;

    background: #fff;

    table-layout: auto;
}

.table th,
.table td {
    padding: clamp(8px, 1.1vw, 12px);

    border-bottom: 1px solid #e7ebf0;

    text-align: right;

    white-space: nowrap;

    font-size: clamp(13px, 1.1vw, 16px);
}

.table th {
    font-weight: 600;

    color: #364152;

    background: #f8fafc;
}

.table tr:hover td {
    background: #fafcff;
}


/* =========================================================
   TAB PANES
========================================================= */

.tabpane {
    display: none;
}

.tabpane.active {
    display: block;
}

.hidden {
    display: none !important;
}


/* =========================================================
   FULLSCREEN LOGIN
========================================================= */

.login-fullscreen {
    position: fixed;

    inset: 0;

    width: 100%;
    height: 100%;
    height: 100dvh;

    display: grid;

    grid-template-columns: 1fr 1fr;

    overflow: hidden;

    background: #fff;

    direction: ltr;

    z-index: 9999;
}

body:has(.login-fullscreen) {
    width: 100%;
    max-width: 100%;

    overflow: hidden;

    background: #fff;
}

body:has(.login-fullscreen) .top {
    display: none;
}

body:has(.login-fullscreen) footer {
    display: none;
}

body:has(.login-fullscreen) .container {
    width: 100%;
    max-width: none;

    margin: 0;
    padding: 0;
}


/* =========================================================
   LOGIN IMAGE SIDE
========================================================= */

.login-background {
    width: 100%;
    height: 100%;

    object-fit: contain;
    object-position: center;

    display: block;

    background: #fff;
}


/* =========================================================
   LOGIN FORM SIDE
========================================================= */

.login-glass {
    position: relative;
    z-index: 2;

    width: 100%;
    height: 100%;

    min-width: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: clamp(25px, 5vw, 70px);

    background:
        linear-gradient(
            145deg,
            #f6f0e8,
            #e8dccb
        );

    border: 0;
    border-radius: 0;

    box-shadow:
        -10px 0 35px rgba(70, 48, 30, .10);

    direction: rtl;

    overflow-y: auto;
    overflow-x: hidden;
}

.login-content {
    width: min(430px, 100%);
    min-width: 0;
}

.login-title {
    text-align: center;

    margin-bottom: 28px;
}

.login-title h2 {
    margin: 0 0 8px;

    color: #5b4029;

    font-size: clamp(23px, 3vw, 31px);
    font-weight: 800;
}

.login-title p {
    margin: 0;

    color: #765f49;

    font-size: clamp(13px, 1.3vw, 16px);
}


/* =========================================================
   LOGIN FIELDS
========================================================= */

.login-glass .field {
    width: 100%;
    margin-bottom: 18px;
}

.login-glass .field label {
    display: block;

    margin-bottom: 7px;

    color: #5b4029;

    font-size: 15px;
    font-weight: 600;
}

.login-glass .field input {
    width: 100%;
    max-width: 100%;

    min-height: 52px;

    padding: 10px 15px;

    border: 1px solid #cbb89d;
    border-radius: 12px;

    background: rgba(255, 255, 255, .92);

    color: #30251c;

    font-family: inherit;
    font-size: 16px;

    outline: none;

    transition: .2s ease;
}

.login-glass .field input:focus {
    background: #fff;

    border-color: #9b774e;

    box-shadow:
        0 0 0 3px rgba(155, 119, 78, .15);
}


/* =========================================================
   LOGIN BUTTON
========================================================= */

.login-button {
    width: 100%;
    min-height: 52px;

    margin-top: 8px;

    border-radius: 12px;

    background: #765437;
    border-color: #765437;

    color: #fff;

    font-family: inherit;
    font-size: 16px;
    font-weight: 700;

    cursor: pointer;
}

.login-button:hover {
    background: #5f432c;
}


/* =========================================================
   LOGIN ERROR
========================================================= */

.login-glass .notice {
    width: 100%;

    margin-bottom: 18px;

    background: rgba(255, 247, 230, .95);
}


/* =========================================================
   TABLET / MOBILE GENERAL SITE
========================================================= */

@media (max-width: 850px) {

    .top {
        width: 100%;
        min-height: 62px;

        padding: 0 12px;
    }

    .top-inner {
        width: 100%;
        max-width: none;

        margin: 0;

        gap: 8px;
    }

    .brand {
        flex: 1 1 auto;

        min-width: 0;
        max-width: calc(100% - 50px);

        overflow: hidden;

        text-overflow: ellipsis;
    }

    .menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;

        position: absolute;

        top: calc(100% + 8px);

        right: 8px;
        left: 8px;

        width: auto;
        max-width: none;

        padding: 8px;

        background: #173b67;

        border-radius: 12px;

        flex-direction: column;
        align-items: stretch;

        gap: 3px;

        box-shadow:
            0 8px 25px rgba(0, 0, 0, .18);

        z-index: 10000;
    }

    .menu-open .main-nav {
        display: flex;
    }

    .main-nav a {
        width: 100%;
        min-height: 44px;

        padding: 10px 13px;

        border-radius: 8px;

        font-size: 15px;
    }

    .main-nav .logout-link {
        margin-right: 0;
        margin-top: 4px;
    }


    .container {
        width: 100%;
        max-width: 100%;

        margin-top: 14px;

        padding:
            0
            10px;
    }


    .grid,
    .grid3 {
        grid-template-columns: 1fr;
    }


    .card {
        width: 100%;

        padding:
            clamp(13px, 2.5vw, 18px);
    }


    .table-wrap {
        width: 100%;

        overflow-x: auto;
    }

    .table {
        min-width: max-content;
    }

    .table th,
    .table td {
        font-size: clamp(14px, 2vw, 16px);

        padding:
            clamp(8px, 1.8vw, 11px);
    }
}


/* =========================================================
   SMALL PHONES
========================================================= */

@media (max-width: 480px) {

    .container {
        padding-left: 8px;
        padding-right: 8px;
    }

    .card {
        padding:
            clamp(12px, 3.5vw, 15px);

        border-radius: 10px;
    }

    .card h2 {
        font-size: clamp(19px, 5vw, 21px);
    }

    .card h3 {
        font-size: clamp(16px, 4.5vw, 18px);
    }


    .btn {
        width: 100%;

        text-align: center;

        min-height: 44px;
    }


    .field input,
    .field select,
    .field textarea {
        min-height: 44px;

        font-size:
            clamp(15px, 4vw, 17px);
    }


    .tabs {
        gap: 6px;
    }

    .tab {
        flex: 1 1 0;

        min-width: 0;

        text-align: center;

        min-height: 44px;
    }


    .big {
        font-size:
            clamp(21px, 6vw, 26px);
    }
}


/* =========================================================
   SIZE PRESETS - MOBILE
========================================================= */

@media (max-width: 700px) {

    .size-presets {
        gap: 5px;
    }

    .size-preset {
        padding: 5px 9px;
        font-size: 12px;
    }
}


/* =========================================================
   LOGIN MOBILE
========================================================= */

@media (max-width: 700px) {

    .login-fullscreen {
        width: 100%;
        height: 100dvh;

        grid-template-columns: 1fr;

        grid-template-rows: 48% 52%;

        overflow: hidden;
    }

    .login-background {
        width: 100%;
        height: 100%;

        object-fit: contain;
        object-position: center;

        background: #fff;
    }

    .login-glass {
        width: 100%;
        height: 100%;

        min-height: 0;

        padding:
            22px
            clamp(18px, 6vw, 32px);

        box-shadow:
            0 -10px 30px rgba(70, 48, 30, .10);

        overflow-y: auto;
        overflow-x: hidden;
    }

    .login-content {
        width: min(430px, 100%);

        margin: auto;
    }

    .login-title {
        margin-bottom: 16px;
    }

    .login-title h2 {
        font-size:
            clamp(21px, 7vw, 27px);
    }

    .login-title p {
        font-size: 13px;
    }

    .login-glass .field {
        margin-bottom: 13px;
    }

    .login-glass .field input,
    .login-button {
        min-height: 46px;
    }
}


/* =========================================================
   VERY SMALL PHONES
========================================================= */

@media (max-width: 400px) {

    .login-fullscreen {
        grid-template-rows: 45% 55%;
    }

    .login-glass {
        padding:
            18px
            16px;
    }

    .login-title {
        margin-bottom: 12px;
    }

    .login-glass .field {
        margin-bottom: 10px;
    }
}