/**
 * CarviceCRM - Custom Styles
 * Car Dealership CRM System
 */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #3b82f6;
    --sidebar-hover: #334155;
    --header-height: 60px;
    --primary-color: #3b82f6;
    --success-color: #22c55e;
    --warning-color: #eab308;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
}

/* Base Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f1f5f9;
    color: #334155;
}

/* Wrapper */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.sidebar-brand:hover {
    color: #fff;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 1.25rem;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

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

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

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 24px;
    margin-right: 0.75rem;
}

.nav-section-title {
    padding: 1.25rem 1.25rem 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    font-weight: 600;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex: 1;
}

/* Navbar */
.navbar {
    height: var(--header-height);
}

.sidebar-toggle {
    padding: 0;
    color: #64748b;
}

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

.card-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.25rem;
}

.stat-card {
    border-radius: 0.75rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

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

.stat-card .stat-label {
    color: #64748b;
    font-size: 0.875rem;
}

/* Tables */
.table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    color: #475569;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.table tbody td {
    vertical-align: middle;
    padding: 1rem 0.75rem;
}

.table tbody tr:hover {
    background: #f8fafc;
}

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

.dataTables_wrapper .dataTables_length select {
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
    padding: 0.375rem 2rem 0.375rem 0.75rem;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.375em 0.625em;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}

/* Forms */
.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
    padding: 0.625rem 0.875rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-label {
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.375rem;
}

/* Page Header */
.page-header {
    margin-bottom: 1.5rem;
}

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

.breadcrumb {
    background: none;
    padding: 0;
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
}

.breadcrumb-item a {
    color: #64748b;
    text-decoration: none;
}

.breadcrumb-item.active {
    color: #94a3b8;
}

/* Pipeline Board */
.pipeline-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.pipeline-column {
    min-width: 300px;
    max-width: 300px;
    background: #f1f5f9;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
}

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

.pipeline-column-body {
    padding: 0.75rem;
    flex: 1;
    min-height: 400px;
    max-height: 70vh;
    overflow-y: auto;
}

.deal-card {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
}

.deal-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.deal-card.sortable-ghost {
    opacity: 0.5;
    background: #e2e8f0;
}

.deal-card.sortable-chosen {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: rotate(2deg);
}

.deal-card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.deal-card-vehicle {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.deal-card-value {
    font-weight: 700;
    color: var(--success-color);
}

.deal-card-date {
    font-size: 0.75rem;
    color: #94a3b8;
}

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

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

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

.activity-item:last-child {
    padding-bottom: 0;
}

.activity-icon {
    position: absolute;
    left: -2rem;
    width: 1.25rem;
    height: 1.25rem;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e2e8f0;
}

.activity-content {
    background: #f8fafc;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

.activity-time {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Quick Actions */
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    text-decoration: none;
    color: #334155;
    transition: all 0.2s;
}

.quick-action-btn:hover {
    background: #f8fafc;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.quick-action-btn i {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

/* Lead Status Pills */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

/* Modal Improvements */
.modal-header {
    border-bottom: 1px solid #e2e8f0;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
}

/* Toast Styling */
.toast {
    background: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-close {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1030;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 767.98px) {
    .pipeline-column {
        min-width: 280px;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

/* Auth Pages */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    padding: 2rem;
}

.auth-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo i {
    font-size: 3rem;
    color: var(--primary-color);
}

.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.5rem 0 0;
}

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.avatar-lg {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #94a3b8;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h5 {
    color: #64748b;
    margin-bottom: 0.5rem;
}

/* Lead Details */
.lead-info-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    color: #fff;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.lead-info-card .lead-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.lead-info-card .lead-email,
.lead-info-card .lead-phone {
    opacity: 0.9;
}

/* Vehicle Card */
.vehicle-card {
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.vehicle-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.vehicle-card-img {
    height: 180px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 3rem;
}

.vehicle-card-body {
    padding: 1rem;
}

.vehicle-card-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.vehicle-card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success-color);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Print Styles */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
}
