/* =========================================================
   BRICKBEEZ SIDEBAR
   Fresh version
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background: #f5f7fa;
    color: #1f2937;
    font-family: Arial, Helvetica, sans-serif;
}


/* =========================================================
   MAIN CONTENT
   ========================================================= */

.main-content {
    min-height: 100vh;
    margin-left: 250px;
    transition: margin-left .25s ease;
}

.page-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 25px;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.bb-sidebar {
    position: fixed;

    top: 0;
    left: 0;
    bottom: 0;

    width: 250px;

    background: #111827;
    color: #fff;

    z-index: 5000;

    overflow-x: hidden;
    overflow-y: auto;

    transition: width .25s ease, left .25s ease;
}


/* =========================================================
   BRAND
   ========================================================= */

.bb-sidebar-brand {
    position: relative;

    height: 72px;

    display: flex;

    align-items: center;

    padding: 0 55px 0 20px;

    border-bottom:
        1px solid rgba(255,255,255,.08);
}

.bb-brand-full {
    font-size: 22px;
    font-weight: 700;

    white-space: nowrap;
}

.bb-brand-mini {
    display: none;

    font-size: 23px;
    font-weight: 700;
}

.bb-collapse-button {
    position: absolute;

    top: 20px;
    right: 10px;

    width: 32px;
    height: 32px;

    display: flex;

    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 7px;

    background:
        rgba(255,255,255,.08);

    color: #fff;

    font-size: 24px;

    cursor: pointer;
}

.bb-collapse-button:hover {
    background:
        rgba(255,255,255,.17);
}


/* =========================================================
   USER
   ========================================================= */

.bb-user-box {
    display: flex;

    align-items: center;

    gap: 10px;

    padding: 16px;

    border-bottom:
        1px solid rgba(255,255,255,.08);
}

.bb-user-avatar {
    flex: 0 0 38px;

    width: 38px;
    height: 38px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #374151;

    color: #fff;

    font-weight: 700;
}

.bb-user-details {
    min-width: 0;
}

.bb-user-name {
    font-size: 14px;
    font-weight: 600;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bb-user-role {
    margin-top: 2px;

    color: #9ca3af;

    font-size: 12px;
}


/* =========================================================
   NAVIGATION
   ========================================================= */

.bb-navigation {
    padding: 12px 10px 25px;
}

.bb-nav-link {
    display: flex;

    align-items: center;

    gap: 12px;

    min-height: 44px;

    margin-bottom: 4px;

    padding: 10px 12px;

    border-radius: 8px;

    color: #d1d5db;

    text-decoration: none;

    font-size: 14px;

    transition:
        background .15s ease,
        color .15s ease;
}

.bb-nav-link:hover {
    background:
        rgba(255,255,255,.07);

    color: #fff;
}

.bb-nav-link.active {
    background:
        rgba(255,255,255,.14);

    color: #fff;

    font-weight: 600;
}

.bb-nav-icon {
    width: 22px;

    flex: 0 0 22px;

    text-align: center;

    font-size: 17px;
}

.bb-nav-text {
    white-space: nowrap;
}

.bb-section-title {
    margin-top: 18px;

    padding: 7px 12px;

    color: #6b7280;

    font-size: 10px;
    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: .08em;
}

.bb-logout {
    margin-top: 5px;
}


/* =========================================================
   DESKTOP COLLAPSED
   ========================================================= */

body.bb-sidebar-collapsed .bb-sidebar {
    width: 72px;
}

body.bb-sidebar-collapsed .main-content {
    margin-left: 72px;
}

body.bb-sidebar-collapsed .bb-sidebar-brand {
    padding: 0;

    justify-content: center;
}

body.bb-sidebar-collapsed .bb-brand-full {
    display: none;
}

body.bb-sidebar-collapsed .bb-brand-mini {
    display: block;
}

body.bb-sidebar-collapsed .bb-collapse-button {
    right: 20px;

    transform: rotate(180deg);
}

body.bb-sidebar-collapsed .bb-user-box {
    justify-content: center;

    padding-left: 0;
    padding-right: 0;
}

body.bb-sidebar-collapsed .bb-user-details {
    display: none;
}

body.bb-sidebar-collapsed .bb-navigation {
    padding-left: 8px;
    padding-right: 8px;
}

body.bb-sidebar-collapsed .bb-nav-link {
    justify-content: center;

    padding-left: 8px;
    padding-right: 8px;
}

body.bb-sidebar-collapsed .bb-nav-text {
    display: none;
}

body.bb-sidebar-collapsed .bb-section-title {
    display: none;
}

body.bb-sidebar-collapsed .bb-nav-icon {
    width: auto;
}


/* =========================================================
   MOBILE HEADER
   ========================================================= */

.bb-mobile-header {
    display: none;
}


/* =========================================================
   MOBILE OVERLAY
   ========================================================= */

.bb-sidebar-overlay {
    display: none;
}


/* =========================================================
   GENERAL PAGE
   ========================================================= */

.page-header {
    margin-bottom: 22px;
}

.page-header h1 {
    margin: 0;

    font-size: 28px;
}

.page-header p {
    margin: 6px 0 0;

    color: #6b7280;

    font-size: 14px;
}


/* =========================================================
   DASHBOARD
   ========================================================= */

.dashboard-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 15px;
}

.dashboard-card {
    padding: 20px;

    background: #fff;

    border-radius: 15px;

    box-shadow:
        0 4px 18px rgba(0,0,0,.05);
}

.card-label {
    color: #6b7280;

    font-size: 13px;
}

.card-value {
    margin-top: 8px;

    font-size: 25px;
    font-weight: 700;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.primary-button,
.secondary-button,
.danger-button,
.success-button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 42px;

    padding: 10px 16px;

    border-radius: 9px;

    text-decoration: none;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
}

.primary-button {
    background: #111827;
    color: #fff;
}

.secondary-button {
    background: #fff;
    color: #111827;

    border: 1px solid #e5e7eb;
}

.danger-button {
    background: #dc2626;
    color: #fff;
}

.success-button {
    background: #15803d;
    color: #fff;
}


/* =========================================================
   FORMS
   ========================================================= */

.form-card {
    width: 100%;
    max-width: 850px;

    margin: 0 auto;

    padding: 22px;

    background: #fff;

    border-radius: 15px;

    box-shadow:
        0 4px 18px rgba(0,0,0,.05);
}

.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0,1fr));

    gap: 17px;
}

.form-group {
    margin-bottom: 3px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;

    margin-bottom: 7px;

    font-size: 13px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea,
.form-control {
    width: 100%;

    padding: 12px 13px;

    border: 1px solid #d1d5db;

    border-radius: 9px;

    background: #fff;

    color: #111827;

    font-size: 15px;
}

.form-group textarea {
    min-height: 110px;

    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-control:focus {
    outline: none;

    border-color: #6b7280;

    box-shadow:
        0 0 0 3px rgba(107,114,128,.12);
}


/* =========================================================
   TABLE
   ========================================================= */

.table-card {
    background: #fff;

    border-radius: 15px;

    overflow: hidden;

    box-shadow:
        0 4px 18px rgba(0,0,0,.05);
}

.table-wrapper {
    width: 100%;

    overflow-x: auto;

    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;

    min-width: 700px;

    border-collapse: collapse;
}

.data-table th {
    padding: 13px 15px;

    background: #f9fafb;

    color: #6b7280;

    text-align: left;

    border-bottom:
        1px solid #e5e7eb;

    font-size: 12px;
}

.data-table td {
    padding: 14px 15px;

    border-bottom:
        1px solid #f0f1f3;

    font-size: 14px;
}


/* =========================================================
   ALERT
   ========================================================= */

.alert {
    padding: 12px 14px;

    margin-bottom: 18px;

    border-radius: 9px;

    background: #fef3c7;

    color: #92400e;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media screen and (max-width: 768px) {

    /* -----------------------------------------------
       MOBILE HEADER
       ----------------------------------------------- */

    .bb-mobile-header {
        position: fixed;

        top: 0;
        left: 0;
        right: 0;

        height: 58px;

        display: flex;

        align-items: center;

        padding: 0 14px;

        background: #111827;

        color: #fff;

        z-index: 7000;
    }

    .bb-mobile-menu-button {
        width: 42px;
        height: 42px;

        display: flex;

        flex-direction: column;

        align-items: center;
        justify-content: center;

        gap: 5px;

        padding: 0;

        border: 0;

        border-radius: 7px;

        background: transparent;

        cursor: pointer;

        -webkit-tap-highlight-color:
            transparent;

        touch-action: manipulation;
    }

    .bb-mobile-menu-button span {
        display: block;

        width: 23px;
        height: 2px;

        background: #fff;

        border-radius: 2px;
    }

    .bb-mobile-menu-button:active {
        background:
            rgba(255,255,255,.15);
    }

    .bb-mobile-logo {
        margin-left: 10px;

        font-size: 18px;
        font-weight: 700;
    }


    /* -----------------------------------------------
       SIDEBAR
       ----------------------------------------------- */

    .bb-sidebar {
        left: -270px !important;

        width: 260px !important;

        top: 0;
        bottom: 0;

        height: 100vh;

        z-index: 8000;

        transition:
            left .25s ease !important;
    }

    .bb-sidebar.bb-mobile-open {
        left: 0 !important;
    }


    /* -----------------------------------------------
       OVERLAY
       ----------------------------------------------- */

    .bb-sidebar-overlay.bb-overlay-visible {
        display: block;

        position: fixed;

        top: 0;
        left: 0;
        right: 0;
        bottom: 0;

        width: 100%;
        height: 100%;

        background:
            rgba(0,0,0,.45);

        z-index: 7500;
    }


    /* -----------------------------------------------
       HIDE DESKTOP COLLAPSE
       ----------------------------------------------- */

    .bb-collapse-button {
        display: none;
    }


    /* -----------------------------------------------
       MAIN CONTENT
       ----------------------------------------------- */

    .main-content {
        margin-left: 0 !important;

        padding-top: 58px;
    }

    .page-container {
        padding: 16px;
    }


    /* -----------------------------------------------
       DISABLE DESKTOP COLLAPSE ON MOBILE
       ----------------------------------------------- */

    body.bb-sidebar-collapsed .bb-sidebar {
        left: -270px !important;

        width: 260px !important;
    }

    body.bb-sidebar-collapsed .main-content {
        margin-left: 0 !important;
    }

    body.bb-sidebar-collapsed .bb-brand-full {
        display: block;
    }

    body.bb-sidebar-collapsed .bb-brand-mini {
        display: none;
    }

    body.bb-sidebar-collapsed .bb-user-details {
        display: block;
    }

    body.bb-sidebar-collapsed .bb-nav-text {
        display: inline;
    }

    body.bb-sidebar-collapsed .bb-section-title {
        display: block;
    }

    body.bb-sidebar-collapsed .bb-nav-link {
        justify-content: flex-start;
    }


    /* -----------------------------------------------
       DASHBOARD
       ----------------------------------------------- */

    .dashboard-grid {
        grid-template-columns:
            repeat(2, minmax(0,1fr));

        gap: 10px;
    }

    .dashboard-card {
        padding: 15px;
    }

    .card-value {
        font-size: 20px;
    }


    /* -----------------------------------------------
       FORMS
       ----------------------------------------------- */

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: auto;
    }


    /* -----------------------------------------------
       BUTTONS
       ----------------------------------------------- */

    .quick-actions {
        display: grid;

        grid-template-columns: 1fr;

        gap: 8px;
    }

    .primary-button,
    .secondary-button,
    .danger-button,
    .success-button {
        width: 100%;
    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media screen and (max-width: 420px) {

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .page-container {
        padding: 12px;
    }

}

/* =========================================================
   MOBILE SIDEBAR CLOSE BUTTON
   ========================================================= */

.bb-mobile-close-button {
    display: none;
}


@media screen and (max-width: 768px) {

    .bb-mobile-close-button {
        position: absolute;

        top: 18px;
        right: 14px;

        width: 38px;
        height: 38px;

        display: flex;

        align-items: center;
        justify-content: center;

        padding: 0;

        border: 0;

        border-radius: 8px;

        background:
            rgba(255,255,255,.08);

        color: #ffffff;

        font-size: 28px;

        line-height: 1;

        cursor: pointer;

        -webkit-tap-highlight-color:
            transparent;

        touch-action: manipulation;
    }

    .bb-mobile-close-button:active {
        background:
            rgba(255,255,255,.18);
    }

}
/* =========================================================
   EXPENSE DETAIL TABLE
   ========================================================= */

.expense-detail-card {
    overflow: hidden;
}

.detail-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.detail-table th,
.detail-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.detail-table th {
    width: 220px;
    font-weight: 600;
    background: #f8fafc;
    white-space: nowrap;
}

.detail-table td {
    background: #ffffff;
}

.detail-table tr:last-child th,
.detail-table tr:last-child td {
    border-bottom: 0;
}

.amount-value {
    font-weight: 700;
    font-size: 16px;
}

.description-cell {
    line-height: 1.6;
    white-space: normal;
}

.muted {
    color: #6b7280;
    font-style: italic;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .detail-table {
        font-size: 14px;
    }

    .detail-table th,
    .detail-table td {
        padding: 12px;
    }

    .detail-table th {
        width: 42%;
        white-space: normal;
    }

    .detail-table td {
        width: 58%;
        word-break: break-word;
    }

    .amount-value {
        font-size: 17px;
    }

}
/* =========================================================
   PROFESSIONAL EXPENSE REGISTER
   ========================================================= */

.expense-page-header {
    margin-bottom: 18px;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-toggle {
    cursor: pointer;
}

.filter-icon {
    margin-right: 5px;
}

.filter-arrow {
    margin-left: 5px;
    font-size: 11px;
}


/* =========================================================
   SUMMARY
   ========================================================= */

.expense-summary-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;
    margin-bottom: 16px;
}

.expense-summary-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 18px;
}

.expense-summary-label {
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.expense-summary-value {
    margin-top: 5px;
    font-size: 22px;
    font-weight: 700;
}

.filter-active-text {
    font-size: 16px;
}


/* =========================================================
   FILTER
   ========================================================= */

.expense-filter-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 18px;
    padding: 18px;
}

.expense-filter-header {
    margin-bottom: 15px;
}

.expense-filter-header strong {
    display: block;
    font-size: 15px;
}

.expense-filter-header span {
    display: block;
    margin-top: 3px;
    color: #6b7280;
    font-size: 12px;
}

.expense-filter-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;
}

.expense-filter-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
}

.expense-filter-field input,
.expense-filter-field select {
    width: 100%;
    min-height: 40px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    padding: 8px 10px;
    background: #ffffff;
    box-sizing: border-box;
}

.expense-filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}


/* =========================================================
   REGISTER
   ========================================================= */

.expense-register-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.expense-register-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid #e5e7eb;
}

.expense-register-header h2 {
    margin: 0;
    font-size: 16px;
}

.expense-register-header span {
    color: #6b7280;
    font-size: 12px;
}


/* =========================================================
   TABLE
   ========================================================= */

.expense-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.expense-table {
    width: 100%;
    min-width: 1050px;
    border-collapse: collapse;
    font-size: 13px;
}

.expense-table th {
    padding: 11px 12px;
    text-align: left;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    color: #4b5563;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
}

.expense-table td {
    padding: 13px 12px;
    border-bottom: 1px solid #f0f1f3;
    vertical-align: middle;
}

.expense-table tbody tr:hover {
    background: #fafafa;
}

.expense-date-cell {
    white-space: nowrap;
}

.property-name {
    font-weight: 600;
}

.category-label {
    font-weight: 500;
}

.expense-description strong {
    display: block;
    font-weight: 600;
}

.expense-description small {
    display: block;
    margin-top: 3px;
    color: #6b7280;
}

.expense-amount {
    font-weight: 700;
    white-space: nowrap;
}

.expense-action-cell {
    white-space: nowrap;
}

.table-view-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 5px 11px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.expense-empty-state {
    padding: 50px 20px;
    text-align: center;
}

.expense-empty-icon {
    width: 45px;
    height: 45px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 700;
}

.expense-empty-state h3 {
    margin: 0 0 5px;
    font-size: 16px;
}

.expense-empty-state p {
    margin: 0 0 18px;
    color: #6b7280;
    font-size: 13px;
}


/* =========================================================
   PAGINATION
   ========================================================= */

.expense-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 18px 0;
}

.expense-pagination a {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
}

.expense-pagination a.active {
    font-weight: 700;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .expense-page-header {
        align-items: flex-start;
    }

    .page-header-actions {
        flex-wrap: wrap;
    }

    .expense-summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .expense-filter-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 600px) {

    .expense-page-header {
        display: block;
    }

    .page-header-actions {
        margin-top: 12px;
        width: 100%;
    }

    .page-header-actions > * {
        flex: 1;
    }

    .expense-summary-grid {
        grid-template-columns: 1fr;
    }

    .expense-register-header {
        padding: 14px;
    }

    /*
     * Turn the register into mobile cards.
     */

    .expense-table {
        min-width: 0;
        width: 100%;
    }

    .expense-table thead {
        display: none;
    }

    .expense-table,
    .expense-table tbody,
    .expense-table tr,
    .expense-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .expense-table tr {
        padding: 12px 14px;
        border-bottom: 1px solid #e5e7eb;
    }

    .expense-table td {
        display: grid;
        grid-template-columns: 105px 1fr;
        gap: 10px;
        padding: 6px 0;
        border: 0;
        min-height: 28px;
        align-items: center;
    }

    .expense-table td::before {
        content: attr(data-label);
        color: #6b7280;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .expense-table .expense-description {
        align-items: start;
    }

    .expense-table .expense-action-cell {
        margin-top: 6px;
        padding-top: 10px;
        border-top: 1px solid #f0f1f3;
    }

    .expense-table .expense-action-cell .table-view-button {
        width: 100%;
    }

}