/* ============================================================
   sublima_cld_stats.css
   Shared styles for CLD stats pages (vendita, acquisti,
   magazzino, export, altro) + hub card grid.
   Extracted from inline <style> to avoid 300+ lines of
   duplication per template.
   ============================================================ */

/* ========== REPORT CARDS ========== */
.report-card {
    display: block;
    background: white;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 12px;
    padding: 16px 20px;
}

.report-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    text-decoration: none;
    border-color: var(--sublima-burgundy, #8B0000);
}

.report-card-content {
    display: grid;
    grid-template-columns: 36px 1fr auto auto;
    grid-template-rows: auto auto;
    gap: 8px 12px;
    grid-template-areas:
        "icon title badge arrow"
        "icon desc desc desc";
    align-items: center;
}

.report-card-icon {
    grid-area: icon;
    width: 36px;
    height: 36px;
    background: var(--sublima-burgundy, #8B0000);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

.report-card-title {
    grid-area: title;
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.01em;
    line-height: 1.3;
    align-self: center;
}

.report-card-description {
    grid-area: desc;
    margin: 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.report-card-badge {
    grid-area: badge;
    background: #ffeaea;
    color: var(--sublima-burgundy, #8B0000);
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    align-self: center;
}

.report-card-arrow {
    grid-area: arrow;
    color: #cbd5e1;
    font-size: 16px;
    transition: all 0.3s ease;
    align-self: center;
}

.report-card:hover .report-card-arrow {
    transform: translateX(4px);
    color: var(--sublima-burgundy, #8B0000);
}

/* ========== SECTION HEADERS ========== */
.section-header {
    font-size: 28px;
    font-weight: 700;
    color: var(--sublima-burgundy, #8B0000);
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
}

.section-header i {
    color: var(--sublima-burgundy, #8B0000);
    font-size: 32px;
}

.section-subtitle {
    font-size: 14px;
    color: #6c757d;
    margin-top: 4px;
    margin-bottom: 32px;
    font-weight: 400;
}

.section-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

/* ========== COLUMN HEADERS ========== */
.column-header {
    font-size: 18px;
    font-weight: 600;
    color: var(--sublima-burgundy, #8B0000);
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 8px;
}

.column-header i {
    color: var(--sublima-burgundy-light, #A52A2A);
    font-size: 20px;
}

/* ========== BACK TO AREAS BUTTON ========== */
.back-to-areas {
    padding: 8px 16px;
    background: var(--sublima-burgundy, #8B0000);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.back-to-areas:hover {
    background: var(--sublima-burgundy-dark, #6B0000);
    color: white;
    text-decoration: none;
    transform: translateX(-2px);
}

/* ========== CHART & PANEL STYLES ========== */
.chart-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.panel_resoconto {
    overflow-y: auto;
    height: 520px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

/* ========== TIME FILTER BUTTONS ========== */
.time-filters {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

.time-filter-btn {
    padding: 8px 16px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
}

.time-filter-btn:hover {
    background: #e0e7ff;
    border-color: #2563eb;
    color: #1e3a8a;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
}

.time-filter-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.3);
}

/* ========== ACCORDION EXPANDER ========== */
.accordion-button-expander {
    background: #e0e7ff;
    color: #1e3a8a;
    border: 1px solid #2563eb;
    font-weight: 700;
    transition: all 0.2s ease;
}

.accordion-button-expander:hover {
    background: #c7d2fe;
    color: #1e3a8a;
    border-color: #2563eb;
}

.accordion-button-expander:focus {
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

.accordion-button-expander:not(.collapsed) {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

/* ========== RESOCONTO STYLES ========== */
.cld-resoconto-card {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.cld-resoconto-card .card-header {
    background: #f8fafc;
    border-bottom: 0;
}

.cld-resoconto-title {
    color: #2563eb;
}

.cld-resoconto-item {
    border-color: #e2e8f0;
}

.cld-resoconto-item-total {
    background: #e0e7ff;
}

.cld-resoconto-item-detail {
    background: #f1f5f9;
}

.resoconto-vendite-hidden {
    display: none !important;
}

.resoconto-vendite-visible {
    display: flex !important;
}

/* ========== LEGACY REPORT LINK ========== */
.report-link {
    display: block;
    padding: 15px;
    margin-bottom: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.report-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-decoration: none;
    border-color: var(--sublima-burgundy, #8B0000);
}

.report-link h4 {
    margin-top: 0;
    margin-bottom: 5px;
    color: var(--sublima-burgundy, #8B0000);
    font-size: 16px;
    font-weight: 600;
}

.report-link p {
    margin-bottom: 0;
    color: #64748b;
    font-size: 13px;
}

/* ========== VISUAL/TABLE HELPERS ========== */
.visualTitleRow {
    font-weight: 600;
    text-decoration: none !important;
    margin: 4px 4px 4px 0px;
    padding-bottom: 5px;
    border-bottom: 2px solid #c7d2fe;
    width: 100%;
    display: block;
    margin-bottom: 25px;
}

.pnlSetRowRoot { vertical-align: top; }
.pnlSetRowRootCol1 { vertical-align: top; }
.pnlSetRowRootCol2 { vertical-align: top; text-align: right; }
.pnlSetRowRootCol3 { text-align: center; width: 30px; }

.std12_dynamicResizeFont { font-size: 0.8rem !important; }
.std14_dynamicResizeFont { font-size: 1rem !important; }
.std16_dynamicResizeFont { font-size: 1rem !important; }
.std18_dynamicResizeFont { font-size: 1.125rem !important; }

/* ========== HUB CARD GRID (index_cld_local) ========== */
.modern-stat-card {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.modern-stat-card .card-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s;
}

.modern-stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    border-color: currentColor;
}

.modern-stat-card:hover .card-gradient {
    opacity: 1;
}

.modern-stat-card:hover .icon-container > div {
    opacity: 1;
}

.modern-stat-card:hover .card-cta {
    opacity: 1;
    transform: translateX(0);
}

.modern-stat-card:hover .card-cta i {
    transform: translateX(4px);
}

/* ========== DARK MODE ========== */
body[data-theme="dark"] .report-card,
.dark-mode .report-card {
    background: #1e293b;
    border-color: #334155;
}

body[data-theme="dark"] .report-card:hover,
.dark-mode .report-card:hover {
    border-color: #A52A2A;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

body[data-theme="dark"] .report-card-icon,
.dark-mode .report-card-icon {
    background: #A52A2A;
}

body[data-theme="dark"] .report-card-title,
.dark-mode .report-card-title {
    color: #e2e8f0;
}

body[data-theme="dark"] .report-card-description,
.dark-mode .report-card-description {
    color: #94a3b8;
}

body[data-theme="dark"] .report-card-badge,
.dark-mode .report-card-badge {
    background: #4a0000;
    color: #ffb3b3;
}

body[data-theme="dark"] .report-card-arrow,
.dark-mode .report-card-arrow {
    color: #475569;
}

body[data-theme="dark"] .report-card:hover .report-card-arrow,
.dark-mode .report-card:hover .report-card-arrow {
    color: #A52A2A;
}

body[data-theme="dark"] .section-header,
.dark-mode .section-header {
    color: #ffb3b3;
}

body[data-theme="dark"] .section-header i,
.dark-mode .section-header i {
    color: #ffb3b3;
}

body[data-theme="dark"] .section-subtitle,
.dark-mode .section-subtitle {
    color: #94a3b8;
}

body[data-theme="dark"] .column-header,
.dark-mode .column-header {
    color: #ffcccc;
    border-bottom-color: #334155;
}

body[data-theme="dark"] .column-header i,
.dark-mode .column-header i {
    color: #ff9999;
}

body[data-theme="dark"] .back-to-areas,
.dark-mode .back-to-areas {
    background: #A52A2A;
}

body[data-theme="dark"] .back-to-areas:hover,
.dark-mode .back-to-areas:hover {
    background: #8B0000;
}

body[data-theme="dark"] .chart-container,
.dark-mode .chart-container {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

body[data-theme="dark"] .panel_resoconto,
.dark-mode .panel_resoconto {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

body[data-theme="dark"] .visualTitleRow,
.dark-mode .visualTitleRow {
    border-bottom-color: #475569;
}

body[data-theme="dark"] .time-filter-btn,
.dark-mode .time-filter-btn {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

body[data-theme="dark"] .time-filter-btn:hover,
.dark-mode .time-filter-btn:hover {
    background: #1e3a8a;
    border-color: #3b82f6;
    color: #f8fafc;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}

body[data-theme="dark"] .time-filter-btn.active,
.dark-mode .time-filter-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #0f172a;
    box-shadow: 0 8px 18px rgba(59, 130, 246, 0.45);
}

body[data-theme="dark"] .accordion-button-expander,
.dark-mode .accordion-button-expander {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #3b82f6;
}

body[data-theme="dark"] .accordion-button-expander:hover,
.dark-mode .accordion-button-expander:hover {
    background: #334155;
    color: #e2e8f0;
}

body[data-theme="dark"] .accordion-button-expander:focus,
.dark-mode .accordion-button-expander:focus {
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.3);
}

body[data-theme="dark"] .accordion-button-expander:not(.collapsed),
.dark-mode .accordion-button-expander:not(.collapsed) {
    background: #3b82f6;
    color: #0f172a;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}

body[data-theme="dark"] .cld-resoconto-card,
.dark-mode .cld-resoconto-card {
    background: #1e293b;
    border-color: #334155;
}

body[data-theme="dark"] .cld-resoconto-card .card-header,
.dark-mode .cld-resoconto-card .card-header {
    background: #1e293b;
}

body[data-theme="dark"] .cld-resoconto-title,
.dark-mode .cld-resoconto-title {
    color: #3b82f6;
}

body[data-theme="dark"] .cld-resoconto-item,
.dark-mode .cld-resoconto-item {
    border-color: #334155;
    color: #e2e8f0;
}

body[data-theme="dark"] .cld-resoconto-item-total,
.dark-mode .cld-resoconto-item-total {
    background: #1e3a8a;
}

body[data-theme="dark"] .cld-resoconto-item-detail,
.dark-mode .cld-resoconto-item-detail {
    background: #0f172a;
}

body[data-theme="dark"] .modern-stat-card,
.dark-mode .modern-stat-card {
    background: #1e293b;
    border-color: #334155;
}

body[data-theme="dark"] .modern-stat-card:hover,
.dark-mode .modern-stat-card:hover {
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}

body[data-theme="dark"] .report-link,
.dark-mode .report-link {
    background: #1e293b;
    border-color: #334155;
}

body[data-theme="dark"] .report-link:hover,
.dark-mode .report-link:hover {
    border-color: #A52A2A;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
