@charset "UTF-8";

:root {
    --primary-color: #0c6197;
    --primary-light: #3585b8;
    --primary-dark: #074c77;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --success-light: #34d399;
    --info-color: #06b6d4;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --danger-light: #f87171;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    /* --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    --gradient-primary: linear-gradient(135deg, #0c6197 0%, #0c6197 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.dashboard-container {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 3rem 2rem;
    background: var(--gradient-primary);
    border-radius: 24px;
    color: white;
    position: relative;
    overflow: hidden;
}

.dashboard-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.dashboard-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.dashboard-header p {
    font-size: 1.25rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.controls-section {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 3rem;
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.control-group label {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--dark-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-select {
    border-radius: 16px;
    border: 2px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 250px;
    background: white;
    box-shadow: var(--shadow-sm);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    outline: none;
    transform: translateY(-1px);
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.summary-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transition: all 0.3s ease;
}

.summary-card.income::before {
    background: var(--gradient-success);
}

.summary-card.expense::before {
    background: var(--gradient-danger);
}

.summary-card.delta::before {
    background: var(--gradient-primary);
}

.summary-card.delta.negative::before {
    background: var(--gradient-danger);
}

.summary-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.summary-card h3 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.summary-card .value {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.summary-card.income .value {
    background: var(--gradient-success);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.summary-card.expense .value {
    background: var(--gradient-danger);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.summary-card.delta .value {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.summary-card.delta.negative .value {
    background: var(--gradient-danger);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chart-row {
    width: 100%;
    margin-bottom: 3rem;
}

.chart-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-card:hover {
    /* box-shadow: var(--shadow-lg);
    transform: translateY(-2px); */
}

.chart-header {
    padding: 2rem 2.5rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.8) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.chart-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
}

.chart-body {
    padding: 2.5rem;
}

.chart-container {
    position: relative;
    height: 450px !important;
    width: 90%;
    border-radius: 16px;
    overflow: hidden;
}

.chart-container canvas {
    max-height: 450px !important;
    height: 450px !important;
}

.course-controls {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.8) 0%, rgba(255, 255, 255, 0.9) 100%);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
}

.legend-container {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark-color);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.monthly-table-container {
    background: white;
    border: 1px solid #F6F7FF;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.members-table-container {
    background: white;
    border: 1px solid #F6F7FF;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.monthly-table,
.members-table {
    font-size: 0.775rem;
}

.members-table .table-header {
    display: grid;
    grid-template-columns: 1fr 0.8fr 1fr 1.5fr;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}


.members-table .table-row {
    display: grid;
    grid-template-columns: 1fr 0.8fr 1fr 1.5fr;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #F6F7FF;
    transition: background-color 0.2s ease;
    align-items: start;
}

.table-cell.season-name {
    text-align: center;
    font-weight: 500;
    font-size: 0.7rem;
}

.table-cell.members-count {
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
}

.table-cell.variation {
    text-align: center;
    font-size: 0.7rem;
}

.variation-positive {
    color: var(--success-color);
    font-weight: 600;
}

.variation-negative {
    color: var(--danger-color);
    font-weight: 600;
}

.variation-neutral {
    color: var(--secondary-color);
    font-weight: 500;
}

.monthly-table {
    font-size: 0.775rem;
}

.table-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.table-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 0.5rem;
    padding: 0.2rem 0;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.table-row:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-row.positive {
    background-color: rgba(0, 184, 148, 0.05);
}

.table-row.negative {
    background-color: rgba(255, 107, 107, 0.05);
}

.table-row.neutral {
    background-color: white;
}

.table-cell {
    padding: 0.25rem 0.5rem;
    text-align: right;
}

.table-header .table-cell {
    font-weight: 600;
    color: var(--secondary-color);
    text-align: center;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.table-cell.month-name {
    text-align: left;
    font-weight: 600;
}

.table-cell.income {
    color: var(--success-color);
    font-weight: 500;
}

.table-cell.expense {
    color: var(--danger-color);
    font-weight: 500;
}

.table-cell.net {
    font-weight: 600;
    white-space: nowrap;
}

.table-row.positive .table-cell.net {
    color: var(--success-color);
}

.table-row.negative .table-cell.net {
    color: var(--danger-color);
}

.table-row.neutral .table-cell.net {
    color: var(--secondary-color);
}

@media (max-width: 1024px) {
    .chart-body>div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .monthly-table-container {
        order: 2;
    }
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--secondary-color);
}

.error-message {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 0.5rem;
    }

    .dashboard-header h1 {
        font-size: 2rem;
    }

    .controls-section {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .chart-body {
        padding: 1rem;
    }

    .chart-container {
        height: 300px !important;
    }

    .chart-container canvas {
        max-height: 300px !important;
        height: 300px !important;
    }

    .legend-container {
        gap: 1rem;
    }
}

.modern-course-card {
    background: rgb(255, 255, 255, 0.9);
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.modern-select {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.modern-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.modern-chart-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
    margin-top: 20px;
}

.course-delta-table {
    background: white;
    border: 1px solid #F6F7FF;
    border-radius: 16px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.course-table-header {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    padding: 16px 20px;
    color: white;
}

.course-table-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.course-table {
    max-height: 500px;
    overflow-y: auto;
}

.course-table .table-header {
    display: grid;
    grid-template-columns: 1fr 89px 110px 75px;
    background: white;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    border-bottom: 1px solid #F6F7FF;
}

.course-table .table-row {
    display: grid;
    grid-template-columns: 1fr 89px 110px 75px;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
}

.course-table .table-row:hover {
    background: #f9fafb;
}

.course-table .table-row:last-child {
    border-bottom: none;
}

.course-table .table-cell {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
}

.course-table .table-cell.month {
    font-weight: 600;
    color: #111827;
}

.course-table .table-cell.participants {
    justify-content: center;
    color: #6b7280;
    font-weight: 600;
}

.course-table .table-cell.suspended {
    justify-content: center;
    color: #0C6197;
    font-weight: 600;
}

.course-table .table-cell.delta {
    justify-content: flex-end;
    font-weight: 600;
}

.course-table .table-cell.earned {
    justify-content: flex-end;
    font-weight: 600;
}

.course-table .table-cell.delta.positive {
    color: #10b981;
}

.course-table .table-cell.delta.negative {
    color: #f28322;
}

.course-table .table-cell.delta.neutral {
    color: #6b7280;
}

.course-table .table-cell.percentage {
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: #10b981;
}

.course-table .table-cell.earned.positive {
    color: #10b981;
}

.course-table .table-cell.earned.neutral {
    color: #6b7280;
}
/*
.course-table .table-cell.percentage.good {
    color: #10b981;
}

.course-table .table-cell.percentage.warning {
    color: #d97706;
}

.course-table .table-cell.percentage.bad {
    color: #dc2626;
} */

.modern-chart-container {
    background: white;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.chart-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    border: 2px dashed #cbd5e1;
    margin-top: 20px;
}

.placeholder-content {
    text-align: center;
    color: #64748b;
}

.placeholder-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    opacity: 0.5;
}

.placeholder-content p {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

@media (max-width: 1024px) {
    .modern-chart-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .course-delta-table {
        order: 2;
    }

    .modern-chart-container {
        order: 1;
    }
}


.modern-chart-container {
    background: white;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    padding: 20px;
    height: 500px;
}

.modern-chart-container canvas {
    height: 460px !important;
}

.modern-chart-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
    margin-top: 20px;
    min-height: 500px;
}
.causals-table-container {
    background: white;
    border: 1px solid #F6F7FF;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.causale-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.table-cell.causale-name {
    text-align: left;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.causals-table.compact {
    font-size: 0.875rem;
}

.causals-table.compact .table-header {
    display: grid;
    /* grid-template-columns: 2fr 80px 45px; */
    grid-template-columns: 2fr auto;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.7rem;
}

.causals-table.compact .table-row {
    display: grid;
    /* grid-template-columns: 2fr 80px 45px; */
    grid-template-columns: 2fr auto;
    gap: 8px;
    padding: 6px 12px;
    font-size: 0.75rem;
}

.causals-table.compact .table-cell.causale {
    text-align: left;
    font-weight: 500;
    display: flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
}

.causals-table.compact .table-cell.euro {
    text-align: right;
    font-weight: 600;
    color: var(--success-color);
    font-size: 0.7rem;
}

.causals-table.compact .table-cell.percent {
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.7rem;
}

.causals-table.compact .causale-indicator {
    width: 8px;
    height: 8px;
    margin-right: 6px;
    flex-shrink: 0;
}

.monthly-table .table-row,
.members-table .table-row,
.causals-table.compact .table-row {
    border-bottom: 1px solid #F6F7FF;
}

.course-table .table-row {
    border-bottom: 1px solid #F6F7FF;
}

.monthly-table .table-header,
.members-table .table-header,
.causals-table.compact .table-header {
    border-bottom: 2px solid #F6F7FF;
}

.table-cell.card-types {
    text-align: left;
    padding: 0.25rem 0.5rem;
}

.card-types-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 120px;
    overflow-y: auto;
}

.card-type-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    padding: 0.25rem 0;
    min-height: 20px;
}

.card-type-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.card-type-name {
    flex: 1;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-type-count {
    font-weight: 600;
    color: #6366f1;
    min-width: 20px;
    text-align: right;
    font-size: 0.7rem;
}

.no-card-types {
    font-size: 0.75rem;
    color: #9ca3af;
    font-style: italic;
    padding: 0.25rem 0;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 1024px) {
    .members-table .table-header {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .members-table .table-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
        padding: 1rem 0;
        border-bottom: 2px solid #F6F7FF;
    }

    .table-cell::before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: #6b7280;
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.5px;
    }

    .table-cell.season-name::before {
        content: "Stagione: ";
    }

    .table-cell.members-count::before {
        content: "Tesserati: ";
    }

    .table-cell.variation::before {
        content: "Variazione: ";
    }

    .table-cell.card-types::before {
        content: "Tipologie: ";
    }

    .card-types-container {
        margin-top: 0.5rem;
        max-height: none;
        overflow-y: visible;
    }

    .card-type-item {
        background: #f8f9fa;
        border-radius: 6px;
        padding: 0.5rem;
        margin-bottom: 0.25rem;
    }
}

/* Scrollbar styling for card types container */
.card-types-container::-webkit-scrollbar {
    width: 4px;
}

.card-types-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.card-types-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.card-types-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.chart-body,
.chart-body *,
.modern-chart-layout,
.modern-chart-layout * {
    box-sizing: border-box;
    max-width: 100%;
}

.chart-container canvas,
.modern-chart-container canvas {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block;
}

.dashboard-container,
.chart-card,
.chart-body {
    overflow-x: hidden;
    max-width: 100%;
}

#courses-chart-\2024 2025-\*,
canvas[id^="courses-chart-"] {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
}

.modern-chart-layout {
    display: grid;
    grid-template-columns: minmax(400px, 400px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    margin-top: 20px;
    min-height: 500px;
    max-width: 100%;
    overflow: hidden;
    width: 100%;
}

.modern-chart-container {
    background: white;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    padding: 20px;
    height: 500px;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.missing-filter-warning,
.missing-filter-warning .chart-placeholder {
    height: 100%;
    margin: 0;
    box-sizing: border-box;
}