/**
 * VMS Custom Styles
 * Vehicle Management System - South African Context
 * Version: 1.5.0 - Phase 4
 */

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Skip to Content Link (Accessibility) */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    z-index: 9999;
    background: var(--bs-primary);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    font-weight: 600;
    transition: top 0.3s ease;
}

.skip-to-content:focus {
    top: 0;
    color: white;
    outline: 3px solid white;
    outline-offset: 2px;
}

/* ============================================
   PAGE LAYOUTS
   ============================================ */

/* Authentication Layout */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="rgba(255,255,255,0.02)"/><path d="M0 0 L100 100 M100 0 L0 100" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></svg>');
    background-size: 100px 100px;
    opacity: 0.5;
}

.auth-card {
    max-width: 450px;
    width: 100%;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 2.5rem;
    position: relative;
    z-index: 1;
}

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

.auth-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.auth-logo i {
    font-size: 2.5rem;
    color: white;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    background-color: #f8f9fa;
    padding: 2rem;
    margin-left: 0;
    transition: margin-left 0.3s ease;
}

@media (min-width: 992px) {
    .main-content {
        margin-left: 280px;
    }
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    z-index: 1030;
    transition: transform 0.3s ease;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
    }
}

.sidebar-nav .nav-link {
    color: #495057;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    padding-left: 1.25rem;
}

.sidebar-nav .nav-link.active {
    background-color: #0d6efd;
    color: white;
    font-weight: 600;
}

.sidebar-nav .nav-link i {
    width: 24px;
    font-size: 1.25rem;
}

/* ============================================
   DASHBOARD COMPONENTS
   ============================================ */

/* Stats Cards */
.stats-card {
    border: none;
    border-radius: 1rem;
    padding: 1.5rem;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.12);
}

.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.stats-icon.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stats-icon.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.stats-icon.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.stats-icon.info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.stats-value {
    font-size: 2rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.25rem;
}

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

/* Vehicle Cards */
.vehicle-card {
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.vehicle-image {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.vehicle-image i {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.9);
}

.vehicle-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.375rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.vehicle-info {
    padding: 1.25rem;
}

.vehicle-registration {
    font-size: 1.25rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.5rem;
}

.vehicle-details {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Status Badges */
.status-badge {
    padding: 0.375rem 0.875rem;
    border-radius: 2rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.status-badge.active {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.completed {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.expired {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge.overdue {
    background-color: #fecaca;
    color: #7f1d1d;
}

/* Province Badges */
.province-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.province-badge.gp {
    background-color: #dbeafe;
    color: #1e40af;
}

.province-badge.wc {
    background-color: #fce7f3;
    color: #9f1239;
}

.province-badge.ec {
    background-color: #dcfce7;
    color: #14532d;
}

.province-badge.kzn {
    background-color: #fef9c3;
    color: #713f12;
}

/* ============================================
   FORMS
   ============================================ */

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6c757d;
    z-index: 5;
}

.password-toggle:hover {
    color: #0d6efd;
}

/* Password Strength Indicator */
.password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
}

.password-strength.weak {
    background: linear-gradient(to right, #dc3545 33%, #e9ecef 33%);
}

.password-strength.medium {
    background: linear-gradient(to right, #ffc107 66%, #e9ecef 66%);
}

.password-strength.strong {
    background: linear-gradient(to right, #198754 100%, #e9ecef 0%);
}

/* File Upload */
.file-upload {
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload:hover {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.05);
}

.file-upload.dragover {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
}

/* ============================================
   TABLES
   ============================================ */

/* Action Buttons in Tables */
.table-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.table-actions .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #adb5bd;
    margin-bottom: 1.5rem;
}

/* ============================================
   INVOICE
   ============================================ */
.invoice-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.invoice-details table {
    width: 100%;
    margin-bottom: 1.5rem;
}

.invoice-total {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.375rem;
    font-size: 1.25rem;
    font-weight: 700;
}

/* ============================================
   TIMELINE
   ============================================ */
.timeline {
    position: relative;
    padding: 1rem 0;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 0;
    left: 20px;
    width: 2px;
    height: 100%;
    background-color: #e9ecef;
}

.timeline-item {
    position: relative;
    padding-left: 50px;
    margin-bottom: 1.5rem;
}

.timeline-marker {
    position: absolute;
    left: 11px;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    border: 3px solid #0d6efd;
}

.timeline-content {
    background-color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #0d6efd;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 9999;
}

.skip-to-content:focus {
    top: 0;
}

/* Focus Styles */
:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 767.98px) {
    .auth-card {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
    
    .vehicle-card {
        margin-bottom: 1rem;
    }
    
    .invoice-container {
        padding: 1rem;
    }
    
    .invoice-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .table-actions {
        flex-direction: column;
    }
    
    .table-actions .btn {
        width: 100%;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}



/* ============================================
   BRANCH INTERFACE STYLES
   ============================================ */

/* Branch-specific card styling */
.branch-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.branch-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Customer table enhancements */
.customer-table tbody tr {
    transition: background-color 0.2s ease;
}

.customer-table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Commission breakdown card */
.commission-breakdown {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 1rem;
}

.commission-breakdown .commission-item {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Registration URL copy section */
.registration-url-section {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(13, 202, 240, 0.1) 100%);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 2px dashed rgba(13, 110, 253, 0.3);
}

/* Walk-in customer badge */
.walk-in-badge {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ============================================
   COMPANY INTERFACE STYLES
   ============================================ */

/* Company-specific dashboard cards */
.company-stat-card {
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.company-stat-card:hover {
    transform: translateX(5px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1) !important;
}

.company-stat-card.primary {
    border-left-color: #0d6efd;
}

.company-stat-card.success {
    border-left-color: #198754;
}

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

.company-stat-card.info {
    border-left-color: #0dcaf0;
}

/* Branch performance card */
.branch-performance-card {
    position: relative;
    overflow: hidden;
}

.branch-performance-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, transparent 100%);
    border-radius: 0 0 0 100%;
}

/* Commission settings form */
.commission-settings-form .province-section {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #0d6efd;
}

.commission-settings-form .commission-input {
    background: white;
    border: 2px solid #dee2e6;
    transition: border-color 0.2s ease;
}

.commission-settings-form .commission-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.1);
}

/* Three-tier commission display */
.commission-tier {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.commission-tier::after {
    content: "→";
    position: absolute;
    right: -1.5rem;
    font-size: 1.5rem;
    color: #6c757d;
}

.commission-tier:last-child::after {
    display: none;
}

.commission-tier.vroom {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.1) 0%, rgba(108, 117, 125, 0.05) 100%);
    border-left: 4px solid #6c757d;
}

.commission-tier.company {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(13, 110, 253, 0.05) 100%);
    border-left: 4px solid #0d6efd;
}

.commission-tier.branch {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.1) 0%, rgba(25, 135, 84, 0.05) 100%);
    border-left: 4px solid #198754;
}

/* Branch comparison table */
.branch-comparison-table {
    font-size: 0.9rem;
}

.branch-comparison-table .top-performer {
    background: linear-gradient(90deg, rgba(25, 135, 84, 0.1) 0%, transparent 100%);
    font-weight: 600;
}

/* ============================================
   SHARED BRANCH/COMPANY STYLES
   ============================================ */

/* Quick action buttons */
.quick-action-btn {
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.quick-action-btn:hover {
    transform: translateY(-3px);
    border-color: currentColor;
}

/* Status badges with animation */
.status-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 0.375rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Empty state styling */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

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

.empty-state .empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.empty-state .empty-state-description {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* Commission report chart placeholder */
.commission-chart {
    min-height: 300px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile responsive adjustments for Branch/Company */
@media (max-width: 991.98px) {
    .branch-card,
    .company-stat-card {
        margin-bottom: 1rem;
    }
    
    .commission-tier::after {
        transform: rotate(90deg);
        right: auto;
        bottom: -1.5rem;
    }
    
    .quick-action-btn {
        min-height: 80px;
    }
}

/* Print styles for reports */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .quick-action-btn {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .card {
        break-inside: avoid;
    }
}

/* Dark mode adjustments for Branch/Company */
[data-bs-theme="dark"] .registration-url-section {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.2) 0%, rgba(13, 202, 240, 0.2) 100%);
    border-color: rgba(13, 110, 253, 0.5);
}

[data-bs-theme="dark"] .commission-breakdown {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

[data-bs-theme="dark"] .commission-tier {
    background: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .empty-state i {
    color: #495057;
}

[data-bs-theme="dark"] .commission-chart {
    background: linear-gradient(135deg, #343a40 0%, #212529 100%);
}



/* ============================================
   ADMIN INTERFACE STYLES - PHASE 3
   ============================================ */

/* Admin Dashboard Metrics */
.admin-metric-card {
    border-left: 4px solid;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.admin-metric-card.metric-companies {
    border-left-color: #0d6efd;
}

.admin-metric-card.metric-branches {
    border-left-color: #6c757d;
}

.admin-metric-card.metric-customers {
    border-left-color: #20c997;
}

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

.admin-metric-card.metric-revenue {
    border-left-color: #198754;
}

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

.admin-metric-icon {
    font-size: 2.5rem;
    opacity: 0.15;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.admin-metric-value {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
}

.admin-metric-label {
    color: #6c757d;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-metric-change {
    font-size: 0.875rem;
}

.admin-metric-change.positive {
    color: #198754;
}

.admin-metric-change.negative {
    color: #dc3545;
}

/* System Health Indicators */
.system-health-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.system-health-indicator.status-healthy {
    background-color: #d1e7dd;
    color: #0a3622;
}

.system-health-indicator.status-warning {
    background-color: #fff3cd;
    color: #664d03;
}

.system-health-indicator.status-critical {
    background-color: #f8d7da;
    color: #58151c;
}

.system-health-indicator .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.system-health-indicator.status-healthy .status-dot {
    background-color: #198754;
}

.system-health-indicator.status-warning .status-dot {
    background-color: #ffc107;
}

.system-health-indicator.status-critical .status-dot {
    background-color: #dc3545;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Three-Tier Commission Display (Enhanced for Admin) */
.commission-breakdown-admin {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1rem 0;
}

.commission-tier-admin {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 0.375rem;
    background: white;
    border-left: 4px solid;
    transition: all 0.2s ease;
}

.commission-tier-admin:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.commission-tier-admin.tier-vroomdocs {
    border-left-color: #dc3545;
}

.commission-tier-admin.tier-company {
    border-left-color: #0d6efd;
}

.commission-tier-admin.tier-branch {
    border-left-color: #198754;
}

.commission-tier-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.commission-tier-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.25rem;
}

.tier-vroomdocs .commission-tier-icon {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.tier-company .commission-tier-icon {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

.tier-branch .commission-tier-icon {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.commission-tier-amount {
    text-align: right;
}

.commission-tier-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
}

.commission-tier-percentage {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Audit Log Styles */
.audit-log-entry {
    border-left: 3px solid;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.audit-log-entry:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.audit-log-entry.log-security {
    border-left-color: #dc3545;
}

.audit-log-entry.log-impersonation {
    border-left-color: #ffc107;
}

.audit-log-entry.log-commission {
    border-left-color: #198754;
}

.audit-log-entry.log-system {
    border-left-color: #0d6efd;
}

.audit-log-timestamp {
    font-size: 0.875rem;
    color: #6c757d;
}

.audit-log-user {
    font-weight: 600;
    color: #495057;
}

.audit-log-action {
    color: #6c757d;
}

.audit-log-details {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
}

/* Impersonation Banner */
.impersonation-banner {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 1040;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #000;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.impersonation-banner-text {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.impersonation-banner-icon {
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}

.impersonation-banner .btn-stop {
    background: #fff;
    color: #000;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.impersonation-banner .btn-stop:hover {
    background: #f8f9fa;
    transform: scale(1.05);
}

/* Email Template Editor */
.email-template-editor {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
}

.email-template-toolbar {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.email-template-content {
    padding: 1rem;
    min-height: 400px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.email-template-variables {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
}

.email-template-variable-tag {
    display: inline-block;
    background: #e7f3ff;
    color: #004085;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    margin: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #b3d7ff;
}

.email-template-variable-tag:hover {
    background: #cce5ff;
    transform: scale(1.05);
}

/* Settings Tabs */
.settings-sidebar {
    background: white;
    border-radius: 0.375rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

.settings-sidebar .nav-link {
    color: #495057;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.settings-sidebar .nav-link:hover {
    background: #f8f9fa;
    color: #0d6efd;
}

.settings-sidebar .nav-link.active {
    background: #0d6efd;
    color: white;
}

.settings-sidebar .nav-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

/* Role Badges */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.role-super-admin {
    background-color: #dc3545;
    color: white;
}

.role-badge.role-renewal {
    background-color: #198754;
    color: white;
}

.role-badge.role-number-plate {
    background-color: #0d6efd;
    color: white;
}

.role-badge.role-enforcement {
    background-color: #ffc107;
    color: #000;
}

/* Chart Containers */
.chart-container {
    position: relative;
    height: 350px;
    margin: 1rem 0;
}

.chart-container canvas {
    max-height: 100%;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.chart-legend-label {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Empty State */
.empty-state-admin {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon-admin {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.empty-state-title-admin {
    font-size: 1.5rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.empty-state-description-admin {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* Batch Action Toolbar */
.batch-action-toolbar {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.batch-action-toolbar .selected-count {
    font-weight: 600;
    color: #495057;
}

.batch-action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Province-Specific Styling (For Number Plates) */
.province-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.province-badge.GP {
    background-color: #ffd700;
    color: #000;
}

.province-badge.WC {
    background-color: #1e90ff;
    color: #fff;
}

.province-badge.KZN {
    background-color: #ff4500;
    color: #fff;
}

.province-badge.EC {
    background-color: #32cd32;
    color: #000;
}

.province-badge.FS {
    background-color: #ff1493;
    color: #fff;
}

.province-badge.NC {
    background-color: #8b4513;
    color: #fff;
}

.province-badge.LP {
    background-color: #9370db;
    color: #fff;
}

.province-badge.MP {
    background-color: #20b2aa;
    color: #fff;
}

.province-badge.NW {
    background-color: #ff6347;
    color: #fff;
}

/* Dark Mode Support for Admin Styles */
@media (prefers-color-scheme: dark) {
    [data-bs-theme="dark"] .admin-metric-card {
        background-color: #212529;
        border-color: #495057;
    }
    
    [data-bs-theme="dark"] .commission-breakdown-admin {
        background: linear-gradient(135deg, #212529 0%, #343a40 100%);
    }
    
    [data-bs-theme="dark"] .commission-tier-admin {
        background-color: #343a40;
        color: #f8f9fa;
    }
    
    [data-bs-theme="dark"] .audit-log-entry {
        background-color: #212529;
        color: #f8f9fa;
    }
    
    [data-bs-theme="dark"] .audit-log-details {
        background-color: #1a1d20;
    }
    
    [data-bs-theme="dark"] .settings-sidebar {
        background-color: #212529;
    }
    
    [data-bs-theme="dark"] .email-template-editor {
        background-color: #212529;
        border-color: #495057;
    }
    
    [data-bs-theme="dark"] .email-template-toolbar {
        background-color: #1a1d20;
        border-color: #495057;
    }
    
    [data-bs-theme="dark"] .batch-action-toolbar {
        background-color: #212529;
        border-color: #495057;
    }
}

/* Responsive Adjustments for Admin */
@media (max-width: 991.98px) {
    .admin-metric-value {
        font-size: 1.5rem;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .commission-tier-admin {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .commission-tier-amount {
        text-align: left;
    }
}

@media (max-width: 575.98px) {
    .admin-metric-card {
        margin-bottom: 1rem;
    }
    
    .batch-action-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .batch-action-buttons {
        width: 100%;
    }
    
    .batch-action-buttons .btn {
        flex: 1;
    }
}

/* Print Styles for Admin Reports */
@media print {
    .sidebar,
    .navbar,
    .impersonation-banner,
    .batch-action-toolbar,
    .btn,
    .settings-sidebar {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .admin-metric-card,
    .commission-tier-admin,
    .audit-log-entry {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
