/* Version: 1.1 */

/* Error and Loading States */
.error-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    background: #fee2e2;
    border-radius: 8px;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.error-state h3 {
    margin-bottom: 1rem;
    color: #dc2626;
}

.error-state button {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.error-state button:hover {
    background: #b91c1c;
}

.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    background: #e0f2fe;
    border-radius: 8px;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #bae6fd;
    border-radius: 50%;
    border-top-color: #0369a1;
    animation: spin 1s ease-in-out infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Debug info styles */
.debug-info {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.75rem;
    max-width: 300px;
    z-index: 9999;
    display: none;
}

.debug-info.show {
    display: block;
}

/* Workload Badge Styles */
.workload-badge {
    display: inline-block;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    background: #64748b;
    letter-spacing: 0.5px;
    margin-right: 0.5rem;
}
.workload-easy {
    background: #facc15;
}
.workload-medium {
    background: #f59e0b;
}
.workload-hard {
    background: #ef4444;
}
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
    background: #dde4ed; /* Oppdatert bakgrunn */
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Dashboard Section */
.dashboard {
    padding: 40px 0;
    min-height: 100vh;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.dashboard-subtitle {
    font-size: 1.125rem;
    color: #64748b;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.pending {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stat-icon.in-progress {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.stat-icon.completed {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.stat-icon.urgent {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.stat-content h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.stat-change {
    font-size: 0.75rem;
    color: #64748b;
}

.stat-change.positive {
    color: #22c55e;
}

.stat-label {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: -0.5rem;
    margin-bottom: 0.25rem;
    text-align: left;
}

/* Queue Section */
.queue-section {
    margin-top: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
}

.queue-filters {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* Queue estimate badge */
.queue-estimate {
    background: #f8fafc;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.6rem 1rem;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Bicycle Grid */
.bicycle-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center; /* center rows horizontally */
    align-items: stretch;
    align-content: flex-start; /* keep rows packed at the top */
    width: 100%;
    margin: 0 auto;
    padding: 0 0.5rem; /* small breathing room from container edges */
    box-sizing: border-box;
}

.bicycle-card {
    background: white;
    border-radius: 8px; /* Mindre avrunding */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #d6dee7; /* Mildere kant */
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 340px !important;
    min-width: 340px !important;
    max-width: 340px !important;
    flex: 0 0 340px;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    /* Remove zoom to prevent iOS focus auto-zoom. Use a narrower natural width instead. */
}

/* Remove transform fallback (no scaling) */

/* Fjern fargestripe rundt sykkelkort */
.bicycle-card.workload-easy,
.bicycle-card.workload-medium,
.bicycle-card.workload-hard {
    border-left: none;
}

.bicycle-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Bike Image */
.bike-image {
    position: relative;
    height: 320px; /* 80% of previous 400px */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Bilde-loading spinner (ikke forstyrrer layout) */
.image-loading-spinner {
    position: absolute;
    width: 42px;
    height: 42px;
    border: 4px solid rgba(255,255,255,0.4);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 2;
}

/* ---------------- Text scaling inside bike cards (+25%) ---------------- */
.bicycle-card { --cardTextScale: 1.25; }
.bicycle-card .bike-info h3 { font-size: calc(1.25rem * var(--cardTextScale)); }
.bicycle-card .owner-name { font-size: calc(1rem * var(--cardTextScale)); }
.bicycle-card .owner-phone { font-size: calc(0.875rem * var(--cardTextScale)); }
.bicycle-card .deadline-label { font-size: calc(0.875rem * var(--cardTextScale)); }
.bicycle-card .deadline-date { font-size: calc(0.875rem * var(--cardTextScale)); }
.bicycle-card .problem-description h4 { font-size: calc(0.875rem * var(--cardTextScale)); }
.bicycle-card .problem-description p { font-size: calc(0.875rem * var(--cardTextScale)); }
.bicycle-card .btn { font-size: calc(0.875rem * var(--cardTextScale)); }
.bicycle-card .status-badge { font-size: calc(0.75rem * var(--cardTextScale)); }
.bicycle-card .workload-badge { font-size: calc(0.85rem * var(--cardTextScale)); }

.bike-image .no-bike-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #e5e7eb !important;
    color: #222 !important;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 1;
}

/* Override for Ingen bilde placeholder */
.bike-image .no-bike-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #e5e7eb !important;
    color: #222 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border-radius: 0;
    z-index: 1;
}

.bike-preview {
    width: 120px;
    height: 80px;
    border: 3px solid white;
    border-radius: 60px 60px 0 0;
    border-bottom: none;
    position: relative;
}

.bike-preview::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid white;
    border-radius: 50%;
    top: 50%;
    left: -20px;
    transform: translateY(-50%);
}

.bike-preview::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid white;
    border-radius: 50%;
    top: 50%;
    right: -20px;
    transform: translateY(-50%);
}

.bike-uploaded-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.mountain-bike {
    background: linear-gradient(45deg, #1e293b, #475569);
}

.road-bike {
    background: linear-gradient(45deg, #dc2626, #ef4444);
}

.city-bike {
    background: linear-gradient(45deg, #059669, #10b981);
}

.electric-bike {
    background: linear-gradient(45deg, #7c3aed, #a855f7);
}

.hybrid-bike {
    background: linear-gradient(45deg, #ea580c, #f97316);
}

.kids-bike {
    background: linear-gradient(45deg, #ec4899, #f472b6);
}

.status-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.status-badge.urgent {
    background: #ef4444;
}

.status-badge.in-progress {
    background: #3b82f6;
}

.status-badge.pending {
    background: #f59e0b;
}

/* Bike Info */
.bike-info {
    padding: 1.1rem; /* slightly tighter to help overall length */
    display: flex;
    flex-direction: column;
    flex: 1; /* fill remaining space under image */
    min-height: 0; /* allow flex children to size properly */
}

.bike-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

.owner-info {
    margin-bottom: 1rem;
}

.owner-name {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.owner-phone {
    font-size: 0.875rem;
    color: #64748b;
}

.deadline {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
}

.deadline-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
}

.deadline-date {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin-left: 0.5rem;
}

.deadline-date.urgent {
    color: #ef4444;
}

.problem-description {
    margin-bottom: 0.9rem;
}

.problem-description h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.problem-description p {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
}

/* Truncated text (problem + work done) */
.text-clamp {
    position: relative;
    max-height: 120px; /* requested max height */
    overflow: hidden;
    display: block;
}
.text-clamp.truncated::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2.5rem; /* fade height */
    background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 70%);
    pointer-events: none;
}

/* Utility: clamp text to 2 lines (used for problem preview) */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.bike-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto; /* push actions to bottom */
    padding-top: 0.5rem;
    justify-content: center; /* center buttons horizontally */
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    flex: 0 0 auto; /* avoid stretching so group can center */
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-warning {
    background: #eeeeee;
    color: #111827;
    border: 1px solid #e5e7eb;
    font-size: 0.875rem;
}

.btn-warning:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

/* Floating Action Button */
.add-bicycle-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}
.archive-fab {
    position: fixed;
    bottom: max(110px, calc(env(safe-area-inset-bottom, 0px) + 80px)); /* keep above Add button and home bar */
    right: max(16px, env(safe-area-inset-right, 16px));
    z-index: 1000;
}
.storage-fab {
    position: fixed;
    bottom: max(180px, calc(env(safe-area-inset-bottom, 0px) + 150px)); /* position above archive button */
    right: max(16px, env(safe-area-inset-right, 16px));
    z-index: 1000;
}
.reminders-fab {
    position: fixed;
    bottom: max(250px, calc(env(safe-area-inset-bottom, 0px) + 220px));
    right: max(16px, env(safe-area-inset-right, 16px));
    z-index: 1000;
}
.book-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: white;
    color: #111827;
    border: 1px solid #d1d5db;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.book-fab .icon { width: 28px; height: 28px; display: block; }
.book-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(0,0,0,0.18);
    border-color: #2563eb;
    color: #2563eb;
}
.storage-fab-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: white;
    color: #111827;
    border: 1px solid #d1d5db;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.storage-fab-link .icon { width: 28px; height: 28px; display: block; }
.storage-fab-link .storage-icon { width: 28px; height: 28px; display: block; object-fit: contain; }
.storage-fab-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(0,0,0,0.18);
    border-color: #2563eb;
    color: #2563eb;
}
.reminders-fab-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: white;
    color: #111827;
    border: 1px solid #d1d5db;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.reminders-fab-link .icon { width: 28px; height: 28px; display: block; }
.reminders-fab-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(0,0,0,0.18);
    border-color: #2563eb;
    color: #2563eb;
}
.fab-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 8px 16px rgba(220,38,38,0.28);
}

/* Mobile tweaks for the floating Archive button (keep desktop as-is) */
@media (max-width: 640px) {
    .archive-fab {
        top: calc(env(safe-area-inset-top, 0px) + 12px);
        right: calc(env(safe-area-inset-right, 0px) + 12px);
        bottom: auto; /* move to top-right on mobile to avoid overlap */
    }
    .storage-fab {
        top: calc(env(safe-area-inset-top, 0px) + 70px);
        right: calc(env(safe-area-inset-right, 0px) + 12px);
        bottom: auto; /* move to top-right on mobile to avoid overlap */
    }
    .reminders-fab {
        top: calc(env(safe-area-inset-top, 0px) + 128px);
        right: calc(env(safe-area-inset-right, 0px) + 12px);
        bottom: auto;
    }
    .book-fab {
        width: 46px;
        height: 46px;
        border-radius: 12px;
        box-shadow: 0 8px 18px rgba(0,0,0,0.14);
        border-color: #e5e7eb;
        background: #fff;
    }
    .book-fab .icon { width: 22px; height: 22px; }
    .storage-fab-link {
        width: 46px;
        height: 46px;
        border-radius: 12px;
        box-shadow: 0 8px 18px rgba(0,0,0,0.14);
        border-color: #e5e7eb;
        background: #fff;
    }
    .storage-fab-link .icon { width: 22px; height: 22px; }
    .storage-fab-link .storage-icon { width: 22px; height: 22px; }
    .reminders-fab-link {
        width: 46px;
        height: 46px;
        border-radius: 12px;
        box-shadow: 0 8px 18px rgba(0,0,0,0.14);
        border-color: #e5e7eb;
        background: #fff;
    }
    .reminders-fab-link .icon { width: 22px; height: 22px; }
    .fab-badge {
        top: -5px;
        right: -5px;
        min-width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }
}

.fab-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
}

.fab-button:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(37, 99, 235, 0.4);
}

.fab-icon {
    font-size: 1.5rem;
    font-weight: 700;
}

.fab-label {
    white-space: nowrap;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .bicycle-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .dashboard-header h1 {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bicycle-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .queue-filters {
        flex-wrap: wrap;
    }

    .fab-button {
        padding: 0.75rem 1.25rem;
    }

    .fab-label {
        display: none;
    }
}

@media (max-width: 480px) {
    .dashboard-header h1 {
        font-size: 1.75rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .bike-actions {
        flex-direction: column;
    }

    .add-bicycle-fab {
        bottom: 1rem;
        right: 1rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Animation for bicycle cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Emergency visibility fix - force all bicycle cards to be visible */
.bicycle-card {
    /* Temporarily disable animation for debugging */
    /* animation: fadeInUp 0.6s ease forwards; */
    opacity: 1 !important;
    transform: translateY(0) !important;
    /* Keep flex layout so inner flex logic (buttons at bottom) works */
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    position: relative !important;
    /* allow JS-applied min-height to control vertical sizing */
    /* height:auto removed so min-height can equalize */
    /* Fjernet width: auto !important; for å unngå stretching */
    background: white !important;
    /* border: 2px solid red !important;  Fjernet debug border */
    margin: 0 !important;
    padding: 0 !important;
    /* Behold nedskalering også i denne override-blokken */
    zoom: 0.8 !important;
}
.bicycle-card.has-reminder::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #dc2626;
    border: 2px solid #fff;
    box-shadow: 0 8px 14px rgba(220, 38, 38, 0.24);
    z-index: 3;
}
@supports not (zoom: 1) {
    .bicycle-card {
        transform: scale(0.8) !important;
        transform-origin: top left !important;
    }
}

.bicycle-card:nth-child(1) { animation-delay: 0.1s; }
.bicycle-card:nth-child(2) { animation-delay: 0.2s; }
.bicycle-card:nth-child(3) { animation-delay: 0.3s; }
.bicycle-card:nth-child(4) { animation-delay: 0.4s; }
.bicycle-card:nth-child(5) { animation-delay: 0.5s; }
.bicycle-card:nth-child(6) { animation-delay: 0.6s; }

/* Modal Styles (global, for all modals) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}
.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
/* Details modal actions row */
.detail-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}
.bike-reminders-panel {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.bike-reminders-header h4 {
    margin: 0 0 0.75rem;
    color: var(--text);
}
.bike-reminders-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.bike-reminders-loading,
.bike-reminders-empty {
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--muted);
}
.bike-reminder-item {
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fbff;
}
.bike-reminder-item.is-done {
    opacity: 0.78;
    background: #f8fafc;
}
.bike-reminder-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}
.bike-reminder-title {
    font-weight: 700;
    color: var(--text);
}
.bike-reminder-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.4rem;
}
.bike-reminder-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    border: 1px solid transparent;
}
.bike-reminder-tag.pinned {
    color: #2563eb;
    background: #dbeafe;
    border-color: #bfdbfe;
}
.bike-reminder-tag.active {
    color: #0f766e;
    background: #ccfbf1;
    border-color: #99f6e4;
}
.bike-reminder-tag.done {
    color: #166534;
    background: #dcfce7;
    border-color: #bbf7d0;
}
.bike-reminder-tag.deadline {
    color: #b45309;
    background: #fef3c7;
    border-color: #fde68a;
}
.bike-reminder-tag.overdue {
    color: #b91c1c;
    background: #fee2e2;
    border-color: #fecaca;
}
.bike-reminder-text {
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}
.bike-reminder-text.muted {
    color: var(--muted);
}

/* ==========================
   Modern theme overrides
   (non-breaking: only enhances visuals)
   ========================== */
:root {
    --bg: #e9eef5;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e5e7eb;
    --brand: #2563eb;
    --brand-600: #1d4ed8;
    --amber: #f59e0b;
    --rose: #ef4444;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 6px 18px rgba(15,23,42,0.12);
    --shadow-lg: 0 14px 32px rgba(15,23,42,0.16);
    --radius: 12px;
}

body { background: var(--bg); color: var(--text); }

/* Prevent iOS Safari input focus auto-zoom by keeping form controls >=16px
     and stabilize text sizing */
html { -webkit-text-size-adjust: 100%; }
input, select, textarea { font-size:16px !important; line-height:1.4; }

/* On small screens disable the card zoom/scale to avoid Safari re-scaling */
@media (max-width: 640px) {
    .bicycle-card { zoom:1 !important; transform:none !important; }
}

/* Card polish */
.bicycle-card {
    border-radius: var(--radius);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
    background: var(--surface);
}
.bicycle-card:hover { box-shadow: var(--shadow-md); }

/* Header and counters */
.stat-card { box-shadow: var(--shadow-sm); border-color: var(--border); }
.queue-estimate { background:#fff; border-color: var(--border); box-shadow: var(--shadow-sm); }

/* Badges (workload + status) */
.workload-badge { opacity: 0.95; letter-spacing: .3px; }
.status-badge { box-shadow: 0 2px 8px rgba(0,0,0,.15); }

/* Buttons: cleaner, consistent focus */
.btn {
    border-radius: 10px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.btn-primary { background: var(--brand); }
.btn-primary:hover { background: var(--brand-600); }
.btn-secondary { background: #f8fafc; color:#0f172a; border: 1px solid var(--border); }
.btn-secondary:hover { background: #eef2f7; }
.btn-warning { background: var(--amber); color: #111827; border-color: var(--amber); }
.btn-warning:hover { background: #d97706; color:#fff; }
.btn-danger { background: var(--rose); color: #fff; border-color: var(--rose); }

/* Focus states for accessibility */
.btn:focus-visible,
.book-fab:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(37,99,235,0.35);
    outline-offset: 2px;
}

/* Bike info readability */
.bike-info h3 { letter-spacing: .2px; }
.owner-name { color:#0f172a; }
.owner-phone { color: var(--muted); }
.problem-description p { color: #475569; }

/* Actions row tighter on wide screens */
.bike-actions { gap: 0.5rem; }

/* Floating archive button subtle tune */
.book-fab { border-color: var(--border); box-shadow: var(--shadow-md); }
.book-fab:hover { box-shadow: var(--shadow-lg); }

/* Modal refinements */
.modal-content { border: 1px solid var(--border); }
.modal-header { display:flex; align-items:center; justify-content:space-between; padding: 0.9rem 1rem; border-bottom: 1px solid var(--border); }
.modal-body { padding: 1rem; }
.modal-close { background: transparent; border: 1px solid var(--border); width:32px; height:32px; border-radius:8px; cursor:pointer; }
.modal-close:hover { background:#f3f4f6; }

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* Hover-only effects (avoid sticky hover on touch) */
@media (hover: hover) and (pointer: fine) {
    .bicycle-card:hover { transform: translateY(-4px); }
}
