
/* =====================================
   MYBUDGET - DESIGN SYSTEM
===================================== */

:root {
    --bg-main: #111827;
    --bg-sidebar: #0d1422;
    --bg-card: #1b2638;
    --bg-card-hover: #222f43;

    --border: #29364a;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --primary: #818cf8;
    --primary-bg: rgba(129, 140, 248, 0.13);

    --green: #34d399;
    --red: #fb7185;
    --blue: #60a5fa;
    --purple: #a78bfa;

    --sidebar-width: 255px;

    --radius: 14px;
}

/* RESET */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;

    background: var(--bg-main);
    color: var(--text-primary);

    min-height: 100vh;
}

button {
    font: inherit;
    cursor: pointer;
}

/* APP LAYOUT */

.app-container {
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;

    position: fixed;
    top: 0;
    left: 0;

    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);

    padding: 28px 18px;

    display: flex;
    flex-direction: column;

    z-index: 100;
}

/* BRAND */

.brand {
    display: flex;
    align-items: center;
    gap: 12px;

    font-size: 21px;
    font-weight: 750;

    margin-bottom: 45px;
    padding-left: 8px;
}

.brand-icon {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: linear-gradient(135deg, #818cf8, #6366f1);

    border-radius: 11px;

    color: white;
    font-weight: 800;
}

.brand-highlight {
    color: var(--primary);
}

/* NAVIGATION */

.sidebar-label {
    color: var(--text-muted);

    font-size: 10px;
    font-weight: 750;
    letter-spacing: 1.2px;

    padding-left: 12px;
    margin-bottom: 15px;
}

.navigation {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.nav-item {
    width: 100%;

    border: none;
    background: transparent;

    color: var(--text-secondary);

    display: flex;
    align-items: center;
    gap: 13px;

    padding: 13px 14px;

    border-radius: 9px;

    text-align: left;
    font-size: 13px;
    font-weight: 550;

    transition: 0.2s ease;
}

.nav-item:hover {
    background: var(--bg-card);
    color: white;
}

.nav-item.active {
    background: var(--primary-bg);
    color: var(--primary);
}

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 19px;
}

.sidebar-bottom {
    margin-top: auto;
}

.sidebar-footer {
    border-top: 1px solid var(--border);

    margin-top: 25px;
    padding: 22px 5px 0;

    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;

    border-radius: 50%;

    background: linear-gradient(135deg, #6366f1, #8b5cf6);

    display: flex;
    align-items: center;
    justify-content: center;

    color: white;
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-info strong {
    font-size: 12px;
}

.user-info span {
    color: var(--text-muted);
    font-size: 10px;
}

/* MAIN CONTENT */

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;

    padding: 0 35px;
}

/* TOPBAR */

.topbar {
    min-height: 95px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--border);
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.breadcrumb {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;

    margin-bottom: 6px;
}

.breadcrumb span {
    color: var(--primary);
}

.topbar h1 {
    font-size: 22px;
    font-weight: 700;
}

.current-date {
    color: var(--text-secondary);
    font-size: 12px;
}

.menu-toggle {
    display: none;

    background: transparent;
    border: none;

    color: white;
    font-size: 22px;
}

/* PAGE SECTIONS */

.page-section {
    display: none;
    padding: 30px 0;
}

.page-section.active {
    display: block;
}

.welcome-section {
    margin-bottom: 25px;
}

.welcome-section h2 {
    font-size: 21px;
    margin-bottom: 8px;
}

.welcome-section p {
    color: var(--text-secondary);
    font-size: 13px;
}

/* STATISTICS CARDS */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 17px;

    margin-bottom: 22px;
}

.stat-card {
    background: var(--bg-card);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    padding: 21px;

    transition: 0.2s ease;
}

.stat-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    color: var(--text-secondary);
    font-size: 12px;
}

.stat-icon {
    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    font-size: 17px;
    font-weight: 700;
}

.purple {
    color: var(--purple);
    background: rgba(167, 139, 250, 0.13);
}

.green {
    color: var(--green);
    background: rgba(52, 211, 153, 0.13);
}

.red {
    color: var(--red);
    background: rgba(251, 113, 133, 0.13);
}

.blue {
    color: var(--blue);
    background: rgba(96, 165, 250, 0.13);
}

.stat-value {
    font-size: 25px;
    font-weight: 750;

    margin-top: 19px;
    margin-bottom: 8px;
}

.positive {
    color: var(--green);
}

.negative {
    color: var(--red);
}

.stat-description {
    color: var(--text-muted);
    font-size: 11px;
}

/* PANELS */

.content-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 18px;

    margin-bottom: 20px;
}

.panel {
    background: var(--bg-card);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    padding: 23px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;
    margin-bottom: 20px;
}

.panel-header h3 {
    font-size: 14px;
    margin-bottom: 6px;
}

.panel-header p {
    color: var(--text-muted);
    font-size: 11px;
}

.panel-badge {
    background: var(--primary-bg);
    color: var(--primary);

    padding: 7px 11px;
    border-radius: 7px;

    font-size: 10px;
}

/* EMPTY STATES */

.empty-chart {
    min-height: 195px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;

    padding: 20px;
}

.empty-chart-icon {
    width: 45px;
    height: 45px;

    border-radius: 12px;

    background: var(--bg-card-hover);
    color: var(--primary);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 23px;

    margin-bottom: 14px;
}

.empty-chart h4 {
    font-size: 12px;
    margin-bottom: 7px;
}

.empty-chart p {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.6;

    max-width: 250px;
}

.empty-transactions {
    min-height: 135px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    color: var(--text-muted);
    font-size: 12px;
}

.empty-transactions .empty-chart-icon {
    margin-bottom: 10px;
}

/* BUTTONS */

.text-button {
    background: transparent;
    border: none;

    color: var(--primary);
    font-size: 11px;
    font-weight: 650;
}

.text-button:hover {
    color: white;
}

/* PLACEHOLDER PAGES */

.placeholder-panel {
    min-height: 380px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    text-align: center;
    padding: 30px;
}

.placeholder-panel > span {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 20px;
}

.placeholder-panel h2 {
    font-size: 20px;
    margin-bottom: 10px;
}

.placeholder-panel p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 18px;
}

.placeholder-panel small {
    color: var(--primary);
    background: var(--primary-bg);
    padding: 8px 13px;
    border-radius: 20px;
    font-size: 10px;
}

/* FOOTER */

.app-footer {
    padding: 25px 0;

    text-align: center;

    color: var(--text-muted);
    font-size: 10px;
}

/* RESPONSIVE TABLET */

@media (max-width: 1100px) {

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

}

/* RESPONSIVE MOBILE */

@media (max-width: 700px) {

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 15px 0 40px rgba(0, 0, 0, 0.4);
    }

    .main-content {
        margin-left: 0;
        padding: 0 17px;
    }

    .topbar {
        min-height: 80px;
    }

    .menu-toggle {
        display: block;
    }

    .topbar h1 {
        font-size: 18px;
    }

    .current-date {
        display: none;
    }

    .topbar-right .user-avatar {
        width: 32px;
        height: 32px;
    }

    .welcome-section h2 {
        font-size: 18px;
    }

    .welcome-section p {
        font-size: 12px;
        line-height: 1.6;
    }

    .stats-grid {
        gap: 10px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-header {
        font-size: 10px;
    }

    .stat-icon {
        width: 27px;
        height: 27px;
        font-size: 14px;
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-description {
        font-size: 9px;
    }

    .panel {
        padding: 17px;
    }

    .page-section {
        padding-top: 23px;
    }

}

/* SMALL MOBILE */

@media (max-width: 360px) {

    .stats-grid {
        grid-template-columns: 1fr;
    }

}


/* =====================================
   FASE 2 - MOVIMENTI
===================================== */

/* TOOLBAR */

.welcome-section,
.section-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.section-toolbar {
    margin-bottom: 22px;
}

.section-toolbar h2 {
    font-size: 19px;
    margin-bottom: 7px;
}

.section-toolbar p {
    font-size: 12px;
    color: var(--text-secondary);
}


/* BUTTONS */

.primary-button,
.secondary-button {
    border: none;
    border-radius: 9px;
    padding: 12px 17px;
    font-size: 12px;
    font-weight: 650;
    transition: 0.2s ease;
}

.primary-button {
    background: #6366f1;
    color: white;
}

.primary-button:hover {
    background: #818cf8;
    transform: translateY(-1px);
}

.secondary-button {
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.secondary-button:hover {
    color: white;
}


/* FILTERS */

.filters-bar {
    display: flex;
    align-items: end;
    gap: 15px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.filter-group,
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label,
.form-group label {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}

.filter-group input,
.filter-group select,
.form-group input,
.form-group select {
    width: 100%;
    min-width: 0;
    background: #111827;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    font: inherit;
    font-size: 12px;
    outline: none;
}

.filter-group input:focus,
.filter-group select:focus,
.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
}


/* TABLE */

.table-container {
    width: 100%;
    overflow-x: auto;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 650px;
}

.transactions-table th {
    text-align: left;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
}

.transactions-table td {
    padding: 16px 12px;
    font-size: 11px;
    border-bottom: 1px solid var(--border);
}

.transactions-table tbody tr:last-child td {
    border-bottom: none;
}

.transactions-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.transactions-table td:first-child strong {
    font-size: 12px;
}

.category-tag {
    display: inline-block;
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    padding: 6px 9px;
    border-radius: 6px;
    font-size: 10px;
}


/* ACTIONS */

.table-actions {
    display: flex;
    gap: 7px;
}

.action-button {
    width: 29px;
    height: 29px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    font-size: 15px;
}

.edit-button:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.delete-button:hover {
    color: var(--red);
    border-color: var(--red);
}


/* MODAL */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 300;
    overflow-y: auto;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 490px;
    background: #1b2638;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.4);
    margin: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
}

.modal-header h2 {
    font-size: 19px;
    margin-bottom: 7px;
}

.modal-header p {
    color: var(--text-secondary);
    font-size: 11px;
}

.close-button {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 27px;
    line-height: 1;
}

.close-button:hover {
    color: white;
}


/* FORM */

#movementForm {
    display: flex;
    flex-direction: column;
    gap: 19px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
}

.type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.type-option {
    cursor: pointer;
}

.type-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.type-option span {
    display: block;
    padding: 12px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 650;
}

.income-option input:checked + span {
    background: rgba(52, 211, 153, 0.12);
    color: var(--green);
    border-color: var(--green);
}

.expense-option input:checked + span {
    background: rgba(251, 113, 133, 0.12);
    color: var(--red);
    border-color: var(--red);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 5px;
}


/* RECENT TRANSACTIONS */

.recent-transactions {
    display: flex;
    flex-direction: column;
}

.recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.recent-info > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.recent-info strong {
    font-size: 12px;
    overflow-wrap: anywhere;
}

.recent-info span {
    color: var(--text-muted);
    font-size: 10px;
}

.recent-icon {
    width: 35px;
    height: 35px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: 17px;
}

.recent-income {
    background: rgba(52, 211, 153, 0.13);
    color: var(--green);
}

.recent-expense {
    background: rgba(251, 113, 133, 0.13);
    color: var(--red);
}


/* MOBILE */

@media (max-width: 700px) {

    .welcome-section {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-toolbar .primary-button,
    .welcome-section .primary-button {
        width: 100%;
    }

    .modal {
        padding: 19px;
    }

}

@media (max-width: 400px) {

    .form-row {
        grid-template-columns: 1fr;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }

}


/* =====================================
   FASE 3 - DASHBOARD AVANZATA
===================================== */

.dashboard-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.dashboard-toolbar h3 {
    font-size: 14px;
    margin-bottom: 6px;
}

.dashboard-toolbar p {
    font-size: 11px;
    color: var(--text-secondary);
}

.dashboard-toolbar input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 11px;
    font: inherit;
    font-size: 12px;
}


/* LEGENDA GRAFICI */

.chart-legend {
    display: flex;
    gap: 18px;
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 10px;
}

.chart-legend span {
    display: flex;
    align-items: center;
    gap: 7px;
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.income-dot {
    background: #34d399;
}

.expense-dot {
    background: #fb7185;
}


/* GRAFICO MENSILE */

.monthly-chart {
    height: 210px;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    padding: 10px 5px 0;
}

.chart-month {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    color: var(--text-muted);
    font-size: 10px;
    text-transform: capitalize;
}

.chart-bars {
    height: 170px;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
}

.chart-bar {
    width: min(27px, 38%);
    min-height: 0;
    border-radius: 5px 5px 0 0;
    transition: height 0.3s ease;
}

.income-bar {
    background: #34d399;
}

.expense-bar {
    background: #fb7185;
}


/* CATEGORIE */

.category-chart {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.category-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.category-info {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 11px;
}

.category-info span {
    color: var(--text-secondary);
}

.category-info strong {
    color: var(--text-primary);
}

.category-progress {
    height: 8px;
    background: var(--bg-card-hover);
    border-radius: 10px;
    overflow: hidden;
}

.category-progress-fill {
    height: 100%;
    border-radius: 10px;
}

.category-row small {
    color: var(--text-muted);
    font-size: 10px;
    min-width: 37px;
    text-align: right;
}

.category-color-0 { background: #818cf8; }
.category-color-1 { background: #34d399; }
.category-color-2 { background: #fb7185; }
.category-color-3 { background: #60a5fa; }
.category-color-4 { background: #fbbf24; }
.category-color-5 { background: #c084fc; }


/* CONFRONTO */

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.comparison-grid > div {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 15px;
    background: var(--bg-card-hover);
    border-radius: 10px;
}

.comparison-grid span {
    color: var(--text-secondary);
    font-size: 11px;
}

.comparison-grid strong {
    font-size: 19px;
    color: var(--primary);
}

.comparison-grid small {
    font-size: 10px;
    color: var(--text-muted);
}


/* RIEPILOGO ANNUALE */

.annual-summary {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.annual-summary > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.annual-summary span {
    color: var(--text-secondary);
    font-size: 11px;
}

.annual-summary strong {
    font-size: 13px;
}


/* RESPONSIVE */

@media (max-width: 700px) {

    .dashboard-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-toolbar input {
        width: 100%;
    }

    .monthly-chart {
        gap: 5px;
    }

    .chart-bars {
        gap: 3px;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }

}


/* =====================================
   FASE 4 - BUDGET E CATEGORIE
===================================== */


/* BUDGET SUMMARY */

.budget-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 22px;
}


/* BUDGET LIST */

.budget-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.budget-item {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.015);
}

.budget-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 17px;
}

.budget-item-header > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.budget-item-header strong {
    font-size: 13px;
}

.budget-status {
    font-size: 10px;
    font-weight: 600;
}

.budget-status.normal {
    color: var(--green);
}

.budget-status.warning {
    color: #fbbf24;
}

.budget-status.exceeded {
    color: var(--red);
}


/* BUDGET AMOUNTS */

.budget-amounts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.budget-amounts > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.budget-amounts span {
    color: var(--text-muted);
    font-size: 10px;
}

.budget-amounts strong {
    font-size: 12px;
    overflow-wrap: anywhere;
}


/* PROGRESS BAR */

.budget-progress {
    height: 9px;
    background: var(--bg-card-hover);
    border-radius: 20px;
    overflow: hidden;
}

.budget-progress-fill {
    height: 100%;
    background: #34d399;
    border-radius: 20px;
    transition: width 0.3s ease;
}

.budget-progress-fill.progress-warning {
    background: #fbbf24;
}

.budget-progress-fill.progress-exceeded {
    background: #fb7185;
}

.budget-percentage {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 10px;
    text-align: right;
}


/* CATEGORIES */

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.category-section-title {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 17px 0 7px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.category-section-title:first-child {
    margin-top: 0;
}

.category-management-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 13px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.015);
}

.category-management-item:hover {
    background: var(--bg-card-hover);
}

.category-management-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-management-info > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.category-management-info strong {
    font-size: 12px;
}

.category-management-info small {
    font-size: 10px;
    color: var(--text-muted);
}

.category-management-icon {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: 16px;
}

.category-management-icon.income {
    background: rgba(52, 211, 153, 0.12);
    color: var(--green);
}

.category-management-icon.expense {
    background: rgba(251, 113, 133, 0.12);
    color: var(--red);
}


/* INPUT MONTH IN PANEL */

.panel-header input[type="month"] {
    background: #111827;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 9px;
    border-radius: 7px;
    font: inherit;
    font-size: 11px;
    max-width: 160px;
}


/* EMPTY BUDGET */

#budgetEmpty {
    flex-direction: column;
    text-align: center;
    padding: 35px 15px;
}

#budgetEmpty h4 {
    font-size: 13px;
    margin-top: 8px;
}

#budgetEmpty p {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 5px;
}


/* RESPONSIVE */

@media (max-width: 900px) {

    .budget-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 700px) {

    .budget-summary-grid {
        grid-template-columns: 1fr;
    }

    .budget-amounts {
        gap: 8px;
    }

    .budget-amounts strong {
        font-size: 11px;
    }

    .budget-item {
        padding: 13px;
    }

}

@media (max-width: 380px) {

    .budget-amounts {
        grid-template-columns: 1fr 1fr;
    }

}


/* =====================================
   FASE 5 - BACKUP E IMPOSTAZIONI
===================================== */

/* GRIGLIA IMPOSTAZIONI */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.settings-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    min-width: 0;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 13px;
}

.settings-card-header h3 {
    font-size: 14px;
    margin-bottom: 5px;
}

.settings-card-header p {
    color: var(--text-muted);
    font-size: 11px;
}

.settings-icon {
    width: 43px;
    height: 43px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font-size: 22px;
    font-weight: 700;
}

.backup-icon {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.csv-icon {
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
}

.restore-icon {
    background: rgba(96, 165, 250, 0.12);
    color: #60a5fa;
}

.database-icon {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
}

.settings-description {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.8;
    flex: 1;
}

.settings-card > button {
    max-width: 100%;
}


/* STATISTICHE DATABASE */

.database-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.database-stats > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 13px;
    background: var(--bg-card-hover);
    border-radius: 9px;
    min-width: 0;
}

.database-stats span {
    color: var(--text-muted);
    font-size: 10px;
}

.database-stats strong {
    color: var(--text-primary);
    font-size: 19px;
}


/* AVVISO PROTEZIONE */

.backup-notice {
    border-left: 3px solid #818cf8;
}

.backup-notice h3 {
    font-size: 14px;
    margin-bottom: 12px;
}

.backup-notice p {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.8;
    margin-bottom: 10px;
}

.backup-notice p:last-child {
    margin-bottom: 0;
}


/* MODALE RIPRISTINO */

.restore-summary {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 22px;
}

#restoreFileName {
    font-size: 12px;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

.restore-warning {
    padding: 13px;
    background: rgba(251, 113, 133, 0.08);
    border: 1px solid rgba(251, 113, 133, 0.25);
    border-radius: 9px;
    color: #fda4af;
    font-size: 12px;
    line-height: 1.7;
}

.restore-confirmation {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.6;
    cursor: pointer;
}

.restore-confirmation input {
    margin-top: 3px;
    accent-color: #818cf8;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

#executeRestore:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}


/* RESPONSIVE */

@media (max-width: 900px) {

    .settings-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 500px) {

    .settings-card-header {
        align-items: flex-start;
    }

    .database-stats > div {
        padding: 10px;
    }

    .database-stats strong {
        font-size: 16px;
    }

    .settings-card > button {
        width: 100%;
    }

}
