* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Nunito', sans-serif;
}

body {
    background: linear-gradient(135deg, #baecc9 0%, #ebeda2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 30px 30px 30px;
    color: #757575;
}

.boxed-container {
    width: 100%;
    /*max-width: 1600px;*/
    background-color: #636d79;
    border-radius: 40px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Sidebar */
.sidebar {
    width: 320px;
    min-width: 320px;
    flex-shrink: 0;
    background-color: #636d79;
    color: #ffffff;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 40px 30px 20px 30px;
    text-align: center;
    background-color: #636d79;
}

.aica-logo {
    width: 130px;
    height: 130px;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.aica-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Notification Dropdown */
.notification-wrapper {
    position: relative;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 350px;
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notification-wrapper:hover .notification-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 20px;
    border-bottom: 1px solid #f1f1f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-header span:first-child {
    font-weight: 800;
    color: #555;
    font-size: 16px;
}

.mark-as-read {
    font-size: 12px;
    color: #004a99;
    cursor: pointer;
    font-weight: 600;
}

.notification-items {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 15px 20px;
    display: flex;
    gap: 15px;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s;
    cursor: pointer;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item.unread {
    background-color: #f0f7ff;
}

.notification-icon-circle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 16px;
}

.bg-orange { background-color: #ffab5e; }
.bg-blue { background-color: #004a99; }
.bg-green { background-color: #28a745; }

.notification-info p {
    font-size: 13px;
    color: #666;
    margin: 0 0 5px 0;
    line-height: 1.4;
}

.notification-info .time {
    font-size: 11px;
    color: #aaa;
}

.dropdown-footer {
    padding: 15px;
    text-align: center;
    border-top: 1px solid #f1f1f1;
}

.dropdown-footer a {
    color: #777;
    font-size: 13px;
    text-decoration: none;
    font-weight: 700;
}

.dropdown-footer a:hover {
    color: #004a99;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 20px;
    color: #e0e6ed;
}

.cycle-pill {
    background-color: #ffffff;
    color: #5c687d;
    padding: 5px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.sidebar-nav {
    flex-grow: 1;
    background-color: #5b6674;
    border-radius: 0px 40px 0 0;
    padding-top: 30px;
}

.sidebar-nav li:has(a.active) {
    /* background-color: rgba(255, 255, 255, 0.1); */
}

.sidebar-nav li a.active {
     opacity: 1;
}

.sidebar-nav li a.active::after {
    content: '';
    width: 8px;
    height: 8px;
    background-color: #ffffff;
    border-radius: 50%;
    display: inline-block;
    margin-left: auto; /* Alinha o ponto totalmente à direita */
}

.sidebar-nav ul {
    list-style: none;
    padding-left: 0 !important;
}

.sidebar-nav li {
    padding: 0; /* Removido o padding do li */
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s;
}

.sidebar-nav li a {
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 1;
    padding: 15px 30px; /* Padding movido para o link */
    width: 100%; /* Ocupa toda a largura da linha */
}

.active-dot {
    width: 8px;
    height: 8px;
    background-color: #ffffff;
    border-radius: 50%;
}

.sidebar-footer {
    padding: 20px 30px;
    text-align: center;
    background-color: #5b6674;
}

.fadc-logo {
    max-width: 130px;
    margin-bottom: 20px;
}

.help-box {
    background-color: rgb(70, 82, 98);
    padding: 25px 30px;
    border-radius: 25px;
    color: #ffffff;
    text-align: left;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.2;
    transition: background-color 0.3s ease;
}

.help-box:hover {
    background-color: rgb(80, 92, 108);
    color: #ffffff;
}

.help-box span {
    font-size: 14px;
    opacity: 0.9;
}

.help-box strong {
    font-size: 16px;
    font-weight: 700;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    background-color: #f4f7f6;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 40px 0 0 40px;
}

.topbar {
    padding: 20px 40px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}

.search-container input {
    width: 350px;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    color: #999;
}

.topbar-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.notification-icon, .logout-icon {
    width: 40px;
    height: 40px;
    background-color: #fff;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #999;
    position: relative;
    cursor: pointer;
}

.notification-icon .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ffab5e;
    color: #fff;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.content-scroll {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 60px 40px;
}

.page-intro {
    margin-bottom: 40px;
}

.page-intro h3 {
    font-size: 18px;
    color: #757575;
    font-weight: 700;
    margin-bottom: 10px;
/*    text-transform: uppercase;*/
}

.page-intro p {
    font-size: 14px;
    color: #888;
    line-height: 1.5;
    max-width: 100%;
}

.header-stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    margin-bottom: 50px;
}

.main-title {
    font-size: 42px;
    color: #555;
    font-weight: 700;
    margin: 0;
    /*max-width: 450px;*/
    line-height: 1.1;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    flex-grow: 1;
    max-width: 400px;
}

.stat-card {
    padding: 20px;
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.stat-card.projeto { background-color: #e1edad; }
.stat-card.beneficiarios { background-color: #c7ecc0; }
.stat-card.faixa-etaria { background-color: #b9e7c6; }

.stat-card label {
    font-size: 11px;
    font-weight: 800;
    color: #5b6674;
    margin-bottom: 15px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.7;
}

.stat-card p {
    font-size: 16px;
    color: #555;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.stat-card .stat-value {
    font-size: 22px;
    margin-top: auto;
}

/* Action Section */
.action-section {
    margin-bottom: 40px;
}

.section-month-title {
    font-size: 32px;
    color: #757575;
    font-weight: 700;
    margin-bottom: 20px;
}

/* Action Grid */
.action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.action-card {
    padding: 20px;
    border-radius: 25px;
    min-height: 140px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.action-card.grey {
    background-color: #f1f1f1;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

.action-card.orange {
    background-color: #ffab5e;
    color: #fff;
    display: flex;
    flex-direction: column;
}

.action-card.orange .action-value {
    margin-top: auto;
    margin-bottom: 0;
}

.action-card.green-btn {
    background-color: #00a65a;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
}

.action-card label {
    font-size: 14px;
    font-weight: 700;
    color: #757575;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.action-card.orange label {
    color: #fff;
}

.repasse-value-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: auto;
}

.repasse-value-stack .currency {
    font-size: 16px;
    font-weight: 600;
    color: #9e9e9e;
}

.repasse-value-stack .amount {
    font-size: 42px;
    font-weight: 800;
    color: #757575;
    line-height: 1;
}

.action-value {
    font-size: 42px;
    font-weight: 800;
    align-self: flex-start;
    line-height: 1;
}

.action-card.green-btn p {
    font-weight: 700;
    font-size: 18px;
    max-width: 150px;
    margin: 0;
}

/* Table Container */
.table-container {
    background-color: #fff;
    padding: 40px;
}

.table-container h3 {
    font-size: 20px;
    color: #555;
    margin-bottom: 30px;
}

.table-filters {
    display: flex;
    gap: 30px;
    align-items: flex-end;
    margin-bottom: 30px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-group label {
    font-size: 11px;
    font-weight: 700;
    color: #888;
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: 15px;
}

.date-input-wrapper {
    position: relative;
    border: 1px solid #eee;
    padding: 8px 15px;
    border-radius: 8px;
}

.date-input-wrapper input {
    border: none;
    font-size: 11px;
    color: #999;
    width: 80px;
    outline: none;
}

.date-input-wrapper i {
    color: #ccc;
    margin-right: 5px;
}

.arrow {
    color: #ccc;
}

.filter-group select {
    border: 1px solid #eee;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 11px;
    color: #999;
    min-width: 150px;
    outline: none;
}

.btn-warning, .btn-danger, .btn-info {
    border: 1px solid #ccc;
    padding: 8px 25px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.btn-clear, .btn-primary, .btn-pagination, .btn-outline-primary {
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 8px 25px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #777;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    line-height: 1.2;
}

.btn-primary:disabled, .btn-primary.disabled {
    background-color: #fff !important;
    color: #bbb !important; /* Fonte mais clara para indicar inatividade */
    border-color: #eee !important;
    cursor: not-allowed !important;
    pointer-events: none;
    opacity: 1; /* Usamos cores em vez de opacidade para manter o fundo sólido */
}

    .btn-primary.btn-sm {
        height: 30px;
    }

.btn-pagination {
    padding: 5px 15px;
    font-size: 12px;
}

.results-per-page {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.results-per-page span {
    font-size: 10px;
    color: #999;
}

.results-per-page select {
    border: 1px solid #eee;
    padding: 2px 10px;
    border-radius: 5px;
    font-size: 10px;
    color: #999;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    font-size: 18px;
    color: #555;
    padding: 15px 0;
    border-bottom: 2px solid #f8f9fa;
}

.data-table td {
    padding: 15px 0;
    border-bottom: 1px solid #f1f1f1;
    font-size: 13px;
    color: #777;
}

.status-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    display: inline-block;
    white-space: nowrap;
}

    .status-badge.orange {
        background-color: #ff7a45;
        color: #fff;
    }
    .status-badge.blue {
        background-color: #0d4db8;
    }
    .status-badge.green {
        background-color: #08a652;
    }
.status-badge.light-green-badge { background-color: #98db8d; }
    .status-badge.yellow {
        background-color: #f3a348;
        color: #fff;
    }
    .status-badge.red {
        background-color: #d9534f;
    }
    .status-badge.gray {
        background-color: #6c757d;
    }
    .status-badge.dark-blue {
        background-color: #004a99;
    }

.actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Pagination */
.pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Hover Effects for Buttons */
.btn-clear:hover,
.btn-primary:hover,
.action-card.green-btn:hover,
.btn-icon:hover,
.btn-pagination:hover {
    background-color: #212529 !important;
    color: #ffffff !important;
    border-color: #212529 !important;
}

.btn-icon:hover i {
    color: #ffffff !important;
}

/* Blazor Error UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.ct-upload {
    display: flex;
}

.ct-upload__input {
    display: none;
}

.ct-upload__box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 190px;
    height: 190px;
    border-radius: 12px;
    border: 2px dashed rgba(59,130,246,.45);
    background: rgba(59,130,246,.04);
    cursor: pointer;
    overflow: hidden;
    border-radius: 50%;
}

.ct-upload__preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.ct-upload__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: rgba(59,130,246,.85);
}

.ct-upload__text {
    font-size: 11px;
    font-weight: 800;
    color: rgba(15,23,42,.65);
    text-decoration: underline;
}


.modal-backdrop-custom {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1040;
}

.modal-custom {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-card-custom {
    width: 100%;
    max-width: 760px;
    background: #fff;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.modal-title-custom {
    font-size: 2rem;
    font-weight: 700;
    color: #555;
}

.input-modal-custom {
    height: 48px;
    border-radius: 10px;
    border: 1px solid #444;
    background-color: #fff;
}

@media (max-width: 768px) {
    .modal-card-custom {
        padding: 20px;
        border-radius: 18px;
    }

    .modal-title-custom {
        font-size: 1.5rem;
    }
}
.btn-success {
    background: #00A75D !important;
}


.cadastro-page {
    width: 100%;
}

.cadastro-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

    .cadastro-header h2 {
        margin: 0;
    }

.cadastro-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.results-per-page {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

    .results-per-page select {
        min-width: 90px;
        border: 1px solid #ced4da;
        border-radius: .5rem;
        padding: .4rem .75rem;
        background: #fff;
    }

.table-responsive-custom {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

    .data-table th,
    .data-table td {
        padding: .9rem .75rem;
        vertical-align: middle;
        border-bottom: 1px solid #e9ecef;
        text-align: left;
    }

    .data-table thead th {
        white-space: nowrap;
    }

.actions {
    white-space: nowrap;
}

    .actions .btn {
        margin-bottom: .35rem;
    }

.desktop-table {
    display: block;
}

.mobile-list {
    display: none;
}

.mobile-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
    margin-bottom: 1rem;
}

.mobile-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .85rem;
    color: #212529;
    word-break: break-word;
}

.mobile-field {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: .45rem 0;
    border-bottom: 1px solid #f1f3f5;
}

    .mobile-field:last-child {
        border-bottom: none;
    }

.mobile-label {
    font-weight: 600;
    color: #6c757d;
    min-width: 120px;
    flex-shrink: 0;
}

.mobile-value {
    text-align: right;
    word-break: break-word;
}

.mobile-actions {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    margin-top: 1rem;
}

    .mobile-actions .btn {
        width: 100%;
    }

.modal-custom {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1055;
}

.modal-card-custom {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    max-width: 900px;
    padding: 1.5rem;
}

.modal-title-custom {
    font-size: 1.35rem;
    font-weight: 700;
}

.input-modal-custom {
    min-height: 44px;
}

.modal-backdrop-custom {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1050;
}

.table-card-mobile {
    width: 100%;
}

.table-card-mobile .table-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #212529;
    word-break: break-word;
}

@media (max-width: 991.98px) {
    .modal-card-custom {
        max-width: 100%;
    }
}

@media (max-width: 767.98px) {
    .container-fluid {
        padding-left: .75rem;
        padding-right: .75rem;
    }

    .table-container {
        padding: 1rem;
    }

    .cadastro-header {
        align-items: stretch;
    }

        .cadastro-header .btn {
            width: 100%;
        }

    .cadastro-toolbar {
        justify-content: stretch;
    }

    .results-per-page {
        width: 100%;
        justify-content: space-between;
    }

    .desktop-table {
        display: none;
    }

    .mobile-list {
        display: block;
    }

    .modal-card-custom {
        padding: 1rem;
        border-radius: 16px;
    }

    .modal-custom {
        align-items: flex-end;
        padding: .5rem;
    }

    .modal-card-custom {
        max-height: 95vh;
    }
}

@media (max-width: 575.98px) {
    .mobile-field {
        flex-direction: column;
        gap: .2rem;
    }

    .mobile-label,
    .mobile-value {
        min-width: auto;
        text-align: left;
    }

    .results-per-page {
        flex-direction: column;
        align-items: stretch;
    }

        .results-per-page select {
            width: 100%;
        }

    .d-flex.justify-content-end.gap-2.mt-4 {
        flex-direction: column;
    }

        .d-flex.justify-content-end.gap-2.mt-4 .btn {
            width: 100%;
        }
}


.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgb(99, 109, 121) !important;
}

.form-check-input:checked {
    background-color: rgb(99, 109, 121) !important;
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
    color: white;
    background-color: rgb(99, 109, 121) !important;
}


.nav-link {
    color: rgb(99, 109, 121) !important;
}

    .nav-link.active {
        color: white !important;
    }

.form-select:focus {
    box-shadow: 0 0 0 .25rem rgb(99 109 121) !important;
}

.text-primary {
    color: rgb(99, 109, 121) !important;
}

.cursor-pointer:hover {
    cursor: pointer;
}


.swal-sobra-popup {
    border-radius: 32px !important;
    padding: 2.5rem 2rem 2rem !important;
    width: 550px !important;
}

.swal-sobra-title {
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    color: #5f5f5f !important;
    margin-bottom: 0.75rem !important;
}

.swal-sobra-html {
    font-size: 1rem !important;
    color: #666 !important;
    line-height: 1.6 !important;
}

.swal-sobra-texto {
    text-align: center;
    max-width: 360px;
    margin: 0 auto;
}

.swal-sobra-actions {
    display: flex !important;
    justify-content: center !important;
    gap: 10px !important;
    margin-top: 1.5rem !important;
}

.swal-sobra-btn {
    border: 0 !important;
    border-radius: 12px !important;
    padding: 12px 18px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    cursor: pointer !important;
    box-shadow: none !important;
}

.swal-sobra-btn-aprovar {
    background: #00A75D !important;
}

.swal-sobra-btn-rejeitar {
    background: #ef4444 !important;
}

.swal-sobra-btn-cancelar {
    background: #7b8794 !important;
}

.swal-sobra-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

body {
    padding: clamp(0px, 2vw, 30px);
    align-items: stretch;
}

.boxed-container {
    min-height: calc(100vh - clamp(0px, 4vw, 60px));
}

.main-content {
    min-width: 0;
}

.sidebar-header {
    position: relative;
}

.sidebar-toggle,
.sidebar-close {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: #ffffff;
    color: #5b6674;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.sidebar-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    box-shadow: none;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 1100;
}

.sidebar-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.search-container {
    flex: 1 1 320px;
    max-width: 420px;
}

.search-container input {
    max-width: 100%;
}

.table-filters {
    flex-wrap: wrap;
}

.filter-group,
.filter-actions {
    flex: 1 1 180px;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
}

.filter-select,
.filter-group select,
.filter-group input,
.filter-group .form-select,
.filter-group .form-control {
    width: 100%;
    min-height: 44px;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 10px 14px;
    background: #fff;
    color: #666;
    outline: none;
}

.filter-group label {
    margin-bottom: 0;
}

.table-container {
    border-radius: 28px;
}

.table-container-spacious {
    padding: 50px 40px;
}

.table-scroll-mobile {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-scroll-mobile > .data-table {
    min-width: 680px;
}

.header-stats-row {
    /*flex-wrap: wrap;*/
}

.main-title {
    min-width: 0;
}

.pagination {
    flex-wrap: wrap;
}

@media (max-width: 1199.98px) {
    .topbar {
        padding: 20px 28px;
    }

    .content-scroll {
        padding: 0 28px 32px;
    }

    .header-stats-row {
        align-items: stretch;
    }
}

@media (max-width: 991.98px) {
    body {
        padding: 16px;
    }

    .boxed-container {
        min-height: calc(100vh - 32px);
        border-radius: 32px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(86vw, 340px);
        min-width: 0;
        height: 100vh;
        z-index: 1200;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 24px 0 40px rgba(15, 23, 42, 0.18);
        overflow-y: auto;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-toggle,
    .sidebar-close {
        display: inline-flex;
    }

    .main-content {
        width: 100%;
        border-radius: 32px;
    }

    .topbar {
        padding: 20px 24px;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .search-container {
        order: 3;
        max-width: none;
        width: 100%;
    }

    .topbar-actions {
        margin-left: auto;
    }

    .content-scroll {
        padding: 0 24px 32px;
    }

    .header-stats-row {
        flex-direction: column;
        gap: 20px;
        margin-bottom: 32px;
    }

    .stats-grid,
    .action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-group,
    .filter-actions {
        flex: 1 1 calc(50% - 8px);
    }

    .notification-dropdown {
        width: min(92vw, 350px);
    }
}

@media (max-width: 767.98px) {
    body {
        padding: 0;
        background: #f4f7f6;
    }

    .boxed-container {
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }

    .main-content {
        border-radius: 0;
    }

    .topbar {
        padding: 16px;
        gap: 12px;
    }

    .topbar-actions {
        gap: 10px;
    }

    .sidebar {
        width: min(92vw, 340px);
    }

    .sidebar-header {
        padding: 24px 20px 18px;
    }

    .sidebar-nav {
        border-radius: 0 28px 0 0;
        padding-top: 18px;
    }

    .sidebar-nav li a {
        padding: 14px 20px;
    }

    .sidebar-footer {
        padding: 20px;
    }

    .aica-logo {
        width: 104px;
        height: 104px;
        margin-bottom: 16px;
    }

    .sidebar-title {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .cycle-pill {
        padding: 6px 14px;
    }

    .content-scroll {
        padding: 0 16px 24px;
    }

    .page-intro {
        margin-bottom: 24px;
    }

    .page-intro h3 {
        font-size: 16px;
    }

    .page-intro p {
        font-size: 13px;
    }

    .main-title {
        font-size: clamp(1.8rem, 8vw, 2.4rem);
        max-width: none;
    }

    .section-month-title {
        font-size: clamp(1.5rem, 7vw, 2rem);
    }

    .stats-grid,
    .action-grid {
        grid-template-columns: 1fr;
    }

    .stat-card,
    .action-card {
        min-height: auto;
    }

    .table-container {
        padding: 16px;
        border-radius: 22px;
    }

    .table-container-spacious {
        padding: 20px 16px;
    }

    .table-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .filter-group,
    .filter-actions {
        width: 100%;
        min-width: 0;
        flex-basis: 100%;
    }

    .filter-actions .btn-clear,
    .table-filters .btn-clear {
        width: 100%;
        text-align: center;
    }

    .results-per-page {
        justify-content: space-between;
    }

    .results-per-page span {
        font-size: 11px;
    }

    .btn-clear,
    .btn-primary,
    .btn-pagination {
        padding: 10px 16px;
    }

    .notification-dropdown {
        position: fixed;
        top: 72px;
        right: 16px;
        left: 16px;
        width: auto;
    }

    .table-scroll-mobile > .data-table {
        min-width: 620px;
    }

    .table-scroll-mobile > .table-card-mobile {
        min-width: 0;
    }

    .table-card-mobile {
        min-width: 0;
        border-collapse: separate;
    }

    .table-card-mobile thead {
        display: none;
    }

    .table-card-mobile tbody {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .table-card-mobile tbody tr {
        display: block;
        background: #fff;
        border: 1px solid #e9ecef;
        border-radius: 14px;
        padding: 1rem;
        box-shadow: 0 2px 10px rgba(0,0,0,.04);
    }

    .table-card-mobile tbody tr.rubrica-row {
        border-color: #dde3ea;
        background: #ffffff;
    }

    .table-card-mobile tbody tr.sub-row {
        margin-left: .9rem;
        border-style: dashed;
        border-color: #d6dee8;
        background: #f8fafc;
        box-shadow: none;
    }

    .table-card-mobile tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 1rem;
        width: 100%;
        padding: .45rem 0;
        border-bottom: 1px solid #f1f3f5;
        text-align: right !important;
        white-space: normal;
        flex-wrap: wrap;
    }

    .table-card-mobile tbody td:last-child {
        border-bottom: none;
    }

    .table-card-mobile tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6c757d;
        min-width: 120px;
        text-align: left;
        flex-shrink: 0;
    }

    .table-card-mobile tbody td[colspan] {
        display: block;
        text-align: center !important;
        border-bottom: none;
        padding: .25rem 0;
    }

    .table-card-mobile tbody td[colspan]::before {
        display: none;
    }

    .table-card-mobile tbody td.table-card-title-cell,
    .table-card-mobile tbody td.table-card-full,
    .table-card-mobile tbody td.actions,
    .table-card-mobile tbody td.table-card-actions {
        display: block;
        text-align: left !important;
    }

    .table-card-mobile tbody td.table-card-title-cell::before {
        display: none;
    }

    .table-card-mobile tbody td.table-card-full::before,
    .table-card-mobile tbody td.actions::before,
    .table-card-mobile tbody td.table-card-actions::before {
        display: block;
        margin-bottom: .45rem;
    }

    .table-card-mobile tbody td.table-card-empty::before {
        display: none;
    }

    .table-card-mobile tbody tr.sub-row td.table-card-empty {
        display: none;
    }

    .table-card-mobile tbody td.actions,
    .table-card-mobile tbody td.table-card-actions {
        white-space: normal;
    }

    .table-card-mobile tbody td.actions .btn,
    .table-card-mobile tbody td.table-card-actions .btn,
    .table-card-mobile tbody td.actions a,
    .table-card-mobile tbody td.table-card-actions a,
    .table-card-mobile tbody td.actions button,
    .table-card-mobile tbody td.table-card-actions button {
        width: 100%;
        margin: 0 0 .5rem 0;
    }

    .table-card-mobile tbody td.actions .btn:last-child,
    .table-card-mobile tbody td.table-card-actions .btn:last-child,
    .table-card-mobile tbody td.actions a:last-child,
    .table-card-mobile tbody td.table-card-actions a:last-child,
    .table-card-mobile tbody td.actions button:last-child,
    .table-card-mobile tbody td.table-card-actions button:last-child {
        margin-bottom: 0;
    }

    .table-card-mobile tbody td .hstack,
    .table-card-mobile tbody td .d-flex {
        flex-direction: column;
        align-items: stretch !important;
        gap: .5rem !important;
    }

    .table-card-mobile tbody tr.sub-row .rubrica-title,
    .table-card-mobile tbody tr.sub-row .item-desc {
        color: #243447;
    }
}

@media (max-width: 575.98px) {
    .notification-icon,
    .logout-icon,
    .sidebar-toggle,
    .sidebar-close {
        width: 44px;
        height: 44px;
    }

    .results-per-page {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination {
        justify-content: stretch;
    }

    .pagination .btn-pagination {
        flex: 1 1 auto;
        text-align: center;
    }
}
