:root {
    --brand-orange: #ff8a00;
    --brand-orange-dark: #e57800;
    --brand-orange-soft: #fff4e5;

    --brand-black: #050505;
    --brand-dark: #111111;
    --brand-charcoal: #1b1b1b;

    --background: #f7f8fa;
    --white: #ffffff;

    --text-primary: #181818;
    --text-secondary: #667085;

    --border: #e4e7ec;

    --sidebar-width: 320px;

    --success: #15803d;
    --warning: #b45309;
    --danger: #b91c1c;
}


/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {
    margin: 0;

    min-width: 320px;

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: var(--text-primary);

    background: var(--background);
}


body.mobile-nav-open {
    overflow: hidden;
}


/* =========================================================
   APPLICATION SHELL
========================================================= */

.app-shell {
    min-height: 100vh;

    display: flex;
}


.app-main {
    min-width: 0;

    flex: 1;

    margin-left: var(--sidebar-width);
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    position: fixed;

    top: 0;
    bottom: 0;
    left: 0;

    z-index: 50;

    width: var(--sidebar-width);

    display: flex;
    flex-direction: column;

    overflow-y: auto;

    background:
        linear-gradient(
            180deg,
            #020202 0%,
            #101010 100%
        );

    color: #ffffff;

    border-right:
        1px solid
        rgba(255, 255, 255, 0.055);

    box-shadow:
        12px 0 45px
        rgba(0, 0, 0, 0.08);
}


.sidebar-brand {
    padding:
        25px 20px
        23px;

    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.07);
}


.sidebar-brand-top {
    display: flex;

    align-items: center;

    justify-content: space-between;
}


.sidebar-logo-link {
    display: block;

    flex: 1;

    min-width: 0;
}


.sidebar-logo {
    display: block;

    width: 100%;
    max-width: 275px;

    height: auto;

    margin: auto;

    object-fit: contain;

    filter:
        drop-shadow(
            0 9px 22px
            rgba(255, 138, 0, 0.08)
        );
}


.sidebar-system-name {
    margin-top: 16px;

    padding-left: 4px;

    font-size: 11px;
    line-height: 1.6;

    font-weight: 650;

    letter-spacing: 0.12em;

    text-transform: uppercase;

    color:
        rgba(255, 255, 255, 0.46);
}


.mobile-sidebar-close {
    display: none;

    width: 38px;
    height: 38px;

    flex-shrink: 0;

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

    border: 1px solid
        rgba(255, 255, 255, 0.1);

    border-radius: 10px;

    background:
        rgba(255, 255, 255, 0.04);

    color: white;

    font-size: 27px;

    cursor: pointer;
}


/* =========================================================
   NAVIGATION
========================================================= */

.sidebar-navigation {
    flex: 1;

    padding: 21px 15px;
}


.nav-link {
    position: relative;

    display: flex;

    align-items: center;

    gap: 14px;

    min-height: 52px;

    margin-bottom: 5px;

    padding:
        12px 15px;

    overflow: hidden;

    border-radius: 11px;

    color:
        rgba(255, 255, 255, 0.82);

    font-size: 15px;
    font-weight: 650;

    text-decoration: none;

    transition:
        background 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}


.nav-link::before {
    content: "";

    position: absolute;

    left: 0;

    top: 10px;
    bottom: 10px;

    width: 3px;

    border-radius:
        0 99px 99px 0;

    background:
        var(--brand-orange);

    opacity: 0;

    transform:
        scaleY(0.4);

    transition:
        opacity 0.18s ease,
        transform 0.18s ease;
}


.nav-link:hover {
    color: #ffffff;

    background:
        rgba(255, 138, 0, 0.09);

    transform:
        translateX(2px);
}


.nav-link-active {
    color: #ffffff;

    background:
        linear-gradient(
            90deg,
            rgba(255, 138, 0, 0.16),
            rgba(255, 138, 0, 0.055)
        );
}


.nav-link-active::before {
    opacity: 1;

    transform:
        scaleY(1);
}


.nav-icon {
    width: 25px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    flex-shrink: 0;

    color:
        var(--brand-orange);

    font-size: 16px;

    font-weight: 850;
}


.nav-section-label {
    margin:
        27px 15px
        9px;

    color:
        rgba(255, 255, 255, 0.34);

    font-size: 10px;

    font-weight: 800;

    letter-spacing:
        0.15em;

    text-transform: uppercase;
}


/* =========================================================
   SIDEBAR USER
========================================================= */

.sidebar-user {
    padding:
        18px 21px
        21px;

    border-top:
        1px solid
        rgba(255, 255, 255, 0.07);
}


.sidebar-user-label {
    color:
        rgba(255, 255, 255, 0.35);

    font-size: 9px;

    font-weight: 700;

    letter-spacing:
        0.1em;

    text-transform: uppercase;
}


.sidebar-user-name {
    margin-top: 5px;

    color: #ffffff;

    font-size: 15px;

    font-weight: 750;
}


.sidebar-role {
    margin-top: 2px;

    color:
        rgba(255, 255, 255, 0.4);

    font-size: 11px;
}


.sidebar-logout {
    display: inline-block;

    margin-top: 10px;

    color:
        var(--brand-orange);

    font-size: 12px;

    font-weight: 700;

    text-decoration: none;
}


/* =========================================================
   TOPBAR
========================================================= */

.topbar {
    position: sticky;

    top: 0;

    z-index: 30;

    min-height: 78px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 25px;

    padding:
        15px 30px;

    background:
        rgba(255, 255, 255, 0.94);

    border-bottom:
        1px solid var(--border);

    backdrop-filter:
        blur(12px);
}


.topbar-heading {
    min-width: 0;
}


.topbar-title {
    margin: 0;

    color: #101010;

    font-size: 20px;

    font-weight: 780;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


.topbar-subtitle {
    margin-top: 3px;

    color: #98a2b3;

    font-size: 11px;
}


.topbar-user {
    display: flex;

    align-items: center;

    gap: 10px;

    flex-shrink: 0;
}


.topbar-avatar,
.mobile-user-avatar {
    width: 40px;
    height: 40px;

    display: flex;

    align-items: center;

    justify-content: center;

    flex-shrink: 0;

    border-radius: 50%;

    background:
        #090909;

    color:
        var(--brand-orange);

    font-weight: 850;

    box-shadow:
        0 4px 14px
        rgba(0, 0, 0, 0.12);
}


.topbar-welcome {
    color: #98a2b3;

    font-size: 10px;
}


.topbar-username {
    color: #344054;

    font-size: 13px;

    font-weight: 700;
}


/* =========================================================
   MOBILE HEADER
========================================================= */

.mobile-header {
    display: none;

    position: sticky;

    top: 0;

    z-index: 35;

    min-height: 68px;

    align-items: center;

    justify-content: space-between;

    padding:
        10px 15px;

    background:
        rgba(5, 5, 5, 0.97);

    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.07);

    backdrop-filter:
        blur(12px);
}


.mobile-menu-button {
    width: 42px;
    height: 42px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 5px;

    flex-shrink: 0;

    border:
        1px solid
        rgba(255, 255, 255, 0.1);

    border-radius: 10px;

    background:
        rgba(255, 255, 255, 0.035);

    cursor: pointer;
}


.mobile-menu-button span {
    width: 18px;
    height: 2px;

    display: block;

    border-radius: 99px;

    background:
        var(--brand-orange);
}


.mobile-brand {
    flex: 1;

    display: flex;

    align-items: center;

    justify-content: center;

    min-width: 0;

    padding:
        0 12px;
}


.mobile-brand-logo {
    display: block;

    width: auto;

    max-width: 230px;

    height: 42px;

    object-fit: contain;
}


.mobile-user-avatar {
    width: 39px;
    height: 39px;
}


/* =========================================================
   PAGE CONTENT
========================================================= */

.page-content {
    width: 100%;

    padding:
        28px 30px
        44px;
}


.page-enter {
    animation:
        pageEnter
        0.34s ease both;
}


@keyframes pageEnter {

    from {
        opacity: 0;

        transform:
            translateY(7px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }

}


.brand-text {
    color:
        var(--brand-orange-dark);
}


/* =========================================================
   BUTTONS
========================================================= */

.primary-button {
    min-height: 44px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    padding:
        11px 18px;

    border:
        1px solid
        var(--brand-orange);

    border-radius: 10px;

    background:
        linear-gradient(
            135deg,
            #ff9700,
            #ff7d00
        );

    color: #090909;

    font-size: 14px;

    font-weight: 780;

    text-decoration: none;

    cursor: pointer;

    box-shadow:
        0 5px 15px
        rgba(255, 138, 0, 0.15);

    transition:
        transform 0.14s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}


.primary-button:hover {
    transform:
        translateY(-1px);

    box-shadow:
        0 8px 20px
        rgba(255, 138, 0, 0.22);
}


.primary-button:active {
    transform:
        translateY(0);
}


/* =========================================================
   CARDS
========================================================= */

.dashboard-card {
    position: relative;

    overflow: hidden;

    padding: 23px;

    border:
        1px solid
        var(--border);

    border-radius: 16px;

    background:
        #ffffff;

    box-shadow:
        0 2px 8px
        rgba(16, 24, 40, 0.035);

    text-decoration: none;

    transition:
        border-color 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}


.dashboard-card::before {
    content: "";

    position: absolute;

    left: 0;
    top: 0;
    bottom: 0;

    width: 4px;

    background:
        var(--brand-orange);
}


.dashboard-card:hover {
    transform:
        translateY(-2px);

    border-color:
        #ffd5a1;

    box-shadow:
        0 9px 25px
        rgba(16, 24, 40, 0.07);
}


.card-label {
    color:
        var(--text-secondary);

    font-size: 13px;

    font-weight: 650;
}


.card-value {
    margin-top: 10px;

    color: #111111;

    font-size: 31px;

    line-height: 1.1;

    font-weight: 850;
}


/* =========================================================
   FORMS
========================================================= */

.form-control {
    width: 100%;

    min-height: 44px;

    padding:
        10px 12px;

    border:
        1px solid
        #d0d5dd;

    border-radius: 9px;

    outline: none;

    background:
        #ffffff;

    color:
        #1d2939;

    font-size: 14px;

    transition:
        border-color 0.17s ease,
        box-shadow 0.17s ease,
        background 0.17s ease;
}


.form-control:hover {
    border-color:
        #b8bec8;
}


.form-control:focus {
    border-color:
        var(--brand-orange);

    box-shadow:
        0 0 0 3px
        rgba(255, 138, 0, 0.1);
}


textarea.form-control {
    resize: vertical;
}


/* =========================================================
   TABLES
========================================================= */

table {
    border-collapse: collapse;
}


table th {
    color:
        #475467;

    font-weight: 700;

    white-space: nowrap;
}


table td {
    vertical-align: middle;
}


tbody tr {
    transition:
        background 0.14s ease;
}


tbody tr:hover {
    background:
        #fffaf4;
}


/* =========================================================
   DETAIL FIELDS
========================================================= */

.detail-label {
    color:
        #98a2b3;

    font-size: 11px;

    font-weight: 750;

    letter-spacing:
        0.055em;

    text-transform: uppercase;
}


.detail-value {
    margin-top: 5px;

    color:
        #101828;

    font-size: 15px;

    font-weight: 650;
}


.detail-date {
    margin-top: 3px;

    color:
        #98a2b3;

    font-size: 12px;
}


/* =========================================================
   REPORT NUMBERS
========================================================= */

.report-number {
    min-width: 32px;
    min-height: 30px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    padding:
        4px 9px;

    border:
        1px solid
        #ffe0ba;

    border-radius: 8px;

    background:
        var(--brand-orange-soft);

    color:
        #a65000;

    font-weight: 850;

    text-decoration: none;

    transition:
        background 0.16s ease,
        transform 0.16s ease,
        border-color 0.16s ease;
}


.report-number:hover {
    transform:
        translateY(-1px);

    background:
        #ffe6c5;

    border-color:
        #ffc77e;
}


/* =========================================================
   SYSTEM MESSAGES
========================================================= */

.system-message {
    position: relative;

    display: flex;

    align-items: center;

    gap: 12px;

    margin-bottom: 20px;

    padding:
        14px 16px;

    overflow: hidden;

    border:
        1px solid
        var(--border);

    border-radius: 11px;

    background:
        #ffffff;

    color:
        #344054;

    font-size: 13px;

    box-shadow:
        0 2px 8px
        rgba(16, 24, 40, 0.04);
}


.system-message-accent {
    width: 5px;
    height: 28px;

    flex-shrink: 0;

    border-radius: 99px;

    background:
        var(--brand-orange);
}


/* =========================================================
   MOBILE OVERLAY
========================================================= */

.mobile-overlay {
    position: fixed;

    inset: 0;

    z-index: 45;

    visibility: hidden;

    opacity: 0;

    background:
        rgba(0, 0, 0, 0.68);

    backdrop-filter:
        blur(3px);

    transition:
        opacity 0.22s ease,
        visibility 0.22s ease;
}


.mobile-overlay-visible {
    visibility: visible;

    opacity: 1;
}


/* =========================================================
   SCROLLBAR
========================================================= */

::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}


::-webkit-scrollbar-track {
    background:
        #f3f4f6;
}


::-webkit-scrollbar-thumb {
    border-radius: 10px;

    background:
        #c5c9cf;
}


::-webkit-scrollbar-thumb:hover {
    background:
        #a8adb5;
}


/* =========================================================
   LARGE DESKTOP
========================================================= */

@media (min-width: 1600px) {

    :root {
        --sidebar-width: 330px;
    }


    .sidebar-logo {
        max-width: 290px;
    }


    .nav-link {
        min-height: 54px;

        font-size: 16px;
    }


    .page-content {
        padding:
            32px 38px
            50px;
    }


    .topbar {
        padding:
            16px 38px;
    }


    .dashboard-card {
        padding: 26px;
    }

}


/* =========================================================
   TABLET + MOBILE
========================================================= */

@media (max-width: 1023px) {

    :root {
        --sidebar-width: 310px;
    }


    .app-main {
        margin-left: 0;
    }


    .sidebar {
        width:
            min(
                var(--sidebar-width),
                87vw
            );

        transform:
            translateX(-105%);

        box-shadow:
            22px 0 55px
            rgba(0, 0, 0, 0.38);

        transition:
            transform
            0.26s
            cubic-bezier(
                0.16,
                1,
                0.3,
                1
            );
    }


    .sidebar-mobile-open {
        transform:
            translateX(0);
    }


    .mobile-sidebar-close {
        display: inline-flex;
    }


    .sidebar-logo {
        max-width: 240px;
    }


    .mobile-header {
        display: flex;
    }


    .topbar {
        position: relative;

        min-height: auto;

        padding:
            17px 20px;

        background:
            #ffffff;

        backdrop-filter: none;
    }


    .topbar-user {
        display: none;
    }


    .page-content {
        padding:
            20px
            20px
            40px;
    }


    .topbar-title {
        font-size: 18px;
    }

}


/* =========================================================
   SMALL TABLET / LARGE PHONE
========================================================= */

@media (max-width: 767px) {

    .topbar {
        padding:
            15px 16px;
    }


    .topbar-subtitle {
        display: none;
    }


    .page-content {
        padding:
            17px
            14px
            34px;
    }


    .dashboard-card {
        padding: 20px;
    }


    .card-value {
        font-size: 28px;
    }


    /*
    Existing template tables already sit inside
    overflow-x-auto wrappers. This ensures they
    retain readable minimum widths on phones.
    */

    table {
        min-width: 720px;
    }


    .primary-button {
        min-height: 46px;

        padding:
            12px 17px;
    }


    .form-control {
        min-height: 46px;

        font-size: 16px;
    }

}


/* =========================================================
   PHONE
========================================================= */

@media (max-width: 480px) {

    .mobile-header {
        min-height: 64px;

        padding:
            9px 11px;
    }


    .mobile-brand-logo {
        max-width: 180px;

        height: 37px;
    }


    .mobile-menu-button {
        width: 39px;
        height: 39px;
    }


    .mobile-user-avatar {
        width: 37px;
        height: 37px;
    }


    .sidebar {
        width: 91vw;

        max-width: 310px;
    }


    .sidebar-brand {
        padding:
            21px 17px;
    }


    .sidebar-logo {
        max-width: 220px;
    }


    .nav-link {
        min-height: 50px;

        padding:
            12px 14px;

        font-size: 14px;
    }


    .topbar {
        padding:
            14px;
    }


    .topbar-title {
        font-size: 17px;
    }


    .page-content {
        padding:
            14px
            11px
            30px;
    }


    .dashboard-card {
        border-radius: 14px;

        padding:
            18px 18px
            18px 20px;
    }


    .card-value {
        font-size: 26px;
    }


    .card-label {
        font-size: 12px;
    }


    .system-message {
        padding:
            12px 13px;
    }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (
    prefers-reduced-motion:
    reduce
) {

    *,
    *::before,
    *::after {
        scroll-behavior:
            auto !important;

        animation-duration:
            0.01ms !important;

        animation-iteration-count:
            1 !important;

        transition-duration:
            0.01ms !important;
    }

}

/* =========================================================
   MOBILE CANDIDATE CARDS
========================================================= */

.mobile-record-list {
    display: none;
}


.mobile-record-card {
    position: relative;

    overflow: hidden;

    margin-bottom: 14px;

    padding: 18px;

    border: 1px solid var(--border);

    border-radius: 15px;

    background: #ffffff;

    box-shadow:
        0 3px 12px
        rgba(16, 24, 40, 0.045);
}


.mobile-record-card::before {
    content: "";

    position: absolute;

    left: 0;
    top: 0;
    bottom: 0;

    width: 4px;

    background: var(--brand-orange);
}


.mobile-record-title {
    padding-right: 12px;

    color: #111111;

    font-size: 16px;

    font-weight: 800;
}


.mobile-record-subtitle {
    margin-top: 3px;

    color: #98a2b3;

    font-size: 12px;
}


.mobile-record-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;

    margin-top: 17px;

    padding-top: 15px;

    border-top: 1px solid #f0f1f3;
}


.mobile-record-label {
    color: #98a2b3;

    font-size: 9px;

    font-weight: 800;

    letter-spacing: 0.08em;

    text-transform: uppercase;
}


.mobile-record-value {
    margin-top: 4px;

    color: #344054;

    font-size: 12px;

    font-weight: 650;

    word-break: break-word;
}


.mobile-record-actions {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 9px;

    margin-top: 17px;
}


.mobile-record-button {
    min-height: 43px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 9px;

    font-size: 12px;

    font-weight: 750;

    text-decoration: none;
}


.mobile-record-button-primary {
    background: var(--brand-orange);

    color: #080808;
}


.mobile-record-button-secondary {
    border: 1px solid #d0d5dd;

    background: #ffffff;

    color: #344054;
}


.mobile-status {
    display: inline-flex;

    align-items: center;

    min-height: 26px;

    padding: 4px 8px;

    border-radius: 999px;

    background: var(--brand-orange-soft);

    color: #a65000;

    font-size: 10px;

    font-weight: 750;
}


@media (max-width: 767px) {

    .desktop-record-table {
        display: none;
    }


    .mobile-record-list {
        display: block;
    }

}


@media (max-width: 390px) {

    .mobile-record-grid {
        grid-template-columns: 1fr;
    }

}