﻿/* ========================================
   IPD Dashboard Styles
   ======================================== */

/* ========================================
   Shared Header Styles (used by multiple dashboards)
   ======================================== */
.inbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 24px;
    flex-wrap: wrap;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1F2937;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 0.875rem;
    color: #6B7280;
    margin: 0;
    font-weight: 400;
    margin-top: 2px;
}

/* ========================================
   Inline Stats (Compact Card Style)
   ======================================== */
.inline-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mini-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    cursor: help;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.mini-stat:hover {
    background: white;
    border-color: #D1D5DB;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.mini-stat i {
    font-size: 20px;
    color: #6B7280;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #F3F4F6;
}

.stat-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.mini-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1F2937;
    line-height: 1;
}

.mini-stat-label {
    font-size: 0.75rem;
    color: #6B7280;
    font-weight: 500;
    text-transform: capitalize;
    letter-spacing: 0.01em;
}

.mini-stat-warning {
    background: #FFFBEB;
    border-color: #FDE68A;
}

.mini-stat-warning i {
    color: #D97706 !important;
    background: #FEF3C7 !important;
}

.mini-stat-danger {
    background: #FEF2F2;
    border-color: #FECACA;
}

.mini-stat-danger i {
    color: #DC2626 !important;
    background: #FEE2E2 !important;
}

.mini-stat-danger .mini-stat-value {
    color: #991B1B;
}

.mini-stat-danger .mini-stat-label {
    color: #B91C1C;
}

@media (max-width: 992px) {
    .inbox-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .inline-stats {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 576px) {
    .inline-stats {
        gap: 8px;
    }
    
    .mini-stat {
        padding: 8px 12px;
    }
    
    .mini-stat-value {
        font-size: 1.25rem;
    }
}

/* Page Header (workbench style) - Legacy */
.workbench-title {
    font-size: 24px;
    font-weight: 700;
    color: #1F2937;
    margin: 0 0 6px 0;
}

.workbench-subtitle {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
}

/* Header with stats inline */
.ipd-header-with-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

/* Inline stats bar variant - no margin, transparent background */
.ipd-stats-bar-inline {
    margin-bottom: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 8px 0;
}

@media (max-width: 992px) {
    .ipd-header-with-stats {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ipd-stats-bar-inline {
        width: 100%;
        background: white;
        border: 1px solid rgba(0, 91, 159, 0.1);
        border-radius: 8px;
        padding: 12px 20px;
        margin-top: 8px;
    }
}

/* ========================================
   Compact Stats Bar - Subtle horizontal layout
   ======================================== */
.ipd-stats-bar {
    display: flex;
    align-items: center;
    gap: 0;
    background: white;
    border: 1px solid rgba(0, 91, 159, 0.1);
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.ipd-stat {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 0 20px;
}

.ipd-stat:first-child {
    padding-left: 0;
}

.ipd-stat:last-child {
    padding-right: 0;
}

.ipd-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #1F2937;
    line-height: 1;
}

.ipd-stat-value.ipd-stat-warning {
    color: #b45309;
}

.ipd-stat-label {
    font-size: 12px;
    font-weight: 500;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ipd-stat-divider {
    width: 1px;
    height: 24px;
    background: rgba(0, 91, 159, 0.12);
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .ipd-stats-bar {
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px 16px;
    }
    
    .ipd-stat {
        padding: 0;
        flex: 1 1 45%;
        min-width: 120px;
    }
    
    .ipd-stat-divider {
        display: none;
    }
}

/* ========================================
   Tab Panel Visibility
   ======================================== */
.dashboard-tab-panel {
    display: none;
}

.dashboard-tab-panel.is-active {
    display: block;
}

.dashboard-tab-panel.is-hidden {
    display: none !important;
}

/* Tab Header inside panels */
.dashboard-tab-panel .tab-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 91, 159, 0.08);
}

.dashboard-tab-panel .tab-title {
    font-size: 16px;
    font-weight: 700;
    color: #1F2937;
    margin: 0 0 4px 0;
}

.dashboard-tab-panel .tab-subtitle {
    font-size: 13px;
    color: #6B7280;
    margin: 0;
}

/* ========================================
   Dashboard Table Styling
   ======================================== */
.dashboard-table {
    width: 100%;
    border-collapse: collapse;
}

.dashboard-table thead th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6B7280;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 91, 159, 0.12);
    background: rgba(227, 241, 251, 0.35);
    text-align: left;
}

.dashboard-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 91, 159, 0.08);
    vertical-align: middle;
    color: #1F2937;
    font-size: 14px;
}

.dashboard-table tbody tr:hover {
    background: rgba(227, 241, 251, 0.25);
}

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

/* Needs issuance row highlight */
.row-needs-issuance {
    background: rgba(245, 158, 11, 0.08) !important;
}

.row-needs-issuance:hover {
    background: rgba(245, 158, 11, 0.14) !important;
}

/* ========================================
   Layout Helpers
   ======================================== */
.tab-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.card-with-tabs {
    padding: 0 !important;
    overflow: hidden;
}

.card-with-tabs > .tab-content {
    padding: 0;
}

.dashboard-tab-panel .table-responsive {
    padding: 0 24px 24px 24px;
    margin: 0;
}

.dashboard-tab-panel .alert {
    margin: 20px 24px;
}

.dashboard-tab-panel .row.g-3 {
    padding: 0 24px 24px 24px;
    margin: 0;
}

.dashboard-tab-panel .d-flex.flex-wrap {
    padding: 20px 24px;
}

/* Spinner animation */
.spinning {
    animation: ipd-spin 1s linear infinite;
}

@keyframes ipd-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Chart container */
.financial-chart {
    min-height: 140px;
}

/* ========================================
   Empty State (Table Placeholder)
   ======================================== */
.empty-state {
    text-align: center;
    padding: 48px 32px !important;
    color: #6B7280;
}

.empty-state i {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
    color: #D1D5DB;
}

.empty-state span {
    font-size: 0.9rem;
    color: #9CA3AF;
    display: block;
}

/* ========================================
   Accounting Tab - Financial Focused Design
   ======================================== */

/* KPI Cards Row */
.accounting-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 24px;
    padding-bottom: 0;
}

.accounting-kpi-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    transition: all 0.2s ease;
}

.accounting-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

.kpi-icon-wrap i {
    font-size: 24px;
}

.kpi-primary .kpi-icon-wrap {
    background: linear-gradient(135deg, #E0E7FF 0%, #C7D2FE 100%);
}

.kpi-primary .kpi-icon-wrap i {
    color: #4F46E5;
}

.kpi-info .kpi-icon-wrap {
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
}

.kpi-info .kpi-icon-wrap i {
    color: #2563EB;
}

.kpi-warning .kpi-icon-wrap {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
}

.kpi-warning .kpi-icon-wrap i {
    color: #D97706;
}

.kpi-success .kpi-icon-wrap {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
}

.kpi-success .kpi-icon-wrap i {
    color: #059669;
}

.kpi-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1F2937;
    line-height: 1;
}

.kpi-label {
    font-size: 0.8rem;
    color: #6B7280;
    font-weight: 500;
}

/* Accounting Notice */
.accounting-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 24px;
    padding: 12px 16px;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 8px;
    color: #92400E;
    font-size: 0.875rem;
}

.accounting-notice i {
    font-size: 1.1rem;
    color: #D97706;
}

/* Content Grid */
.accounting-content-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    padding: 0 24px 24px 24px;
}

/* Section Cards */
.accounting-section {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
}

.accounting-section-header {
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
    background: white;
}

.accounting-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1F2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.accounting-section-title i {
    font-size: 1rem;
    color: #6B7280;
}

/* Accounting Table */
.accounting-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.accounting-table thead th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6B7280;
    padding: 12px 16px;
    border-bottom: 1px solid #E5E7EB;
    background: #F9FAFB;
}

.accounting-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #F3F4F6;
    vertical-align: middle;
    font-size: 0.875rem;
}

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

.accounting-table tbody tr:hover {
    background: #F9FAFB;
}

.bank-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bank-name {
    font-weight: 500;
    color: #1F2937;
}

.policy-count {
    font-weight: 600;
    color: #1F2937;
}

.premium-value {
    font-weight: 600;
    color: #059669;
}

.premium-total {
    color: #059669;
    font-size: 1rem;
}

/* Percentage Cell with Bar */
.percentage-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
}

.percentage-bar {
    height: 6px;
    background: linear-gradient(90deg, #3B82F6 0%, #60A5FA 100%);
    border-radius: 3px;
    min-width: 4px;
    max-width: 60px;
    transition: width 0.3s ease;
}

.percentage-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: #6B7280;
    white-space: nowrap;
}

/* Totals Row */
.totals-row {
    background: #F3F4F6 !important;
    border-top: 2px solid #E5E7EB;
}

.totals-row td {
    padding-top: 16px !important;
    padding-bottom: 16px !important;
}

/* Charts Container */
.charts-container {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: white;
}

.chart-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chart-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ========================================
   Reports Grid
   ======================================== */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.report-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--neutral-50, #F8FAFC);
    border: 1px solid var(--border-light, #f0e5dc);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.report-card:hover {
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

.report-icon-green {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.report-icon-blue {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.report-icon-purple {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
}

.report-icon-orange {
    background: rgba(249, 115, 22, 0.1);
    color: #ea580c;
}

.report-icon-red {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.report-info {
    flex: 1;
}

.report-info h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary, #0F172A);
    margin: 0 0 4px 0;
}

.report-info p {
    font-size: 0.8125rem;
    color: var(--text-muted, #64748B);
    margin: 0;
}

.btn-export {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--border-medium, #e5d5c8);
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-export:hover {
    background: var(--brand-50, #E6F2F8);
    border-color: var(--brand-300, #66B1D5);
    color: var(--brand-600, #004980);
}

.btn-export:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Custom Report Generator Button */
.btn-custom-report {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--brand-600, #004980) 0%, var(--brand-700, #003d6b) 100%);
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 73, 128, 0.2);
}

.btn-custom-report:hover {
    background: linear-gradient(135deg, var(--brand-700, #003d6b) 0%, var(--brand-800, #002d52) 100%);
    box-shadow: 0 4px 8px rgba(0, 73, 128, 0.3);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.btn-custom-report i {
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .accounting-kpis {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .accounting-content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .accounting-kpis {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    
    .accounting-kpi-card {
        padding: 16px;
    }
    
    .kpi-value {
        font-size: 1.5rem;
    }
    
    .accounting-content-grid {
        padding: 0 16px 16px 16px;
    }
    
    .percentage-cell {
        min-width: 80px;
    }
    
    .percentage-bar {
        max-width: 40px;
    }
    
    .reports-grid {
        grid-template-columns: 1fr;
    }
}

