/* CRM Platform - Base Stylesheet */
:root {
    --bs-info: #0dcaf0;
    --bs-dark: #111827;
    --bs-card-border-radius: 12px;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8f9fa;
    color: #1f2937;
    overflow-x: hidden;
}

/* Sidebar Hover Mechanics */
.sidebar .nav-link {
    transition: all 0.2s ease-in-out;
}
.sidebar .nav-link.hover-opacity:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--bs-info) !important;
}

/* Cards System styling */
.crm-card {
    border: none;
    border-radius: var(--bs-card-border-radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.15s ease;
}
.crm-card:hover {
    transform: translateY(-2px);
}

.table-responsive-wrapper {
    background: #ffffff;
    border-radius: var(--bs-card-border-radius);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

/* Custom Dynamic Badge Formats */
.badge-stage-new { background-color: #e0f2fe; color: #0369a1; }
.badge-stage-called { background-color: #fef3c7; color: #d97706; }
.badge-stage-interested { background-color: #dcfce7; color: #15803d; }
.badge-stage-meeting { background-color: #f3e8ff; color: #7e22ce; }
.badge-stage-proposal { background-color: #e0e7ff; color: #4338ca; }
.badge-stage-negotiation { background-color: #ffedd5; color: #c2410c; }
.badge-stage-converted { background-color: #bbf7d0; color: #166534; font-weight: bold; }
.badge-stage-lost { background-color: #fee2e2; color: #b91c1c; }
.badge-stage-future { background-color: #f3f4f6; color: #374151; }

.badge-priority-high { background-color: #dc3545; color: #ffffff; }
.badge-priority-medium { background-color: #ffc107; color: #000000; }
.badge-priority-low { background-color: #6c757d; color: #ffffff; }

/* Timeline UI styling */
.timeline-stream {
    position: relative;
    padding-left: 24px;
    list-style: none;
}
.timeline-stream::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background-color: #e5e7eb;
}
.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -21px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--bs-info);
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 2px rgba(13, 202, 240, 0.2);
}/* ==========================================
   PHASE 3 & 4: MOBILE TABLE-TO-CARD TRANSFORMATION
   Transforms standard tables into stacked app cards on mobile
   ========================================== */
@media (max-width: 991.98px) {
    .tbf-responsive-table {
        border: none !important;
        background: transparent !important;
    }
    
    /* Hide the horizontal column headers */
    .tbf-responsive-table thead {
        display: none !important; 
    }
    
    /* Protect date/group header rows from wrapping */
    .tbf-responsive-table tbody tr.tbf-date-header-group td {
        background-color: transparent !important;
        border: none !important;
        padding: 16px 0 8px 0 !important;
    }
    
    /* Convert each table row into a floating card */
    .tbf-responsive-table tbody tr:not(.tbf-date-header-group) {
        display: flex;
        flex-direction: column;
        background-color: #ffffff;
        border: 1px solid #cbd5e1 !important;
        border-radius: 12px;
        margin-bottom: 16px;
        box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
        padding: 4px;
        position: relative;
    }
    
    /* Stack the individual cells on top of each other */
    .tbf-responsive-table tbody td {
        display: block;
        width: 100% !important;
        text-align: left !important;
        padding: 12px 10px !important;
        border-bottom: 1px dashed #e2e8f0;
    }
    
    /* Remove border from the last cell */
    .tbf-responsive-table tbody td:last-child {
        border-bottom: none;
    }

    /* Standardize Action Buttons Row for Touch Devices */
    .tbf-responsive-table tbody td.text-end {
        background-color: #f8fafc;
        border-radius: 8px;
        margin-top: 6px;
        padding: 10px !important;
    }
    .tbf-responsive-table tbody td.text-end .d-flex {
        justify-content: space-between !important;
        width: 100%;
        gap: 8px !important;
    }
    
    /* Make Quick Action buttons larger and stretch evenly for fat fingers */
    .tbf-responsive-table tbody td.text-end .btn {
        flex: 1;
        padding: 10px 0 !important;
        font-size: 1.1rem !important;
    }

    /* Force dropdowns (like Stage/Priority/Agent) to 100% width on mobile */
    .tbf-responsive-table select.form-select-sm-custom {
        width: 100% !important;
        padding: 10px !important;
        font-size: 0.95rem !important;
    }
}