/* Navigation Layout Styles */

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
    background: #f8f9fa;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    transition: all 0.3s ease;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transform: translateX(0); /* Always visible on desktop */
    display: flex;
    flex-direction: column;
}


.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #34495e;
    color: white;
    opacity: 1;
    pointer-events: auto;
    position: relative;
    z-index: 2100;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: white;
    pointer-events: auto;
}

.sidebar-header p {
    color: #bdc3c7;
    font-size: 0.9rem;
    opacity: 1;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    border-bottom: 1px solid #34495e;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.nav-item a:hover {
    background: #34495e;
    color: white;
}

.nav-item.active a {
    background: #3498db;
    color: white;
}

.nav-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Header */
.top-header {
    background: white;
    padding: 18px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
    z-index: 100; /* Lower than sidebar (1000) */
    backdrop-filter: blur(10px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
    display: block;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

/* Fallback icon handling */
.sidebar-toggle .fallback-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Ensure button is always visible and properly styled */
.sidebar-toggle {
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Show fallback icon if Font Awesome fails to load */
.sidebar-toggle i.fas {
    display: block;
}

.sidebar-toggle i.fas:not(.fa-bars):not(.fa-times) {
    display: none;
}

.sidebar-toggle:not(:has(i.fas)) .fallback-icon {
    display: block !important;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 100; /* Lower than sidebar */
}

.chit-selector select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    transition: all 0.3s ease;
}

.chit-selector select:hover {
    border-color: #4ecdc4;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chit-selector select:focus {
    border-color: #4ecdc4;
    outline: none;
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    position: relative;
    z-index: 10; /* Lower than sidebar */
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 30px;
    background: #f8f9fa;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.page-header h2 {
    color: #2c3e50;
    font-size: 2rem;
    font-weight: 600;
}

.page-actions {
    display: flex;
    gap: 10px;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.card-header h3 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

/* Fix chart canvas sizing to prevent vertical overflow */
#bidsOverTimeChart {
    display: block;
    width: 100% !important;
    height: 260px !important;
    max-height: 260px;
}

.chart-card h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

/* Recent Bids */
.recent-bids-list {
    max-height: 300px;
    overflow-y: auto;
}

.bid-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #ecf0f1;
}

.bid-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bid-member {
    font-weight: 600;
    color: #2c3e50;
}

.bid-date {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.bid-amount {
    font-weight: 600;
    color: #27ae60;
}

/* Interest Trends */
.interest-trends {
    max-height: 300px;
    overflow-y: auto;
}

.trend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #ecf0f1;
}

.member-name {
    font-weight: 600;
    color: #2c3e50;
}

.trend-values {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
}

.simple-interest {
    font-size: 0.9rem;
    color: #3498db;
}

.compound-interest {
    font-size: 0.9rem;
    color: #e74c3c;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.notification-success {
    border-left: 4px solid #27ae60;
}

.notification-error {
    border-left: 4px solid #e74c3c;
}

.notification-warning {
    border-left: 4px solid #f39c12;
}

.notification-info {
    border-left: 4px solid #3498db;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.notification-close {
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    padding: 5px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Custom Scrollbar Styling - 20% of original width */
::-webkit-scrollbar {
    width: 3px; /* Reduced from default ~15px to 3px (20%) */
    height: 3px;
}

/* Add margin to scrollable content to prevent overlap */
.table-container,
.chart-container,
.dashboard-card,
.modal,
.recent-bids,
.interest-trends {
    margin-right: 8px; /* Space for scrollbar + padding */
    padding-right: 4px; /* Additional padding for content */
}

/* Specific spacing for different container types */
.table-container {
    margin-right: 10px;
    padding-right: 6px;
}

.chart-container {
    margin-right: 8px;
    padding-right: 4px;
}

.dashboard-card {
    margin-right: 6px;
    padding-right: 3px;
}

.modal {
    margin-right: 8px;
    padding-right: 4px;
}

/* Table specific spacing */
.table-container table {
    margin-right: 0;
    padding-right: 0;
}

.table-container th,
.table-container td {
    padding-right: 8px; /* Extra padding for last column */
}

/* Chart specific spacing */
.chart-container canvas {
    margin-right: 4px;
}

/* Modal content spacing */
.modal-content {
    margin-right: 4px;
    padding-right: 8px;
}

/* Dashboard specific scrollable content */
.dashboard-grid .dashboard-card {
    margin-right: 6px;
    padding-right: 3px;
}

.dashboard-charts .chart-container {
    margin-right: 8px;
    padding-right: 4px;
}

/* Recent bids specific spacing */
.recent-bids,
.recent-bids-list {
    margin-right: 10px;
    padding-right: 6px;
}

.recent-bids table {
    margin-right: 0;
}

.recent-bids th:last-child,
.recent-bids td:last-child {
    padding-right: 12px; /* Extra padding for last column */
}

/* Centralized Chart Content Styling */
.chart-content {
    margin-right: 8px;
    padding-right: 4px;
    overflow-x: auto;
}

.chart-item {
    margin-right: 4px;
    padding-right: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007bff;
}

.chart-item-info {
    margin-right: 4px;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chart-item-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.chart-item-subtitle {
    font-size: 0.8rem;
    color: #6c757d;
}

.chart-item-value {
    margin-right: 4px;
    padding-right: 4px;
    font-weight: 700;
    color: #28a745;
    font-size: 1rem;
}

/* Recent Bids Specific Styling */
.recent-bids-list {
    margin-right: 8px;
    padding-right: 4px;
    overflow-x: auto;
}

.bid-item {
    margin-right: 4px;
    padding-right: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007bff;
}

.bid-info {
    margin-right: 4px;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bid-member {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.bid-date {
    font-size: 0.8rem;
    color: #6c757d;
}

.bid-amount {
    margin-right: 4px;
    padding-right: 4px;
    font-weight: 700;
    color: #28a745;
    font-size: 1rem;
}

/* Interest Trends Specific Styling */
.interest-trends {
    margin-right: 8px;
    padding-right: 4px;
    overflow-x: auto;
}

.trend-item {
    margin-right: 4px;
    padding-right: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #ffc107;
}

.member-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.trend-values {
    margin-right: 4px;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-end;
}

.simple-interest {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

.compound-interest {
    font-size: 0.8rem;
    color: #28a745;
    font-weight: 600;
}

/* Chart card specific spacing */
.chart-card {
    margin-right: 8px;
    padding-right: 4px;
}

.chart-card h3 {
    margin-right: 4px;
    padding-right: 4px;
}

#recentBidsChart,
#interestTrendsChart {
    margin-right: 6px;
    padding-right: 4px;
}

/* Interest trends specific spacing */
.interest-trends {
    margin-right: 8px;
    padding-right: 4px;
}

.interest-trends .chart-container {
    margin-right: 4px;
    padding-right: 2px;
}

/* Sidebar scrollable content */
.sidebar .nav-menu {
    margin-right: 4px;
    padding-right: 2px;
}

/* Page content spacing */
.page-content {
    margin-right: 8px;
    padding-right: 4px;
}

/* Form help text styling */
.form-text {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 4px;
    display: block;
}

/* Modal form styling */
.modal .form-group {
    margin-bottom: 20px;
}

.modal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.modal .form-group input,
.modal .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.modal .form-group input:focus,
.modal .form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Firefox scrollbar styling */
* {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* Specific styling for table containers */
.table-container::-webkit-scrollbar {
    width: 2px;
    height: 2px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #6c757d;
    border-radius: 1px;
}

.table-container::-webkit-scrollbar-track {
    background: #f8f9fa;
}

/* Chart container scrollbars */
.chart-container::-webkit-scrollbar {
    width: 2px;
    height: 2px;
}

.chart-container::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 1px;
}

/* Modal scrollbars */
.modal::-webkit-scrollbar {
    width: 2px;
    height: 2px;
}

.modal::-webkit-scrollbar-thumb {
    background: #495057;
    border-radius: 1px;
}

/* Dashboard specific scrollbars */
.dashboard-card::-webkit-scrollbar {
    width: 2px;
    height: 2px;
}

.dashboard-card::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 1px;
}

.dashboard-card::-webkit-scrollbar-track {
    background: rgba(0, 123, 255, 0.1);
}

/* Recent bids table scrollbars */
.recent-bids::-webkit-scrollbar {
    width: 2px;
    height: 2px;
}

.recent-bids::-webkit-scrollbar-thumb {
    background: #28a745;
    border-radius: 1px;
}

.recent-bids::-webkit-scrollbar-track {
    background: rgba(40, 167, 69, 0.1);
}

/* Interest trends scrollbars */
.interest-trends::-webkit-scrollbar {
    width: 2px;
    height: 2px;
}

.interest-trends::-webkit-scrollbar-thumb {
    background: #ffc107;
    border-radius: 1px;
}

.interest-trends::-webkit-scrollbar-track {
    background: rgba(255, 193, 7, 0.1);
}

/* Sidebar scrollbars */
.sidebar::-webkit-scrollbar {
    width: 2px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #495057;
    border-radius: 1px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

/* Bidding Suggestions Page Styles */
.suggestions-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.suggestion-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-left: 4px solid #007bff;
}

.suggestion-card h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bid-input-section {
    margin-bottom: 25px;
}

.bid-input-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.bid-input-group label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 120px;
}

.bid-input-group input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.bid-input-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.bid-suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.recent-bids-card {
    border-left-color: #2ecc71;
}

.recent-bids-card .insight-subtitle.standalone {
    font-size: 0.85rem;
    color: #2f855a;
    font-weight: 600;
    margin-bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.recent-bids-insights .insight-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 340px;
    overflow-y: auto;
    padding-right: 4px;
}

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

.insight-header h4 {
    margin: 0;
    font-size: 1.05rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.insight-subtitle {
    font-size: 0.85rem;
    color: #4a5568;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.insight-subtitle.standalone {
    margin-bottom: 12px;
    color: #2f855a;
    font-weight: 600;
}

.insight-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.insight-item {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.08), rgba(46, 204, 113, 0.02));
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.insight-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(46, 204, 113, 0.18);
}

.insight-rank {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a202c;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    border: 1px solid rgba(46, 204, 113, 0.4);
    padding: 10px 0;
}

.insight-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.insight-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2f855a;
}

.insight-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #4a5568;
}

.insight-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.insight-badge {
    padding: 4px 8px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.insight-badge.positive {
    background: rgba(56, 161, 105, 0.15);
    color: #2f855a;
}

.insight-badge.negative {
    background: rgba(229, 62, 62, 0.15);
    color: #c53030;
}

.insight-badge.neutral {
    background: rgba(99, 102, 241, 0.15);
    color: #3730a3;
}

.insight-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px dashed #cbd5f5;
    color: #4a5568;
}

.suggestion-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.suggestion-item:hover {
    border-color: #007bff;
    background: #e3f2fd;
    transform: translateY(-2px);
}

.suggestion-item.selected {
    border-color: #28a745;
    background: #d4edda;
}

.suggestion-type {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.2;
}

.suggestion-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 8px;
    line-height: 1.2;
}

.suggestion-badge {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.suggestion-description {
    font-size: 0.75rem;
    color: #6c757d;
    line-height: 1.3;
    margin-top: auto;
}

.interest-trends-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.interest-chart-container {
    position: relative;
    height: 300px;
    margin-top: 20px;
}

.interest-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.metric-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    border-left: 4px solid #28a745;
}

.metric-card.warning {
    border-left-color: #ffc107;
}

.metric-card.danger {
    border-left-color: #dc3545;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.metric-label {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

.previous-bids-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.previous-bids-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.previous-bids-table th,
.previous-bids-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.previous-bids-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.previous-bids-table th:first-child {
    border-top-left-radius: 12px;
}

.previous-bids-table th:last-child {
    border-top-right-radius: 12px;
}

.previous-bids-table tr:hover {
    background: #f8f9fa;
}

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

.bid-month {
    color: #6c757d;
    font-size: 0.9rem;
}

.bid-member {
    font-weight: 500;
    color: #2c3e50;
}

/* Responsive Design for Suggestions */
@media (max-width: 768px) {
    .suggestions-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .bid-suggestions {
        grid-template-columns: 1fr;
    }
    
    .interest-metrics {
        grid-template-columns: 1fr;
    }
    
    .bid-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bid-input-group label {
        min-width: auto;
        margin-bottom: 5px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1001;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* Ensure nav items are touchable on mobile */
    .nav-item a {
        min-height: 44px; /* iOS recommended touch target size */
        padding: 15px 20px;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
        touch-action: manipulation;
    }
    
    .nav-item a:active {
        background: #34495e;
        transform: scale(0.98);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: flex !important;
        visibility: visible !important;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
    
    .page-content {
        padding: 20px;
    }

    /* Mobile sidebar overlay */
    .sidebar.open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    /* Mobile: Always show toggle button */
    .sidebar-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Optimize page header for mobile */
    .page-header {
        padding: 15px 20px;
        margin-bottom: 15px;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    
    /* Make chit selector more prominent on mobile */
    .chit-selector {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px 15px;
        border: 2px solid #ddd;
        border-radius: 8px;
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .chit-selector:focus {
        border-color: #4ecdc4;
        outline: none;
        box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
    }
    
    /* Optimize form elements for mobile */
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 5px;
        display: block;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px 15px;
        border: 2px solid #ddd;
        border-radius: 6px;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Optimize buttons for mobile */
    .btn {
        padding: 12px 20px;
        font-size: 16px;
        border-radius: 6px;
        min-height: 44px; /* Minimum touch target size */
    }
    
    /* Optimize modal for mobile */
    .modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
}

/* Small screens - always collapsed by default */
@media (max-width: 480px) {
    body.sidebar-collapsed .sidebar {
        width: 60px;
    }
    
    body.sidebar-collapsed .main-content {
        margin-left: 60px;
    }
    
    .sidebar-header h2 {
        font-size: 1rem;
    }
    
    /* Hide heading on mobile to give more space to chit selection */
    .page-header {
        display: none;
    }
    
    /* Make chit selector more prominent when header is hidden */
    .chit-selector {
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        border: 2px solid #4ecdc4;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        font-weight: 600;
        margin: 10px 0;
        padding: 8px 12px;
        font-size: 14px;
        border-radius: 6px;
        width: 100%;
        max-width: none;
    }
    
    .chit-selector select {
        font-weight: 600;
        color: #2c3e50;
    }
    
    .chit-selector option {
        padding: 8px;
        font-size: 14px;
    }
    
    /* Make dashboard cards more compact on mobile */
    .dashboard-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .dashboard-card h3 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    .dashboard-card .value {
        font-size: 1.5rem;
    }
    
    /* Optimize table display on mobile */
    .table-responsive {
        font-size: 12px;
    }
    
    .table-responsive th,
    .table-responsive td {
        padding: 8px 4px;
    }
}

/* Sidebar Collapsed State */
body.sidebar-collapsed .sidebar {
    width: 70px;
}

body.sidebar-collapsed .main-content {
    margin-left: 70px;
}

body.sidebar-collapsed .nav-item span {
    display: none;
}

body.sidebar-collapsed .logout-btn span {
    display: none;
}

body.sidebar-collapsed .logout-btn {
    justify-content: center;
    padding: 12px;
}

body.sidebar-collapsed .sidebar-header p {
    display: none;
}

body.sidebar-collapsed .sidebar-header h2 {
    font-size: 1.2rem;
    text-align: center;
}

body.sidebar-collapsed .sidebar-header h2 i {
    margin-right: 0;
}

/* Hide text in collapsed state to prevent horizontal scroll */
body.sidebar-collapsed .sidebar-header h2 {
    font-size: 1.2rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}

body.sidebar-collapsed .sidebar-header h2 span {
    display: none;
}

body.sidebar-collapsed .sidebar-header h2::after {
    content: '';
}

/* Ensure no horizontal overflow in collapsed state */
body.sidebar-collapsed .sidebar {
    overflow: hidden;
}

body.sidebar-collapsed .sidebar-header {
    padding: 20px 10px;
    text-align: center;
}

body.sidebar-collapsed .sidebar-header h2 {
    white-space: nowrap;
    overflow: hidden;
}

/* Enhanced collapsed state */
body.sidebar-collapsed .nav-item a {
    justify-content: center;
    padding: 15px 10px;
}

body.sidebar-collapsed .nav-item a i {
    margin-right: 0;
    font-size: 1.2rem;
}

/* Tooltip for collapsed sidebar */
body.sidebar-collapsed .nav-item {
    position: relative;
}

body.sidebar-collapsed .nav-item:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #2c3e50;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    white-space: nowrap;
    z-index: 1000;
    margin-left: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

body.sidebar-collapsed .nav-item:hover::before {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #2c3e50;
    z-index: 1000;
    margin-left: 5px;
}

/* User Info Section */
.user-info {
    padding: 15px;
    margin: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 12px;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding: 15px;
    color: white;
    opacity: 1;
    pointer-events: auto;
    position: relative;
    z-index: 2100;
}

.logout-btn {
    width: 100%;
    padding: 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    pointer-events: auto !important;
    position: relative;
    z-index: 2110;
}

.logout-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.logout-btn i {
    font-size: 16px;
}

/* Delegation Styles */
.delegation-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #4ecdc4;
}

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

.delegation-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.delegation-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.delegation-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.delegation-detail {
    display: flex;
    flex-direction: column;
}

.delegation-detail-label {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.delegation-detail-value {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
}

.delegation-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.delegation-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-edit {
    background: #3498db;
    color: white;
}

.btn-edit:hover {
    background: #2980b9;
}

.btn-revoke {
    background: #e74c3c;
    color: white;
}

.btn-revoke:hover {
    background: #c0392b;
}

.btn-accept {
    background: #27ae60;
    color: white;
}

.btn-accept:hover {
    background: #229954;
}

/* Profile Styles */
.profile-card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 600px;
}

.profile-header {
    text-align: center;
    margin-bottom: 30px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 32px;
    color: white;
}

.profile-name {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 5px 0;
}

.profile-email {
    color: #7f8c8d;
    font-size: 16px;
}

.profile-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.profile-detail {
    display: flex;
    flex-direction: column;
}

.profile-detail-label {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.profile-detail-value {
    font-size: 16px;
    color: #2c3e50;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

/* Sidebar overlay - always available */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    display: none;
    pointer-events: none; /* Allow clicks through when sidebar is closed */
}

body.sidebar-open .sidebar-overlay {
    display: block;
    pointer-events: auto; /* Block clicks when sidebar is open */
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        max-width: 85%;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 2000;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* Ensure sidebar content is visible and clickable above overlay */
    .sidebar {
        z-index: 2000;
    }
    
    .sidebar-header {
        opacity: 1 !important;
        color: white !important;
        pointer-events: auto !important;
        z-index: 2100 !important;
        position: relative;
    }
    
    .sidebar-footer {
        opacity: 1 !important;
        color: white !important;
        pointer-events: auto !important;
        z-index: 2100 !important;
        position: relative;
    }
    
    .logout-btn {
        pointer-events: auto !important;
        z-index: 2110 !important;
        position: relative;
    }
    
    .user-info {
        opacity: 1 !important;
        color: white !important;
        pointer-events: auto !important;
        position: relative;
        z-index: 2100 !important;
    }
    
    .sidebar .nav-item {
        z-index: 2010;
        position: relative;
    }
    
    .sidebar .nav-item a {
        pointer-events: auto !important;
        position: relative;
        z-index: 2020;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100%;
        padding: 10px;
    }
    
    .sidebar-toggle {
        display: block !important;
    }
    
    .top-header {
        padding: 10px;
        flex-wrap: wrap;
    }
    
    .top-header h1 {
        font-size: 1.2rem;
    }
    
    .content {
        padding: 15px 10px;
        position: relative;
        z-index: 1;
        overflow-x: visible;
    }
    
    /* Table wrapper on mobile */
    .bids-table-wrapper,
    .previous-bids-wrapper {
        width: 100%;
        margin-bottom: 20px;
        position: relative;
        z-index: 1;
        overflow-x: visible;
    }
    
    /* Table containers on mobile */
    .bids-table-container,
    .previous-bids-table-container,
    .table-container {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: scroll !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        display: block !important;
        position: relative;
        z-index: 1;
        margin-bottom: 0;
        padding: 0;
        background: white;
        border-radius: 8px;
        border: 1px solid #e2e8f0;
        /* Force scrollbar on mobile */
        scrollbar-width: thin;
        /* Ensure scrolling works */
        touch-action: pan-x pan-y;
    }
    
    /* Ensure table header rounded corners show on mobile */
    .bids-table th:last-child,
    .previous-bids-table th:last-child {
        border-top-right-radius: 12px !important;
    }
    
    /* Ensure table doesn't shrink on mobile - but allow compact columns */
    .bids-table-container .bids-table,
    .previous-bids-table-container .previous-bids-table {
        width: auto !important;
        min-width: auto !important;
        max-width: none !important;
        table-layout: auto;
    }
    
    /* Make table columns more compact on mobile */
    .bids-table th,
    .bids-table td,
    .previous-bids-table th,
    .previous-bids-table td {
        padding: 8px 6px !important;
        font-size: 0.8rem !important;
        white-space: nowrap;
    }
    
    /* Adjust specific column widths - Serial column (first) */
    .bids-table th:first-child,
    .bids-table td:first-child {
        min-width: 60px !important;
        width: 60px !important;
        max-width: 60px !important;
        text-align: center !important;
    }
    
    /* Date column (second) */
    .bids-table th:nth-child(2),
    .bids-table td:nth-child(2) {
        min-width: 85px !important;
        width: 95px !important;
        max-width: 95px !important;
    }
    
    /* Member column (third) */
    .bids-table th:nth-child(3),
    .bids-table td:nth-child(3) {
        min-width: 90px !important;
        width: 100px !important;
        max-width: 100px !important;
    }
    
    /* Bid Amount column (fourth) */
    .bids-table th:nth-child(4),
    .bids-table td:nth-child(4) {
        min-width: 95px !important;
        width: 105px !important;
        max-width: 105px !important;
    }
    
    /* All other columns */
    .bids-table th:nth-child(n+5),
    .bids-table td:nth-child(n+5) {
        min-width: 100px !important;
        width: auto !important;
    }
    
    /* Ensure wrapper allows scrolling */
    .bids-table-wrapper,
    .previous-bids-wrapper {
        overflow-x: visible;
        overflow-y: visible;
    }
    
    /* Table controls wrapper on mobile - MUST be visible */
    .table-controls-wrapper {
        position: relative !important;
        z-index: 100 !important;
        width: 100% !important;
        padding: 12px 10px !important;
        margin-bottom: 15px !important;
        background: #ffffff !important;
        border-radius: 8px !important;
        border: 2px solid #667eea !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2) !important;
        order: -1;
    }
    
    /* Ensure buttons are visible on mobile */
    .table-copy-buttons {
        position: relative !important;
        z-index: 101 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        margin-bottom: 10px !important;
        width: 100% !important;
        padding: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .table-copy-btn {
        width: 100% !important;
        min-width: auto !important;
        margin: 0 !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        font-size: 15px !important;
        padding: 12px 16px !important;
    }
    
    .column-toggle-btn {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 10px !important;
        z-index: 102 !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        font-size: 15px !important;
        padding: 12px 16px !important;
    }
    
    .column-menu {
        position: relative;
        z-index: 103;
        width: 100%;
        max-width: 100%;
        margin-top: 5px;
        display: block;
    }
    
    .bids-table {
        font-size: 0.8rem !important;
        min-width: auto !important;
        width: max-content !important;
    }
    
    .bids-table th,
    .bids-table td {
        padding: 8px 6px !important;
        white-space: nowrap;
        font-size: 0.8rem !important;
    }
    
    /* Compact column widths - ensure key columns are visible */
    .bids-table th:first-child,
    .bids-table td:first-child {
        min-width: 60px !important;
        width: 60px !important;
        max-width: 60px !important;
        text-align: center !important;
    }
    
    .bids-table th:nth-child(2),
    .bids-table td:nth-child(2) {
        min-width: 85px !important;
        width: 95px !important;
        max-width: 95px !important;
    }
    
    .bids-table th:nth-child(3),
    .bids-table td:nth-child(3) {
        min-width: 90px !important;
        width: 100px !important;
        max-width: 100px !important;
    }
    
    .bids-table th:nth-child(4),
    .bids-table td:nth-child(4) {
        min-width: 95px !important;
        width: 105px !important;
        max-width: 105px !important;
    }
    
    /* Actions column - keep it compact */
    .bids-table th:last-child,
    .bids-table td:last-child {
        min-width: 80px !important;
        width: 80px !important;
        max-width: 80px !important;
        text-align: center !important;
    }
    
    .modal-content {
        width: 95% !important;
        margin: 10px auto;
        max-height: 90vh;
        padding: 0;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group input,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .btn:last-child {
        margin-bottom: 0;
    }
    
    .dashboard-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .top-header {
        z-index: 100 !important;
    }
    
    .header-right .user-info {
        z-index: 10 !important;
    }
    
    .user-info {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .chit-select-container {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .chit-select-container select {
        width: 100%;
        font-size: 16px;
    }
}
