:root {
    --sidebar-w: 264px;
    --sidebar-w-collapsed: 76px;
    --topbar-h: 64px;
    --bg: #f4f6fb;
    --surface: #ffffff;
    --ink: #1b2236;
    --ink-soft: #6b7385;
    --ink-faint: #9aa1b3;
    --border: #eef0f5;
    --primary: #4f46e5;
    --primary-soft: #eef0fe;
    --primary-grad: linear-gradient(135deg, #6d5cf6 0%, #4338ca 100%);
    --sidebar-bg: #161b2e;
    --sidebar-bg-2: #1d2440;
    --sidebar-text: #aab0c6;
    --ah-navy: #1d2440;
    --ah-border: #eef0f5;
    --radius: 12px;
    --shadow: 0 8px 24px rgba(20,24,50,.06);
    --shadow-lg: 0 18px 50px rgba(20,24,50,.14);
    --transition: all .25s cubic-bezier(.4,0,.2,1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter',sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 12px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand {
    font-family: 'Poppins',sans-serif;
}

/*Update progress*/

#overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 20, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#modalprogress {
    background: #fff;
    border-radius: 20px;
    padding: 2.5rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    min-width: 260px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.mp-ring-wrap {
    position: relative;
    width: 56px;
    height: 56px;
}

.mp-ring {
    width: 56px;
    height: 56px;
    animation: mp-spin 1s linear infinite;
    transform-origin: 28px 28px;
}

.mp-track {
    fill: none;
    stroke: #e5e5e5;
    stroke-width: 4;
}

.mp-arc {
    fill: none;
    stroke: #7F77DD;
    stroke-width: 4;
    stroke-dasharray: 138.2;
    stroke-dashoffset: 104;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 28px 28px;
    transition: stroke-dashoffset 0.4s ease;
}

.mp-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #7F77DD;
}

.mp-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
}

.mp-sub {
    margin: 0;
    font-size: 13px;
    color: #888;
}

.mp-bar-track {
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: #f0f0f0;
    overflow: hidden;
}

.mp-bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: #7F77DD;
    transition: width 0.4s ease;
}

@keyframes mp-spin {
    to {
        transform: rotate(360deg);
    }
}


.ah-page {
    margin-left: var(--sidebar-w);
    margin-top: var(--topbar-h);
    padding: 12px 16px;
    width: calc(100% - var(--sidebar-w));
    transition: var(--transition);
    min-height: calc(100vh - var(--topbar-h));
    background: #ffffff;
}

.ah-card {
    background: #fff;
    border: 1px solid var(--ah-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(20,38,74,.06);
    margin-bottom: 22px;
    overflow: hidden;
}

.ah-card-header {
    background: var(--ah-navy);
    color: #fff;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 600;
}

    .ah-card-header i {
        margin-right: 8px;
    }

.ah-card-body {
    padding: 18px;
}

.ah-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 18px;
    background: #fafbfd;
    border-bottom: 1px solid var(--ah-border);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    transition: var(--transition);
}

    .sidebar.collapsed {
        width: var(--sidebar-w-collapsed);
    }


.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--topbar-h);
    padding: 0 12px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

    .sidebar-brand .logo-mark {
        width: 50px;
        height: 36px;
        border-radius: 10px;
        background: var(--primary-grad);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        font-weight: 800;
        color: #fff;
        font-size: 15px;
        box-shadow: 0 6px 16px rgba(79,70,229,.45);
    }

    .sidebar-brand .brand-text {
        color: #fff;
        font-weight: 700;
        font-size: 16px;
        letter-spacing: .3px;
        white-space: nowrap;
        overflow: hidden;
        transition: var(--transition);
    }

.sidebar.collapsed .brand-text {
    opacity: 0;
    width: 0;
}

.sidebar-brand .brand-sub {
    display: block;
    font-size: 10px;
    color: var(--ink-faint);
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-search {
    padding: 14px 16px;
    flex-shrink: 0;
}

    .sidebar-search .form-control {
        background: rgba(255,255,255,.05);
        border: 1px solid rgba(255,255,255,.08);
        color: #fff;
        border-radius: 10px;
        font-size: 13px;
        padding: 8px 12px 8px 36px;
    }

        .sidebar-search .form-control::placeholder {
            color: var(--ink-faint);
        }

        .sidebar-search .form-control:focus {
            background: rgba(255,255,255,.08);
            box-shadow: 0 0 0 3px rgba(79,70,229,.25);
            border-color: var(--primary);
            color: #fff;
        }

.sidebar-search-wrap {
    position: relative;
}

    .sidebar-search-wrap i {
        position: absolute;
        right: 0;
        padding-right: 10px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--ink-faint);
        font-size: 12px;
    }

.sidebar.collapsed .sidebar-search {
    display: none;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}

    .sidebar-nav::-webkit-scrollbar {
        width: 5px;
    }

    .sidebar-nav::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,.08);
        border-radius: 4px;
    }

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ink-faint);
    padding: 18px 12px 8px;
    opacity: .7;
}

.sidebar.collapsed .nav-section-label {
    text-align: center;
    padding: 16px 0 6px;
}

    .sidebar.collapsed .nav-section-label span {
        display: none;
    }

    .sidebar.collapsed .nav-section-label::after {
        content: '\2022\2022\2022';
        letter-spacing: 3px;
        font-size: 8px;
        font-family: Arial,sans-serif;
    }


/* Tooltip on collapsed sidebar icons */
.sidebar.collapsed .nav-item .nav-link-main {
    position: relative;
}

    .sidebar.collapsed .nav-item .nav-link-main::after {
        content: attr(data-label);
        position: fixed;
        top: var(--tt-top, 50%);
        left: calc(var(--sidebar-w-collapsed) + (-15px));
        background: #1d2440;
        color: #fff;
        font-size: 12px;
        font-weight: 500;
        padding: 5px 10px;
        border-radius: 6px;
        border: 2px solid #ffffff;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity .15s ease;
        box-shadow: 0 4px 12px rgba(0,0,0,.25);
        z-index: 1300;
    }

.sidebar.collapsed .nav-item:hover > .nav-link-main::after {
    opacity: 1;
}

/* Hide tooltip when submenu exists (flyout is already visible) */
.sidebar.collapsed .nav-item:hover > .nav-link-main:not([data-label])::after {
    display: none;
}


.nav-item {
    margin-bottom: 2px;
    position: relative;
}

.nav-link-main {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 13.5px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

    .nav-link-main:hover {
        background: rgba(255,255,255,.06);
        color: #fff;
    }

    .nav-link-main.active {
        background: var(--primary-grad);
        color: #fff;
        box-shadow: 0 6px 18px rgba(79,70,229,.35);
    }

    .nav-link-main i.nav-ic {
        width: 20px;
        text-align: center;
        font-size: 15px;
        flex-shrink: 0;
        opacity: .9;
    }

    .nav-link-main .nav-text {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-link-main .chev {
        font-size: 10px;
        transition: transform .25s;
        opacity: .6;
    }

.nav-item.open > .nav-link-main .chev {
    transform: rotate(90deg);
}

.sidebar.collapsed .nav-text,
.sidebar.collapsed .chev,
.sidebar.collapsed .nav-link-main .badge {
    display: none;
}

.sidebar.collapsed .nav-link-main {
    justify-content: center;
    padding: 12px 0;
    width: var(--sidebar-w-collapsed);
    position: relative;
    z-index: 1201;
}

/* Submenu */
.submenu {
    list-style: none;
    margin: 2px 0 4px;
    padding: 2px 0 2px 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    border-left: 1px solid rgba(255,255,255,.08);
    margin-left: 12px;
}

/* Level-2 nested submenu (Admin > User > Staff/Members) */
li.nav-item-sub {
    list-style: none;
}

    li.nav-item-sub > .submenu-link-main {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        cursor: pointer;
        padding: 7px 14px;
        margin: 1px 6px;
        border-radius: 8px;
        font-size: 12.5px;
        font-weight: 500;
        color: var(--ink-faint);
        text-decoration: none;
        transition: var(--transition);
    }

        li.nav-item-sub > .submenu-link-main:hover {
            color: #fff;
            background: rgba(255,255,255,.06);
        }

    li.nav-item-sub.open > .submenu-link-main {
        color: #fff;
    }

.submenu-level2 {
    list-style: none;
    margin: 0 6px 4px 12px;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    border-left: 1px solid rgba(255,255,255,.08);
}

li.nav-item-sub.open > .submenu-level2 {
    max-height: 500px;
}

.chev-sub {
    font-size: 9px;
    opacity: .6;
    transition: transform .25s;
}

li.nav-item-sub.open > .submenu-link-main .chev-sub {
    transform: rotate(90deg);
}

.nav-item.open > .submenu {
    max-height: 2000px;
}

.submenu li a {
    display: block;
    padding: 7px 14px;
    font-size: 12.5px;
    color: var(--ink-faint);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    margin: 1px 6px;
}

    .submenu li a:hover {
        color: #fff;
        background: rgba(255,255,255,.06);
        padding-left: 18px;
    }

.submenu .submenu-group-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #6f7794;
    text-transform: uppercase;
    padding: 10px 14px 4px;
}

/* Collapsed flyout */
.sidebar.collapsed .nav-item .submenu {
    display: none;
}

.sidebar.collapsed .nav-item:hover > .submenu {
    display: block;
    position: fixed;
    left: var(--sidebar-w-collapsed);
    min-width: 260px;
    background: #1d2440;
    border-radius: 0 12px 12px 0;
    box-shadow: 0 18px 50px rgba(20,24,50,.14);
    max-height: 80vh;
    overflow-y: auto;
    padding: 8px;
    border-left: none;
    margin-left: 0;
    z-index: 1200;
}

.sidebar.collapsed .nav-item:hover > .nav-link-main {
    background: rgba(255,255,255,.06);
}

/* Sidebar footer */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}

.collapse-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    color: var(--ink-faint);
    border-radius: 10px;
    padding: 9px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 12px;
}

    .collapse-btn:hover {
        background: rgba(255,255,255,.08);
        color: #fff;
    }

.sidebar.collapsed .collapse-btn span {
    display: none;
}

.sidebar.collapsed .collapse-btn i {
    transform: rotate(180deg);
}

/* Topbar */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    z-index: 1050;
}

.sidebar.collapsed ~ .topbar {
    left: var(--sidebar-w-collapsed);
}

.sidebar.collapsed ~ .ah-page {
    margin-left: var(--sidebar-w-collapsed);
    width: calc(100% - var(--sidebar-w-collapsed));
}

.main-content {
    margin-left: var(--sidebar-w);
    margin-top: var(--topbar-h);
    padding: 28px;
    width: calc(100% - var(--sidebar-w));
    transition: var(--transition);
    min-height: calc(100vh - var(--topbar-h));
}

.mobile-toggle {
    display: none;
    border: none;
    background: var(--bg);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    font-size: 16px;
    cursor: pointer;
}

.topbar-search {
    flex: 1;
    max-width: 420px;
    position: relative;
}

    .topbar-search input {
        width: 100%;
        border: 1px solid var(--border);
        background: var(--bg);
        border-radius: 10px;
        padding: 9px 14px 9px 38px;
        font-size: 13.5px;
        transition: var(--transition);
    }

        .topbar-search input:focus {
            outline: none;
            border-color: var(--primary);
            background: #fff;
            box-shadow: 0 0 0 4px var(--primary-soft);
        }

    .topbar-search i {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--ink-faint);
        font-size: 13px;
    }

    .topbar-search kbd {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 10px;
        color: var(--ink-faint);
        border: 1px solid var(--border);
        border-radius: 5px;
        padding: 2px 6px;
        background: #fff;
    }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

    .icon-btn:hover {
        background: var(--bg);
        color: var(--ink);
    }

    .icon-btn .dot {
        position: absolute;
        top: 8px;
        right: 9px;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #f43f5e;
        border: 2px solid var(--surface);
    }

.company-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 6px;
    border-radius: 30px;
    background: var(--bg);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

    .company-pill:hover {
        border-color: var(--primary);
    }

    .company-pill .dot-badge {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: var(--primary-grad);
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-weight: 700;
        font-size: 12px;
    }

    .company-pill .meta {
        line-height: 1.2;
    }

        .company-pill .meta .name {
            font-size: 12.5px;
            font-weight: 600;
            color: var(--ink);
        }

        .company-pill .meta .role {
            font-size: 10.5px;
            color: var(--ink-faint);
        }

.user-menu {
    position: relative;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 5px;
    border-radius: 30px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: var(--transition);
}

    .user-trigger:hover {
        box-shadow: var(--shadow);
    }

    .user-trigger img {
        width: 34px;
        height: 34px;
        border-radius: 50%;
        object-fit: cover;
    }

    .user-trigger .meta {
        line-height: 1.2;
        text-align: left;
    }

        .user-trigger .meta .name {
            font-size: 12.5px;
            font-weight: 600;
        }

        .user-trigger .meta .role {
            font-size: 10.5px;
            color: var(--ink-faint);
        }

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 550px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 18px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    z-index: 1300;
}

    .user-dropdown.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .user-dropdown .ud-head {
        display: flex;
        gap: 12px;
        align-items: center;
        padding-bottom: 14px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 10px;
    }

        .user-dropdown .ud-head img {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            object-fit: cover;
        }

        .user-dropdown .ud-head .name {
            font-weight: 700;
            font-size: 14px;
        }

        .user-dropdown .ud-head .email {
            font-size: 11.5px;
            color: var(--ink-faint);
        }

.ud-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    margin-bottom: 14px;
}

    .ud-grid .lbl {
        font-size: 9.5px;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: var(--ink-faint);
        font-weight: 700;
    }

    .ud-grid .val {
        font-size: 12.5px;
        font-weight: 500;
        margin-top: 1px;
    }

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

    .ud-actions .btn {
        flex: 1;
        font-size: 12.5px;
        border-radius: 10px;
    }


.w-max-90 {
    max-width: 90px;
    width: 100%;
}

.w-max-180 {
    max-width: 180px;
    width: 100%;
}

.w-max-250 {
    max-width: 250px;
    width: 100%;
}

.w-max-300 {
    max-width: 300px;
    width: 100%;
}

.w-max-350 {
    max-width: 350px;
    width: 100%;
}

.w-max-400 {
    max-width: 400px;
    width:100px;
}

.w-max-500 {
    max-width: 500px;
    width: 100%;
}

.w-max-120 {
    max-width: 120px;
    width: 100%;
}


@media (max-width:991px) {

    .ah-page {
        margin-left: 0px;
        margin-top: 64px;
        padding: 10px 6px;

    }

    .sidebar {
        left: calc(-1 * var(--sidebar-w));
    }

        .sidebar.mobile-open {
            left: 0;
            box-shadow: var(--shadow-lg);
        }

    .topbar, .main-content {
        left: 0 !important;
        margin-left: 0 !important;
    }

    .mobile-toggle {
        display: flex;
    }

    .company-pill .meta {
        display: none;
    }

    .topbar-search {
        display: none;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15,18,32,.5);
        z-index: 1090;
    }

        .sidebar-overlay.show {
            display: block;
        }
}
