:root {
    --brand-navy: #111b31;
    --brand-navy-deep: #0b1428;
    --brand-accent: #ff9f0a;
    --surface-bg: #f3f4f7;
    --surface-panel: #ffffff;
    --line-soft: #e4e7ee;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --sidebar-surface-start: #f7f9fc;
    --sidebar-surface-end: #eef3f9;
    --sidebar-line: #dbe3ee;
    --sidebar-text: #334155;
    --sidebar-text-muted: #64748b;
    --sidebar-hover: #e6edf7;
    --sidebar-active: #dbe7f7;
    --sidebar-active-text: #0f2f57;
    --table-shell: #ffffff;
    --table-header: #f3f5f8;
    --table-row-alt: #fafbfc;
    --table-line: #e6e9ef;
    --table-head-text: #5d6b82;
    --table-body-text: #334155;
    --table-hover: #f5f8fc;
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
    font-size: 15px;
}

body.app-body {
    margin: 0;
    min-height: 100%;
    font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    font-size: 0.95rem;
    color: var(--text-main);
    background: radial-gradient(circle at top right, #f8f9fc 0%, #eef1f7 45%, #e9edf6 100%);
    overflow: hidden;
}

.app-shell {
    height: 100dvh;
    min-height: 100vh;
    display: flex;
    border: 1px solid #d9deea;
    overflow: hidden;
    background: var(--surface-bg);
}

.app-sidebar {
    width: 280px;
    height: 100%;
    background: linear-gradient(180deg, var(--sidebar-surface-start) 0%, var(--sidebar-surface-end) 100%);
    color: var(--sidebar-text);
    border-right: 1px solid var(--sidebar-line);
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.app-sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.brand-logo-img {
    width: 100%;
    max-height: 56px;
    object-fit: contain;
}

.sidebar-frame {
    padding: 14px 14px 12px;
    min-height: 0;
}

.brand-block {
    display: block;
    padding: 6px 0 16px;
    border-bottom: 1px solid var(--sidebar-line);
}

.brand-logo {
    width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2b4d73;
    font-size: 1.2rem;
}

.brand-copy {
    padding: 0.55rem 0.8rem 0;
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #25364e;
}

.brand-tag {
    font-size: 0.825rem;
    color: var(--sidebar-text-muted);
}

.sidebar-nav {
    margin-top: 10px;
}

.sidebar-link {
    color: var(--sidebar-text);
    border-radius: 12px;
    padding: 0.72rem 0.8rem;
    font-weight: 500;
    transition: 0.2s ease;
}

.sidebar-link .bi {
    width: 18px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-link:hover {
    color: #1e2f45;
    background: var(--sidebar-hover);
}

.sidebar-link.active {
    color: var(--sidebar-active-text);
    background: var(--sidebar-active);
    font-weight: 700;
}

.sidebar-link.disabled {
    opacity: 0.68;
}

.sidebar-submenu {
    margin: 0.1rem 0 0.2rem 0.9rem;
    padding-left: 0.65rem;
    border-left: 1px solid var(--sidebar-line);
}

.sidebar-submenu .sidebar-submenu-link {
    font-size: 0.9rem;
    font-weight: 500;
    padding-top: 0.56rem;
    padding-bottom: 0.56rem;
}

.sidebar-submenu-toggle .submenu-caret {
    font-size: 0.78rem;
    transition: transform 0.2s ease;
}

.sidebar-submenu-toggle[aria-expanded="true"] .submenu-caret {
    transform: rotate(180deg);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
    color: #fff;
    background: #f5ad45;
}

.user-name {
    color: #1f2d40;
    font-size: 0.95rem;
    font-weight: 600;
}

.user-email {
    color: var(--sidebar-text-muted);
    font-size: 0.82rem;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.top-navbar {
    flex-shrink: 0;
    min-height: 72px;
    padding: 0 1.1rem;
    border-bottom: 1px solid var(--line-soft);
    background: var(--surface-panel);
}

.topbar-inner {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-page-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2d40;
    line-height: 1.2;
    white-space: nowrap;
    min-width: 0;
}

.top-search {
    position: relative;
    width: 118px;
    min-width: 118px;
    max-width: 100%;
    transition: width 0.24s ease;
}

.top-search:focus-within {
    width: min(420px, 42vw);
}

.top-search .bi {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.96rem;
    pointer-events: none;
}

.search-input {
    height: 42px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f6f7fb;
    padding-left: 38px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.search-input:focus {
    border-color: #cbd5e1;
    box-shadow: 0 0 0 0.2rem rgba(255, 159, 10, 0.15);
    background: #fff;
}

.global-search-dropdown {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    right: 0;
    border: 1px solid #dbe4f0;
    border-radius: 0.82rem;
    background: #ffffff;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.16);
    max-height: min(60vh, 420px);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1600;
    padding: 0.34rem;
}

.global-search-group {
    padding: 0.15rem 0;
}

.global-search-group + .global-search-group {
    border-top: 1px solid #edf2f8;
}

.global-search-group-title {
    margin: 0;
    padding: 0.28rem 0.42rem 0.34rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.global-search-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    text-decoration: none;
    border-radius: 0.58rem;
    padding: 0.45rem 0.5rem;
    color: inherit;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.global-search-item + .global-search-item {
    margin-top: 0.12rem;
}

.global-search-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.2;
}

.global-search-item-subtitle {
    font-size: 0.76rem;
    color: #5d6c80;
    line-height: 1.18;
}

.global-search-item:hover,
.global-search-item.is-active {
    background: #f1f5fb;
}

.global-search-empty {
    padding: 0.7rem 0.58rem;
    font-size: 0.82rem;
    color: #4b607a;
}

.global-search-empty.is-error {
    color: #b91c1c;
}

.global-search-empty.is-loading {
    color: #1d4ed8;
}

.top-mobile-menu .global-search-dropdown {
    max-height: min(52vh, 300px);
}

.notification-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #eadfd6;
    background: #fff;
    color: #5b5b5b;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-decoration: none;
}

.notification-btn:hover,
.notification-btn:focus,
.notification-btn.active {
    color: #ff603a;
    border-color: #ffc8b1;
    background: #fff5ef;
    text-decoration: none;
}

.notification-btn .bi {
    font-size: 0.95rem;
    line-height: 1;
}

.notification-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 50%;
    position: absolute;
    top: -7px;
    right: -7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ff603a;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    border: 2px solid #fff;
}

.top-mobile-more-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #eadfd6;
    background: #fff;
    color: #5b5b5b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.top-mobile-more-btn:hover,
.top-mobile-more-btn:focus {
    color: #ff603a;
    border-color: #ffc8b1;
    background: #fff5ef;
}

.top-mobile-more-btn .bi {
    font-size: 1rem;
    line-height: 1;
}

.top-mobile-menu {
    width: min(300px, 75vw);
    max-width: 75vw;
    padding: 0.72rem;
    border-radius: 5px;
    border: 1px solid #e4e8ef;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    position: fixed !important;
    left: auto !important;
    right: 0 !important;
    top: 72px !important;
    margin-top: 0 !important;
    transform: none !important;
}

.top-mobile-account-card {
    background: #e9edf2;
    border: 1px solid #e0e6ee;
    border-radius: 0.82rem;
    min-height: 74px;
    display: flex;
    align-items: center;
    gap: 0.62rem;
    padding: 0.62rem 0.72rem;
    margin-bottom: 0.72rem;
}

.top-mobile-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.top-mobile-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 25%, #314b84 0%, #1f335f 58%, #16284a 100%);
    color: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.top-mobile-status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #20c274;
    border: 2px solid #f3f5f9;
    position: absolute;
    right: -2px;
    bottom: 0;
}

.top-mobile-account-text {
    min-width: 0;
}

.top-mobile-account-label {
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #5f6f86;
}

.top-mobile-account-name {
    font-size: 1.03rem;
    font-weight: 700;
    line-height: 1.06;
    color: #0f1f3c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-mobile-account-email {
    font-size: 0.78rem;
    line-height: 1.1;
    color: #4f6f95;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-mobile-search-row {
    margin-bottom: 0.72rem;
}

.top-mobile-search-row .bi {
    left: 14px;
    color: #6f8098;
    font-size: 1.02rem;
}

.top-mobile-search-input {
    height: 42px;
    border-radius: 0.8rem;
    border: 1px solid #e0e6ee;
    background: #e9edf2;
    padding-left: 40px;
    font-size: 0.9rem;
    color: #314863;
}

.top-mobile-search-input::placeholder {
    color: #5f7695;
}

.top-mobile-search-input:focus {
    border-color: #d1dceb;
    box-shadow: 0 0 0 0.2rem rgba(82, 131, 199, 0.14);
    background: #edf1f6;
}

.top-search-mobile {
    width: 100%;
    min-width: 100%;
}

.top-search-mobile:focus-within {
    width: 100%;
}

.top-mobile-notification {
    width: 100%;
    border: 1px solid #e0e6ee;
    border-radius: 0.82rem;
    background: #e9edf2;
    color: #223249;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.44rem 0.62rem;
    position: relative;
    margin-bottom: 0.72rem;
    text-decoration: none;
}

.top-mobile-notification:hover,
.top-mobile-notification:focus,
.top-mobile-notification.active {
    border-color: #d3dcea;
    background: #edf1f6;
    text-decoration: none;
}

.top-mobile-notification-icon {
    width: 30px;
    height: 30px;
    border-radius: 0.6rem;
    border: 1px solid #dbe3ee;
    background: #eef2f7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #0f172a;
}

.top-mobile-notification-icon .bi {
    font-size: 0.94rem;
    line-height: 1;
}

.top-mobile-notification-text {
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.1;
}

.top-mobile-notification-count {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #ff7300;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.76rem;
    font-weight: 700;
    margin-left: auto;
    flex-shrink: 0;
}

.top-mobile-notification-arrow {
    color: #6a7f99;
    font-size: 0.88rem;
}

.top-mobile-profile-btn,
.top-mobile-logout-btn {
    width: 100%;
    min-height: 42px;
    border-radius: 0.82rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.1;
}

.top-mobile-profile-btn {
    border: 1px solid #ccd6e5;
    color: #0f172a;
    background: transparent;
    margin-bottom: 0.48rem;
}

.top-mobile-profile-btn:hover,
.top-mobile-profile-btn:focus {
    color: #0f172a;
    border-color: #bac8dc;
    background: #eef3f9;
}

.top-mobile-logout-btn {
    border: 0;
    color: #fff;
    background: linear-gradient(180deg, #3b6bff 0%, #2757de 100%);
    box-shadow: 0 6px 16px rgba(37, 87, 222, 0.3);
}

.top-mobile-logout-btn:hover,
.top-mobile-logout-btn:focus {
    color: #fff;
    background: linear-gradient(180deg, #4875ff 0%, #2c5ee8 100%);
}

.top-mobile-profile-btn .bi,
.top-mobile-logout-btn .bi {
    font-size: 0.98rem;
    line-height: 1;
}

.op-7 {
    opacity: 0.7;
}

.top-user-dropdown {
    margin-left: 0.35rem;
}

.top-user-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.56rem 0.95rem;
    color: #111827;
    white-space: nowrap;
}

.top-user-toggle:hover,
.top-user-toggle:focus {
    background: #eceff5;
    color: #111827;
    border-color: #d8dde8;
}

.top-user-toggle:focus {
    box-shadow: 0 0 0 0.2rem rgba(17, 27, 49, 0.06);
}

.top-user-toggle::after {
    display: none;
}

.profile-pic:hover,
.profile-pic:focus {
    text-decoration: none;
}

.profile-pic span {
    font-size: 1rem;
}

.hidden-caret .dropdown-toggle::after {
    display: none !important;
}

.profile-username {
    display: inline-flex;
    align-items: baseline;
    gap: 0.45rem;
    line-height: 1;
}

.profile-username .fw-bold {
    max-width: 230px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-user-menu {
    position: absolute;
    z-index: 1200;
    min-width: 260px;
    border: 0;
    border-radius: 4px;
    padding: 0;
    margin-top: 3px;
    background: #fff;
    box-shadow: 0 1px 11px rgba(0, 0, 0, 0.15) !important;
}

.top-user-menu-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    background: #ff7d36;
    color: #fff;
}

.user-box {
    display: flex;
    align-items: center;
    padding: 0.25rem 1rem;
}

.user-box .avatar-lg {
    width: 62px;
    min-width: 62px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.user-box .u-text {
    min-width: 0;
    padding: 0 10px;
}

.user-box .u-text h4 {
    color: #2e2f33;
    margin-bottom: 5px;
    margin-top: 4px;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-box .u-text .text-muted {
    font-size: 12px;
    margin-bottom: 5px;
    color: #6b7280 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-user-menu .dropdown-item {
    border-radius: 0;
    padding: 0.75rem 1rem;
    color: #26272b;
    font-size: 1rem;
    font-weight: 400;
}

.top-user-menu .dropdown-item:hover {
    background: #f5f6f8;
    color: #111827;
}

.top-user-menu .dropdown-divider {
    margin: 0;
    border-top-color: #e6e8ee;
}

@media (min-width: 992px) {
    .top-user-dropdown .dropdown-menu {
        margin-top: 13px;
    }

    .top-user-dropdown .dropdown-menu::after {
        border-bottom: 8px solid #fff;
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        content: "";
        right: 10px;
        top: -8px;
        position: absolute;
        z-index: 1001;
    }
}

.btn-round {
    border-radius: 999px;
}

.app-content {
    flex: 1;
    min-height: 0;
    padding: 1.6rem;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.app-content > div.pt-2.pb-4 > div:first-child > h3.fw-bold {
    display: none;
}

.mobile-sidebar {
    background: linear-gradient(180deg, var(--sidebar-surface-start) 0%, var(--sidebar-surface-end) 100%);
    color: var(--sidebar-text);
}

.mobile-sidebar.offcanvas {
    width: 280px;
}

.mobile-sidebar .offcanvas-body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.mobile-sidebar .offcanvas-body::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.card {
    border-radius: 16px;
    border-color: #e5e7eb;
}

.app-content .table-responsive {
    border: 1px solid var(--table-line);
    border-radius: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    background: var(--table-shell);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.app-content .table-responsive.table-dropdown-open {
    overflow: visible;
}

.app-content .table {
    margin-bottom: 0;
    border-radius: 5px;
    border-collapse: separate;
    border-spacing: 0;
    --bs-table-bg: transparent;
    --bs-table-striped-bg: transparent;
    color: var(--table-body-text);
    font-size: 0.86rem;
    line-height: 1.25;
}

.app-content .table > :not(caption) > * > * {
    padding: 0.72rem 0.84rem;
    border-bottom: 1px solid var(--table-line);
    background: transparent;
    vertical-align: middle;
}

.app-content .table thead th {
    background: var(--table-header);
    color: var(--table-head-text);
    font-size: 0.73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.045em;
    border-bottom: 1px solid var(--table-line);
    white-space: nowrap;
}

.app-content .table tbody td {
    background: var(--table-shell);
    color: var(--table-body-text);
}

.app-content .table tbody tr:nth-child(even) td {
    background: var(--table-row-alt);
}

.app-content .table tbody tr:hover td {
    background: var(--table-hover);
}

.app-content .table tbody tr:nth-child(even):hover td {
    background: var(--table-hover);
}

.app-content .table tbody tr:last-child td {
    border-bottom: 0;
}

.app-content .table.table-sm > :not(caption) > * > * {
    padding: 0.44rem 0.56rem;
}

.member-avatar {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

.profile-avatar {
    width: 120px;
    height: 120px;
}

.avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff7ec;
    color: #d1890c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

@media (max-width: 991.98px) {
    .app-shell {
        border-radius: 0;
        border: 0;
    }

    .topbar-page-title {
        font-size: 1.02rem;
        flex: 1 1 auto;
        max-width: calc(100vw - 8.5rem);
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .top-search {
        width: 108px;
        min-width: 108px;
    }

    .top-search:focus-within {
        width: min(320px, 62vw);
    }

    .top-search-mobile,
    .top-search-mobile:focus-within {
        width: 100%;
        min-width: 100%;
    }

    .app-content {
        padding: 1.15rem;
    }

    .top-user-toggle {
        min-height: 42px;
        padding: 0.5rem 0.8rem;
    }

    .profile-username .fw-bold {
        max-width: 155px;
    }

    .top-user-menu {
        min-width: 250px;
    }

    .app-content .table-responsive > .table {
        width: max-content;
        min-width: 100%;
    }

    .app-content .table-responsive > .table > :not(caption) > * > * {
        white-space: nowrap;
    }
}

@media (max-width: 767.98px) {
    .top-user-dropdown {
        margin-left: 0.4rem;
    }

    .top-user-toggle {
        min-height: 40px;
        padding: 0.46rem 0.7rem;
    }

    .profile-username .fw-bold {
        max-width: 105px;
    }

    .top-user-menu {
        min-width: 236px;
    }

    .profile-avatar {
        width: 96px;
        height: 96px;
    }
}
