:root {
    --primary-blue: #2c6dd5;
    --dark-blue: #1c4a91;
    --light-blue: #e8f0fe;
    --border-color: #bbbfc4;
    --border-default: #bbbfc4;
    --input-bg: #ffffff;
    --input-border: #9ca3af;

    /* Semantic Colors - Light Mode Default */
    --bg-body: #f8f9fa;
    --bg-gradient: linear-gradient(135deg, #e2e8f0 0%, #bdc9d7 100%);
    --bg-card: #ffffff;
    --bg-card-rgb: 255, 255, 255;
    --text-main: #333333;
    --text-muted: #6c757d;

    --navbar-bg: #ffffff;
    --table-header-bg: #f8f9fa;
    --table-header-text: #495057;
    --table-row-hover: #f2f2f2;
    --primary-blue-rgb: 44, 109, 213;
    --success-green: #198754;
    --danger-red: #dc3545;
}

/* Dark Mode Overrides */
body.dark-mode {
    --bg-body: #1a1a1a;
    --bg-gradient: linear-gradient(135deg, #1e1e1e 0%, #121212 100%);
    --bg-card: #252525;
    --bg-card-rgb: 37, 37, 37;
    --text-main: #f8f9fa;
    --text-muted: #adb5bd;
    --border-default: #4a4a4a;
    --light-blue: #1a2639;
    /* Darker version of light-blue */
    --border-color: #555555;
    --input-bg: #2d2d2d;
    --input-border: #666666;
    --navbar-bg: #1e1e1e;
    --table-header-bg: #2d2d2d;
    --table-header-text: #e0e0e0;
    --table-row-hover: #2c2c2c;
    --alert-info-bg: #0c344b;
    --alert-info-text: #b6effb;
    --alert-info-border: #0c344b;
}

body {
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    background-size: cover;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
}

/* Privacy Mode (Blur Effect) */
.blur-value {
    transition: filter 0.3s ease, opacity 0.3s ease;
}

body.privacy-mode .blur-value {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
}

.no-privacy {
    filter: none !important;
    -webkit-filter: none !important;
}

/* Reveal on hover for better UX (optional, but premium) */
body.privacy-mode .blur-value:hover {
    filter: blur(0);
    pointer-events: auto;
    user-select: auto;
}

.privacy-toggle .bi-eye-slash-fill {
    display: none;
}

body.privacy-mode .privacy-toggle .bi-eye-fill {
    display: none;
}

body.privacy-mode .privacy-toggle .bi-eye-slash-fill {
    display: inline-block;
}

.navbar {
    background-color: var(--navbar-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-blue) !important;
}

.btn-primary {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-primary:hover {
    background-color: var(--dark-blue);
    border-color: var(--dark-blue);
}

.card {
    border: 1px solid rgba(var(--primary-blue-rgb), 0.1);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    border-radius: 1rem;
    background-color: rgba(var(--bg-card-rgb), 0.75) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    overflow: hidden !important;
}

.card-header {
    background-color: transparent !important;
    border-bottom: none !important;
    font-weight: 600;
    color: var(--text-main);
}

.text-main-color {
    color: var(--text-main);
}

.text-muted-color {
    color: var(--text-muted);
}

/* Specific Invoice Layout styles */
.invoice-container {
    background-color: var(--bg-card);
    padding: 3rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 1rem;
    overflow: hidden;
}

.invoice-header-line {
    border-top: 8px solid var(--primary-blue);
    margin-bottom: 20px;
}

.table-invoice thead th {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 12px;
}

/* Global Form Check / Switch Visibility Improvements */
.form-check-input {
    border: 1.5px solid var(--input-border) !important;
    background-color: var(--input-bg);
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-check-input:checked {
    background-color: var(--primary-blue) !important;
    border-color: var(--primary-blue) !important;
}

.form-switch .form-check-input {
    border: 1.5px solid var(--input-border) !important;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-blue-rgb), 0.25) !important;
    border-color: var(--primary-blue) !important;
}

/* Global Standard UI Classes (from PG Module) */
.bg-primary-blue {
    background-color: var(--primary-blue) !important;
}

.text-primary-blue {
    color: var(--primary-blue) !important;
}

.bg-primary-gradient {
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--primary-blue) 100%) !important;
}

/* Standardized Table Headers */
.table-thead-standard {
    background-color: var(--primary-blue) !important;
    color: white !important;
}

.table-thead-standard th {
    border: none !important;
    padding: 1rem 0.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.5px !important;
}

/* Card and Shadow Standard */
.card-standard {
    border: none !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05) !important;
    border-radius: 1rem !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden !important;
}

.card-standard:hover {
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.08) !important;
}

/* Modal Standardization */
.modal-standard .modal-content {
    border: none !important;
    border-radius: 1rem !important;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
    overflow: hidden;
}

.modal-standard .modal-header {
    background-color: #f8f9fa;
    border-bottom: none !important;
    padding: 1.5rem;
}

.modal-standard .modal-header.bg-primary {
    background-color: var(--primary-blue) !important;
    color: white !important;
}

.modal-standard .modal-title {
    font-weight: 700;
    letter-spacing: -0.5px;
}

.modal-standard .modal-body {
    padding: 1.5rem;
}

.modal-standard .modal-footer {
    background-color: #f8f9fa;
    border-top: none !important;
    padding: 1.25rem 1.5rem;
}

/* Animatio Helpers */
.animate-fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.text-primary-blue {
    color: var(--primary-blue);
}

.bg-light-blue {
    background-color: var(--light-blue);
}

.bg-purple-subtle {
    background-color: #f3e8ff;
}

.text-purple {
    color: #9333ea;
}

.card-accent-purple {
    border-left: 4px solid #9333ea !important;
}

.sidebar {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--dark-blue) 0%, #0d1b3e 100%);
    border-right: none;
    color: white;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-right: 0 !important;
    overflow-x: hidden;
}

/* Remove gutter padding from sidebar column in desktop */
@media (min-width: 768px) {

    .col-md-3.sidebar,
    .col-lg-2.sidebar {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

.nav-link {
    color: #444;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    margin: 4px 10px;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--light-blue);
    color: var(--primary-blue);
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}


/* Regra removida pois causava conflito e era órfã de funcionalidade */

.sidebar .nav-link.active {
    background-color: var(--primary-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-right: 10px !important;
}

/* Sidebar Footer Adjustments */
.sidebar .custom-sidebar-footer {
    padding: 0 5px;
}

.sidebar .custom-sidebar-footer .nav-link {
    font-size: 0.85rem !important;
    padding: 0.5rem 0.4rem !important;
    gap: 5px !important;
}

.sidebar .custom-sidebar-footer .nav-link i {
    font-size: 1rem !important;
    width: 18px !important;
}

/* Enhancing Global Nav Tabs (Reports, Settings) */
.nav-tabs .nav-link {
    border: none !important;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-bottom: 2px solid transparent !important;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-blue);
    background-color: var(--light-blue);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--primary-blue) !important;
    background-color: transparent !important;
    font-weight: 700 !important;
    border-bottom: 3px solid var(--primary-blue) !important;
}

.nav-tabs {
    border-bottom: none !important;
}

.border-bottom {
    border-bottom: none !important;
}

.border-top {
    border-top: none !important;
}

body.dark-mode .nav-tabs .nav-link.active {
    color: #ffffff !important;
    border-bottom-color: var(--primary-blue) !important;
}

/* Dark Mode Specific Adjustments */
body.dark-mode .list-group-item {
    background-color: var(--bg-card);
    color: var(--text-main);
    border-color: var(--border-default);
}

body.dark-mode .list-group-item-action:hover {
    background-color: var(--table-row-hover);
    color: var(--text-main);
}

body.dark-mode .list-group-item.active {
    background-color: var(--primary-blue) !important;
    border-color: var(--primary-blue) !important;
    color: #ffffff !important;
}

body.dark-mode .form-text,
body.dark-mode .text-muted {
    color: #a0a0a0 !important;
}

body.dark-mode .alert-info {
    background-color: var(--alert-info-bg);
    color: var(--alert-info-text);
    border-color: var(--alert-info-border);
}

body.dark-mode .bg-light {
    background-color: #2c2c2c !important;
}

body.dark-mode .bg-white {
    background-color: var(--bg-card) !important;
}

body.dark-mode .bg-light-blue {
    background-color: #1a2639 !important;
}

body.dark-mode .card-header.bg-white {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
}

body.dark-mode .table-light {
    --bs-table-bg: #2d2d2d;
    --bs-table-color: #f8f9fa;
}

body.dark-mode .bg-success-subtle {
    background-color: #0d2a1c !important;
    color: #a3cfbb !important;
}

body.dark-mode .bg-warning-subtle {
    background-color: #332701 !important;
    color: #ffda6a !important;
}

body.dark-mode .bg-info-subtle {
    background-color: #0c344b !important;
    color: #b6effb !important;
}

body.dark-mode .bg-danger-subtle {
    background-color: #2c0b0e !important;
    color: #f8d7da !important;
}

.nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
}

/* Mobile Responsiveness Improvements */
@media (max-width: 768px) {
    #sidebar {
        display: none !important;
    }

    .mobile-nav {
        background-color: var(--dark-blue) !important;
        padding: 0.6rem 1rem;
        border-bottom: 2px solid var(--primary-blue);
    }

    .mobile-nav .navbar-brand {
        color: white !important;
        font-weight: 700;
        letter-spacing: -0.5px;
    }

    .mobile-nav .nav-link {
        color: rgba(255, 255, 255, 0.9) !important;
        padding: 0.8rem 1rem;
        font-weight: 500;
    }

    .mobile-nav .nav-link.active {
        background-color: var(--primary-blue) !important;
        color: white !important;
        border-radius: 6px;
    }

    .mobile-nav .navbar-toggler:focus,
    .mobile-nav .navbar-toggler:active {
        outline: none !important;
        box-shadow: none !important;
    }

    .mobile-offcanvas-nav .nav-link {
        color: rgba(255, 255, 255, 1) !important;
        padding: 0.8rem 1.5rem !important;
        font-weight: 500;
        border-radius: 0;
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .mobile-offcanvas-nav .nav-link.active {
        background-color: rgba(255, 255, 255, 0.1) !important;
        color: white !important;
        border-left: 4px solid var(--primary-blue);
    }

    /* Reset paddings for footer items in mobile menu */
    .mobile-offcanvas-nav .nav-item.mt-3 .nav-link {
        padding: 0.25rem 0.5rem !important;
        border-bottom: none !important;
    }

    /* Fix white background on click/hover in mobile menu */
    .mobile-offcanvas-nav .nav-link:hover,
    .mobile-offcanvas-nav .nav-link:focus,
    .mobile-offcanvas-nav .nav-link:active,
    .theme-toggle:focus,
    .theme-toggle:active {
        background-color: transparent !important;
        outline: none !important;
        box-shadow: none !important;
    }

    .offcanvas {
        max-width: 260px !important;
    }

    /* Quick Filter Chips */
    .scrollbar-hidden::-webkit-scrollbar {
        display: none;
    }

    .scrollbar-hidden {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .filter-chip {
        transition: all 0.2s ease;
        font-weight: 500 !important;
        border-color: #dee2e6 !important;
    }

    .filter-chip.active {
        box-shadow: 0 4px 10px rgba(13, 110, 253, 0.2);
    }

    .dark-mode .filter-chip {
        border-color: rgba(255, 255, 255, 0.1) !important;
        color: #adb5bd;
    }

    .dark-mode .filter-chip.active {
        background-color: var(--primary-blue);
        color: white !important;
    }

    .offcanvas-header {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 1.2rem;
    }

    .offcanvas-body {
        overflow-y: auto;
    }

    .btn-close-white {
        filter: invert(1) grayscale(100%) brightness(200%);
    }

    .content-area {
        padding: 0.75rem !important;
        margin-left: 0 !important;
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        overflow-x: hidden;
    }

    /* Prevent text overflow on mobile */
    .table-invoice td {
        font-size: 0.85rem;
        white-space: normal !important;
        word-break: break-word !important;
    }

    body {
        margin: 0 !important;
        padding: 0 !important;
    }

    .container-fluid {
        padding: 0 !important;
    }

    /* Botões em grid 2x2 em mobile (visualizar.php) */
    .d-flex.gap-2.flex-wrap {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }

    .d-flex.gap-2.flex-wrap .btn,
    .d-flex.gap-2.flex-wrap .btn-outline-secondary {
        width: 100% !important;
        font-size: 0.85rem !important;
        padding: 0.5rem 0.25rem !important;
        margin: 0 !important;
        grid-column: auto !important;
    }

    /* Espaçamento entre tabs e conteúdo em Configurações */
    .nav-tabs {
        margin-bottom: 1rem !important;
    }

    .table-invoice th {
        white-space: normal !important;
    }

    /* Universal fix for horizontal scroll on mobile */
    .row {
        margin: 0 !important;
        padding: 0 !important;
    }

    .col-md-6,
    .col-md-4,
    .col-md-3,
    .col-lg-2,
    .col-lg-10 {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* Wizard / Invoice Items Table to Vertical Stack */
    #items-table,
    #items-table thead,
    #items-table tbody,
    #items-table th,
    #items-table td,
    #items-table tr {
        display: block !important;
        width: 100% !important;
    }

    #items-table thead {
        display: none !important;
    }

    #items-table tr {
        margin-bottom: 1.5rem;
        border: 1px solid var(--border-color);
        border-radius: 10px;
        padding: 1rem;
        background: var(--bg-card);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    }

    #items-table td {
        border: none !important;
        padding: 0.5rem 0 !important;
        position: relative;
    }

    #items-table td:before {
        content: attr(data-label);
        display: block;
        font-weight: bold;
        font-size: 0.75rem;
        color: var(--text-muted);
        margin-bottom: 0.25rem;
        text-transform: uppercase;
    }

    .item-total {
        text-align: left !important;
        border-top: 1px solid var(--border-color) !important;
        margin-top: 0.5rem;
        padding-top: 1rem !important;
    }

    /* Spacing for stacked filter columns */
    form.row.g-2>[class*="col-"] {
        margin-bottom: 0.5rem;
    }

    form.row.g-2>[class*="col-"]:last-child {
        margin-bottom: 0;
    }
}

/* Mobile-Specific Styles for Invoice/Quote Visualization - PROPORTIONAL SCALING */
@media (max-width: 768px) {

    /* Container - Scale to fit screen width while maintaining layout */
    .invoice-container {
        max-width: 100% !important;
        width: 100% !important;
        padding: 1rem !important;
        margin: 0 auto !important;
        box-shadow: none !important;
        border: 1px solid #dee2e6;
        transform-origin: top center;
    }

    /* Proportional Font Scaling - Maintain hierarchy */
    .invoice-container h1 {
        font-size: 1.5rem !important;
    }

    .invoice-container h5 {
        font-size: 0.95rem !important;
    }

    .invoice-container h6 {
        font-size: 0.85rem !important;
    }

    .invoice-container .small,
    .invoice-container small {
        font-size: 0.7rem !important;
    }

    .invoice-container p {
        font-size: 0.8rem !important;
    }

    /* Company Header - Reduce proportionally */
    .invoice-container .row.mb-5 p {
        font-size: 0.7rem !important;
        line-height: 1.4 !important;
    }

    .invoice-container .row.mb-5 strong {
        font-size: 0.7rem !important;
    }

    /* Payment Section - Reduce proportionally */
    .invoice-container .row.mt-5 p,
    .invoice-container .row.mt-4 p {
        font-size: 0.7rem !important;
        line-height: 1.4 !important;
    }

    .invoice-container .row.mt-5 strong,
    .invoice-container .row.mt-4 strong {
        font-size: 0.7rem !important;
    }

    .invoice-container .row.mt-5 .small,
    .invoice-container .row.mt-4 .small {
        font-size: 0.65rem !important;
    }

    /* Info Box Labels - Reduce size to prevent wrapping */
    .invoice-container .bg-light-blue .small,
    .invoice-container .bg-light-blue small,
    .invoice-container .bg-light-blue .fw-bold.small {
        font-size: 0.6rem !important;
    }

    .invoice-container .bg-light-blue .row .col-7,
    .invoice-container .bg-light-blue .row .col-5 {
        font-size: 0.7rem !important;
    }

    /* Table - Reduce font size to keep values on same line */
    .invoice-container .table-invoice {
        font-size: 0.6rem !important;
    }

    .invoice-container .table-invoice th,
    .invoice-container .table-invoice td {
        padding: 0.3rem !important;
        white-space: nowrap !important;
    }

    /* Table Body - Specific sizing for item details */
    .invoice-container .table-invoice tbody td {
        font-size: 0.6rem !important;
    }

    /* Item name - Same size as "Total" label */
    .invoice-container .table-invoice tbody td .fw-bold,
    .invoice-container .table-invoice tbody td span.fw-bold {
        font-size: 0.65rem !important;
    }

    /* Item description - Same size as "Subtotal" label */
    .invoice-container .table-invoice tbody td small,
    .invoice-container .table-invoice tbody td .small {
        font-size: 0.6rem !important;
    }

    /* Table Footer - Reduce labels for totals */
    .invoice-container .table-invoice tfoot td {
        font-size: 0.6rem !important;
        padding: 0.4rem !important;
    }

    .invoice-container .table-invoice tfoot .fw-bold {
        font-size: 0.65rem !important;
    }

    .invoice-container .table-invoice tfoot .fs-5 {
        font-size: 0.75rem !important;
    }

    /* Images - Scale proportionally */
    .invoice-container img {
        max-width: 100% !important;
        height: auto !important;
        max-height: 70px !important;
    }

    /* QR Code - Maintain aspect ratio */
    .invoice-container img[src*="qrcode"],
    .invoice-container img[style*="width: 150px"],
    .invoice-container img[style*="width: 120px"] {
        width: 80px !important;
        height: 80px !important;
        max-width: 80px !important;
        max-height: 80px !important;
    }

    /* Reduce spacing proportionally */
    .invoice-container .mb-5 {
        margin-bottom: 0.75rem !important;
    }

    .invoice-container .mb-4 {
        margin-bottom: 0.5rem !important;
    }

    .invoice-container .p-5 {
        padding: 1rem !important;
    }

    .invoice-container .p-4 {
        padding: 0.75rem !important;
    }

    /* Action buttons - Stack on mobile */
    .d-print-none .d-flex {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .d-print-none .btn-group {
        flex-direction: column !important;
        width: 100% !important;
    }

    .d-print-none .btn {
        width: 100% !important;
        margin: 0.25rem 0 !important;
        font-size: 0.85rem !important;
    }
}

/* Extra Small Devices (Smartphones Portrait) - Further scaling */
@media (max-width: 480px) {
    .invoice-container {
        padding: 0.75rem !important;
    }

    .invoice-container h1 {
        font-size: 1.25rem !important;
    }

    .invoice-container h5 {
        font-size: 0.85rem !important;
    }

    /* Company Header - Even smaller for small phones */
    .invoice-container .row.mb-5 p {
        font-size: 0.65rem !important;
    }

    .invoice-container .row.mb-5 strong {
        font-size: 0.65rem !important;
    }

    /* Payment Section - Even smaller for small phones */
    .invoice-container .row.mt-5 p,
    .invoice-container .row.mt-4 p {
        font-size: 0.65rem !important;
    }

    .invoice-container .row.mt-5 strong,
    .invoice-container .row.mt-4 strong {
        font-size: 0.65rem !important;
    }

    .invoice-container .row.mt-5 .small,
    .invoice-container .row.mt-4 .small {
        font-size: 0.6rem !important;
    }

    /* Info Box Labels - Even smaller for small phones */
    .invoice-container .bg-light-blue .small,
    .invoice-container .bg-light-blue small,
    .invoice-container .bg-light-blue .fw-bold.small {
        font-size: 0.55rem !important;
    }

    /* Table - Further reduce to prevent wrapping */
    .invoice-container .table-invoice {
        font-size: 0.55rem !important;
    }

    .invoice-container .table-invoice th,
    .invoice-container .table-invoice td {
        padding: 0.25rem !important;
    }

    /* Table Body - Even smaller for small phones */
    .invoice-container .table-invoice tbody td {
        font-size: 0.55rem !important;
    }

    /* Item name - Slightly larger for readability */
    .invoice-container .table-invoice tbody td .fw-bold,
    .invoice-container .table-invoice tbody td span.fw-bold {
        font-size: 0.6rem !important;
    }

    /* Item description - Match body size */
    .invoice-container .table-invoice tbody td small,
    .invoice-container .table-invoice tbody td .small {
        font-size: 0.55rem !important;
    }

    /* Table Footer - Smaller totals */
    .invoice-container .table-invoice tfoot td {
        font-size: 0.55rem !important;
    }

    .invoice-container .table-invoice tfoot .fw-bold {
        font-size: 0.6rem !important;
    }

    .invoice-container .table-invoice tfoot .fs-5 {
        font-size: 0.7rem !important;
    }

    .invoice-container img {
        max-height: 60px !important;
    }

    .invoice-container img[src*="qrcode"],
    .invoice-container img[style*="width: 150px"],
    .invoice-container img[style*="width: 120px"] {
        width: 70px !important;
        height: 70px !important;
        max-width: 70px !important;
        max-height: 70px !important;
    }
}

/* Global Fixes */
.container-fluid {
    width: 100%;
    overflow-x: hidden;
}

.row {
    margin-right: 0;
    margin-left: 0;
}

.bg-primary-dark {
    background-color: #0d1b3e !important;
}

/* Dashboard Card Accents */
.card-accent-primary {
    border-left: 5px solid var(--primary-blue) !important;
}

.card-accent-success {
    border-left: 5px solid #198754 !important;
}

.card-accent-warning {
    border-left: 5px solid #ffc107 !important;
}

.card-accent-info {
    border-left: 5px solid #0dcafec9 !important;
}

.bg-success-subtle {
    background-color: #e6ffed !important;
}

.bg-warning-subtle {
    background-color: #fffde6 !important;
}

/* Print Overrides */
@media print {

    body,
    html {
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }

    .mobile-nav,
    #sidebar,
    .d-print-none {
        display: none !important;
    }
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
}

@media (max-width: 768px) {
    .login-container {
        align-items: flex-start !important;
        padding-top: 10vh !important;
    }

    .login-card .card-body {
        padding: 1.5rem !important;
    }
}

.login-card {
    width: 100%;
    max-width: 400px;
    border: none;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.2);
    border-radius: 1rem;
    overflow: hidden;
}

.login-card .card-body {
    padding: 2.5rem;
}

/* Seguranca e PWA */
.mask-security {
    -webkit-text-security: disc !important;
    text-security: disc !important;
}

.d-standalone-block {
    display: none !important;
}

@media (display-mode: standalone) {
    .pwa-only-hide {
        display: none !important;
    }

    .d-standalone-block {
        display: block !important;
    }

    .login-card .card-body {
        padding: 3rem 2rem !important;
    }
}

/* Fallback para iOS Safari que ignora display-mode: standalone */
body.pwa-standalone .pwa-only-hide {
    display: none !important;
}

body.pwa-standalone .d-standalone-block {
    display: block !important;
}

body.pwa-standalone .login-card .card-body {
    padding: 3rem 2rem !important;
}


/* DARK MODE COMPONENT FIXES */
body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode .input-group-text {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-main);
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background-color: var(--input-bg);
    border-color: var(--primary-blue);
    color: var(--text-main);
}

/* Forçar contraste na tela de login */
body.dark-mode .login-card .form-control::placeholder {
    color: #ced4da !important;
    opacity: 1 !important;
}

body.dark-mode .login-card .form-control {
    color: #ffffff !important;
}

body.dark-mode .login-card .form-label {
    color: #ffffff !important;
}

body.dark-mode .table {
    color: var(--text-main);
    border-color: var(--border-color);
}

body.dark-mode .table-hover tbody tr:hover {
    color: var(--text-main);
    background-color: var(--table-row-hover);
}

body.dark-mode .table thead th {
    background-color: var(--table-header-bg);
    color: var(--text-main);
    border-bottom-color: var(--border-color);
}

/* Fix Invoice Table Headers - Make them consistent (Dark) */
body.dark-mode .table-invoice thead th {
    background-color: #000000 !important;
    color: var(--text-main) !important;
    border-bottom: 1px solid var(--border-color);
}

body.dark-mode .text-muted,
body.dark-mode .text-secondary,
body.dark-mode .text-muted-color {
    color: var(--text-muted) !important;
}

/* Fix .text-dark and text colors in Dark Mode */
body.dark-mode .text-dark,
body.dark-mode .card-title,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
    color: var(--text-main) !important;
}

body.dark-mode .modal-content {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    border-radius: 1rem !important;
    overflow: hidden;
}

body.dark-mode .modal-header {
    border-color: var(--border-color);
    border-bottom-width: 1.5px !important;
}

/* Fix Bootstrap table-light in Dark Mode - Force BLACK for Headers, CARD BG for Rows */
body.dark-mode .table-light,
body.dark-mode .table-light th,
body.dark-mode .table-light td,
body.dark-mode .table thead th {
    background-color: #000000 !important;
    /* Headers Black */
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Force Table Cells to be Dark (Card Background) */
body.dark-mode .table tbody td,
body.dark-mode .table tbody th {
    background-color: var(--bg-card) !important;
    /* Rows Dark Grey */
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Fix btn-light in Dark Mode (Action buttons) - Higher Contrast */
body.dark-mode .btn-light {
    background-color: #3a3a3a !important;
}

/* PWA Mobile Optimizations */
@media (max-width: 768px) {
    body {
        -webkit-tap-highlight-color: transparent;
        overscroll-behavior-y: contain;
        /* Prevents pull-to-refresh pull-away feel */
    }

    .content-area {
        padding-bottom: 80px !important;
        /* Extra space for mobile browser bars */
    }
}

/* Install Prompt Styles */
#pwa-install-banner {
    display: none;
    position: fixed;
    bottom: 30px;
    left: 10px;
    right: 10px;
    background: var(--primary-blue);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    z-index: 99999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    bottom: calc(30px + env(safe-area-inset-bottom));
    max-width: calc(100% - 20px);
}

#pwa-install-banner .d-flex {
    flex-wrap: wrap;
    gap: 10px;
}

#pwa-install-banner .pe-3 {
    flex: 1 1 200px;
    /* Allow text to grow but not crush button */
    min-width: 0;
}

#pwa-install-banner strong {
    font-size: 0.9rem;
    line-height: 1.2;
    display: block;
    white-space: normal;
    word-break: break-word;
}

#pwa-install-banner span {
    font-size: 0.75rem;
    opacity: 0.9;
    display: block;
    margin-top: 2px;
    white-space: normal;
    word-break: break-word;
}

#pwa-install-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

body.dark-mode .btn-light:hover {
    background-color: var(--border-color);
    color: white;
}

body.dark-mode .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

body.dark-mode .card-footer,
body.dark-mode .bg-light,
body.dark-mode .bg-white {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color);
}

body.dark-mode .list-group-item {
    background-color: var(--bg-card);
    color: var(--text-main);
    border-color: var(--border-color);
}

/* Dashbord Fixes */
.revenue-icon-light-fix {
    opacity: 0.8 !important;
    color: #fff !important;
    z-index: 5;
}

/* Global Dark Mode Overrides - VERY SPECIFIC */
body.dark-mode {
    color: var(--text-main) !important;
}

body.dark-mode .card,
body.dark-mode .modal-content,
body.dark-mode .card-body,
body.dark-mode .card-footer,
body.dark-mode .card-header {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
    border-width: 1px !important;
}

body.dark-mode label,
body.dark-mode .form-label,
body.dark-mode .col-form-label,
body.dark-mode .text-muted,
body.dark-mode .text-muted-color,
body.dark-mode small,
body.dark-mode .small,
body.dark-mode .badge:not(.bg-primary):not(.bg-success):not(.bg-danger):not(.bg-warning):not(.bg-info) {
    color: var(--text-main) !important;
}

body.dark-mode .text-dark,
body.dark-mode .card-title,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode p,
body.dark-mode span,
body.dark-mode td,
body.dark-mode th {
    color: var(--text-main) !important;
}

/* Pagination Dark Mode Fixes */
body.dark-mode .pagination .page-link {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--primary-blue) !important;
}

body.dark-mode .pagination .page-item.active .page-link {
    background-color: var(--primary-blue) !important;
    border-color: var(--primary-blue) !important;
    color: #fff !important;
}

body.dark-mode .pagination .page-item.disabled .page-link {
    background-color: var(--bg-body) !important;
    color: var(--text-muted) !important;
    border-color: var(--border-color) !important;
}

/* Ensure background colors behave */
body.dark-mode .bg-light,
body.dark-mode .bg-white {
    background-color: var(--bg-body) !important;
    color: var(--text-main) !important;
}

body.dark-mode .input-group-text,
body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--text-main) !important;
}

/* Dark Mode Refinements for Form Elements */
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #adb5bd !important;
    opacity: 0.8 !important;
}

body.dark-mode .form-label,
body.dark-mode label {
    color: #e0e0e0 !important;
    font-weight: 500 !important;
}

/* Specific fix for filter inputs in dark mode */
body.dark-mode .input-group-text i {
    color: #adb5bd !important;
}

body.dark-mode .form-control:focus::placeholder {
    color: #ced4da !important;
}

body.dark-mode .border,
body.dark-mode .border-bottom,
body.dark-mode .border-top {
    border-color: var(--border-color) !important;
}

/* --- REFINAMENTOS DE UI: BOTÕES DE AÇÃO --- */
.actions-group {
    display: inline-flex !important;
    gap: 2px !important;
    align-items: center;
}

.actions-group .btn {
    margin: 0 !important;
    padding: 0.25rem 0.4rem !important;
}

/* Dashboard Activity specifically */
#activity-feed p,
#activity-feed span {
    color: inherit;
}

/* Theme Toggle Styling */
.theme-icon {
    color: #FFD700 !important;
}

/* --- REFINAMENTOS DE UI: MODO ESCURO (CONFIGURAÇÕES) --- */

/* 1. Destaque de Categoria Ativa (Sidebar) */
body.dark-mode #settings-tabs .list-group-item.active {
    background-color: #2c6dd5 !important;
    color: #ffffff !important;
    border-color: #2c6dd5 !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(44, 109, 213, 0.4) !important;
    z-index: 5;
}

body.dark-mode #settings-tabs .list-group-item:not(.active) {
    background-color: #1e1e1e !important;
    color: #f8f9fa !important;
    border-color: #404040 !important;
}

body.dark-mode #settings-tabs .list-group-item:hover:not(.active) {
    background-color: #2c2c2c !important;
    color: #2c6dd5 !important;
}

/* 2. Contraste de Textos Auxiliares (Form-text / Text-muted) */
body.dark-mode .tab-content .form-text,
body.dark-mode .tab-content .text-muted,
body.dark-mode .tab-content .small,
body.dark-mode .tab-content small {
    color: #b0b0b0 !important;
}

/* 3. Blocos Premium: Segurança PWA (Verde) e Lembretes (Azul) */

/* Segurança PWA - Apenas o Alerta em Verde */
body.dark-mode #tab-security .alert-info,
body.dark-mode .alert-success {
    background-color: rgba(20, 83, 45, 0.4) !important;
    color: #4ade80 !important;
    border: 1px solid rgba(74, 222, 128, 0.5) !important;
}

/* Alertas de Aviso (Warning) no Modo Escuro - Ex: NFS-e Config */
body.dark-mode .alert-warning {
    background-color: rgba(255, 193, 7, 0.15) !important;
    color: #ffda6a !important;
    border: 1px solid rgba(255, 193, 7, 0.3) !important;
}

/* Lembretes Proativos - Apenas o Alerta em Azul/Cyan */
body.dark-mode #tab-reminders .alert-info,
body.dark-mode .alert-info {
    background-color: rgba(12, 36, 58, 0.5) !important;
    border: 1px solid rgba(56, 189, 248, 0.5) !important;
    color: #7dd3fc !important;
}

/* Tags Code no Modo Escuro */
body.dark-mode code {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ff79c6 !important;
    /* Lighter pink for contrast */
    padding: 2px 4px;
    border-radius: 4px;
}

.input-group {
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1.5px solid var(--input-border);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group:focus-within {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-blue-rgb), 0.25);
}

.input-group .form-control,
.input-group .input-group-text,
.input-group .form-select {
    border: none !important;
    border-radius: 0 !important;
}

.form-control,
.form-select {
    border-radius: 0.75rem !important;
    border: 1.5px solid var(--input-border) !important;
}

/* Customização de Input File no Modo Escuro */
body.dark-mode input[type="file"]::file-selector-button {
    background-color: #3a3a3a;
    color: #f8f9fa;
    border: 1px solid #404040;
    border-radius: 4px;
    padding: 2px 10px;
    margin-right: 10px;
    transition: background-color 0.2s;
}

body.dark-mode input[type="file"]::file-selector-button:hover {
    background-color: #4a4a4a;
}

/* Ajuste de cards genéricos e outros elementos para seguir o padrão do sistema */
body.dark-mode .card,
body.dark-mode .tab-content .card,
body.dark-mode .tab-content .card-header {
    background-color: rgba(var(--bg-card-rgb), 0.6) !important;
    border-color: #404040 !important;
    color: #f8f9fa !important;
}

/* Command Palette (Spotlight Style) */
.command-palette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.command-palette-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.command-palette-container {
    width: 100%;
    max-width: 600px;
    background: var(--card-bg, #fff);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
    transform: translateY(-20px) scale(0.98);
    transition: transform 0.2s ease;
}

.command-palette-overlay.show .command-palette-container {
    transform: translateY(0) scale(1);
}

.command-palette-search {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.command-palette-search i {
    font-size: 1.2rem;
    color: #6c757d;
    margin-right: 15px;
}

.command-palette-search input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 1.1rem;
    background: transparent;
    color: #212529;
}

.command-palette-results {
    overflow-y: auto;
    padding: 10px 0;
}

.command-palette-category {
    padding: 8px 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    background: rgba(0, 0, 0, 0.02);
}

.command-palette-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    color: #212529;
    text-decoration: none;
}

.command-palette-item:hover,
.command-palette-item.active {
    background: rgba(13, 110, 253, 0.08);
    border-left-color: #0d6efd;
}

.command-palette-item i {
    margin-right: 15px;
    font-size: 1.1rem;
    color: #0d6efd;
}

.command-palette-item.active i {
    transform: scale(1.1);
}

.command-palette-no-results {
    padding: 30px 20px;
    text-align: center;
    color: #6c757d;
}

.command-palette-footer {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.02);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: #6c757d;
}

.command-palette-footer kbd {
    background: #eee;
    color: #333;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: inherit;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}

/* Dark Mode Adjustments */
.dark-mode .command-palette-container {
    background: #2d3238;
}

.dark-mode .command-palette-search input,
.dark-mode .command-palette-item {
    color: #eee;
}

.dark-mode .command-palette-category {
    background: rgba(255, 255, 255, 0.05);
}

.dark-mode .command-palette-footer kbd {
    background: #444;
    color: #ccc;
}

/* Desktop specific content area width */
@media (min-width: 768px) {
    .content-area {
        width: calc(100% - 215px) !important;
        flex: 0 0 calc(100% - 215px) !important;
        padding: 1.5rem !important;
    }
}

/* ==========================================================================
   Listagens e Tabelas (Padrão Antigravity)
   ========================================================================== */

/* Padronização de fonte baseada no badge de status */
.table-invoice {
    font-size: 0.75rem !important;
}

.table-invoice thead th {
    font-size: 0.7rem !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 700;
    color: var(--text-muted);
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    background-color: var(--table-header-bg) !important;
}

.table-invoice tbody td {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    vertical-align: middle;
}

/* Ajuste nos badges dentro de tabelas para não ficarem minúsculos */
.table-invoice .badge {
    font-size: 0.85em; /* Proporcional ao pai de 0.75rem */
    padding: 0.35em 0.65em;
}

/* Compactar botões de ação em listas */
.table-invoice .btn-sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
}

.table-invoice .actions-group {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}
/* Global Period Filter Button (Theme Aware) */
.btn-period-filter {
    background-color: var(--bg-card) !important;
    border: 1.5px solid var(--border-default) !important;
    color: var(--text-main) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.2s ease;
}

.btn-period-filter:hover {
    border-color: var(--primary-blue) !important;
    background-color: var(--table-row-hover) !important;
    color: var(--primary-blue) !important;
}

body.dark-mode .btn-period-filter {
    background-color: #2c2c2c !important;
    border-color: #4a4a4a !important;
    color: #f8f9fa !important;
}
/* ==========================================================================

/* ==========================================================================
   AGENDA MODAL & PREMIUM CARDS
   ========================================================================== */
#agenda-results .agenda-card {
    background: var(--bg-card) !important;
    border: none !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

#agenda-results .agenda-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15) !important;
}

#agenda-results .agenda-card:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 3px;
}

.search-group-delicate {
    background: #f8fafc;
    border-radius: 50px;
    padding: 2px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.search-group-delicate:focus-within {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(44, 109, 213, 0.1);
    background: #ffffff;
}

.search-group-delicate .input-group-text,
.search-group-delicate .form-control,
.search-group-delicate .btn {
    border-radius: 50px !important;
    border: none !important;
    background: transparent !important;
}

.search-group-delicate .form-control:focus {
    box-shadow: none !important;
}

.agenda-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.agenda-avatar.pf { background: linear-gradient(135deg, #198754 0%, #2fb344 100%); }
.agenda-avatar.pj { background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); }

.agenda-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: #f8f9fa;
    color: var(--text-muted);
    border: 1px solid #edf2f7;
    text-decoration: none;
    position: relative;
    z-index: 5;
}

.agenda-action-btn:hover {
    background: var(--primary-blue);
    color: white;
    transform: scale(1.1);
}

.agenda-action-btn.whatsapp:hover { background: #25d366; border-color: #25d366; }
.agenda-action-btn.maps:hover { background: #ef4444; border-color: #ef4444; }

body.dark-mode #agenda-results .agenda-card {
    background-color: #252525 !important;
    border: 1px solid #333 !important;
}

/* Custom scrollbar for agenda results */
#modalAgenda .modal-body::-webkit-scrollbar {
    width: 6px;
}
#modalAgenda .modal-body::-webkit-scrollbar-track { background: transparent; }
#modalAgenda .modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

#modalAgenda .modal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   Tablet / iPad (Horizontal) Responsiveness Optimization
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1200px) {
    :root {
        font-size: 11px !important; /* Redução agressiva da escala base */
    }
    
    body {
        font-size: 0.8rem !important;
    }
    
    /* Forçar quebra de linha em containers de Badges/Cards no IRPF */
    .d-flex.align-items-center, 
    .d-flex.justify-content-between {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    
    /* Redução drástica de Cards */
    .card-standard, .card {
        padding: 0.5rem !important;
    }
    
    .card-body {
        padding: 0.5rem !important;
    }
    
    /* Badges Minúsculos para caber na tela */
    .badge {
        font-size: 0.65rem !important;
        padding: 0.3em 0.5em !important;
    }
    
    /* Tabelas Ultra-Compactas (Evitar Rolagem Horizontal) */
    .table-invoice th, 
    .table-invoice td,
    .table th, 
    .table td {
        padding: 0.35rem 0.2rem !important;
        font-size: 0.7rem !important;
        white-space: nowrap; /* Evita quebra de linha interna que encavala */
    }
    
    /* Se necessário quebrar linha em células específicas */
    .table-invoice td.allow-wrap {
        white-space: normal !important;
    }
    
    /* Restaurar tamanho da Sidebar para não ficar desproporcional à barra azul */
    .sidebar .nav-link {
        font-size: 14px !important;
        padding: 0.65rem 1rem !important;
        gap: 10px !important;
    }
    
    .sidebar .nav-link i {
        font-size: 1.1rem !important;
    }
    
    .sidebar .custom-sidebar-footer {
        flex-wrap: nowrap !important;
        padding: 0.25rem !important;
        gap: 2px !important;
    }
    
    .sidebar .custom-sidebar-footer .nav-link,
    .sidebar .custom-sidebar-footer .nav-link-compact {
        font-size: 12px !important;
        padding: 2px 4px !important;
    }
    
    .sidebar h5 {
        font-size: 1.25rem !important;
    }
    
    /* Resetar tamanho da Tela de Login (Manter legível) */
    .login-container, 
    .login-container input, 
    .login-container button, 
    .login-container label, 
    .login-container span {
        font-size: 14px !important;
    }
    
    .login-container h4 {
        font-size: 1.5rem !important;
    }
    
    .login-container .card-footer span {
        font-size: 0.85rem !important;
    }
    
    /* Ajuste para Atividades Recentes no Tablet (Evitar sobreposição de ícones) */
    .activity-item {
        padding-left: 2.5rem !important;
    }
    
    .activity-item i.bi {
        font-size: 0.85rem !important;
        width: 24px !important;
        height: 24px !important;
    }
    
    /* Títulos Menores */
    .h2, h2 { font-size: 1.25rem !important; }
    .h4, h4 { font-size: 0.95rem !important; }
    .h5, h5 { font-size: 0.85rem !important; }
    .h6, h6 { font-size: 0.75rem !important; }
}

/* Sidebar Collapsible Submenu Styling */
.submenu-toggle .submenu-arrow {
    transition: transform 0.25s ease-in-out;
    margin-left: auto;
    font-size: 0.8rem;
}

.submenu-toggle[aria-expanded="true"] .submenu-arrow {
    transform: rotate(180deg);
}

.sidebar .submenu-nav {
    list-style: none;
    padding-left: 0.75rem;
    margin: 0.25rem 0.5rem 0.5rem 1.25rem;
    border-left: 2px solid rgba(255, 255, 255, 0.2);
}

.sidebar .submenu-nav .nav-link {
    font-size: 0.85rem;
    padding: 0.35rem 0.6rem;
    margin: 2px 0;
    color: rgba(255, 255, 255, 0.75);
    border-radius: 6px;
}

.sidebar .submenu-nav .nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.12);
}

.sidebar .submenu-nav .nav-link.active {
    color: #ffffff;
    background-color: var(--primary-blue);
    font-weight: 600;
}

.mobile-offcanvas-nav .submenu-nav {
    list-style: none;
    padding-left: 1.25rem;
    background-color: rgba(0, 0, 0, 0.15);
    margin: 0;
}

.mobile-offcanvas-nav .submenu-nav .nav-link {
    font-size: 0.88rem;
    padding: 0.6rem 1.25rem !important;
}

