/* css/dealer-dashboard.css — Premium Dealer Dashboard Styles */
/* ============================================
   CREDCARS MOBILITY — Dealer Dashboard
   ============================================ */

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */
.dealer-dashboard-layout {
    display: flex;
    min-height: 100vh;
    background: #F8FAFC;
}

/* ============================================
   SIDEBAR
   ============================================ */
.dealer-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: #0A1628;
    color: #fff;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.dealer-sidebar::-webkit-scrollbar {
    width: 4px;
}

.dealer-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.sidebar-logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
}

.sidebar-logo-text .logo-highlight {
    color: #2D7DFF;
}

.sidebar-badge {
    background: linear-gradient(135deg, #2D7DFF, #7C3AED);
    color: #fff;
    font-size: 0.6rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-left: 0.25rem;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}

.sidebar-close:hover {
    color: #fff;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-avatar {
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #2D7DFF, #7C3AED);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
}

.sidebar-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
}

.sidebar-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.5rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    background: none;
    border-right: none;
    border-top: none;
    border-bottom: none;
    width: 100%;
    font-family: inherit;
    text-align: left;
}

.sidebar-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-nav-link.active {
    color: #fff;
    background: rgba(45, 125, 255, 0.12);
    border-left-color: #2D7DFF;
}

.sidebar-nav-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-nav-label {
    flex: 1;
}

.sidebar-badge {
    padding: 0.125rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
}

.sidebar-badge.badge-unread {
    background: #EF4444;
    color: #fff;
}

.sidebar-footer {
    padding: 0.75rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-footer .sidebar-nav-link {
    color: rgba(255, 255, 255, 0.4);
}

.sidebar-footer .sidebar-nav-link:hover {
    color: #fff;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.dealer-main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   HEADER
   ============================================ */
.dealer-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: #fff;
    border-bottom: 1px solid #E2E8F0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.dealer-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
}

.sidebar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #1E293B;
    border-radius: 2px;
    transition: all 0.2s;
}

.dashboard-page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0A1628;
    margin: 0;
}

.dealer-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-icon-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 9999px;
    border: none;
    background: #F8FAFC;
    color: #64748B;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-icon-btn:hover {
    background: #F1F5F9;
    color: #2D7DFF;
}

.header-icon-btn .header-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 0.6rem;
    font-weight: 600;
    background: #EF4444;
    color: #fff;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0.75rem;
    border-left: 1px solid #E2E8F0;
}

.header-user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1E293B;
}

.header-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #2D7DFF, #7C3AED);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: #fff;
}

/* ============================================
   DASHBOARD CONTENT
   ============================================ */
.dealer-dashboard-content {
    padding: 1.5rem 2rem 6rem;
    flex: 1;
}

/* ============================================
   SECTIONS
   ============================================ */
.dashboard-section {
    display: none;
    animation: fadeInUp 0.3s ease;
}

.dashboard-section.active {
    display: block;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: #fff;
    border-radius: 1rem;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
}

.stat-card-icon {
    font-size: 2rem;
}

.stat-card-content {
    flex: 1;
}

.stat-card-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #0A1628;
}

.stat-card-label {
    font-size: 0.875rem;
    color: #64748B;
}

.stat-card-change {
    font-size: 0.75rem;
    font-weight: 500;
}

.stat-card-change.positive {
    color: #10B981;
}

.stat-card-change.negative {
    color: #EF4444;
}

/* ============================================
   DASHBOARD ROW
   ============================================ */
.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-panel {
    background: #fff;
    border-radius: 1rem;
    padding: 1.25rem;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0A1628;
    margin: 0;
}

.panel-subtitle {
    font-size: 0.875rem;
    color: #94A3B8;
}

.panel-link {
    font-size: 0.875rem;
    color: #2D7DFF;
    text-decoration: none;
    font-weight: 500;
}

.panel-link:hover {
    text-decoration: underline;
}

.panel-count {
    font-size: 0.875rem;
    color: #64748B;
}

/* ============================================
   CHART
   ============================================ */
.chart-container {
    height: 180px;
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.chart-bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    min-height: 12px;
    position: relative;
    transition: height 0.6s ease;
    background: linear-gradient(180deg, #2D7DFF, #7C3AED);
    opacity: 0.8;
}

.chart-bar:hover {
    opacity: 1;
    transform: scaleY(1.02);
    transform-origin: bottom;
}

.chart-bar-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    color: #94A3B8;
}

.chart-bar-value {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    font-weight: 600;
    color: #0A1628;
    opacity: 0;
    transition: opacity 0.3s;
}

.chart-bar:hover .chart-bar-value {
    opacity: 1;
}

/* ============================================
   ACTIVITY FEED
   ============================================ */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
}

.activity-feed::-webkit-scrollbar {
    width: 4px;
}

.activity-feed::-webkit-scrollbar-thumb {
    background: #E2E8F0;
    border-radius: 9999px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background: #F8FAFC;
    transition: background 0.2s;
}

.activity-item:hover {
    background: #F1F5F9;
}

.activity-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.activity-text {
    flex: 1;
    font-size: 0.875rem;
    color: #1E293B;
}

.activity-text strong {
    color: #0A1628;
}

.activity-time {
    font-size: 0.7rem;
    color: #94A3B8;
    white-space: nowrap;
}

/* ============================================
   QUICK ACTIONS
   ============================================ */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.25rem;
    padding: 1rem;
    background: #F8FAFC;
    border-radius: 0.75rem;
    text-decoration: none;
    color: #1E293B;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.quick-action-card:hover {
    background: #fff;
    border-color: #2D7DFF;
    box-shadow: 0 4px 12px rgba(45, 125, 255, 0.08);
    transform: translateY(-2px);
}

.quick-action-icon {
    font-size: 1.5rem;
}

.quick-action-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748B;
}

/* ============================================
   NOTIFICATIONS
   ============================================ */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.notifications-list::-webkit-scrollbar {
    width: 4px;
}

.notifications-list::-webkit-scrollbar-thumb {
    background: #E2E8F0;
    border-radius: 9999px;
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    background: #F8FAFC;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #F1F5F9;
}

.notification-item.unread {
    background: rgba(45, 125, 255, 0.04);
    border-left: 3px solid #2D7DFF;
}

.notification-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.notification-text {
    flex: 1;
    font-size: 0.875rem;
    color: #1E293B;
}

.notification-text strong {
    color: #0A1628;
}

.notification-time {
    font-size: 0.7rem;
    color: #94A3B8;
    white-space: nowrap;
}

/* ============================================
   INVENTORY GRID
   ============================================ */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.inventory-item {
    background: #F8FAFC;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid #E2E8F0;
    transition: all 0.2s;
}

.inventory-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    border-color: #2D7DFF;
}

.inventory-item-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #E2E8F0;
}

.inventory-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inventory-item-body {
    padding: 0.75rem;
}

.inventory-item-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0A1628;
    margin: 0 0 0.25rem;
}

.inventory-item-details {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #64748B;
}

.inventory-item-price {
    font-size: 1rem;
    font-weight: 700;
    color: #0A1628;
    margin: 0.25rem 0 0;
}

.inventory-item-status {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.inventory-item-status.active {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.inventory-item-status.pending {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.inventory-item-status.sold {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

/* ============================================
   LEADS LIST
   ============================================ */
.leads-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.lead-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #F8FAFC;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.lead-item:hover {
    background: #F1F5F9;
}

.lead-item .lead-avatar {
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #2D7DFF, #7C3AED);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.lead-info {
    flex: 1;
}

.lead-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #0A1628;
}

.lead-vehicle {
    font-size: 0.75rem;
    color: #64748B;
}

.lead-status {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

.lead-status.hot {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.lead-status.warm {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.lead-status.cold {
    background: rgba(100, 116, 139, 0.1);
    color: #64748B;
}

/* ============================================
   MESSAGES LIST
   ============================================ */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #F8FAFC;
    border-radius: 0.5rem;
    transition: background 0.2s;
    cursor: pointer;
}

.message-item:hover {
    background: #F1F5F9;
}

.message-item.unread {
    background: rgba(45, 125, 255, 0.04);
    border-left: 3px solid #2D7DFF;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    background: #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: #475569;
    flex-shrink: 0;
}

.message-info {
    flex: 1;
}

.message-sender {
    font-size: 0.875rem;
    font-weight: 500;
    color: #0A1628;
}

.message-preview {
    font-size: 0.75rem;
    color: #64748B;
}

.message-time {
    font-size: 0.7rem;
    color: #94A3B8;
    white-space: nowrap;
}

/* ============================================
   ANALYTICS
   ============================================ */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.analytics-card {
    text-align: center;
    padding: 1.25rem;
    background: #F8FAFC;
    border-radius: 0.75rem;
}

.analytics-label {
    display: block;
    font-size: 0.75rem;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.analytics-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #0A1628;
    margin: 0.25rem 0;
}

.analytics-change {
    font-size: 0.75rem;
    font-weight: 500;
}

.analytics-change.positive {
    color: #10B981;
}

.analytics-change.negative {
    color: #EF4444;
}

/* ============================================
   FINANCING
   ============================================ */
.financing-overview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.financing-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: #F8FAFC;
    border-radius: 0.75rem;
}

.financing-card-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.financing-card-content {
    flex: 1;
}

.financing-card-content h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748B;
    margin: 0 0 0.25rem;
}

.financing-amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0A1628;
    margin: 0;
}

.financing-sub {
    font-size: 0.75rem;
    color: #94A3B8;
    margin: 0.125rem 0 0;
}

/* ============================================
   PROFILE
   ============================================ */
.profile-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.profile-field {
    padding: 0.75rem 1rem;
    background: #F8FAFC;
    border-radius: 0.5rem;
}

.profile-field-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.profile-field-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: #0A1628;
    margin-top: 0.125rem;
}

/* ============================================
   SETTINGS
   ============================================ */
.settings-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #F8FAFC;
    border-radius: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.setting-item-info {
    display: flex;
    flex-direction: column;
}

.setting-item-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #0A1628;
}

.setting-item-desc {
    font-size: 0.75rem;
    color: #64748B;
}

/* ============================================
   MOBILE NAV
   ============================================ */
.dealer-mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #E2E8F0;
    padding: 0.25rem 0;
    z-index: 50;
    justify-content: space-around;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: #94A3B8;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    position: relative;
    transition: color 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.mobile-nav-item:hover {
    color: #475569;
}

.mobile-nav-item.active {
    color: #2D7DFF;
}

.mobile-nav-icon {
    font-size: 1.2rem;
}

.mobile-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    font-size: 0.55rem;
    font-weight: 600;
    background: #94A3B8;
    color: #fff;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-badge.badge-unread {
    background: #EF4444;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .dealer-sidebar {
        transform: translateX(-100%);
    }

    .dealer-sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .dealer-main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: flex;
    }

    .dashboard-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .analytics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dealer-dashboard-header {
        padding: 0.75rem 1rem;
    }

    .dealer-dashboard-content {
        padding: 1rem;
        padding-bottom: 5rem;
    }

    .dashboard-page-title {
        font-size: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 0.875rem;
    }

    .stat-card-value {
        font-size: 1.25rem;
    }

    .header-user-name {
        display: none;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .inventory-grid {
        grid-template-columns: 1fr 1fr;
    }

    .profile-content {
        grid-template-columns: 1fr;
    }

    .analytics-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dealer-mobile-nav {
        display: flex;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .inventory-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr 1fr;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .financing-card {
        flex-direction: column;
        text-align: center;
    }

    .dashboard-panel {
        padding: 1rem;
    }
}