/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Primary Palette - Poppers Amber */
    --bg-primary: #060502;
    --bg-secondary: #0D0804;
    --bg-card: #141008;
    --bg-input: #060502;
    --border: #1E1810;

    /* Accent - Amber */
    --accent: #CC8400;
    --accent-hover: #E09500;
    --accent-muted: #8B5A00;
    --accent-dark: #5C3D00;
    --accent-glow: rgba(204, 132, 0, 0.3);

    /* Neutrals */
    --text-primary: #FAF8F5;
    --text-secondary: #8E8678;
    --text-muted: #5C5548;

    /* Semantic */
    --success: #4ADE80;
    --warning: #FBBF24;
    --danger: #F87171;

    /* Spacing & Effects */
    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --transition: 0.2s ease;

    /* Typography */
    --font-display: 'Space Mono', monospace;
    --font-body: 'Outfit', sans-serif;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.5;
    overflow-x: hidden;
}

#app {
    min-height: 100vh;
    min-height: 100dvh;
}

/* Screens */
.screen {
    display: none;
    min-height: 100vh;
    min-height: 100dvh;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* Auth Screen */
#auth-screen {
    justify-content: center;
    align-items: center;
    padding: 24px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.auth-container {
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 8px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
}

.logo {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.logo-breed {
    color: #666666;
}

.logo-count {
    color: var(--accent);
}

.tagline {
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 1rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form.hidden {
    display: none;
}

.auth-form input {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.auth-form input::placeholder {
    color: var(--text-muted);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.auth-switch {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 8px;
}

.auth-switch a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.error-msg {
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 16px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius);
}

.error-msg.hidden {
    display: none;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    -webkit-user-select: none;
    user-select: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-large {
    width: 100%;
    padding: 18px 24px;
    font-size: 1.1rem;
}

.btn-large svg {
    width: 20px;
    height: 20px;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition);
}

.btn-icon svg {
    width: 24px;
    height: 24px;
}

.btn-icon:hover {
    background: var(--bg-card);
}

.btn-icon.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Dashboard */
.dashboard-content {
    flex: 1;
    padding: 20px;
    padding-bottom: 100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

/* Tabs */
.tab-content {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.tab-content.active {
    display: flex;
}

.section-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 8px;
    min-height: 56px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item.active {
    color: var(--accent);
}

.nav-item:hover {
    color: var(--text-primary);
}

.nav-item.active:hover {
    color: var(--accent);
}

.stats-card {
    display: flex;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    gap: 8px;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 2rem;
}

.stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-value {
    font-weight: 700;
    color: var(--accent);
    line-height: 1.1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Leaderboard */
.leaderboard-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.leaderboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.leaderboard-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.leaderboard-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.leaderboard-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.leaderboard-entry:hover {
    background: var(--bg-card);
    transform: translateX(4px);
}

.leaderboard-entry.is-you {
    background: rgba(233, 69, 96, 0.15);
    border: 1px solid var(--accent);
}

.leaderboard-rank {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-card);
    border-radius: 50%;
}

.leaderboard-entry:nth-child(1) .leaderboard-rank {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #1a1a2e;
}

.leaderboard-entry:nth-child(2) .leaderboard-rank {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: #1a1a2e;
}

.leaderboard-entry:nth-child(3) .leaderboard-rank {
    background: linear-gradient(135deg, #cd7f32, #a0522d);
    color: #1a1a2e;
}

.leaderboard-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.leaderboard-entry.is-you .leaderboard-name {
    color: var(--accent);
}

.leaderboard-score {
    font-weight: 700;
    color: var(--accent);
    font-size: 1.1rem;
}

/* Sessions List */
.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.session-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    padding: 16px 20px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform var(--transition), background var(--transition);
    border: 1px solid transparent;
}

.session-card:hover {
    background: var(--bg-secondary);
    border-color: var(--border);
}

.session-card:active {
    transform: scale(0.98);
}

.session-card.active {
    border-color: var(--accent);
    background: rgba(233, 69, 96, 0.1);
}

.session-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.session-card-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.session-card-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.session-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.session-card-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-primary);
    border-radius: var(--radius);
}

.session-card-count-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.session-card-count-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.session-card-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition), background var(--transition), color var(--transition);
}

.session-card:hover .session-card-delete {
    opacity: 1;
}

.session-card-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.session-card-delete svg {
    width: 16px;
    height: 16px;
}

.session-card {
    position: relative;
}

/* Session Details Card */
.session-details-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    width: 100%;
}

.session-details-card h3 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.session-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.session-detail-row:last-child {
    border-bottom: none;
}

.session-detail-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.session-detail-value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Session Screen */
.session-content {
    flex: 1;
    padding: 20px;
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.counter-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    background: var(--bg-card);
    border-radius: 50%;
    width: 200px;
    height: 200px;
    justify-content: center;
    box-shadow: var(--shadow), 0 0 60px var(--accent-glow);
    margin-top: 20px;
}

.counter-value {
    font-size: 5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.counter-label {
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 8px;
}

/* Load Buttons */
.load-buttons {
    display: flex;
    gap: 16px;
}

.btn-load {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 8px 30px var(--accent-glow);
    -webkit-user-select: none;
    user-select: none;
}

.btn-load:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 40px var(--accent-glow);
}

.btn-load:active {
    transform: scale(0.92);
}

.btn-load-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.btn-load-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.btn-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 200px;
    margin: 16px auto 0;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-note svg {
    width: 18px;
    height: 18px;
}

.btn-note:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--accent);
}

.modal-fields textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.modal-fields textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.session-location {
    color: var(--accent);
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 8px;
}

.session-info {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.session-info p {
    margin: 4px 0;
}

/* Loads Timeline */
.loads-timeline {
    width: 100%;
    margin-top: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.loads-timeline h3 {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
    font-weight: 600;
}

#loads-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.load-entry {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    animation: fadeSlide 0.3s ease;
}

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

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.load-entry-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.load-entry-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.load-entry-number {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.load-entry-time {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.load-entry-note {
    background: rgba(233, 69, 96, 0.1);
    border-left: 3px solid var(--accent);
}

.load-entry-note-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
    word-break: break-word;
}

.loads-empty {
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    width: 100%;
    max-width: 340px;
    text-align: center;
    box-shadow: var(--shadow), 0 0 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    animation: scaleIn 0.2s ease;
}

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

.modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 50%;
    color: var(--danger);
}

.modal-icon svg {
    width: 32px;
    height: 32px;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.modal-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 28px;
}

.modal-text span {
    color: var(--accent);
    font-weight: 600;
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.modal-form .modal-title {
    margin-bottom: 4px;
}

.modal-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.modal-fields input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.modal-fields input::placeholder {
    color: var(--text-muted);
}

.modal-fields input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-actions button {
    flex: 1;
    padding: 14px 20px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition), background var(--transition);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-input);
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-danger-solid {
    background: var(--danger);
    color: white;
    border: none;
}

.btn-danger-solid:hover {
    background: #dc2626;
}

.btn-danger-solid:active {
    transform: scale(0.98);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-weight: 500;
    z-index: 1000;
    transition: transform 0.3s ease;
    border: 1px solid var(--border);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.hidden {
    display: none;
}

/* Utilities */
.hidden {
    display: none !important;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Desktop Enhancements */
@media (min-width: 768px) {
    .auth-container {
        padding: 40px;
        background: var(--bg-secondary);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow);
    }

    .dashboard-content,
    .session-content {
        max-width: 480px;
        margin: 0 auto;
        width: 100%;
    }

    .counter-display {
        width: 240px;
        height: 240px;
    }

    .counter-value {
        font-size: 6rem;
    }
}

/* Autocomplete */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    list-style: none;
    z-index: 1001;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.autocomplete-list.hidden {
    display: none;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: background var(--transition);
    border-bottom: 1px solid var(--border);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background: var(--bg-primary);
}

.autocomplete-item.highlighted {
    background: rgba(233, 69, 96, 0.2);
}

.autocomplete-item mark {
    background: transparent;
    color: var(--accent);
    font-weight: 600;
}

/* Profile Modal */
.modal-profile {
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    text-align: left;
    padding-top: 20px;
}

.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background var(--transition), color var(--transition);
}

.modal-close-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.modal-close-btn svg {
    width: 20px;
    height: 20px;
}

.profile-header {
    text-align: center;
    margin-bottom: 20px;
}

.profile-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 24px;
}

.profile-stat {
    text-align: center;
}

.profile-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.profile-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.profile-timeline h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.profile-sessions-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.profile-session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 12px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.profile-session-item:hover {
    background: var(--bg-primary);
    transform: translateX(4px);
}

.profile-session-item.active {
    border-left: 3px solid var(--accent);
}

.profile-session-info {
    flex: 1;
    min-width: 0;
}

.profile-session-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-session-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.profile-session-count {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    margin-left: 12px;
}

.profile-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

/* Session View Modal */
.modal-session-view {
    max-width: 400px;
    max-height: 85vh;
    overflow-y: auto;
    text-align: center;
    padding-top: 20px;
}

.session-view-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.session-view-user {
    font-size: 0.875rem;
    color: var(--accent);
    margin: 0;
}

.session-view-count {
    margin: 20px 0;
}

.session-view-count span:first-child {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
}

.session-view-count-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.session-view-details {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    text-align: left;
}

.session-view-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.session-view-detail-row:last-child {
    border-bottom: none;
}

.session-view-detail-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.session-view-detail-value {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
}

.session-view-timeline {
    text-align: left;
}

.session-view-timeline h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.session-view-loads {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.session-view-load-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    padding: 10px 14px;
    border-radius: var(--radius);
}

.session-view-load-icon {
    font-size: 1.25rem;
}

.session-view-load-info {
    flex: 1;
}

.session-view-load-number {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.session-view-load-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.session-view-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

.session-view-chart {
    text-align: left;
    margin-bottom: 20px;
}

.session-view-chart h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Timeline Chart */
.timeline-chart {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    position: relative;
}

.timeline-bar {
    position: relative;
    height: 40px;
    background: var(--bg-primary);
    border-radius: 20px;
    overflow: visible;
}

.timeline-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.15s ease;
    z-index: 1;
}

.timeline-marker:hover {
    transform: translate(-50%, -50%) scale(1.3);
    z-index: 2;
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.timeline-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 10px;
    font-size: 0.85rem;
}

.loads-chart-section {
    margin-bottom: 16px;
}

.loads-chart-section h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.loads-chart-section .timeline-chart {
    background: var(--bg-card);
}

/* Live Map Tab */
.live-header {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 8px 16px;
    background: rgba(26, 26, 46, 0.9);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.live-count {
    font-size: 0.875rem;
    color: var(--accent);
    background: rgba(233, 69, 96, 0.15);
    padding: 6px 14px;
    border-radius: 12px;
    font-weight: 600;
}

#tab-live {
    position: fixed;
    top: 49px;
    left: 0;
    right: 0;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    margin: 0;
    padding: 0;
    gap: 0;
    z-index: 50;
    background: var(--bg-primary);
}

#tab-live.active {
    display: flex;
}

.live-map-full {
    flex: 1;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
}

.live-map-full .leaflet-container {
    background: var(--bg-primary);
}

.leaflet-popup-content-wrapper {
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.leaflet-popup-tip {
    background: var(--bg-card);
}

.leaflet-popup-content {
    margin: 12px 16px;
    font-size: 0.9rem;
}

.map-popup-loads {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
}

.map-popup {
    min-width: 140px;
}

.map-popup-user {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.map-popup-location {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.map-popup-stats {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.map-popup-loads {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
}

.map-popup-duration {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.map-popup-btn {
    width: 100%;
    padding: 8px 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.map-popup-btn:hover {
    background: var(--accent-hover);
}

/* Leaflet controls dark theme */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: var(--shadow) !important;
}

.leaflet-control-zoom a {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: none !important;
}

.leaflet-control-zoom a:hover {
    background: var(--bg-secondary) !important;
}

#live-map {
    width: 100%;
    height: 100%;
}

/* Pulsing marker animation */
.pulse-marker {
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    position: relative;
}

.pulse-marker::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.4;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Marker Cluster Styling */
.marker-cluster {
    background: rgba(233, 69, 96, 0.3);
}

.marker-cluster div {
    background: var(--accent);
    color: white;
    font-weight: 600;
    font-size: 12px;
}

.marker-cluster-small {
    background: rgba(233, 69, 96, 0.4);
}

.marker-cluster-small div {
    background: var(--accent);
}

.marker-cluster-medium {
    background: rgba(233, 69, 96, 0.5);
}

.marker-cluster-medium div {
    background: #c93d5a;
}

.marker-cluster-large {
    background: rgba(233, 69, 96, 0.6);
}

.marker-cluster-large div {
    background: #a8324d;
}
