/* Dashboard Styles */
.fr-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.fr-month-selector {
    margin-bottom: 30px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
}

.fr-month-selector label {
    font-weight: 600;
    margin-right: 10px;
    font-size: 16px;
}

.fr-month-selector select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    min-width: 200px;
}

/* Tabs */
.fr-tabs {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.fr-tab {
    padding: 15px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #495057;
    border-bottom: 3px solid transparent;
}

.fr-tab:hover {
    background: #e9ecef;
}

.fr-tab.active {
    color: #517971;
    background: #fff;
    border-bottom-color: #517971;
}

.fr-tab-content {
    background: #fff;
    padding: 30px;
    min-height: 400px;
}

.fr-tab-pane {
    display: none;
}

.fr-tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Representatives Grid */
.fr-representatives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.fr-rep-tile {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 30px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.fr-rep-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border-color: #517971;
}

.fr-rep-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #517971;
}

.fr-rep-title {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    line-height: 1.4;
}

/* Representative Details */
.fr-rep-details h2 {
    color: #212529;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
}

.fr-salaries-list {
    margin-bottom: 30px;
}

/* Summary Card */
.fr-summary-card {
    background: #507971;
    color: white;
    padding: 20px 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.fr-summary-card h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    opacity: 0.9;
}

.fr-summary-amount {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
}

.fr-summary-breakdown {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 10px;
}

.fr-summary-type {
    font-size: 16px;
    opacity: 0.9;
}

/* Person Section */
.fr-person-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.fr-person-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.fr-person-header h3 {
    margin: 0;
    color: #212529;
    font-size: 20px;
}

.fr-person-total {
    font-size: 24px;
    font-weight: 600;
    color: #28a745;
}

.fr-person-summary {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* Type Badges */
.fr-type-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.fr-type-salario {
    background: #e3f2fd;
    color: #1976d2;
}

.fr-type-beneficio {
    background: #e8f5e9;
    color: #388e3c;
}

.fr-type-diet, .fr-type-dieta {
    background: #fff3e0;
    color: #f57c00;
}

/* GL Breakdown Table */
.fr-gl-breakdown {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.fr-gl-breakdown h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
}

.fr-gl-table {
    width: 100%;
    border-collapse: collapse;
}

.fr-gl-table thead {
    background: #e9ecef;
}

.fr-gl-table th {
    padding: 10px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.fr-gl-table td {
    padding: 10px;
    border-bottom: 1px solid #dee2e6;
}

.fr-gl-table tbody tr:last-child td {
    border-bottom: none;
}

.fr-gl-table .fr-amount {
    text-align: right;
    font-weight: 500;
}

.fr-type-label {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
}

/* Back Button */
.fr-back-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.fr-back-btn:hover {
    background: #5a6268;
}

/* Loading State */
.fr-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.fr-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* People List Styles */
.fr-people-list-container {
    max-width: 1000px;
    margin: 0 auto;
}

.fr-people-alpha-list {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.fr-letter-group {
    border-bottom: 1px solid #dee2e6;
}

.fr-letter-group:last-child {
    border-bottom: none;
}

.fr-letter-header {
    background: #f8f9fa;
    margin: 0;
    padding: 10px 20px;
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
}

.fr-person-list-item {
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.fr-person-list-item:last-child {
    border-bottom: none;
}

.fr-person-list-item:hover {
    background: #f8f9fa;
}

.fr-person-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fr-person-name {
    font-size: 16px;
    font-weight: 500;
    color: #212529;
}

.fr-person-stats {
    display: flex;
    align-items: center;
    gap: 20px;
}

.fr-person-types {
    color: #6c757d;
    font-size: 14px;
}

.fr-person-amount {
    font-size: 16px;
    font-weight: 600;
    color: #28a745;
}

/* Person Details */
.fr-person-details {
    max-width: 1000px;
    margin: 0 auto;
}

.fr-person-summary-card {
    background: #517971;
    color: white;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}

.fr-person-summary-card h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    opacity: 0.9;
}

/* Presupuesto Table */
.fr-presupuesto-container {
    max-width: 1000px;
    margin: 0 auto;
}

.fr-presupuesto-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.fr-presupuesto-table thead {
    background: #f8f9fa;
}

.fr-presupuesto-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.fr-presupuesto-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.fr-presupuesto-table tbody tr:hover {
    background: #f8f9fa;
}

.fr-presupuesto-table .fr-amount {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.fr-presupuesto-table tfoot td {
    background: #f8f9fa;
    font-weight: 600;
    border-top: 2px solid #dee2e6;
}

/* Back Button - when at top */
.fr-rep-details .fr-back-btn {
    margin-bottom: 20px;
}

/* Accounts Grid */
.fr-accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.fr-account-tile {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.fr-account-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border-color: #517971;
}

.fr-account-title {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    text-align: center;
}

.fr-account-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #6c757d;
}

.fr-account-amount {
    font-weight: 600;
    color: #28a745;
}

.fr-account-people-container {
    max-width: 1000px;
    margin: 0 auto;
}

.fr-people-list {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-top: 20px;
}

.fr-accounts-list-container h3,
.fr-account-people-container h2 {
    margin-bottom: 20px;
}

.fr-person-list-item-static {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.fr-person-list-item-static:last-child {
    border-bottom: none;
}

/* Remove hover effect for static items */
.fr-person-list-item-static .fr-person-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Simplified Account Summary Card */
#fr-account-people .fr-summary-card {
    background: #517971;
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    text-align: center;
}

#fr-account-people .fr-summary-card h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    opacity: 0.95;
    color: white;
}

#fr-account-people .fr-summary-amount {
    font-size: 42px;
    font-weight: 700;
}

/* Remove the individual person total styling */
.fr-person-list-item-static .fr-person-stats {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Keep the badges but remove any total amount styling */
.fr-person-list-item-static .fr-person-amount {
    display: none;
}

/* Contracts Table */
.fr-contracts-container {
    max-width: 1000px;
    margin: 0 auto;
}

.fr-contracts-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
}

.fr-contracts-table thead {
    background: #f8f9fa;
}

.fr-contracts-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.fr-contracts-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.fr-contracts-table tbody tr:hover {
    background: #f8f9fa;
}

.fr-contracts-table .fr-amount {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.fr-contracts-table .fr-center {
    text-align: center;
}

.fr-contracts-table tfoot td {
    background: #f8f9fa;
    font-weight: 600;
    border-top: 2px solid #dee2e6;
}

.fr-contracts-container h3 {
    margin-bottom: 10px;
    color: #212529;
}

/* Gastos Styles */
.fr-gastos-container {
    max-width: 1200px;
    margin: 0 auto;
}

.fr-gastos-account-list {
    margin-top: 20px;
}

/* Simplified account list without counts */
.fr-gastos-account-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border: 1px solid #dee2e6;
    border-bottom: none;
    background: #fff;
    transition: all 0.3s ease;
}

.fr-gastos-account-item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.fr-gastos-account-item:last-child {
    border-bottom: 1px solid #dee2e6;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.fr-gastos-account-item.has-data {
    cursor: pointer;
}

.fr-gastos-account-item.has-data:hover {
    background: #f8f9fa;
    transform: translateX(5px);
}

.fr-gastos-account-item.no-data {
    opacity: 0.6;
}

.fr-gastos-account-info {
    flex: 1;
}

.fr-gastos-account-title {
    font-size: 16px;
    font-weight: 500;
    color: #212529;
}

.fr-gastos-account-code {
    font-size: 13px;
    color: #6c757d;
    margin-top: 3px;
}

/* Remove the stats section */
.fr-gastos-account-stats {
    display: none;
}

.fr-gastos-arrow {
    font-size: 24px;
    color: #517971;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fr-gastos-account-item.has-data:hover .fr-gastos-arrow {
    opacity: 1;
}

/* Gastos Details */
.fr-gastos-details {
    padding: 20px 0;
}

.fr-gastos-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.fr-gastos-column h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
}

/* Updated detail table styles */
.fr-gastos-detail-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.fr-gastos-detail-table thead {
    background: #f8f9fa;
}

.fr-gastos-detail-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    border-bottom: 2px solid #dee2e6;
}

.fr-gastos-detail-table th:not(:first-child) {
    text-align: right;
}

.fr-gastos-detail-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.fr-gastos-detail-table tbody tr:last-child td {
    border-bottom: none;
}

.fr-gastos-detail-table tbody tr:hover {
    background: #f8f9fa;
}

.fr-gastos-detail-table tfoot td {
    background: #f8f9fa;
    font-weight: 600;
    border-top: 2px solid #dee2e6;
}

.fr-gastos-detail-table .fr-amount {
    text-align: right;
    font-family: 'Courier New', monospace;
}

/* Benefit source styling */
.fr-benefit-source {
    font-size: 11px;
    color: #6c757d;
    font-style: italic;
    display: block;
    margin-top: 2px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Name column */
.fr-gastos-name {
    font-weight: 500;
}

/* Adjust column widths */
.fr-gastos-detail-table th:first-child,
.fr-gastos-detail-table td:first-child {
    width: 40%;
}

.fr-gastos-detail-table th:last-child,
.fr-gastos-detail-table td:last-child {
    width: 15%;
    font-weight: 600;
}

.fr-gastos-types {
    font-size: 12px;
    color: #6c757d;
    margin-top: 2px;
}

.fr-gastos-contract-count {
    font-size: 12px;
    color: #6c757d;
    margin-top: 2px;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .fr-tabs {
        flex-wrap: wrap;
    }
    
    .fr-tab {
        flex: 1 1 50%;
        text-align: center;
    }
    
    .fr-representatives-grid {
        grid-template-columns: 1fr;
    }
    
    .fr-person-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .fr-person-total {
        margin-top: 10px;
    }
    
    .fr-summary-breakdown {
        flex-direction: column;
        gap: 10px;
    }
    
    .fr-person-info-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .fr-person-stats {
        margin-top: 5px;
        width: 100%;
        justify-content: space-between;
    }
    
    .fr-gastos-columns {
        grid-template-columns: 1fr;
    }
    
    .fr-gastos-account-stats {
        flex-direction: column;
        gap: 10px;
    }
}