:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --dark-color: #1a1a2e;
}

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #fff;
}

.bg-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    color: #333;
}

.content-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    color: #333;
    margin-bottom: 1.5rem;
    overflow: visible;
}

.content-card .card-header {
    background: #0d6efd !important;
    color: white;
    border-radius: 0 !important;
    padding: 1rem 1.5rem;
    border-bottom: none;
}

.content-card .card-header h5,
.content-card .card-header h4 {
    margin: 0;
    font-weight: 600;
    color: #fff;
}

.bg-card .card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
    color: white;
    border-radius: 0 !important;
    padding: 1rem 1.5rem;
}

.bg-card .card-header.bg-dark {
    background: linear-gradient(135deg, #2d3436 0%, #1a1a2e 100%) !important;
}

.bg-card .card-header.bg-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #146c43 100%) !important;
}

.bg-card .card-header.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.form-control, .form-select {
    border-radius: 0;
    border: 2px solid #e9ecef;
    padding: 0.6rem 1rem;
}

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

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.page-header .lead {
    opacity: 0.9;
    margin-bottom: 0;
}

.btn {
    border-radius: 0;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

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

.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.status-badge {
    padding: 0.35em 0.65em;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-stopped { background: #fee2e2; color: #dc2626; }
.status-moving { background: #dcfce7; color: #16a34a; }
.status-completed { background: #f3f4f6; color: #6b7280; }

.imei-code {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #0d6efd;
    font-weight: 600;
}

.table {
    --bs-table-bg: transparent;
}

.table thead th {
    background: var(--info-color);
    color: #fff;
    border-bottom: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
}

.table tbody tr {
    transition: background 0.2s ease;
}

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

/* Map containers */
#createMap .leaflet-pane {
    z-index: 1001 !important;
}

#createMap .leaflet-tile-pane {
    z-index: 1001 !important;
}

#createMap .leaflet-marker-pane {
    z-index: 1002 !important;
}

.coord-display {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 0.75rem;
    border-radius: 0;
    font-family: monospace;
    font-size: 0.85rem;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0;
    padding: 1rem;
    text-align: center;
}

.stat-card .number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card .label {
    font-size: 0.85rem;
    color: #6c757d;
}

.log-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: background 0.2s;
}

.log-entry:hover {
    background: rgba(13, 110, 253, 0.03);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry .log-icon {
    margin-right: 0.75rem;
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.log-entry .log-imei {
    font-weight: 600;
    color: #0d6efd;
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.9rem;
}

.log-entry .log-time {
    font-size: 0.75rem;
    color: #6c757d;
}

.log-entry .log-status {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    padding: 0.3em 0.55em;
    border-radius: 50px;
    letter-spacing: 0.5px;
}

/* Quick Action Buttons */

.log-entry:last-child {
    border-bottom: none;
}

.status-success { color: #198754; }
.status-failed { color: #dc3545; }

.code-preview {
    background: #1a1a2e;
    color: #a5d6ff;
    padding: 1rem;
    border-radius: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
}

.log-container {
    max-height: 500px;
    overflow-y: auto;
}

.log-container-sm {
    max-height: 350px;
    overflow-y: auto;
}

.sidebar-brand-text {
    font-size: 1.1rem;
    color: #fff;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

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

.vehicle-popup {
    font-size: 12px;
}

.vehicle-popup strong {
    display: block;
    margin-bottom: 5px;
}

.vehicle-popup .badge {
    font-size: 10px;
}

.nav-link {
    color: rgba(255,255,255,0.8);
}

/* Stat Cards - Professional with white text */
.stat-card {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: #fff;
    border-radius: 12px;
    padding: 1.75rem 1.25rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.25);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(13, 110, 253, 0.35);
}

.stat-card .number {
    font-size: 2.75rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
    line-height: 1;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.stat-card .label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-top: auto;
    position: relative;
    z-index: 1;
    font-weight: 600;
}

/* Stat Card Icons */
.stat-card .stat-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 2rem;
    opacity: 0.25;
    color: #fff;
    transition: opacity 0.3s;
    z-index: 0;
}

.stat-card:hover .stat-icon {
    opacity: 0.35;
}

/* Stat Card Color Variants */
.stat-card.success {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.25);
}
.stat-card.success:hover {
    box-shadow: 0 8px 25px rgba(25, 135, 84, 0.35);
}

.stat-card.warning {
    background: linear-gradient(135deg, #ff6b35 0%, #e04b25 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.25);
}
.stat-card.warning:hover {
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.35);
}

.stat-card.info {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
    box-shadow: 0 4px 15px rgba(111, 66, 193, 0.25);
}
.stat-card.info:hover {
    box-shadow: 0 8px 25px rgba(111, 66, 193, 0.35);
}

/* Recent Activity Logs */
.log-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: background 0.2s;
}

.log-entry:hover {
    background: rgba(13, 110, 253, 0.03);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry .log-icon {
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.log-entry .log-imei {
    font-weight: 600;
    color: #0d6efd;
    display: block;
    margin-bottom: 0.25rem;
}

.log-entry .log-time {
    font-size: 0.75rem;
    color: #6c757d;
}

.log-entry .log-status {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    padding: 0.35em 0.65em;
    border-radius: 50px;
}

/* Quick Action Buttons */
.quick-action-btn {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.quick-action-btn:active {
    transform: translateY(0);
}
.quick-action-btn.active {
    transform: scale(0.98);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

/* Page Header Enhancement */
.page-header h4 {
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #0d6efd;
}
.page-header small {
    color: #6c757d;
    font-weight: 500;
}

/* Content Card Improvements */
.content-card {
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s ease;
}
.content-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
.content-card .card-header {
    border-bottom: none;
    font-weight: 600;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%) !important;
    color: white !important;
    border-radius: 0 !important;
}
.content-card .card-header h5 {
    margin: 0;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Table Improvements */
.table thead th {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%) !important;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border: none;
    padding: 1rem;
    position: sticky;
    top: 0;
}
.table tbody tr {
    transition: background 0.15s ease;
}
.table tbody tr:hover {
    background: rgba(13, 110, 253, 0.04);
}

/* Badge Enhancements */
.badge {
    padding: 0.4em 0.7em;
    font-weight: 600;
    border-radius: 50px;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
}

/* Top Navigation Time */
.topnav-time {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #6c757d;
    background: rgba(108, 117, 125, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stat-card .number {
        font-size: 2rem;
    }
    .stat-card {
        min-height: auto;
        padding: 1.25rem 1rem;
    }
}

/* Dashboard cards equal height */
.dashboard-cards-row .col-lg-8,
.dashboard-cards-row .col-lg-4 {
    display: flex;
}

.dashboard-cards-row .content-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dashboard-cards-row .card-body {
    flex: 1;
}

.dashboard-cards-row .card-body.p-0 {
    flex: 1;
}

.log-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: background 0.2s;
}

.log-entry:hover {
    background: rgba(13, 110, 253, 0.03);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry .log-icon {
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.log-entry .log-imei {
    font-weight: 600;
    color: #0d6efd;
    display: block;
    margin-bottom: 0.25rem;
}

.log-entry .log-time {
    font-size: 0.75rem;
    color: #6c757d;
}

.log-entry .log-status {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    padding: 0.35em 0.65em;
    border-radius: 50px;
}
