:root {
    --pb-primary: #17324d;
    --pb-primary-dark: #10263b;
    --pb-accent: #c99a45;

    --pb-bg: #f5f7fa;
    --pb-surface: #ffffff;

    --pb-text: #1c2733;
    --pb-muted: #6b7785;

    --pb-border: #e4e9ef;

    --sidebar-width: 260px;
}


* {
    box-sizing: border-box;
}


body {
    margin: 0;
    background: var(--pb-bg);
    color: var(--pb-text);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}


/* ================================
   APP
================================ */

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


.app-sidebar {
    position: fixed;

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

    width: var(--sidebar-width);

    background: var(--pb-primary-dark);

    padding: 24px 18px;

    flex-direction: column;

    z-index: 1030;
}


.app-main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}


/* ================================
   BRAND
================================ */

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;

    color: white;

    padding: 0 8px 24px;
}


.brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;

    position: relative;
    overflow: hidden;

    border-radius: 11px;

    background: white;
}

.brand-mark img {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 145px;
    max-width: none;
    height: auto;

    transform: translate(-50%, -50%);
}


.sidebar-brand strong {
    display: block;
    font-size: 15px;
}


.sidebar-brand small {
    display: block;

    margin-top: 2px;

    color: rgba(255, 255, 255, .58);

    font-size: 11px;
}


/* ================================
   NAV
================================ */

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


.sidebar-section {
    margin-bottom: 25px;
}


.sidebar-section-title {
    display: block;

    padding: 0 12px 8px;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 1px;

    color: rgba(255, 255, 255, .38);
}


.sidebar-link {
    position: relative;

    display: flex;
    align-items: center;

    gap: 11px;

    width: 100%;

    padding: 10px 12px;
    margin-bottom: 3px;

    border-radius: 8px;

    color: rgba(255, 255, 255, .72);

    text-decoration: none;

    font-size: 13px;
    font-weight: 500;

    transition: .2s ease;
}


.sidebar-link:hover {
    color: white;

    background: rgba(255, 255, 255, .06);
}


.sidebar-link.active {
    color: white;

    background: rgba(255, 255, 255, .09);
}


.nav-indicator {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: rgba(255, 255, 255, .28);
}


.sidebar-link.active .nav-indicator {
    background: var(--pb-accent);
}


.disabled-link {
    opacity: .43;
    cursor: default;
}


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

.sidebar-footer {
    padding-top: 18px;

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


.sidebar-user {
    display: flex;
    align-items: center;

    gap: 10px;

    margin-bottom: 14px;
}


.user-avatar,
.header-avatar {
    display: flex;

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

    flex-shrink: 0;

    border-radius: 50%;

    font-weight: 700;
}


.user-avatar {
    width: 38px;
    height: 38px;

    background: rgba(255, 255, 255, .12);

    color: white;
}


.user-info {
    min-width: 0;
}


.user-info strong {
    display: block;

    color: white;

    font-size: 12px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.user-info small {
    color: rgba(255, 255, 255, .45);

    font-size: 10px;
}


.logout-button {
    width: 100%;

    border: 1px solid rgba(255, 255, 255, .12);

    border-radius: 8px;

    background: transparent;

    color: rgba(255, 255, 255, .65);

    padding: 8px;

    font-size: 12px;
}


.logout-button:hover {
    color: white;
    border-color: rgba(255, 255, 255, .3);
}


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

.app-header {
    min-height: 76px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 14px 32px;

    background: var(--pb-surface);

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


.header-left {
    display: flex;
    align-items: center;

    gap: 15px;
}


.app-header h1 {
    margin: 0;

    font-size: 20px;
    font-weight: 700;
}


.page-subtitle {
    margin-top: 2px;

    font-size: 12px;

    color: var(--pb-muted);
}


.header-user {
    display: flex;
    align-items: center;

    gap: 9px;
}


.header-avatar {
    width: 36px;
    height: 36px;

    background: #e9eef4;

    color: var(--pb-primary);
}


.header-user strong {
    display: block;

    font-size: 12px;
}


.header-user small {
    display: block;

    font-size: 10px;

    color: var(--pb-muted);
}


.mobile-menu-button {
    border: none;

    background: transparent;

    font-size: 22px;

    padding: 4px 7px;
}


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

.app-content {
    padding: 28px 32px 50px;

    max-width: 1600px;

    margin: auto;
}


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

.panel {
    background: white;

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

    border-radius: 12px;

    box-shadow:
        0 2px 8px rgba(20, 38, 55, .03);
}


.panel-header {
    padding: 18px 20px;

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

    display: flex;
    align-items: center;
    justify-content: space-between;
}


.panel-header h2 {
    margin: 0;

    font-size: 15px;
    font-weight: 700;
}


.panel-body {
    padding: 20px;
}


/* ================================
   KPI
================================ */

.metric-card {
    height: 100%;

    padding: 20px;

    background: white;

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

    border-radius: 12px;
}


.metric-label {
    display: block;

    color: var(--pb-muted);

    font-size: 11px;
    font-weight: 600;

    text-transform: uppercase;

    letter-spacing: .5px;
}


.metric-value {
    display: block;

    margin-top: 8px;

    font-size: 21px;
    font-weight: 700;

    color: var(--pb-text);
}


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

.btn-pb {
    background: var(--pb-primary);

    border-color: var(--pb-primary);

    color: white;
}


.btn-pb:hover {
    background: var(--pb-primary-dark);

    border-color: var(--pb-primary-dark);

    color: white;
}


/* ================================
   TABLE
================================ */

.app-table {
    margin: 0;
}


.app-table thead th {
    background: #f8fafc;

    color: var(--pb-muted);

    font-size: 10px;
    font-weight: 700;

    letter-spacing: .5px;

    text-transform: uppercase;

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

    padding: 12px 16px;
}


.app-table td {
    padding: 13px 16px;

    vertical-align: middle;

    font-size: 12px;

    border-color: var(--pb-border);
}


.table-title {
    font-weight: 600;
    color: var(--pb-text);
}


.table-secondary {
    color: var(--pb-muted);

    font-size: 11px;
}


/* ================================
   STATUS
================================ */

.status-badge {
    display: inline-flex;

    align-items: center;

    padding: 5px 9px;

    border-radius: 20px;

    font-size: 10px;

    font-weight: 600;
}


.status-planned {
    background: #edf1f5;
    color: #596574;
}


.status-in_progress {
    background: #e8f2ff;
    color: #2165a8;
}


.status-completed {
    background: #e7f7ef;
    color: #277852;
}


.status-suspended {
    background: #fff4dd;
    color: #946918;
}


.status-cancelled {
    background: #fdecec;
    color: #a63e3e;
}


/* ================================
   FILTERS
================================ */

.filters-bar {
    padding: 16px;

    background: white;

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

    border-radius: 12px;

    margin-bottom: 18px;
}


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

.form-card {
    max-width: 960px;

    margin: auto;
}


.form-label {
    font-size: 12px;

    font-weight: 600;

    color: #45515e;
}


.form-control,
.form-select {
    border-color: #dce2e8;

    min-height: 42px;

    font-size: 13px;

    border-radius: 8px;
}


textarea.form-control {
    min-height: auto;
}


.form-control:focus,
.form-select:focus {
    border-color: #879cad;

    box-shadow:
        0 0 0 .15rem rgba(23, 50, 77, .08);
}


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

.mobile-sidebar {
    background: var(--pb-primary-dark);

    color: white;
}


.mobile-sidebar .offcanvas-header {
    border-bottom:
        1px solid rgba(255, 255, 255, .08);
}


@media (max-width: 991.98px) {

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

    .app-content {
        padding: 22px 18px 40px;
    }

    .app-header {
        padding: 12px 18px;
    }

}


@media (max-width: 575.98px) {

    .app-header h1 {
        font-size: 17px;
    }

    .app-content {
        padding:
            18px 12px 35px;
    }

    .metric-value {
        font-size: 18px;
    }

}


.login-page {
    min-height: 100vh;

    display: flex;

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

    padding: 25px;

    background:
        linear-gradient(
            135deg,
            #f5f7fa 0%,
            #e9eef3 100%
        );
}


.login-card {
    width: 100%;
    max-width: 420px;

    padding: 36px;

    background: white;

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

    border-radius: 16px;

    box-shadow:
        0 14px 40px rgba(23, 50, 77, .08);
}


.login-brand {
    display: flex;
    align-items: center;

    gap: 12px;

    margin-bottom: 35px;
}


.login-brand strong {
    display: block;

    color: var(--pb-primary);

    font-size: 15px;
}


.login-brand span {
    display: block;

    color: var(--pb-muted);

    font-size: 11px;
}


.login-heading {
    margin-bottom: 27px;
}


.login-heading h1 {
    margin-bottom: 6px;

    font-size: 25px;
    font-weight: 700;
}


.login-heading p {
    margin: 0;

    color: var(--pb-muted);

    font-size: 13px;
}

.panel .text-muted + div {
    margin-top: 3px;
}


.form-check {
    padding-top: 8px;
}


.form-check-input {
    width: 1.1rem;
    height: 1.1rem;
}


.form-check-label {
    margin-left: 5px;

    font-size: 13px;
    font-weight: 500;
}


@media (max-width: 575.98px) {

    .panel-header {
        padding: 15px;
    }

    .panel-body {
        padding: 16px;
    }

}


.operation-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 14px 0;

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


.operation-row:first-child {
    padding-top: 0;
}


.operation-row:last-child {
    padding-bottom: 0;
    border-bottom: none;
}


.operation-row strong {
    font-size: 13px;
}


.operation-actions {
    display: flex;
    align-items: center;

    gap: 10px;
}


.operation-actions a {
    font-size: 11px;

    text-decoration: none;

    color: var(--pb-primary);
}


.operation-actions a:hover {
    text-decoration: underline;
}


.operation-actions .text-danger {
    color: #b23b3b !important;
}


.empty-state {
    padding: 24px 5px;

    text-align: center;

    color: var(--pb-muted);

    font-size: 13px;
}


.purchase-item-row {
    padding: 17px 0;

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


.purchase-item-row:first-child {
    padding-top: 0;
}


.purchase-item-row:last-child {
    border-bottom: none;
}


.nav-tabs {
    border-bottom:
        1px solid var(--pb-border);
}


.nav-tabs .nav-link {
    border: none;

    color: var(--pb-muted);

    padding: 11px 16px;

    font-size: 12px;
    font-weight: 600;

    border-bottom:
        2px solid transparent;
}


.nav-tabs .nav-link:hover {
    color: var(--pb-primary);
}


.nav-tabs .nav-link.active {
    color: var(--pb-primary);

    background: transparent;

    border-bottom-color:
        var(--pb-primary);
}


@media (max-width: 767.98px) {

    .operation-row {
        align-items: flex-start;

        flex-direction: column;

        gap: 10px;
    }

    .operation-actions {
        flex-wrap: wrap;
    }

    .nav-tabs {
        flex-wrap: nowrap;

        overflow-x: auto;

        overflow-y: hidden;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
    }

}


/* ================================
   MODERN UI REFRESH
================================ */

:root {
    --pb-primary: #153e5c;
    --pb-primary-dark: #0b263c;
    --pb-primary-soft: #e8f1f7;
    --pb-accent: #d2a54c;
    --pb-bg: #f3f6f9;
    --pb-surface: #ffffff;
    --pb-text: #17212b;
    --pb-muted: #667686;
    --pb-border: #dfe7ee;
    --pb-danger: #b42318;
    --pb-success: #16794b;
    --pb-shadow-sm: 0 1px 2px rgba(15, 35, 50, .04), 0 4px 12px rgba(15, 35, 50, .04);
    --pb-shadow-md: 0 14px 36px rgba(15, 35, 50, .09);
    --pb-radius-sm: 10px;
    --pb-radius: 14px;
    --pb-radius-lg: 20px;
    --sidebar-width: 276px;
}

html {
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a,
button,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid rgba(44, 132, 185, .3);
    outline-offset: 2px;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 2000;
    padding: 10px 14px;
    border-radius: 10px;
    background: white;
    color: var(--pb-primary-dark);
    box-shadow: var(--pb-shadow-md);
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

.app-sidebar,
.mobile-sidebar {
    background:
        radial-gradient(circle at 20% 0%, rgba(47, 117, 153, .28), transparent 34%),
        linear-gradient(180deg, #102f47 0%, var(--pb-primary-dark) 100%);
}

.app-sidebar {
    padding: 22px 16px 18px;
    box-shadow: 12px 0 30px rgba(8, 29, 44, .08);
}

.sidebar-brand {
    min-height: 62px;
    padding: 0 10px 20px;
}

.sidebar-brand strong {
    font-size: 16px;
    letter-spacing: -.15px;
}

.sidebar-brand small {
    font-size: 11px;
}

.brand-mark {
    box-shadow: 0 8px 20px rgba(0, 0, 0, .16);
}

.sidebar-nav {
    padding: 6px 4px 12px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .15) transparent;
}

.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-section-title {
    padding: 0 12px 7px;
    font-size: 9px;
    letter-spacing: 1.4px;
}

.sidebar-link {
    min-height: 43px;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
}

.sidebar-link .bi {
    width: 20px;
    color: rgba(255, 255, 255, .56);
    font-size: 16px;
    text-align: center;
    transition: color .2s ease, transform .2s ease;
}

.sidebar-link:hover .bi,
.sidebar-link.active .bi {
    color: #f1c66e;
    transform: translateX(1px);
}

.sidebar-link.active {
    background: linear-gradient(90deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .07));
    box-shadow: inset 3px 0 0 var(--pb-accent);
}

.sidebar-footer,
.mobile-sidebar-account {
    padding: 16px 10px 0;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.mobile-sidebar-account {
    margin-top: auto;
}

.logout-button {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    min-height: 78px;
    padding: 14px 32px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 1px 0 rgba(20, 49, 70, .04);
    backdrop-filter: blur(14px);
}

.app-header h1 {
    font-size: 21px;
    letter-spacing: -.35px;
}

.page-subtitle {
    font-size: 12px;
}

.mobile-menu-button {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid var(--pb-border);
    border-radius: 11px;
    background: var(--pb-surface);
    color: var(--pb-primary);
    box-shadow: var(--pb-shadow-sm);
    font-size: 24px;
}

.app-content {
    padding: 30px 32px 56px;
}

.panel,
.metric-card,
.filters-bar {
    border-color: rgba(212, 223, 232, .88);
    border-radius: var(--pb-radius);
    box-shadow: var(--pb-shadow-sm);
}

.panel {
    overflow: hidden;
}

.panel-header {
    min-height: 62px;
    padding: 17px 20px;
}

.panel-header h2 {
    font-size: 15px;
    letter-spacing: -.1px;
}

.metric-card {
    position: relative;
    overflow: hidden;
    min-height: 112px;
    padding: 20px;
    transition: transform .2s ease, box-shadow .2s ease;
}

.metric-card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    border-radius: 0 0 0 60px;
    background: linear-gradient(135deg, transparent, rgba(31, 92, 128, .07));
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(15, 35, 50, .08);
}

.metric-label {
    font-size: 11px;
    letter-spacing: .65px;
}

.metric-value {
    margin-top: 10px;
    font-size: clamp(19px, 2vw, 25px);
    letter-spacing: -.5px;
    overflow-wrap: anywhere;
}

.btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}

.btn-sm {
    min-height: 34px;
    border-radius: 8px;
    font-size: 12px;
}

.btn-pb {
    box-shadow: 0 6px 14px rgba(21, 62, 92, .16);
}

.page-actions,
.detail-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 18px;
}

.detail-toolbar {
    justify-content: space-between;
    margin-bottom: 22px;
}

.filters-bar {
    padding: 18px;
}

.filters-heading {
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 15px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--pb-border);
}

.filters-heading strong,
.filters-heading span {
    display: block;
}

.filters-heading strong {
    font-size: 13px;
}

.filters-heading div > span {
    margin-top: 2px;
    color: var(--pb-muted);
    font-size: 11px;
}

.filter-label {
    display: block;
    margin-bottom: 6px;
    color: #526272;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .45px;
    text-transform: uppercase;
}

.filter-action-column {
    display: flex;
    align-items: flex-end;
}

.filter-action-column .btn {
    width: 100%;
}

.filter-grid {
    display: grid;
    gap: 14px 10px;
    align-items: end;
}

.filter-grid > [class*="col-"] {
    width: auto;
    max-width: none;
    padding: 0;
}

.filter-grid-finance {
    grid-template-columns:
        minmax(210px, 1.4fr)
        minmax(150px, 1fr)
        minmax(170px, 1fr)
        minmax(150px, .9fr)
        minmax(150px, .9fr)
        minmax(84px, auto)
        minmax(84px, auto);
}

.filter-grid-projects {
    grid-template-columns:
        minmax(240px, 1.5fr)
        minmax(155px, .8fr)
        minmax(155px, .8fr)
        minmax(190px, 1fr)
        minmax(84px, auto)
        minmax(84px, auto);
}

.filter-grid-contacts,
.filter-grid-users {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.filter-grid-contacts > [class*="col-"],
.filter-grid-users > [class*="col-"] {
    flex: 1 1 160px;
}

.filter-grid-contacts > [class*="col-"]:first-child,
.filter-grid-users > [class*="col-"]:first-child {
    flex: 2 1 280px;
}

.filter-grid-contacts > .filter-action-column,
.filter-grid-users > .filter-action-column {
    flex: 0 0 auto;
    min-width: 86px;
}

.filter-grid-reports {
    grid-template-columns:
        minmax(180px, 240px)
        minmax(180px, 240px)
        minmax(84px, auto)
        minmax(84px, auto);
    justify-content: start;
}

.filters-toggle {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 11px 14px;
    border: 1px solid var(--pb-border);
    border-radius: 12px;
    background: white;
    color: var(--pb-text);
    box-shadow: var(--pb-shadow-sm);
    font-size: 13px;
    font-weight: 700;
}

.filters-bar {
    background:
        linear-gradient(180deg, rgba(249, 251, 253, .72), rgba(255, 255, 255, 1) 42%);
}

.filters-heading {
    position: relative;
    min-height: 47px;
    padding-left: 15px;
}

.filters-heading::before {
    content: "";
    position: absolute;
    top: 2px;
    bottom: 15px;
    left: 0;
    width: 3px;
    border-radius: 999px;
    background: var(--pb-primary);
}

.filters-heading strong {
    color: var(--pb-text);
    font-size: 14px;
    line-height: 1.25;
}

.filters-heading div > span {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.35;
}

.filter-label {
    margin-bottom: 7px;
    color: #46596b;
    font-size: 10px;
    line-height: 1;
}

.filters-bar .form-control,
.filters-bar .form-select {
    height: 46px;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid #cfdbe5;
    border-radius: 10px;
    background-color: white;
    color: #243746;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    box-shadow: 0 1px 2px rgba(15, 35, 50, .025);
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.filters-bar .form-control::placeholder {
    color: #8a98a6;
    font-weight: 400;
    opacity: 1;
}

.filters-bar .form-control:hover,
.filters-bar .form-select:hover {
    border-color: #aebfcd;
}

.filters-bar .form-control:focus,
.filters-bar .form-select:focus {
    border-color: #4c7895;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(38, 104, 142, .11);
}

.filters-bar .filter-action-column .btn {
    height: 46px;
    min-height: 46px;
    padding-inline: 16px;
    white-space: nowrap;
}

.filters-toggle > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.filters-toggle .bi {
    color: var(--pb-primary);
    font-size: 16px;
}

.filter-active-badge {
    display: inline-flex !important;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--pb-primary-soft);
    color: var(--pb-primary) !important;
    font-size: 10px !important;
    font-weight: 700;
    letter-spacing: .2px;
}

.filters-bar .form-control,
.filters-bar .form-select {
    background-color: #fbfcfd;
}

.form-control,
.form-select {
    min-height: 44px;
    border-radius: 10px;
    font-size: 14px;
}

.form-label {
    margin-bottom: 7px;
    font-size: 12px;
}

.form-card {
    max-width: 980px;
}

.confirm-card {
    max-width: 640px;
    margin: 0 auto;
}

.confirm-card .panel-body {
    padding: 28px;
}

.form-card .panel-body {
    padding: 28px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--pb-border);
}

.app-table thead th {
    padding: 13px 16px;
    font-size: 10px;
}

.app-table td {
    padding: 15px 16px;
    font-size: 13px;
}

.app-table tbody tr {
    transition: background-color .15s ease;
}

.app-table tbody tr:hover {
    background: #f8fbfd;
}

.app-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    white-space: nowrap;
}

.app-table td {
    color: #334353;
    font-size: 13px;
    line-height: 1.45;
}

.app-table td:first-child,
.app-table th:first-child {
    padding-left: 20px;
}

.app-table td:last-child,
.app-table th:last-child {
    padding-right: 20px;
}

.table-panel-header > div {
    min-width: 0;
}

.table-panel-header small {
    display: block;
    margin-top: 2px;
    color: var(--pb-muted);
    font-size: 11px;
}

.app-table thead th {
    height: 45px;
    color: #506477;
    font-size: 10px;
    letter-spacing: .7px;
}

.app-table tbody td {
    min-height: 58px;
}

.app-table .table-secondary {
    margin-top: 3px;
    color: #718191;
    font-size: 11px;
}

.app-table strong,
.app-table .table-title {
    color: #172b3a;
}

@media (max-width: 1399.98px) {
    .filter-grid-finance {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .filter-grid-finance > .filter-action-column {
        min-width: 0;
    }

    .filter-grid-finance > .filter-action-column:nth-last-child(2) {
        grid-column: 4;
    }

    .filter-grid-finance > .filter-action-column:last-child {
        grid-column: 5;
    }

    .filter-grid-projects {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .filter-grid-projects > .filter-action-column:nth-last-child(2) {
        grid-column: 3;
    }

    .filter-grid-projects > .filter-action-column:last-child {
        grid-column: 4;
    }
}

@media (max-width: 991.98px) {
    .filter-grid-finance,
    .filter-grid-projects {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-grid-finance > .filter-action-column:nth-last-child(2),
    .filter-grid-finance > .filter-action-column:last-child,
    .filter-grid-projects > .filter-action-column:nth-last-child(2),
    .filter-grid-projects > .filter-action-column:last-child {
        grid-column: auto;
    }

    .filter-grid-contacts,
    .filter-grid-users {
        flex-wrap: wrap;
    }
}

.table-count {
    min-width: 34px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--pb-primary-soft);
    color: var(--pb-primary);
    font-size: 12px;
    font-weight: 800;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #38556c;
    text-decoration: none;
}

.contact-link:hover {
    color: var(--pb-primary);
    text-decoration: underline;
}

.table-title {
    font-weight: 700;
}

.status-badge {
    min-height: 26px;
    padding: 5px 10px;
    font-size: 11px;
}

.app-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-top: 1px solid var(--pb-border);
}

.nav-tabs {
    gap: 4px;
    padding: 0 4px;
}

.nav-tabs .nav-link {
    min-height: 44px;
    border-radius: 9px 9px 0 0;
    font-size: 13px;
}

.operation-row {
    min-height: 66px;
}

.operation-actions a {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 5px 7px;
    border-radius: 7px;
    font-size: 12px;
}

.operation-actions a:hover {
    background: var(--pb-primary-soft);
    text-decoration: none;
}

.empty-state {
    padding: 42px 16px;
}

.login-page {
    background:
        radial-gradient(circle at 15% 20%, rgba(62, 132, 170, .13), transparent 28%),
        radial-gradient(circle at 85% 85%, rgba(210, 165, 76, .12), transparent 25%),
        #f1f5f8;
}

.login-card {
    border-radius: var(--pb-radius-lg);
    box-shadow: var(--pb-shadow-md);
}

@media (max-width: 991.98px) {
    .mobile-sidebar {
        width: min(88vw, 340px);
    }

    .mobile-sidebar .offcanvas-header {
        min-height: 82px;
        padding: 16px 18px 10px;
    }

    .mobile-sidebar .sidebar-brand {
        padding-bottom: 10px;
    }

    .mobile-sidebar .offcanvas-body {
        padding: 8px 14px 18px;
    }

    .app-content {
        padding: 24px 20px 44px;
    }
}

@media (max-width: 767.98px) {
    .app-header {
        min-height: 70px;
        padding: 10px 14px;
    }

    .header-left {
        min-width: 0;
        gap: 11px;
    }

    .header-left > div {
        min-width: 0;
    }

    .app-header h1,
    .page-subtitle {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-content {
        padding: 20px 14px 38px;
    }

    .page-actions .btn {
        width: 100%;
    }

    .detail-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .detail-toolbar > div:last-child {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .detail-toolbar form,
    .detail-toolbar .btn {
        width: 100%;
    }

    .filters-bar {
        padding: 14px;
    }

    .filter-panel {
        margin-top: -2px;
    }

    .filter-panel.show,
    .filter-panel.collapsing {
        margin-bottom: 18px;
    }

    .filter-label {
        margin-top: 2px;
    }

    .filter-grid,
    .filter-grid-finance,
    .filter-grid-projects,
    .filter-grid-reports {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 13px 9px;
    }

    .filter-grid-contacts,
    .filter-grid-users {
        display: grid;
        align-items: end;
    }

    .filter-grid > [class*="col-"] {
        grid-column: 1 / -1;
    }

    .filter-grid > .col-6,
    .filter-grid > .filter-action-column {
        grid-column: span 1;
    }

    .filters-bar .filter-action-column .btn {
        padding-inline: 10px;
    }

    .form-card .panel-body {
        padding: 18px;
    }

    .confirm-card .panel-body {
        padding: 20px;
    }

    .form-actions {
        position: sticky;
        bottom: 0;
        z-index: 5;
        margin: 24px -18px -18px;
        padding: 14px 18px;
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 -8px 20px rgba(15, 35, 50, .06);
        backdrop-filter: blur(10px);
    }

    .form-actions .btn {
        flex: 1;
    }

    .app-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .app-pagination > div {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-pagination .btn {
        width: 100%;
    }

    .mobile-card-table {
        padding: 12px;
        overflow: visible;
    }

    .mobile-card-table .app-table,
    .mobile-card-table .app-table tbody,
    .mobile-card-table .app-table tr,
    .mobile-card-table .app-table td {
        display: block;
        width: 100%;
    }

    .mobile-card-table .app-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .mobile-card-table .app-table tbody {
        display: grid;
        gap: 12px;
    }

    .mobile-card-table .app-table tbody tr {
        padding: 14px;
        border: 1px solid var(--pb-border);
        border-radius: 12px;
        background: white;
        box-shadow: 0 3px 12px rgba(15, 35, 50, .04);
    }

    .mobile-card-table .app-table tbody tr:hover {
        background: white;
    }

    .mobile-card-table .app-table td {
        min-height: 34px;
        padding: 7px 0;
        border: 0;
        text-align: left !important;
    }

    .mobile-card-table .app-table td[data-label] {
        display: grid;
        grid-template-columns: minmax(82px, 34%) 1fr;
        gap: 12px;
        align-items: start;
    }

    .mobile-card-table .app-table td[data-label]::before {
        content: attr(data-label);
        color: var(--pb-muted);
        font-size: 10px;
        font-weight: 700;
        letter-spacing: .45px;
        text-transform: uppercase;
    }

    .mobile-card-table .app-table td.mobile-primary {
        padding-top: 0;
        padding-bottom: 11px;
        border-bottom: 1px solid var(--pb-border);
        font-size: 15px;
    }

    .mobile-card-table .app-table td.mobile-primary .table-title,
    .mobile-card-table .app-table td.mobile-primary > strong {
        font-size: 15px;
    }

    .mobile-card-table .app-table td.mobile-actions {
        padding-top: 12px;
        border-top: 1px solid var(--pb-border);
    }

    .mobile-card-table .app-table td.mobile-actions .btn,
    .mobile-card-table .app-table td.mobile-actions > .d-flex {
        width: 100%;
    }

    .mobile-card-table .app-table td.mobile-actions .d-flex {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mobile-card-table .app-table tr:has(td[colspan]) {
        box-shadow: none;
    }

    .panel-header {
        gap: 12px;
    }

    .table-panel-header {
        min-height: 58px;
    }

    .operation-row > .d-flex {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
}

@media (max-width: 575.98px) {
    .app-header h1 {
        font-size: 17px;
    }

    .page-subtitle {
        max-width: 220px;
        font-size: 11px;
    }

    .metric-card {
        min-height: 104px;
        padding: 16px;
    }

    .metric-label {
        font-size: 10px;
    }

    .login-page {
        align-items: flex-start;
        padding: 18px 14px;
    }

    .login-card {
        margin-top: 4vh;
        padding: 25px 20px;
    }

    .login-brand {
        margin-bottom: 28px;
    }
}


/* ================================
   FULL-SCREEN MOBILE LOGIN
================================ */

body.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: #f1f5f8;
}

.login-form .form-label {
    margin-bottom: 8px;
    color: #334655;
    font-size: 12px;
    font-weight: 700;
}

.login-form .form-control {
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid #cfdbe4;
    border-radius: 11px;
    background: #fbfcfd;
    color: #1c2e3c;
    font-size: 15px;
}

.login-form .form-control::placeholder {
    color: #8a98a5;
    opacity: 1;
}

.login-form .form-control:focus {
    border-color: #477895;
    background: white;
    box-shadow: 0 0 0 4px rgba(32, 100, 139, .11);
}

.login-form .btn {
    min-height: 50px;
    margin-top: 4px;
    font-size: 14px;
}

@media (max-width: 575.98px) {
    body.auth-page {
        overflow: hidden;
        background: white;
    }

    .auth-page .login-page {
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        align-items: stretch;
        padding: 0;
        overflow-y: auto;
        background: white;
    }

    .auth-page .login-card {
        width: 100%;
        max-width: none;
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        margin: 0;
        padding:
            max(32px, env(safe-area-inset-top))
            max(24px, env(safe-area-inset-right))
            max(32px, env(safe-area-inset-bottom))
            max(24px, env(safe-area-inset-left));
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-page .login-brand {
        margin-bottom: clamp(36px, 8vh, 64px);
    }

    .auth-page .brand-mark {
        width: 52px;
        height: 52px;
        flex-basis: 52px;
        border: 1px solid #e3e9ee;
        border-radius: 14px;
        box-shadow: 0 9px 22px rgba(20, 48, 68, .12);
    }

    .auth-page .brand-mark img {
        width: 180px;
    }

    .auth-page .login-brand strong {
        font-size: 18px;
    }

    .auth-page .login-brand span {
        margin-top: 2px;
        font-size: 12px;
    }

    .auth-page .login-heading {
        margin-bottom: 34px;
    }

    .auth-page .login-heading h1 {
        margin-bottom: 9px;
        font-size: clamp(29px, 8vw, 36px);
        letter-spacing: -.8px;
    }

    .auth-page .login-heading p {
        max-width: 420px;
        font-size: 15px;
        line-height: 1.55;
    }

    .auth-page .login-form .mb-3 {
        margin-bottom: 20px !important;
    }

    .auth-page .login-form .mb-4 {
        margin-bottom: 28px !important;
    }

    .auth-page .login-form .form-label {
        margin-bottom: 9px;
        font-size: 13px;
    }

    .auth-page .login-form .form-control {
        min-height: 56px;
        padding: 14px 16px;
        border-radius: 13px;
        font-size: 16px;
    }

    .auth-page .login-form .btn {
        min-height: 56px;
        border-radius: 13px;
        font-size: 16px;
        box-shadow: 0 10px 24px rgba(21, 62, 92, .2);
    }
}

@media (max-width: 575.98px) and (max-height: 680px) {
    .auth-page .login-card {
        justify-content: flex-start;
        padding-top: max(24px, env(safe-area-inset-top));
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }

    .auth-page .login-brand {
        margin-bottom: 28px;
    }

    .auth-page .login-heading {
        margin-bottom: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}


/* ================================
   DETAIL PAGES
================================ */

.detail-hero {
    position: relative;
    overflow: hidden;
    min-height: 116px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
    padding: 22px 24px;
    border: 1px solid #d8e4ec;
    border-radius: var(--pb-radius);
    background:
        radial-gradient(circle at 92% 15%, rgba(57, 129, 164, .13), transparent 30%),
        linear-gradient(135deg, #ffffff 0%, #f5f9fc 100%);
    box-shadow: var(--pb-shadow-sm);
}

.detail-hero::after {
    content: "";
    position: absolute;
    top: -70px;
    right: -55px;
    width: 180px;
    height: 180px;
    border: 28px solid rgba(21, 62, 92, .025);
    border-radius: 50%;
    pointer-events: none;
}

.detail-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.detail-avatar {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 58px;
    border-radius: 16px;
    background: linear-gradient(145deg, var(--pb-primary), #2b6689);
    color: white;
    box-shadow: 0 10px 22px rgba(21, 62, 92, .2);
    font-size: 22px;
    font-weight: 800;
}

.detail-avatar-project {
    background: linear-gradient(145deg, #173f5d, #28759b);
}

.detail-avatar-project .bi {
    font-size: 24px;
}

.detail-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: var(--pb-primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .9px;
    text-transform: uppercase;
}

.detail-identity h2 {
    margin: 0 0 7px;
    color: #152b3a;
    font-size: clamp(18px, 2vw, 23px);
    font-weight: 750;
    letter-spacing: -.4px;
}

.detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: var(--pb-muted);
    font-size: 12px;
}

.detail-meta > span:not(.status-badge) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.detail-hero > .d-flex {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
}

.project-metrics .metric-card {
    min-height: 126px;
    padding-top: 18px;
}

.metric-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 13px;
    border-radius: 10px;
    background: var(--pb-primary-soft);
    color: var(--pb-primary);
    font-size: 16px;
}

.metric-card-received .metric-icon,
.metric-card-result .metric-icon {
    background: #e5f6ed;
    color: #16714a;
}

.metric-card-pending .metric-icon {
    background: #fff4da;
    color: #95690d;
}

.metric-card-expense .metric-icon {
    background: #fcebea;
    color: #a53d37;
}

.project-metrics .metric-value {
    margin-top: 6px;
    font-size: clamp(17px, 1.6vw, 22px);
}

.panel-title-group {
    display: flex;
    align-items: center;
    gap: 11px;
}

.panel-title-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    border-radius: 10px;
    background: var(--pb-primary-soft);
    color: var(--pb-primary);
    font-size: 16px;
}

.panel-title-group small {
    display: block;
    margin-top: 2px;
    color: var(--pb-muted);
    font-size: 11px;
}

.detail-summary-panel .panel-body {
    background: #fbfcfd;
}

.detail-info-grid {
    display: grid;
    gap: 12px;
}

.project-detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.contact-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-info-grid > [class*="col-"] {
    width: auto;
    max-width: none;
    min-height: 78px;
    padding: 14px 16px;
    border: 1px solid #e4ebf1;
    border-radius: 11px;
    background: white;
}

.detail-info-grid > .col-12 {
    grid-column: 1 / -1;
}

.detail-info-grid small {
    display: block;
    margin-bottom: 6px;
    color: #71808f !important;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .45px;
    text-transform: uppercase;
}

.detail-info-grid small + div,
.detail-info-grid .fw-semibold {
    color: #223746;
    font-size: 13px;
    line-height: 1.5;
}

.detail-value-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--pb-primary);
    font-weight: 600;
    text-decoration: none;
}

.detail-value-link:hover {
    text-decoration: underline;
}

.detail-tabs {
    gap: 7px;
    padding: 5px;
    border: 1px solid var(--pb-border);
    border-radius: 12px;
    background: #eef3f6;
}

.detail-tabs .nav-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 13px;
    border: 0;
    border-radius: 9px;
    color: #5b6c7c;
}

.detail-tabs .nav-link:hover {
    background: rgba(255, 255, 255, .58);
}

.detail-tabs .nav-link.active {
    border: 0;
    background: white;
    color: var(--pb-primary);
    box-shadow: 0 3px 10px rgba(15, 35, 50, .08);
}

.detail-tab-content {
    overflow: hidden;
}

.detail-tab-content .panel-header {
    background: #fbfcfd;
}

.detail-tab-content .operation-row {
    margin: 0 -4px;
    padding: 16px 8px;
    border-radius: 9px;
    transition: background-color .18s ease;
}

.detail-tab-content .operation-row:hover {
    background: #f6f9fb;
}

.detail-tab-content .operation-row > div:first-child {
    min-width: 0;
}

.detail-back-action {
    margin-top: 18px;
}

@media (max-width: 991.98px) {
    .project-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-metrics > div {
        flex: 0 0 50%;
        width: 50%;
    }
}

@media (max-width: 767.98px) {
    .detail-hero {
        min-height: 0;
        align-items: stretch;
        flex-direction: column;
        gap: 18px;
        padding: 18px;
    }

    .detail-avatar {
        width: 50px;
        height: 50px;
        flex-basis: 50px;
        border-radius: 14px;
        font-size: 19px;
    }

    .detail-hero > .d-flex {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .detail-hero > .d-flex form,
    .detail-hero > .d-flex .btn {
        width: 100%;
    }

    .contact-detail-grid,
    .project-detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-info-grid > .col-12 {
        grid-column: auto;
    }

    .detail-tabs {
        margin-inline: -2px;
    }

    .detail-tabs .nav-link {
        min-height: 40px;
        padding: 8px 12px;
    }

    .detail-tab-content .panel-body {
        padding: 8px 16px;
    }

    .detail-tab-content .operation-row {
        margin: 0;
        padding: 16px 0;
        border-radius: 0;
    }
}

@media (max-width: 575.98px) {
    .project-metrics > div {
        flex: 0 0 100%;
        width: 100%;
    }

    .project-metrics .metric-card {
        min-height: 106px;
        display: grid;
        grid-template-columns: 38px 1fr;
        grid-template-rows: auto auto;
        column-gap: 12px;
        align-content: center;
    }

    .project-metrics .metric-icon {
        grid-row: 1 / 3;
        margin: 0;
    }

    .project-metrics .metric-label,
    .project-metrics .metric-value {
        grid-column: 2;
    }

    .project-metrics .metric-value {
        margin-top: 2px;
    }

    .panel-title-group small {
        display: none;
    }
}
