body {
    font-family: var(--font-main, "Inter", "Segoe UI", Arial, sans-serif);
    background: #f5f7fb;
}

:root {
    --brand: #0d6efd;
    --brand-dark: #0a58ca;
    --brand-light: #6ea8fe;
    --font-main: "Inter", "Segoe UI", Arial, sans-serif;
    --login-bg-url: url("../images/login-bg.jpg");
    --text-dark: #0f172a;
    --text-muted: #6b7280;
    --card-bg: #ffffff;
    --card-border: #eef2f7;
}

body.theme-blue {
    --brand: #0d6efd;
    --brand-dark: #0a58ca;
    --brand-light: #6ea8fe;
}

body.theme-emerald {
    --brand: #10b981;
    --brand-dark: #047857;
    --brand-light: #6ee7b7;
}

body.theme-purple {
    --brand: #7c3aed;
    --brand-dark: #5b21b6;
    --brand-light: #a78bfa;
}

body.theme-amber {
    --brand: #f59e0b;
    --brand-dark: #b45309;
    --brand-light: #fcd34d;
}

.card,
.table,
.offcanvas {
    border: 0;
}

.offcanvas .sidebar-nav {
    gap: 0.5rem;
}

.offcanvas .sidebar-link {
    color: #0f172a;
    background: #f8fafc;
}

.offcanvas .sidebar-link.active,
.offcanvas .sidebar-link:hover {
    background: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
}

.offcanvas .sidebar-submenu a {
    color: #475569;
    background: #f1f5f9;
}

.offcanvas .sidebar-submenu a:hover {
    color: #0d6efd;
}

.card {
    border-radius: 1rem;
    background: var(--card-bg);
}

.card-header {
    background: #f8fafc;
    border-bottom: 1px solid #eef2f7;
    font-weight: 600;
}

.form-section {
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 0.9rem;
    padding: 1rem;
}

.form-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.form-inline-muted {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.table-sticky thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.table thead th {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    background: #f8fafc;
}

input[type="date"] {
    min-height: 44px;
    border-radius: 0.6rem;
}

.date-input {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.btn-primary {
    box-shadow: 0 0.5rem 1rem rgba(13, 110, 253, 0.2);
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    flex-direction: column;
    padding: 1.5rem 1rem;
}

.brand {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 2rem;
}

.brand-logo {
    font-size: 1.5rem;
}

.brand-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.sidebar-link.active,
.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-submenu {
    display: none;
    flex-direction: column;
    gap: 0.35rem;
    padding-left: 0.75rem;
}

.sidebar-submenu a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.35rem 0.5rem;
    border-radius: 0.5rem;
}

.sidebar-submenu a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.sidebar-submenu.show {
    display: flex;
}

.sidebar-footer {
    margin-top: auto;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.topbar-title {
    font-weight: 600;
}

.topbar-actions {
    gap: 0.5rem;
    align-items: center;
}

.topbar-user {
    margin-left: 0.5rem;
    color: #6c757d;
}

.content-body {
    padding: 1.5rem;
}

.stat-card {
    border: none;
    box-shadow: 0 0.75rem 1.5rem rgba(15, 23, 42, 0.08);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 600;
}

.erp-header {
    background: linear-gradient(120deg, var(--brand), var(--brand-light));
    color: #fff;
    border-radius: 1rem;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 1rem 2rem rgba(13, 110, 253, 0.2);
}

.erp-header h3 {
    margin: 0 0 0.25rem;
}

.erp-card {
    border: 1px solid var(--card-border);
    box-shadow: 0 0.75rem 1.5rem rgba(15, 23, 42, 0.06);
}

.erp-kpi {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.erp-kpi .icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(13, 110, 253, 0.12);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.quick-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quick-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 1rem 2rem rgba(15, 23, 42, 0.12);
}

.table-striped > tbody > tr.table-balance > * {
    background-color: #ffe4e6 !important;
}

.report-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1.75rem;
    border-radius: 1rem;
    background: linear-gradient(120deg, var(--brand), var(--brand-light));
    color: #fff;
    box-shadow: 0 1rem 2rem rgba(13, 110, 253, 0.25);
}

.theme-picker {
    margin-top: 1.5rem;
}

.theme-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.theme-swatches {
    display: flex;
    gap: 0.5rem;
}

.theme-swatch {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    background: #fff;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-swatch.active {
    transform: scale(1.08);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25);
}

.theme-swatch.blue { background: #0d6efd; }
.theme-swatch.emerald { background: #10b981; }
.theme-swatch.purple { background: #7c3aed; }
.theme-swatch.amber { background: #f59e0b; }

.font-picker {
    margin-top: 1rem;
}

.font-picker .form-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.35rem;
}

.font-picker .form-select {
    border-radius: 0.6rem;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-size: 0.85rem;
}

.font-picker .form-select option {
    color: #0f172a;
}

.report-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.report-table .table thead th {
    background: #f1f5f9;
}

.accordion-button {
    font-weight: 600;
}

.report-nav .list-group-item {
    border: 0;
    padding: 0.75rem 1rem;
}

.report-nav .list-group-item.active {
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    font-weight: 600;
}

body.login-bg {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.65), rgba(10, 88, 202, 0.6)),
        var(--login-bg-url) center/cover no-repeat fixed;
    min-height: 100vh;
}

body.login-bg::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 0;
}

body.login-bg > * {
    position: relative;
    z-index: 1;
}

.login-card {
    border-radius: 1.25rem;
    overflow: hidden;
}

.login-hero {
    background: linear-gradient(135deg, #0d6efd, #6ea8fe);
    color: #fff;
    padding: 1.5rem;
    text-align: center;
}

.login-hero h4 {
    margin-bottom: 0.25rem;
}

@media (max-width: 991px) {
    .content-body {
        padding: 1rem;
    }
}