:root {
    --jm-primary: #1a73e8;
    --jm-primary-dark: #1557b0;
    --jm-surface: #ffffff;
    --jm-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

body { font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

.hero-section { background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%); min-height: 60vh; display: flex; align-items: center; }
.feature-card { background: #fff; border-radius: 16px; box-shadow: var(--jm-shadow); transition: transform .2s; }
.feature-card:hover { transform: translateY(-4px); }

.auth-page { background: linear-gradient(135deg, #e8f0fe 0%, #f8f9fa 100%); }
.auth-card { width: 100%; max-width: 440px; border-radius: 16px; }
.auth-card-wide { max-width: 480px; }
.auth-alert { border-radius: 10px; font-size: 0.9rem; }
.auth-alert ul { margin-bottom: 0; }
.auth-page .form-control.is-invalid,
.auth-page .form-check-input.is-invalid {
    border-color: #dc3545;
}
.auth-page .invalid-feedback {
    font-size: 0.85rem;
    color: #dc3545;
}

/* Map PWA */
.map-page { overflow: hidden; height: 100vh; }
.map-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
}
.map-main {
    flex: 1;
    position: relative;
    min-width: 0;
    height: 100%;
}
.map-canvas { width: 100%; height: 100%; }

/* Google Maps-style location panel */
.location-panel {
    width: 0;
    flex-shrink: 0;
    background: var(--jm-surface);
    box-shadow: 2px 0 12px rgba(0,0,0,0.08);
    z-index: 15;
    overflow: hidden;
    transition: width .3s cubic-bezier(.4,0,.2,1);
}
.location-panel.open {
    width: 400px;
}
.location-panel-inner {
    width: 400px;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.lp-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    padding: 12px 12px 0;
    background: linear-gradient(to bottom, var(--jm-surface) 70%, transparent);
}
.lp-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f1f3f4;
    color: #5f6368;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
}
.lp-close:hover { background: #e8eaed; color: #202124; }

.lp-hero {
    padding: 0 20px 16px;
}
.lp-company-avatar {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1a73e8, #4285f4);
    color: #fff;
    font-weight: 700;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(26,115,232,.25);
}
.lp-company-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.lp-company-name {
    font-size: 1.35rem;
    font-weight: 600;
    color: #202124;
    margin: 0 0 6px;
    line-height: 1.3;
}
.lp-verified {
    font-size: 13px;
    color: #1a73e8;
    margin: 0 0 8px;
}
.lp-address, .lp-openings {
    font-size: 14px;
    color: #5f6368;
    margin: 0 0 6px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}
.lp-address i, .lp-openings i {
    color: #ea4335;
    margin-top: 2px;
    flex-shrink: 0;
}
.lp-openings i { color: #1a73e8; }

.lp-divider {
    height: 8px;
    background: #f1f3f4;
    margin: 0;
}

.lp-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #202124;
    margin: 0 0 12px;
    padding: 0 20px;
}
.lp-jobs-list {
    padding: 16px 0 8px;
}
.lp-jobs-list .lp-section-title { padding-top: 0; }

.lp-job-card {
    display: block;
    width: calc(100% - 40px);
    margin: 0 20px 8px;
    padding: 12px 14px;
    border: 1.5px solid #e8eaed;
    border-radius: 12px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
}
.lp-job-card:hover {
    border-color: #1a73e8;
    box-shadow: 0 2px 8px rgba(26,115,232,.12);
}
.lp-job-card.active {
    border-color: #1a73e8;
    background: #e8f0fe;
}
.lp-job-card-title {
    font-weight: 600;
    font-size: 14px;
    color: #202124;
    margin-bottom: 4px;
}
.lp-job-card-meta {
    font-size: 12px;
    color: #5f6368;
}
.lp-job-card-exp {
    display: inline-block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #6d28d9;
    background: #f5f3ff;
    padding: 2px 8px;
    border-radius: 10px;
}

.lp-job-detail {
    padding: 16px 20px 28px;
}
.lp-salary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e6f4ea;
    color: #137333;
    font-weight: 600;
    font-size: 15px;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
}
.lp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.lp-tag {
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 16px;
}
.lp-tag.mode { background: #e8f0fe; color: #1a73e8; }
.lp-tag.exp { background: #f3e8fd; color: #7c3aed; }
.lp-tag.dist { background: #fef7e0; color: #e37400; }

.lp-commute {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 12px;
}
.lp-commute-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #3c4043;
}
.lp-commute-item i { color: #1a73e8; font-size: 16px; }

.lp-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.lp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 24px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all .2s;
}
.lp-btn-outline {
    background: #fff;
    color: #1a73e8;
    border: 1.5px solid #dadce0;
}
.lp-btn-outline:hover {
    background: #f8f9fa;
    color: #1557b0;
}
.lp-btn-primary {
    background: #1a73e8;
    color: #fff;
}
.lp-btn-primary:hover {
    background: #1557b0;
    color: #fff;
    box-shadow: 0 2px 8px rgba(26,115,232,.35);
}

.panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 14;
}

.map-container.has-panel .map-top-bar {
    left: 12px;
}

.map-top-bar {
    position: absolute; top: 12px; left: 12px; right: 12px; z-index: 10;
    display: flex; align-items: center; gap: 10px;
}
.brand-pill {
    background: var(--jm-surface); padding: 8px 16px; border-radius: 24px;
    font-weight: 700; color: var(--jm-primary); text-decoration: none;
    box-shadow: var(--jm-shadow); white-space: nowrap;
}
.search-box {
    flex: 1; background: var(--jm-surface); border-radius: 24px;
    display: flex; align-items: center; padding: 0 16px; box-shadow: var(--jm-shadow);
    max-width: 500px;
}
.search-box i { color: #5f6368; margin-right: 8px; }
.search-box input { border: none; outline: none; width: 100%; padding: 10px 0; background: transparent; }

.map-controls {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    z-index: 10; display: flex; flex-direction: column; gap: 8px;
}
.map-control-btn {
    width: 44px; height: 44px; border-radius: 50%; border: none;
    background: var(--jm-surface); box-shadow: var(--jm-shadow);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: #5f6368; cursor: pointer; transition: background .2s;
}
.map-control-btn:hover { background: #f1f3f4; color: var(--jm-primary); }

.filter-panel {
    position: absolute; right: 68px; top: 50%; transform: translateY(-50%);
    z-index: 10; background: var(--jm-surface); border-radius: 16px;
    padding: 20px; width: 280px; box-shadow: var(--jm-shadow);
}

.job-count-badge {
    position: absolute; bottom: 100px; left: 50%; transform: translateX(-50%);
    background: var(--jm-surface); padding: 8px 20px; border-radius: 20px;
    box-shadow: var(--jm-shadow); font-size: 14px; font-weight: 500; z-index: 10;
    transition: bottom .3s cubic-bezier(.4,0,.2,1);
}
.map-container:has(.bottom-sheet.open) .job-count-badge { bottom: 280px; }

/* Sheet backdrop */
.sheet-backdrop {
    position: absolute; inset: 0; z-index: 19;
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
    transition: background .3s ease;
}
.sheet-backdrop.visible {
    background: rgba(0, 0, 0, 0.35);
    pointer-events: auto;
}

/* Bottom sheet — job preview */
.bottom-sheet {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 20;
    background: var(--jm-surface);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(.32, .72, 0, 1);
    max-height: 55vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.bottom-sheet.open { transform: translateY(0); }

.bottom-sheet-header {
    position: relative;
    flex-shrink: 0;
    padding: 8px 16px 0;
}
.bottom-sheet-handle {
    width: 36px; height: 4px;
    background: #d1d5db;
    border-radius: 4px;
    margin: 4px auto 8px;
    cursor: pointer;
    transition: background .2s;
}
.bottom-sheet-handle:hover { background: #9ca3af; }

.sheet-close-btn {
    position: absolute;
    top: 4px; right: 12px;
    width: 36px; height: 36px;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: background .2s, color .2s, transform .15s;
}
.sheet-close-btn:hover {
    background: #e5e7eb;
    color: #111827;
    transform: scale(1.05);
}

.bottom-sheet-content {
    padding: 4px 20px 28px;
    overflow-y: auto;
    flex: 1;
}

.sheet-job-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
    padding-right: 40px;
}

.sheet-company-avatar {
    width: 48px; height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    color: #fff;
    font-weight: 700;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.sheet-job-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.sheet-company-name {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sheet-company-name i { font-size: 12px; opacity: .7; }

.sheet-featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #b45309;
    background: #fef3c7;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.sheet-featured-badge i { font-size: 10px; }

.sheet-bookmark-btn {
    width: 40px; height: 40px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 18px;
    transition: all .2s;
    margin-left: auto;
}
.sheet-bookmark-btn:hover { border-color: #1a73e8; color: #1a73e8; }
.sheet-bookmark-btn.active {
    background: #eff6ff;
    border-color: #1a73e8;
    color: #1a73e8;
}

.sheet-salary-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #047857;
    font-weight: 700;
    font-size: 1rem;
    padding: 10px 16px;
    border-radius: 12px;
    margin-bottom: 14px;
}
.sheet-salary-row i { font-size: 14px; opacity: .8; }

.sheet-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.sheet-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    color: #374151;
    background: #f3f4f6;
}
.sheet-tag i { font-size: 13px; opacity: .75; }
.sheet-tag-mode { background: #eff6ff; color: #1d4ed8; }
.sheet-tag-exp { background: #f5f3ff; color: #6d28d9; }
.sheet-tag-dist { background: #fff7ed; color: #c2410c; }

.sheet-commute-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}
.commute-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 14px;
}
.commute-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.commute-icon.drive { background: #dbeafe; color: #2563eb; }
.commute-icon.transit { background: #ede9fe; color: #7c3aed; }
.commute-label {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.commute-value {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.sheet-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-top: 4px;
}
.sheet-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all .2s;
}
.sheet-btn-secondary {
    background: #fff;
    color: #1a73e8;
    border: 2px solid #1a73e8;
}
.sheet-btn-secondary:hover {
    background: #eff6ff;
    color: #1557b0;
}
.sheet-btn-primary {
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(26, 115, 232, 0.35);
}
.sheet-btn-primary:hover {
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.45);
    transform: translateY(-1px);
    color: #fff;
}

.loading-overlay {
    position: absolute; inset: 0; background: rgba(255,255,255,0.6);
    display: flex; align-items: center; justify-content: center; z-index: 30;
}

.admin-sidebar .nav-link.active { background: rgba(255,255,255,0.1); border-radius: 8px; }
.admin-sidebar .nav-link { border-radius: 8px; padding: 8px 12px; }
.admin-sidebar .nav-link:hover { background: rgba(255,255,255,0.05); }

@media (max-width: 768px) {
    .map-top-bar { flex-wrap: wrap; }
    .search-box { order: 3; max-width: 100%; flex-basis: 100%; }
    .filter-panel { right: 12px; top: auto; bottom: 120px; transform: none; width: calc(100% - 24px); }

    .location-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        height: auto;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 24px rgba(0,0,0,.15);
        transform: translateY(100%);
        transition: transform .35s cubic-bezier(.32,.72,0,1);
        z-index: 20;
    }
    .location-panel.open {
        transform: translateY(0);
    }
    .location-panel-inner {
        width: 100%;
        max-height: 85vh;
        height: auto;
    }
    .map-container.has-panel .job-count-badge { display: none; }
}

[data-bs-theme="dark"] {
    --jm-surface: #1e1e1e;
    --jm-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

/* Map user menu */
.map-user-menu { flex-shrink: 0; }
.map-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 5px;
    border: 1px solid rgba(26, 115, 232, 0.12);
    border-radius: 999px;
    background: linear-gradient(135deg, #ffffff 0%, #f3f8ff 100%);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.map-user-btn:hover,
.map-user-btn:focus,
.map-user-btn[aria-expanded="true"] {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(26, 115, 232, 0.18);
    outline: none;
}
.map-user-avatar {
    --pct: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #fff 58%, transparent 59%),
        conic-gradient(#1a73e8 calc(var(--pct) * 1%), #e2e8f0 0);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    overflow: hidden;
}
.map-user-avatar.lg {
    width: 44px;
    height: 44px;
}
.map-user-avatar img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}
.map-user-avatar.lg img {
    width: 34px;
    height: 34px;
}
.map-user-initials {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #1a73e8, #7c3aed);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}
.map-user-avatar.lg .map-user-initials {
    width: 34px;
    height: 34px;
    font-size: 0.82rem;
}
.map-user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
    min-width: 0;
}
.map-user-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.map-user-sub {
    font-size: 0.68rem;
    font-weight: 600;
    color: #1a73e8;
}
.map-user-caret {
    font-size: 0.72rem;
    color: #64748b;
    margin-left: 2px;
}
.map-user-dropdown {
    min-width: 280px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 10px;
    margin-top: 10px !important;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    overflow: hidden;
}
.map-user-dropdown-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 12px;
}
.map-user-dropdown-name {
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
}
.map-user-dropdown-email {
    font-size: 0.75rem;
    color: #64748b;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.map-user-hub {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin: 0 4px 8px;
    padding: 11px 12px !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: #fff !important;
    font-weight: 700;
}
.map-user-hub:hover {
    background: linear-gradient(135deg, #1557b0, #0d47a1);
    color: #fff !important;
}
.map-user-dropdown-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 0 4px 8px;
}
.map-user-dropdown-grid a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    color: #0f172a;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s;
}
.map-user-dropdown-grid a:hover {
    background: #e8f0fe;
    border-color: #c7d9fd;
    color: #1a73e8;
}
.map-user-dropdown-grid a i {
    color: #1a73e8;
}
.map-user-dropdown .dropdown-item {
    border-radius: 10px;
    font-size: 0.86rem;
    font-weight: 600;
}
.map-signin-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(26, 115, 232, 0.28);
}
.map-signin-btn:hover { color: #fff; }

@media (max-width: 640px) {
    .map-user-meta { display: none; }
    .map-user-btn { padding: 4px; }
    .map-user-caret { display: none; }
}
