/* Financial Plan - Professional Stylesheet */

/* Base Styles */
body {
    font-family: 'Kanit', sans-serif;
    background-color: #f5f6fa;
    color: #2c3e50;
}

/* Header Section */
.header-gradient {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-gradient h1 {
    font-size: 1.75rem;
    font-weight: 500;
}

.header-gradient p {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Summary Cards - Updated for 6 cards layout */
.summary-card {
    background: white;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    border: 1px solid #e1e8ed;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e0;
}

.summary-card i {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.summary-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.summary-card p {
    font-size: 0.8rem;
    color: #718096;
    margin: 0;
}

/* Responsive layout for summary cards */
@media (min-width: 1400px) {
    /* Ultra wide screens - show all 7 cards in one row */
    .summary-card-container {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }
}

@media (max-width: 1399px) and (min-width: 1200px) {
    /* Large screens - 4 cards per row */
    .col-lg-2 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

@media (max-width: 1199px) and (min-width: 768px) {
    /* Medium screens - 3 cards per row */
    .col-lg-2 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

@media (max-width: 767px) {
    /* Small screens - 2 cards per row */
    .col-lg-2 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .summary-card {
        padding: 1rem;
    }
    
    .summary-card i {
        font-size: 1.5rem;
    }
    
    .summary-card h3 {
        font-size: 1.25rem;
    }
    
    .summary-card p {
        font-size: 0.75rem;
    }
}

/* Filter Section */
.filter-section {
    background: white;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e8ed;
}

.filter-section label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.form-select, .form-control {
    border: 1px solid #cbd5e0;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.2s;
}

.form-select:focus, .form-control:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* Table Container */
.table-container {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e8ed;
    overflow-x: auto;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-container h5 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 1.25rem;
}

/* Table Styles */
.table {
    font-size: 0.9rem;
    white-space: nowrap;
}

.table thead th {
    background-color: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
    color: #4a5568;
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.table tbody tr:hover {
    background-color: #f7fafc;
}

/* Highlight effect for updated rows */
.table tbody tr.table-success {
    background-color: #d4edda !important;
    transition: background-color 2s ease;
}

.table tbody tr.table-warning {
    background-color: #fff3cd !important;
    transition: background-color 2s ease;
}

/* Collected Note Styles */
.collected-note {
    font-size: 0.8rem;
    color: #6c757d;
    max-width: 250px;
    word-wrap: break-word;
}

.collected-note small {
    line-height: 1.4;
}

/* Status Badges */
.status-critical {
    background-color: #e53e3e;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-warning {
    background-color: #ed8936;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-normal {
    background-color: #48bb78;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Plan Badges */
.plan-badge {
    background: #e6fffa;
    color: #234e52;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    display: inline-block;
    font-size: 0.8rem;
    border: 1px solid #81e6d9;
}

.no-plan-badge {
    background: #fed7d7;
    color: #742a2a;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    display: inline-block;
    font-size: 0.8rem;
    border: 1px solid #fc8181;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
}

.btn-plan {
    background: #4299e1;
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: background 0.2s;
    font-weight: 500;
}

.btn-plan:hover {
    background: #3182ce;
    color: white;
}

.btn-success {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    font-weight: 500;
}

.btn-warning {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    font-weight: 500;
    background: #ed8936;
    border-color: #ed8936;
    color: white;
}

.btn-warning:hover {
    background: #dd6b20;
    border-color: #dd6b20;
    color: white;
}

.btn-outline-secondary {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
}

/* Dropdown Action Button */
.dropdown-toggle::after {
    margin-left: 0.255em;
}

.dropdown-menu {
    font-size: 0.85rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background-color: #f7fafc;
}

.dropdown-item i {
    width: 20px;
    margin-right: 0.5rem;
}

/* Customer Details */
.customer-detail {
    font-size: 0.8rem;
    color: #718096;
    margin-top: 0.25rem;
    white-space: nowrap;
}

.customer-name {
    font-weight: 500;
    color: #2d3748;
    display: block;
    margin-bottom: 0.25rem;
    white-space: nowrap;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    text-align: center;
    padding: 4rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.loading-spinner .spinner-border {
    width: 3rem !important;
    height: 3rem !important;
    border-width: 0.3rem;
}

/* Modal Styles */
.modal-header {
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 1.5rem;
}

.detail-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
}

.detail-section h6 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
}

.detail-row {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: #718096;
}

.detail-value {
    font-weight: 400;
    color: #2d3748;
}

.caretaker-badge {
    background: #edf2f7;
    color: #4a5568;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    display: inline-block;
    margin: 0.25rem;
    font-size: 0.85rem;
    border: 1px solid #cbd5e0;
}

.amount-display {
    font-size: 1.5rem;
    font-weight: 700;
}

.amount-badge {
    background: #f7fafc;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
}

/* Primary Button Override */
.btn-primary {
    background-color: #4299e1;
    border-color: #4299e1;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: #3182ce;
    border-color: #3182ce;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-gradient h1 {
        font-size: 1.5rem;
    }
    
    .summary-card {
        margin-bottom: 1rem;
    }
    
    .summary-card i {
        font-size: 1.5rem;
    }
    
    .summary-card h3 {
        font-size: 1.5rem;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .table thead th {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
    
    .table tbody td {
        padding: 0.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .filter-section .row {
        margin: 0;
    }
    
    .filter-section .col-md-3 {
        padding: 0;
    }
}

/* iPad Specific Styles */
@media (min-width: 768px) and (max-width: 1024px) {
    .container-fluid {
        padding: 0 1rem;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .table {
        min-width: 900px;
    }
}

/* DataTables Custom Styling */
.dataTables_wrapper .dataTables_length select {
    min-width: 60px;
    padding: 0.25rem;
}

.dataTables_wrapper .dataTables_filter input {
    padding: 0.35rem;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #4299e1 !important;
    border-color: #4299e1 !important;
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #e2e8f0 !important;
    border-color: #cbd5e0 !important;
    color: #2d3748 !important;
}

/* Professional Color Scheme */
.text-primary {
    color: #4299e1 !important;
}

.text-success {
    color: #48bb78 !important;
}

.text-danger {
    color: #e53e3e !important;
}

.text-warning {
    color: #ed8936 !important;
}

.text-info {
    color: #38b2ac !important;
}

.bg-primary {
    background-color: #2c3e50 !important;
}

.bg-success {
    background-color: #48bb78 !important;
}