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

body {
    background: #f4f7fb;
    color: #1f2937;
    font-size: 0.98rem;
    line-height: 1.45;
    max-width: 100%;
    overflow-x: hidden;
}

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

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

.app-sidebar {
    width: 300px;
    background: linear-gradient(180deg, #0f172a 0%, #162338 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
}

.app-sidebar-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    padding: 1.1rem 1.25rem;
}

.app-sidebar-body {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.app-sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 100%;
    padding: 1rem;
    width: 100%;
}

.app-brand {
    color: #f8fafc;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.app-brand:hover {
    color: #ffffff;
}

.app-eyebrow {
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.sidebar-nav-root {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
}

.app-sidebar .nav-item {
    width: 100%;
}

.app-sidebar .nav-link,
.app-sidebar .dropdown-item {
    border-radius: 12px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.7rem 0.9rem;
    white-space: normal;
}

.app-sidebar .nav-link:hover,
.app-sidebar .dropdown-item:hover,
.app-sidebar .nav-link:focus,
.app-sidebar .dropdown-item:focus {
    background: rgba(59, 130, 246, 0.18);
    color: #f8fafc;
}

.app-sidebar .nav-link.active,
.app-sidebar .dropdown-item.active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
}

.app-sidebar .dropdown-toggle::after {
    margin-left: auto;
    transition: transform 0.18s ease;
}

.app-sidebar .dropdown-menu {
    background: transparent;
    border: 0;
    box-shadow: none;
    display: none;
    margin: 0.2rem 0 0.55rem;
    min-width: 100%;
    padding: 0.15rem 0 0.15rem 1rem;
    position: static;
    transform: none !important;
}

.app-sidebar .dropdown-menu.show {
    display: block;
}

.app-sidebar .dropdown-item {
    font-size: 0.93rem;
    padding-left: 1rem;
}

.app-sidebar .dropdown-toggle {
    cursor: pointer;
    justify-content: space-between;
}

.app-sidebar .dropdown-toggle.active::after,
.app-sidebar .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.app-sidebar .dropdown-divider {
    border-color: rgba(148, 163, 184, 0.16);
}

.app-sidebar .dropdown-header {
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    padding: 0.55rem 0.9rem 0.35rem;
    text-transform: uppercase;
}

.app-sidebar .navbar-nav:last-child {
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    margin-top: auto;
    padding-top: 1rem;
}

.app-sidebar .navbar-nav:last-child .nav-link {
    color: #e2e8f0;
}

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

.app-topbar {
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 20;
}

.app-nav-toggle {
    align-items: center;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 12px;
    color: #0f172a;
    display: none;
    font-size: 1.15rem;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.app-nav-toggle:hover,
.app-nav-toggle:focus {
    background: #eff6ff;
    color: #1d4ed8;
}

.app-sidebar-backdrop {
    display: none;
}

.app-page-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0.2rem 0 0;
}

h1, .h1 {
    font-size: 1.75rem;
}

h2, .h2 {
    font-size: 1.5rem;
}

h3, .h3 {
    font-size: 1.28rem;
}

h4, .h4 {
    font-size: 1.12rem;
}

h5, .h5 {
    font-size: 1rem;
}

h6, .h6 {
    font-size: 0.94rem;
}

.table {
    font-size: 0.95rem;
}

.table-responsive {
    position: static;
    -webkit-overflow-scrolling: touch;
}

.table-responsive .table th,
.card-body.p-0 > .table th,
.card-body.p-0 .table th {
    background: #f8fafc;
    position: static;
    top: auto;
    z-index: auto;
    box-shadow: inset 0 -1px 0 rgba(148, 163, 184, 0.18);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.15;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    vertical-align: middle;
}

.table-responsive .table thead th,
.card-body.p-0 > .table thead th,
.card-body.p-0 .table thead th {
    z-index: auto;
}

.table-responsive .table th a,
.card-body.p-0 > .table th a,
.card-body.p-0 .table th a {
    color: inherit;
}

.normal-grid-headers .table th,
.normal-grid-headers .table thead th {
    position: static;
    top: auto;
    z-index: auto;
    box-shadow: none;
    white-space: normal;
}

.report-masthead {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
    padding: 1.5rem 1.65rem;
}

.report-masthead__identity {
    align-items: flex-start;
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
}

.report-eyebrow {
    color: #0f766e;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
}

.report-title {
    color: #0f172a;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
}

.report-subtitle {
    color: #475569;
    margin: 0.55rem 0 0;
    max-width: 60rem;
}

.report-meta {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

.report-logo {
    height: auto;
    max-width: 170px;
    object-fit: contain;
    width: 170px;
}

.report-actionbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    margin-top: 1.25rem;
}

.report-surface {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.report-kpi-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
    height: 100%;
}

.report-kpi-label {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.report-kpi-value {
    color: #0f172a;
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.1;
    margin-top: 0.35rem;
}

.report-kpi-note {
    color: #64748b;
    font-size: 0.88rem;
    margin-top: 0.45rem;
}

.report-card-header {
    background: #fff;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    padding: 1.05rem 1.25rem 0.95rem;
}

.report-card-title {
    color: #0f172a;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.12rem;
    font-weight: 700;
    margin: 0;
}

.report-card-subtitle {
    color: #64748b;
    font-size: 0.92rem;
    margin: 0.3rem 0 0;
}

.report-highlight-note {
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    color: #334155;
    padding: 0.85rem 1rem;
}

@media (max-width: 767.98px) {
    .report-masthead__identity {
        flex-direction: column-reverse;
    }

    .report-title {
        font-size: 1.5rem;
    }

    .report-logo {
        width: 140px;
    }
}

.form-control,
.form-select,
.btn,
.form-label,
.dropdown-menu,
.alert,
.card-body,
.card-header {
    font-size: 0.95rem;
}

.body-content {
    padding: 1.25rem;
}

.body-content-auth {
    margin: 0 auto;
    max-width: 880px;
    padding: 2.5rem 1.25rem;
}

.body-content .container,
.body-content .container-fluid {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}

.app-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    color: #64748b;
    margin-top: 1.5rem;
    padding: 1rem 0 0;
}

.dl-horizontal dt {
    white-space: normal;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="select"] {
    max-width: 280px;
}

@media (min-width: 992px) {
    .app-shell {
        display: grid;
        grid-template-columns: 300px minmax(0, 1fr);
    }

    .app-shell-auth {
        display: block;
    }

    .app-sidebar {
        display: flex;
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
    }

    .app-sidebar .offcanvas-header {
        display: flex;
    }

    .app-main {
        min-width: 0;
    }
}

@media (max-width: 991.98px) {
    html,
    body {
        overflow-x: hidden;
    }

    .app-shell {
        display: block;
    }

    .app-sidebar {
        bottom: 0;
        height: 100vh;
        left: 0;
        max-width: 88vw;
        position: fixed;
        top: 0;
        transform: translateX(-104%);
        transition: transform 0.22s ease;
        width: 300px;
        z-index: 50;
        overflow-y: auto;
        box-shadow: 0 18px 40px rgba(15, 23, 42, 0.24);
    }

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

    .app-sidebar-backdrop {
        background: rgba(15, 23, 42, 0.44);
        bottom: 0;
        display: block;
        left: 0;
        opacity: 0;
        pointer-events: none;
        position: fixed;
        right: 0;
        top: 0;
        transition: opacity 0.2s ease;
        z-index: 40;
    }

    .app-shell.sidebar-open .app-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .app-nav-toggle {
        display: inline-flex;
    }

    .body-content {
        padding: 1rem;
    }

    .container,
    .container-fluid {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    .form-control,
    .form-select,
    .btn,
    .input-group-text {
        min-height: 44px;
    }

    .report-masthead__identity,
    .report-actionbar,
    .income-statement-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .report-logo,
    .income-statement-logo {
        max-width: 180px;
    }

    body.sidebar-locked {
        overflow: hidden;
    }

    :root {
        --app-sticky-table-top: 52px;
    }
}
