:root {
    --bg-main: #0b0f19;
    --card-bg: rgba(22, 30, 49, 0.75);
    --card-border: rgba(255, 255, 255, 0.08);
    --accent-motor: #f59e0b;
    --accent-motor-glow: rgba(245, 158, 11, 0.25);
    --accent-walk: #10b981;
    --accent-walk-glow: rgba(16, 185, 129, 0.25);
    --accent-primary: #6366f1;
    --accent-primary-hover: #4f46e5;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --radius-lg: 20px;
    --radius-md: 14px;
    --font-family: 'Plus Jakarta Sans', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 10% 10%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(245, 158, 11, 0.12) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    padding: 24px 16px;
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 740px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    font-size: 28px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 8px 10px;
    border-radius: var(--radius-md);
}

.brand h1 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.date-badge {
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    padding: 6px 14px;
    border-radius: 20px;
    color: var(--text-muted);
}

/* Profile Selector Card */
.profile-card {
    padding: 12px 18px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-label {
    font-size: 12px;
    font-weight: 700;
    color: #c7d2fe;
}

.profile-dropdown {
    background: #1e1b4b;
    color: #ffffff;
    border: 1px solid rgba(99, 102, 241, 0.4);
    padding: 6px 12px;
    border-radius: 10px;
    font-family: var(--font-family);
    font-size: 12px;
    font-weight: 700;
    outline: none;
    cursor: pointer;
}

.btn-sm-profile {
    background: rgba(99, 102, 241, 0.25);
    border: 1px solid rgba(99, 102, 241, 0.5);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sm-profile:hover {
    background: var(--accent-primary);
}

/* Cards & Glassmorphism */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* Control Panel */
.control-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #6b7280;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.status-indicator.active .dot {
    background-color: var(--accent-walk);
    box-shadow: 0 0 12px var(--accent-walk);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.mode-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.mode-badge.motor {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-motor);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.mode-badge.walk {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-walk);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.menu-toggle-bar {
    display: flex;
    justify-content: flex-end;
}

.btn-toggle-menu {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-toggle-menu:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-main);
}

.advanced-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px dashed var(--card-border);
}

.advanced-panel.hidden {
    display: none;
}

.battery-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.25);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
}

.battery-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.battery-options {
    display: flex;
    gap: 8px;
}

.btn-battery {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-battery.active {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn {
    flex: 1;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: none;
    font-family: var(--font-family);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-export {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #e9d5ff;
}

.btn-export:hover {
    background: rgba(168, 85, 247, 0.3);
}

.btn-danger-soft {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-sm-export {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    margin-right: 4px;
}

.btn-sm-export:hover {
    background: var(--accent-primary);
}

/* Map Card */
.map-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.map-header h3 {
    font-size: 14px;
    font-weight: 700;
}

.map-legend {
    display: flex;
    gap: 12px;
    font-size: 11px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.legend-color {
    width: 12px;
    height: 4px;
    border-radius: 2px;
}

.legend-color.motor {
    background: var(--accent-motor);
}

.legend-color.walk {
    background: var(--accent-walk);
}

.map-container {
    width: 100%;
    height: 340px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    overflow: hidden;
    background: #111827;
    z-index: 1;
}

.map-footer {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.battery-status {
    color: #34d399;
    font-weight: 600;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

@media (max-width: 520px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
}

.motor-card {
    border-left: 4px solid var(--accent-motor);
}

.walk-card {
    border-left: 4px solid var(--accent-walk);
}

.total-card {
    border-left: 4px solid var(--accent-primary);
}

.active-card {
    border-left: 4px solid #ec4899;
}

.stat-icon {
    font-size: 26px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: var(--radius-md);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 2px 0;
}

.stat-value small {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.stat-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* History Card */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.history-header h3 {
    font-size: 14px;
    font-weight: 700;
}

.btn-text {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.table-responsive {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.history-table th, .history-table td {
    padding: 8px 10px;
    text-align: left;
}

.history-table th {
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--card-border);
}

.history-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
