/* Special Plans & Financial Reports - Sabora Unified Design System */
:root {
    --accent-primary: var(--sb-brand);
    --accent-primary-hover: var(--sb-brand-800, #a02000);
    --accent-purple: var(--sb-accent-violet, #8b5cf6);
    --text-main: var(--sb-neutral-800);
    --text-muted: var(--sb-neutral-500);
    --bg-card: var(--sb-neutral-0);
    --border-color: var(--sb-neutral-200);
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.12);
}

.report-container {
    padding: 0;
    background: transparent;
    min-height: auto;
}

.report-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.025em;
    margin-bottom: 0.25rem;
}

/* Modern Report Toolbar */
.report-toolbar-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--sb-neutral-150, #f1f5f9);
}

.report-period-navigator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.report-period-nav-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--sb-neutral-200);
    background: var(--sb-neutral-0);
    color: var(--sb-neutral-700);
    cursor: pointer;
    transition: all 0.15s ease;
}

.report-period-nav-btn:hover:not(:disabled) {
    background: var(--sb-neutral-100);
    border-color: var(--sb-neutral-300);
    color: var(--sb-neutral-900);
    transform: translateY(-1px);
}

.report-period-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.report-period-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    height: 38px;
    padding: 0 1.15rem;
    border-radius: 10px;
    border: 1px solid var(--sb-neutral-200);
    background: var(--sb-neutral-0);
    color: var(--sb-neutral-800);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.report-period-pill:hover,
.report-period-pill.is-active {
    border-color: var(--sb-brand);
    background: var(--sb-neutral-25, #fafafa);
    box-shadow: 0 0 0 3px rgba(200, 40, 0, 0.08);
}

.report-period-pill .text-brand {
    color: var(--sb-brand);
}

.report-toolbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

/* Horizontal Filter Bar - Pure CSS */
.filter-bar-premium {
    background: var(--bg-card);
    border: 1px solid var(--sb-neutral-200);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 170px;
}

.filter-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--sb-neutral-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.custom-input {
    width: 100%;
    height: 38px;
    padding: 0 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--sb-neutral-200) !important;
    background: var(--sb-neutral-0);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-main);
    transition: all 0.15s ease;
    outline: none !important;
}

.custom-input:focus {
    border-color: var(--sb-brand) !important;
    box-shadow: 0 0 0 3px rgba(200, 40, 0, 0.1);
}

.btn-search-premium {
    height: 38px;
    padding: 0 1.25rem;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--sb-brand), var(--sb-brand-gradient-end, #ff4d26));
    color: white;
    border: none;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 6px rgba(200, 40, 0, 0.2);
}

.btn-search-premium:hover {
    background: linear-gradient(135deg, var(--sb-brand-800, #a02000), var(--sb-brand, #c82800));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(200, 40, 0, 0.3);
    color: white !important;
}

.btn-search-premium:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Dedicated styles for Radzen Excel Button to fix hover bugs */
.btn-excel-premium {
    height: 38px !important;
    padding: 0 1rem !important;
    border-radius: 8px !important;
    background: #107c41 !important; /* Authentic Excel Green */
    color: white !important;
    border: none !important;
    font-weight: 700 !important;
    font-size: 0.78rem !important;
    letter-spacing: 0.02em !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    box-shadow: 0 2px 6px rgba(16, 124, 65, 0.2) !important;
}

.btn-excel-premium:hover {
    background: #0d6334 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(16, 124, 65, 0.3) !important;
    color: white !important;
}

/* KPI Cards Grid */
.kpi-grid,
.kpi-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card-luxury,
.kpi-card-unified {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.15rem 1.25rem;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card-luxury:hover,
.kpi-card-unified:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -8px rgba(15, 23, 42, 0.12);
}

.kpi-icon-square {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.kpi-info h4 {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.kpi-info h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0.2rem 0 0 0;
}

/* Premium Table Outer */
.table-container-premium {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.table-header-luxury {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* The Table Itself (Aligned with Sabora design tokens) */
.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table th {
    background: var(--sb-brand) !important;
    padding: 8px 16px;
    text-align: left;
    font-family: var(--sb-font);
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--sb-neutral-0) !important;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.12);
    white-space: nowrap;
}

.modern-table td {
    padding: 8px 16px;
    border-bottom: 1px solid var(--sb-neutral-100);
    font-size: 0.88rem;
    color: var(--text-main);
    vertical-align: middle;
}

.modern-table tr:hover td {
    background: var(--sb-neutral-25, #fafafa);
}

/* Report Table Utilities */
.report-badge-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--sb-neutral-100);
    color: var(--sb-neutral-700);
    font-size: 0.78rem;
    font-weight: 700;
}

.report-scheme-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--sb-neutral-100);
    color: var(--sb-neutral-700);
    border: 1px solid var(--sb-neutral-200);
}

.report-table-row-academia {
    background: var(--sb-neutral-50) !important;
    border-top: 1px solid var(--sb-neutral-200);
}

.report-table-row-academia td {
    padding: 10px 16px !important;
    color: var(--sb-neutral-700);
    font-size: 0.85rem;
}

.report-table-total-row {
    background: var(--sb-neutral-100) !important;
    border-top: 2px solid var(--sb-brand) !important;
}

.report-table-total-row td {
    padding: 12px 16px !important;
    vertical-align: middle;
}

.report-total-headline {
    font-weight: 900;
    font-size: 0.95rem;
    color: var(--sb-neutral-900);
    letter-spacing: -0.2px;
}

.report-total-sub {
    font-size: 0.75rem;
    color: var(--sb-neutral-500);
    font-weight: 500;
}

.sabora-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(200, 40, 0, 0.08);
    color: var(--sb-brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Plan Badges */
.luxury-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 0.6rem;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-mensual { background: var(--sb-blue-100); color: var(--sb-blue-700); }
.badge-bimestral { background: #e0e7ff; color: #3730a3; }
.badge-trimestral { background: #ede9fe; color: #5b21b6; }
.badge-mediomes { background: var(--sb-amber-100); color: var(--sb-amber-700); }
.badge-claseunica { background: var(--sb-green-100); color: var(--sb-green-800); }

/* Price Styling */
.price-tag {
    font-weight: 800;
    color: var(--accent-primary);
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-bar-premium {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-item {
        min-width: 100%;
    }
    .btn-search-premium {
        width: 100%;
    }
}

.table-footer-luxury {
    background: linear-gradient(to right, var(--sb-neutral-0), var(--sb-neutral-50));
    border-top: 4px solid var(--accent-primary);
    box-shadow: 0 -10px 20px -5px rgba(0, 0, 0, 0.05);
}

.table-footer-luxury td {
    padding: 2rem 1.5rem !important;
    vertical-align: middle;
}

/* Luxury Amount Badges */
.total-badge {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #ff4d26 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 1.25rem;
    font-size: 1.35rem;
    font-weight: 900;
    box-shadow: 0 10px 25px -5px rgba(200, 40, 0, 0.3);
    display: inline-block;
    letter-spacing: -0.02em;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.total-badge-alt {
    background: linear-gradient(135deg, #6d28d9 0%, var(--sb-accent-violet) 100%);
    box-shadow: 0 10px 25px -5px rgba(109, 40, 217, 0.3);
}

.total-label-premium {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    font-weight: 800;
    margin-bottom: 0.5rem;
    display: block;
}

.total-label-purple { color: #6d28d9; }
.total-label-red { color: var(--accent-primary); }

.table-row-academia-summary {
    background: var(--sb-neutral-100);
}

.table-row-academia-summary td {
    padding: 1rem 1.5rem !important;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    border-top: 1px solid var(--border-color);
}