/* =========================================
   Ijaride CRM - Main Stylesheet
   ========================================= */

:root {
    --rf-sidebar-width: 250px;
    --rf-navbar-height: 56px;
    --rf-primary: #0d6efd;
    --rf-dark: #1a1d21;
    --rf-sidebar-bg: #212529;
    --rf-sidebar-hover: #2c3136;
    --rf-sidebar-active: #0d6efd;
}

/* === Base === */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.875rem;
    background-color: #f4f6f9;
    overflow-x: hidden;
}

/* === Navbar === */
.rf-navbar {
    height: var(--rf-navbar-height);
    z-index: 1040;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.rf-navbar .navbar-brand {
    font-size: 1.1rem;
}

/* === Sidebar === */
.rf-sidebar {
    position: fixed;
    top: var(--rf-navbar-height);
    left: 0;
    width: var(--rf-sidebar-width);
    height: calc(100vh - var(--rf-navbar-height));
    background-color: var(--rf-sidebar-bg);
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease;
    z-index: 1030;
}

.rf-sidebar-content {
    padding: 0.5rem 0;
}

.rf-sidebar-nav .nav-link {
    color: #adb5bd;
    padding: 0.6rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.rf-sidebar-nav .nav-link:hover {
    color: #fff;
    background-color: var(--rf-sidebar-hover);
}

.rf-sidebar-nav .nav-link.active {
    color: #fff;
    background-color: rgba(13, 110, 253, 0.15);
    border-left-color: var(--rf-sidebar-active);
}

.rf-sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
}

/* === Sidebar Overlay (mobile) === */
.rf-sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--rf-navbar-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--rf-navbar-height));
    background: rgba(0, 0, 0, 0.5);
    z-index: 1029;
}

.rf-sidebar-overlay.show {
    display: block;
}

/* === Main Content === */
.rf-main {
    margin-left: var(--rf-sidebar-width);
    margin-top: var(--rf-navbar-height);
    min-height: calc(100vh - var(--rf-navbar-height));
}

/* === Page Header === */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

/* === Cards === */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-radius: 0.5rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}

/* === Stat Cards === */
.stat-card {
    border-left: 4px solid var(--rf-primary);
    transition: transform 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-icon {
    font-size: 2rem;
    opacity: 0.3;
}

.stat-card.border-success { border-left-color: #198754; }
.stat-card.border-warning { border-left-color: #ffc107; }
.stat-card.border-danger { border-left-color: #dc3545; }
.stat-card.border-info { border-left-color: #0dcaf0; }
.stat-card.border-primary { border-left-color: #0d6efd; }

/* === Tables === */
.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #6c757d;
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
}

/* DataTables overrides */
.dataTables_wrapper .dataTables_filter input {
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    padding: 0.375rem 0.75rem;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
}

/* === Status Badges === */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

/* === Kanban Board === */
.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    min-height: 400px;
}

.kanban-column {
    flex: 0 0 280px;
    min-width: 280px;
    background: #f8f9fa;
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
}

.kanban-column-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: 2px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-column-body {
    flex: 1;
    padding: 0.5rem;
    min-height: 100px;
    overflow-y: auto;
}

.kanban-card {
    background: #fff;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    cursor: grab;
    border-left: 3px solid transparent;
    transition: box-shadow 0.15s ease;
}

.kanban-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.kanban-card.sortable-ghost {
    opacity: 0.5;
}

.kanban-card .card-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.kanban-card .card-meta {
    font-size: 0.75rem;
    color: #6c757d;
}

/* === Forms === */
.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--rf-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* === Timeline === */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.65rem;
    top: 0.25rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--rf-primary);
    border: 2px solid #fff;
}

.timeline-item .timeline-date {
    font-size: 0.75rem;
    color: #6c757d;
}

.timeline-item .timeline-content {
    font-size: 0.875rem;
}

/* === Scrollbar === */
.rf-sidebar::-webkit-scrollbar {
    width: 4px;
}

.rf-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

/* === Photo Upload === */
.photo-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.photo-upload-area:hover,
.photo-upload-area.dragover {
    border-color: var(--rf-primary);
    background: rgba(13, 110, 253, 0.05);
}

/* === Responsive === */
@media (max-width: 991.98px) {
    .rf-sidebar {
        transform: translateX(-100%);
    }

    .rf-sidebar.show {
        transform: translateX(0);
    }

    .rf-main {
        margin-left: 0;
    }
}

@media (max-width: 575.98px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .stat-card .stat-value {
        font-size: 1.25rem;
    }
}

/* === Utility === */
.cursor-pointer { cursor: pointer; }
.min-w-0 { min-width: 0; }
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === Print === */
@media print {
    .rf-navbar,
    .rf-sidebar,
    .rf-sidebar-overlay {
        display: none !important;
    }
    .rf-main {
        margin-left: 0 !important;
        margin-top: 0 !important;
    }
}
