:root {
    --navy: #142b4a;
    --navy2: #203e63;
    --gold: #bd984e;
    --bg: #f5f7fa;
    --text: #243247;
    --muted: #8290a2
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Cairo',sans-serif;
    font-size: 14px;
    padding-top: 72px
}

.top-header {
    height: 72px;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid #e9edf2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 26px;
    box-shadow: 0 3px 14px #142b4a08
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--navy);
    font-weight: 800;
    font-size: 20px;
    line-height: 1
}

    .brand small {
        display: block;
        font-size: 8px;
        letter-spacing: 2px;
        color: #8793a2;
        margin-top: 5px
    }

.brand-mark {
    width: 39px;
    height: 39px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--navy);
    color: #fff;
    font-size: 23px
}

.gold, .doc-brand span {
    color: var(--gold)
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 17px
}

.today {
    color: var(--muted);
    font-size: 12px
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #f1e8d7;
    color: #8b682c;
    font-weight: 800
}

.app-shell {
    display: flex;
    min-height: calc(100vh - 72px)
}

.sidebar {
    width: 245px;
    position: fixed;
    top: 72px;
    right: 0;
    bottom: 0;
    background: #fff;
    border-left: 1px solid #e9edf2;
    padding: 24px 15px;
    z-index: 800
}

    .sidebar a {
        display: flex;
        align-items: center;
        gap: 12px;
        text-decoration: none;
        color: #59687b;
        padding: 12px 14px;
        border-radius: 10px;
        margin: 4px 0;
        font-weight: 600
    }

        .sidebar a:hover, .sidebar a.active {
            background: #f2f5f9;
            color: var(--navy)
        }

        .sidebar a i {
            width: 20px;
            text-align: center;
            color: var(--gold)
        }

.side-caption {
    font-size: 11px;
    color: #a0aaba;
    padding: 15px 14px 7px
}

.main-content {
    margin-right: 245px;
    width: calc(100% - 245px);
    padding: 30px;
    max-width: 1700px
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px
}

    .page-heading h1 {
        font-size: 25px;
        font-weight: 800;
        color: var(--navy);
        margin: 5px 0
    }

    .page-heading p {
        margin: 0;
        color: var(--muted)
    }

.eyebrow {
    font-size: 11px;
    color: var(--gold);
    font-weight: 800
}

.btn {
    border-radius: 9px;
    padding: 10px 17px;
    font-weight: 700
}

.btn-gold {
    background: var(--gold);
    border-color: var(--gold);
    color: #fff
}

    .btn-gold:hover {
        background: #a9823c;
        color: white
    }

.btn-navy {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff
}

    .btn-navy:hover {
        background: var(--navy2);
        color: #fff
    }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 16px;
    margin-bottom: 24px
}

.stat-card {
    background: #fff;
    border: 1px solid #edf0f4;
    border-radius: 14px;
    padding: 19px;
    position: relative;
    overflow: hidden;
    min-height: 115px
}

    .stat-card span {
        display: block;
        color: var(--muted);
        font-size: 12px
    }

    .stat-card strong {
        display: block;
        font-size: 23px;
        color: var(--navy);
        margin-top: 8px
    }

    .stat-card i {
        position: absolute;
        left: 18px;
        top: 25px;
        color: #e5d8bd;
        font-size: 25px
    }

.panel {
    background: #fff;
    border: 1px solid #edf0f4;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 18px #142b4a05
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px
}

    .panel-head h3 {
        font-size: 16px;
        font-weight: 800;
        color: var(--navy);
        margin: 0
    }

    .panel-head p {
        font-size: 11px;
        color: var(--muted);
        margin: 4px 0 0
    }

    .panel-head a {
        color: var(--gold);
        text-decoration: none;
        font-weight: 700
    }

.table {
    font-size: 12px;
    margin: 0
}

    .table thead th {
        background: #f7f8fa;
        color: #8290a2;
        font-weight: 700;
        white-space: nowrap;
        border: 0;
        padding: 13px
    }

    .table td {
        padding: 14px 13px;
        border-color: #f0f2f5;
        color: #4a586a
    }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 31px;
    height: 31px;
    border-radius: 8px;
    background: #f2f5f8;
    color: var(--navy);
    text-decoration: none
}

.form-panel {
    max-width: 950px;
    padding: 25px
}

.form-label {
    font-weight: 700;
    color: #536174;
    font-size: 12px
}

.form-control, .form-select {
    border-color: #e3e8ef;
    border-radius: 9px;
    padding: 11px;
    font-family: inherit;
    font-size: 13px
}

    .form-control:focus, .form-select:focus {
        border-color: var(--gold);
        box-shadow: 0 0 0 .2rem #bd984e20
    }

.form-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 25px;
    padding-top: 18px;
    border-top: 1px solid #edf0f4
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 17px;
    max-width: 560px
}

.filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px
}

    .filter-chips a {
        padding: 8px 14px;
        background: #fff;
        border: 1px solid #e8edf2;
        border-radius: 30px;
        color: #5b6879;
        text-decoration: none;
        font-size: 12px
    }

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

.document-preview {
    background: #fff;
    max-width: 850px;
    min-height: 850px;
    margin: 0 auto;
    padding: 55px 65px;
    box-shadow: 0 8px 35px #142b4a12;
    color: #29384c
}

.doc-top {
    display: flex;
    justify-content: space-between;
    align-items: center
}

.doc-brand {
    font-size: 29px;
    font-weight: 800;
    color: var(--navy)
}

.doc-top h2 {
    font-size: 24px;
    color: var(--gold);
    font-weight: 800
}

.doc-top small {
    color: #8491a1
}

.document-preview hr {
    border-top: 2px solid var(--gold);
    opacity: 1;
    margin: 20px 0
}

.doc-meta {
    display: flex;
    justify-content: space-between;
    color: #64748b;
    font-size: 12px
}

.doc-customer {
    background: #f5f7fa;
    border-radius: 10px;
    padding: 17px;
    margin: 25px 0
}

    .doc-customer p {
        margin: 8px 0 0;
        font-weight: 700
    }

    .doc-customer small {
        color: #8491a1
    }

.document-preview h3 {
    font-size: 19px;
    color: var(--navy);
    font-weight: 800;
    margin: 22px 0
}

.doc-description {
    white-space: pre-wrap;
    line-height: 2;
    min-height: 70px
}

.doc-line {
    display: flex;
    justify-content: space-between;
    padding: 17px 0;
    border-bottom: 1px solid #e8edf2
}

.doc-total {
    text-align: left;
    font-size: 19px;
    color: var(--navy);
    font-weight: 800;
    margin: 22px 0
}

.doc-signatures {
    display: flex;
    justify-content: space-between;
    margin: 85px 20px 55px;
    font-weight: 700
}

.document-preview > footer {
    text-align: center;
    border-top: 1px solid var(--gold);
    padding-top: 14px;
    color: #8994a3;
    font-size: 11px
}

.mobile-menu, .mobile-bottom {
    display: none
}

@media(max-width:900px) {
    .sidebar {
        transform: translateX(105%);
        transition: .25s;
        box-shadow: -8px 0 25px #142b4a12
    }

        .sidebar.open {
            transform: translateX(0)
        }

    .main-content {
        margin-right: 0;
        width: 100%;
        padding: 22px 18px 105px
    }

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

    .mobile-menu {
        display: grid;
        place-items: center;
        border: 0;
        background: #f4f6f9;
        color: var(--navy);
        width: 38px;
        height: 38px;
        border-radius: 9px;
        font-size: 17px;
        order: 0
    }

    .top-header {
        padding: 0 14px
    }

    .brand {
        margin-left: auto;
        margin-right: 12px
    }

    .today {
        display: none
    }

    .mobile-bottom {
        display: flex;
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        height: 70px;
        padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
        background: #fff;
        border-top: 1px solid #e7ebf0;
        z-index: 1100;
        justify-content: space-around;
        box-shadow: 0 -5px 20px #142b4a0a
    }

        .mobile-bottom a {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
            text-decoration: none;
            color: #8390a0;
            font-size: 10px;
            font-weight: 700
        }

            .mobile-bottom a i {
                font-size: 18px
            }

            .mobile-bottom a.add-nav {
                color: var(--gold)
            }

                .mobile-bottom a.add-nav i {
                    background: var(--navy);
                    color: #fff;
                    border-radius: 13px;
                    width: 35px;
                    height: 30px;
                    display: grid;
                    place-items: center
                }

    .page-heading {
        align-items: flex-start;
        flex-direction: column
    }

        .page-heading h1 {
            font-size: 21px
        }

        .page-heading > .btn {
            align-self: stretch;
            text-align: center
        }

    .panel {
        padding: 14px
    }

    .document-preview {
        padding: 28px 22px;
        min-height: unset
    }

    .doc-top h2 {
        font-size: 18px
    }

    .doc-brand {
        font-size: 24px
    }

    .heading-actions {
        width: 100%
    }

        .heading-actions .btn {
            flex: 1
        }

    .form-panel {
        padding: 17px
    }
}

@media(max-width:420px) {
    .stats-grid {
        gap: 9px
    }

    .stat-card {
        padding: 14px;
        min-height: 100px
    }

        .stat-card strong {
            font-size: 19px
        }

        .stat-card i {
            font-size: 19px;
            left: 12px
        }

    .brand {
        font-size: 17px
    }

    .brand-mark {
        width: 34px;
        height: 34px
    }

    .main-content {
        padding-right: 12px;
        padding-left: 12px
    }

    .doc-meta {
        flex-direction: column;
        gap: 8px
    }

    .doc-signatures {
        margin: 55px 4px 35px;
        font-size: 12px
    }
}

@media print {
    body {
        padding: 0;
        background: white
    }

    .top-header, .sidebar, .mobile-bottom, .no-print {
        display: none !important
    }

    .app-shell, .main-content {
        display: block;
        margin: 0;
        padding: 0;
        width: 100%;
        max-width: none
    }

    .document-preview {
        box-shadow: none;
        margin: 0;
        max-width: none;
        padding: 20mm;
        min-height: 0
    }

        .document-preview footer {
            position: fixed;
            bottom: 10mm;
            left: 0;
            right: 0
        }
}
