@layer tokens,base,layout,components,print;

@layer tokens {
    :root {
        --fx-primary: #175cd3;
        --fx-surface: #fff;
        --fx-bg: #f3f6fb;
        --fx-text: #162b45;
        --fx-muted: #60738c;
        --fx-border: #dce4ee;
        --fx-padding: 18px;
        --fx-font: "Segoe UI",Tahoma,Arial,sans-serif
    }

    [data-palette=teal] {
        --fx-primary: #0f766e
    }

    [data-palette=green] {
        --fx-primary: #15803d
    }

    [data-palette=red] {
        --fx-primary: #b42318
    }

    [data-density=comfortable] {
        --fx-padding: 28px
    }

    :lang(ar), :lang(ur) {
        --fx-font: Tahoma,"Segoe UI",Arial,sans-serif
    }
}

@layer base {
    * {
        box-sizing: border-box
    }

    body {
        margin: 0;
        background: var(--fx-bg);
        color: var(--fx-text);
        font: 14px/1.6 var(--fx-font)
    }

    h1, h2, p {
        margin: 0 0 12px
    }

    h1 {
        font-size: 29px
    }

    h2 {
        font-size: 19px
    }

    p {
        color: var(--fx-muted)
    }

   
     button, input, select {
        font: inherit;
        padding: 8px 12px;
        border: 1px solid var(--fx-border);
        border-radius: 5px;
        background: var(--fx-surface);
        color: var(--fx-text)
    }

    button {
        cursor: pointer
    }

        button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
            outline: 3px solid var(--fx-primary);
            outline-offset: 3px
        }

    table {
        border-collapse: collapse;
        width: 100%;
        margin-top: 18px
    }

    th, td {
        text-align: start;
        border-bottom: 1px solid var(--fx-border);
        padding: 12px
    }

    th {
        background: var(--fx-bg)
    }
}

@layer layout {
    .fx-nav {
        position: fixed;
        inset-block: 0;
        inset-inline-start: 0;
        width: 210px;
        padding: 15px 16px 0px;
        background: linear-gradient(180deg, #102a4b 0%, #0b1e36 100%);
        color: #fff;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: thin;
        scrollbar-color: #355476 transparent;
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 5px 0 24px rgba(15, 35, 60, 0.08);
        font-family: "DM Sans", "Segoe UI", sans-serif;
        z-index:2
    }

        /* Brand */
        .fx-nav h2 {
            margin: 0 10px 4px;
            color: #fff;
            font-size: 27px;
            font-weight: 800;
            letter-spacing: 2px;
            line-height: 1.3;
        }

        .fx-nav p {
            margin: 0 10px 28px;
            color: #a9c6e8;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 2.2px;
        }

        /* Section headings */
        .fx-nav small {
            display: block;
            margin: 25px 10px 9px;
            color: #82a6d0;
            font-size: 10px;
            font-weight: 800;
            letter-spacing: 1.5px;
            line-height: 1.4;
        }

        /* Navigation links */
        .fx-nav a {
            position: relative;
            display: flex;
            align-items: center;
            min-height: 30px;
            margin: 3px 0;
            padding: 4px 12px;
            border: 1px solid transparent;
            border-radius: 7px;
            color: #d5e2f2 !important;
            text-decoration: none;
            font-size: 13px;
            font-weight: 500;
            line-height: 1.45;
            transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, padding 0.2s ease;
        }

            /* Hover */
            .fx-nav a:hover {
                color: #fff;
                background: rgba(177, 211, 255, 0.10);
                border-color: rgba(177, 211, 255, 0.10);
                padding-inline-start: 16px;
            }

            /* Active link — add class="active" to the current page link */
            .fx-nav a.active {
                color: #fff;
                background: linear-gradient( 90deg, rgba(113, 174, 245, 0.23), rgba(113, 174, 245, 0.08) );
                border-color: rgba(151, 197, 255, 0.20);
                font-weight: 700;
            }

                .fx-nav a.active::before {
                    content: "";
                    position: absolute;
                    inset-block: 8px;
                    inset-inline-start: -1px;
                    width: 3px;
                    border-radius: 0 4px 4px 0;
                    background: #a9d3ff;
                }

        /* Website footer */
        .fx-nav small:last-child {
            margin-top: 30px;
            padding: 18px 10px 0;
            border-top: 1px solid rgba(255, 255, 255, 0.12);
            color: #8eabc9;
            font-size: 11px;
            font-weight: 500;
            letter-spacing: 0.5px;
        }

        /* Clean scrollbar */
        .fx-nav::-webkit-scrollbar {
            width: none;
        }

        .fx-nav::-webkit-scrollbar-track {
            background: transparent;
        }

        .fx-nav::-webkit-scrollbar-thumb {
            background: #355476;
            border-radius: 10px;
        }

            .fx-nav::-webkit-scrollbar-thumb:hover {
                background: #6287b1;
            }


@media(min-width:991px){
    /*.fx-main {
        margin-inline-start: 210px;
        padding:15px;
        
        overflow: auto;
        position: fixed;
        inset-block: 0;
        width: calc(100% - 210px);
    }*/
    .fx-main {
        margin-inline-start: 210px;
        padding: 15px;
        overflow: auto;
        position: fixed;
        inset-block: 0;
        width: calc(100% - 210px);
        /* ye add karein */
        transform: translateZ(0);
    }

}

    header {
        display: flex;
        justify-content: space-between;
        gap: 20px;
        align-items: center;
        margin-bottom: 24px
    }

    .fx-tools {
        display: flex;
        gap: 6px
    }

        .fx-tools button {
            border-radius: 2px;
            min-width: 46px
        }

    .fx-grid {
        display: grid;
        grid-template-columns: repeat(3,1fr);
        gap: 18px
    }

    .fx-filters {
        display: flex;
        gap: 14px;
        flex-wrap: wrap;
        align-items: center
    }

        .fx-filters label {
            display: flex;
            align-items: center;
            gap: 8px
        }

    @media(max-width:991px) {
        .fx-nav a {
           
            border: 1px solid rgb(255 255 255 / 23%);
           
        }
        .fx-nav {
            position: static;
            width: auto
        }

            .fx-nav small {
                position: static
            }

            .fx-nav a {
                display: inline-block
            }

        .fx-main {
            margin: 0;
            padding: 18px
        }

        .fx-grid {
            grid-template-columns: 1fr
        }

        header {
            align-items: start
        }

        .fx-filters label {
            flex-wrap: wrap
        }

        table {
            font-size: 12px
        }
    }
}

@layer components {
    .fx-card {
        background: var(--fx-surface);
        padding: var(--fx-padding);
        border: 1px solid var(--fx-border);
        border-radius: 10px;
        margin-bottom: 20px
    }

    .fx-primary {
        background: var(--fx-primary);
        color: white;
        border-color: var(--fx-primary)
    }

    .fx-badge {
        display: inline-block;
        color: var(--fx-primary);
        background: color-mix(in srgb,var(--fx-primary) 10%,white);
        padding: 5px 10px;
        border-radius: 5px
    }

    .fx-number {
        font-size: 32px;
        letter-spacing: -1px
    }

    .fx-chart {
        display: flex;
        align-items: end;
        gap: 18px;
        height: 200px;
        padding-top: 20px
    }

        .fx-chart div {
            height: var(--height);
            background: var(--fx-primary);
            color: white;
            border-radius: 7px 7px 0 0;
            flex: 1;
            text-align: center;
            padding-top: 5px
        }

    .fx-alert {
        color: #b42318
    }

    .fx-drawer {
        position: fixed;
        inset-block: 0;
        inset-inline-start: auto;
        inset-inline-end: 0;
        margin: 0;
        width: min(480px,100%);
        max-width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border: none;
        padding: 24px;
        box-shadow: -8px 0 40px #0002;
        overflow: auto
    }

        .fx-drawer[open] {
            animation: enter .18s ease-out
        }

        .fx-drawer::backdrop {
            background: #0d21345c
        }

    .fx-drawer-head {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 22px
    }

    @keyframes enter {
        from {
            opacity: 0;
            transform: translateY(8px)
        }

        to {
            opacity: 1;
            transform: none
        }
    }

    @media(prefers-reduced-motion:reduce) {
        .fx-drawer[open] {
            animation: none
        }
    }
}

@layer print {
    @media print {
        @page {
            size: A4;
            margin: 15mm
        }

        .fx-nav, .fx-tools, .fx-filters, dialog {
            display: none !important
        }

        .fx-main {
            margin: 0;
            padding: 0;
            max-width: none
        }

        body {
            background: white
        }

        .fx-card {
            border: none;
            padding: 0
        }

        thead {
            display: table-header-group
        }

        tr {
            break-inside: avoid
        }

        h1, h2 {
            break-after: avoid
        }
    }
}



/* Mobile menu button */
.fx-mobile-menu {
    display: none;
    position: fixed;
    top: 14px;
    right: 16px;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    background: var(--white, #fff);
    color: var(--ink-medium, #334155);
    cursor: pointer;
    z-index: 1002;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Backdrop */
.fx-nav-backdrop {
    display: none;
}

/* Mobile responsive */
@media (max-width: 991px) {

    .fx-mobile-menu {
        display: flex;
    }

    .fx-nav {
        position: fixed !important;
        top: 0;
        right: 0;
        left: auto !important;
        bottom: 0;
        width: min(290px, 85vw);
        height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 1001;
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 0.3s ease, visibility 0.3s ease;
        box-shadow: -8px 0 28px rgba(0, 0, 0, 0.10);
    }

        .fx-nav.fx-nav-open {
            transform: translateX(0);
            visibility: visible;
        }

    .fx-nav-backdrop.fx-backdrop-open {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.40);
        z-index: 1000;
    }

    .fx-main {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
        padding-top: 68px;
    }

        .fx-main header {
            padding-right: 16px;
        }

    body.fx-menu-active {
        overflow: hidden;
    }
}

/* Mobile Header */
.fx-mobile-header {
    display: none;
}

@media (max-width: 991px) {

    .fx-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 62px;
        padding: 0 16px;
        background: linear-gradient(180deg, #102a4b 0%, #0b1e36 100%);
        border-bottom: 1px solid var(--border-color, #e2e8f0);
        z-index: 999;
    }

    .fx-mobile-logo {
        display: flex;
        flex-direction: column;
        gap: 2px;
        text-decoration: none;
        color: var(--bs-body-bg);
        line-height: 1.2;
    }

        .fx-mobile-logo strong {
            font-size: 20px;
            font-weight: 800;
            letter-spacing: 1px;
        }

        .fx-mobile-logo span {
            font-size: 9px;
            font-weight: 600;
            letter-spacing: 1.5px;
            opacity: 0.65;
        }

    .fx-mobile-menu {
        position: static;
        flex-shrink: 0;
        width: 40px;
        height: 40px;
        border-radius: 9px;
        box-shadow: none;
    }

    .fx-main {
        padding-top: 78px !important;
    }
}


.fx-nav-close {
    display: none;
}

@media (max-width: 991px) {
    .fx-nav-close {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 18px;
        right: 16px;
        width: 36px;
        height: 36px;
        padding: 0;
        border: 1px solid rgba(255,255,255,.2);
        border-radius: 8px;
        background: transparent;
        color: #fff;
        cursor: pointer;
        z-index: 2;
    }

        .fx-nav-close:hover {
            background: rgba(255,255,255,.1);
        }
}


/* Sidebar Search */
.fx-nav-search {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0 18px;
    padding: 0 11px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06);
    color: #9eb4ce;
    transition: border-color .2s, background .2s;
}

    .fx-nav-search:focus-within {
        border-color: #79a9e8;
        background: rgba(255, 255, 255, 0.09);
    }

    .fx-nav-search svg {
        flex-shrink: 0;
    }

    .fx-nav-search input {
        width: 100%;
        min-width: 0;
        padding: 0;
        border: 0;
        outline: 0;
        background: transparent;
        color: #fff;
        font: inherit;
        font-size: 13px;
    }

        .fx-nav-search input::placeholder {
            color: #91a7c0;
        }

        .fx-nav-search input::-webkit-search-cancel-button {
            cursor: pointer;
        }

    .fx-nav-search kbd {
        flex-shrink: 0;
        padding: 2px 6px;
        border: 1px solid rgba(255, 255, 255, .18);
        border-radius: 4px;
        color: #a9bdd5;
        font-size: 11px;
    }

.fx-search-empty {
    margin: 8px 0;
    color: #b4c5d9;
    font-size: 12px;
}

    .fx-search-empty[hidden] {
        display: none;
    }

.fx-nav a.fx-search-hidden,
.fx-nav small.fx-search-hidden {
    display: none !important;
}

