:root {
    --primary: var(--cg-primary, #1877f2);
    --sidebar-width: 250px;
}

body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; }

/* Hero */
.hero-section {
    background: linear-gradient(135deg, #1877f2 0%, #0d5bbd 50%, #004494 100%);
    min-height: 400px;
}

.feature-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-card { transition: transform 0.2s; }
.feature-card:hover { transform: translateY(-4px); }

/* Auth */
.auth-bg {
    background: linear-gradient(180deg, #f0f2f5 0%, #e4e6eb 100%);
    min-height: 100vh;
}

/* Dashboard */
.dashboard-body { background: #f0f2f5; }

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: #1c1e21;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand { border-bottom: 1px solid #3a3b3c; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #b0b3b8;
    text-decoration: none;
    transition: background 0.15s;
}

.sidebar-link:hover, .sidebar-link.active {
    background: #3a3b3c;
    color: #fff;
}

.sidebar-link.active {
    border-left: 3px solid var(--cg-primary, var(--primary, #1877f2));
    padding-left: 17px;
}

.sidebar-nav-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 0.5rem;
}

.sidebar-nav-scroll::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav-scroll::-webkit-scrollbar-thumb {
    background: #3a3b3c;
    border-radius: 3px;
}

.sidebar-section {
    margin-bottom: 0.35rem;
}

.sidebar-section-label {
    padding: 0.65rem 20px 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
}

/* Pro dashboard sidebar — works without external dashboard-pro.css */
.sidebar.dash-sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e3e8ef;
    box-shadow: none;
}

.sidebar.dash-sidebar .sidebar-brand {
    border-bottom: 1px solid #e3e8ef !important;
}

.sidebar.dash-sidebar .sidebar-brand a {
    color: #1a1d21 !important;
}

.sidebar.dash-sidebar .sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4b5563 !important;
    text-decoration: none !important;
    padding: 0.55rem 1rem;
    margin: 2px 0.75rem;
    border-radius: 10px;
    border-left: none !important;
}

.sidebar.dash-sidebar .sidebar-link:hover,
.sidebar.dash-sidebar .sidebar-link.active {
    background: #f3f4f6 !important;
    color: var(--cg-primary, var(--primary, #1877f2)) !important;
}

.sidebar.dash-sidebar .sidebar-link.active {
    background: rgba(24, 119, 242, 0.1) !important;
    font-weight: 600;
}

.admin-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.admin-menu-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    color: #1a1d21 !important;
    min-height: 80px;
    padding: 12px 10px;
    background: #fff;
    border: 1px solid #e3e8ef;
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    gap: 8px;
}

.admin-menu-tile i {
    font-size: 1.35rem;
    color: var(--cg-primary, var(--primary, #1877f2));
}

.main-content { min-height: 100vh; padding-bottom: 70px; }

/* Mobile bottom nav */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
}

.nav-link-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.65rem;
    color: #65676b;
    text-decoration: none;
    padding: 4px 8px;
}

.nav-link-mobile i { font-size: 1.3rem; }
.nav-link-mobile.active { color: var(--primary); }

/* Cards */
.stat-card { transition: transform 0.15s; }
.stat-card:hover { transform: translateY(-2px); }

.quick-action { transition: transform 0.15s, box-shadow 0.15s; }
.quick-action:hover { transform: translateY(-3px); box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important; }

.merchant-card { transition: transform 0.15s; }
.merchant-card:hover { transform: translateY(-2px); }

/* Tracking steps */
.tracking-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 0 10px;
}

.tracking-steps::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 30px;
    right: 30px;
    height: 3px;
    background: #e4e6eb;
    z-index: 0;
}

.track-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    flex: 1;
}

.track-step .step-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e4e6eb;
    border: 3px solid #fff;
    margin-bottom: 6px;
}

.track-step.active .step-dot { background: var(--primary); }
.track-step span { font-size: 0.65rem; text-align: center; color: #65676b; }
.track-step.active span { color: var(--primary); font-weight: 600; }

/* Star rating input */
.star-rating { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.star-rating input { display: none; }
.star-rating label { cursor: pointer; font-size: 1.5rem; color: #ddd; }
.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label { color: #ffc107; }

/* Fixed cart button */
.fixed-cart-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    border-radius: 50px;
    padding: 12px 24px;
    z-index: 999;
}

@media (min-width: 992px) {
    .fixed-cart-btn { bottom: 30px; }
    .main-content { padding-bottom: 0; }
}

/* Notifications */
.notif-dropdown { width: 320px; max-height: 400px; overflow-y: auto; }

.notif-item .dropdown-item {
    border: 0;
    white-space: normal;
}

.notif-unread {
    background: rgba(13, 110, 253, 0.04);
}

.notif-dismiss-btn {
    font-size: 1.25rem;
    line-height: 1;
    min-width: 1.5rem;
    opacity: 0.55;
}

.notif-dismiss-btn:hover {
    opacity: 1;
}
.notif-badge { position: absolute; top: -2px; right: -2px; font-size: 0.6rem; }

/* Job cards */
.job-card { border-left: 4px solid var(--primary) !important; }

/* Bootstrap overrides */
.btn-primary { background-color: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background-color: #166fe5; border-color: #166fe5; }
.bg-primary { background-color: var(--primary) !important; }
.text-primary { color: var(--primary) !important; }
.navbar-dark.bg-primary { background-color: var(--primary) !important; }

/* Geocoding */
.geocode-map { height: 280px; width: 100%; z-index: 1; }
.geocode-map-sm { height: 200px; }
.geocode-suggestions {
    position: absolute;
    z-index: 1050;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    display: none;
}
.geocode-field { position: relative; }
.geocode-field:focus-within .geocode-suggestions:not(:empty) { display: block; }
.geocode-option { cursor: pointer; border: none; text-align: left; }
.geo-pin-icon { background: none; border: none; }
.geo-pin {
    width: 22px; height: 22px; border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg); margin: 4px 0 0 1px;
    border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.geo-pin-tip {
    width: 0; height: 0; border-left: 6px solid transparent;
    border-right: 6px solid transparent; border-top: 8px solid;
    margin: -2px auto 0; transform: rotate(45deg);
}
.geocode-field.geo-field-active .geocode-input {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(24, 119, 242, 0.15);
}

/* Profile avatars */
.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    flex-shrink: 0;
}
.profile-avatar-sm { width: 48px; height: 48px; }
.profile-avatar-lg { width: 96px; height: 96px; }
.profile-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e4e6eb, #f0f2f5);
    color: #65676b;
}
.profile-avatar-placeholder i { font-size: 1.75rem; }
.profile-avatar-lg.profile-avatar-placeholder i { font-size: 2.5rem; }
.profile-card { transition: transform 0.15s, box-shadow 0.15s; }
.profile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

/* Instagram-style story circles (customer) */
.ig-home,
.ig-browse-page {
    max-width: 480px;
    margin: 0 auto;
}

.ig-home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
}

.ig-greeting-label {
    font-size: 0.8rem;
    color: #65676b;
}

.ig-greeting-name {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.ig-header-action {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1c1e21;
    font-size: 1.15rem;
}

.story-row-section {
    background: #fff;
    border-radius: 16px;
    padding: 12px 8px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.story-row-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #262626;
}

.story-see-all {
    color: #0095f6;
    font-weight: 600;
}

.story-row-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -4px;
    padding: 4px 2px 2px;
}

.story-row-scroll::-webkit-scrollbar {
    display: none;
}

.story-row-track {
    display: flex;
    flex-direction: row;
    gap: 14px;
    padding: 2px 6px 6px;
    width: max-content;
}

.story-circle-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 76px;
    flex-shrink: 0;
    color: #262626;
}

.story-ring {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Flash / pulse effects on story circles */
.story-ring-flash {
    animation: storyRingPulse 2.2s ease-in-out infinite;
}

.story-ring-flash::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: inherit;
    filter: blur(10px);
    opacity: 0.45;
    z-index: -1;
    animation: storyRingGlow 2.2s ease-in-out infinite alternate;
}

.story-ring-flash::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(
        105deg,
        transparent 35%,
        rgba(255, 255, 255, 0.55) 50%,
        transparent 65%
    );
    animation: storyRingShimmer 3s ease-in-out infinite;
    pointer-events: none;
}

.story-circle-item:nth-child(4n+1) .story-ring-flash { animation-delay: 0s; }
.story-circle-item:nth-child(4n+2) .story-ring-flash { animation-delay: 0.35s; }
.story-circle-item:nth-child(4n+3) .story-ring-flash { animation-delay: 0.7s; }
.story-circle-item:nth-child(4n) .story-ring-flash { animation-delay: 1.05s; }

.story-ring-live.story-ring-flash::before {
    background: linear-gradient(45deg, #00c853, #00e676, #69f0ae);
}

@keyframes storyRingPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 10px rgba(225, 48, 108, 0.2);
    }
    50% {
        transform: scale(1.07);
        box-shadow: 0 4px 22px rgba(225, 48, 108, 0.45);
    }
}

@keyframes storyRingGlow {
    0% { opacity: 0.25; transform: scale(0.92); }
    100% { opacity: 0.65; transform: scale(1.1); }
}

@keyframes storyRingShimmer {
    0%, 100% { opacity: 0; transform: rotate(0deg); }
    40% { opacity: 1; }
    60% { opacity: 0.6; transform: rotate(8deg); }
}

.story-circle-item:hover .story-ring-flash {
    animation-duration: 1.2s;
}

@media (prefers-reduced-motion: reduce) {
    .story-ring-flash,
    .story-ring-flash::before,
    .story-ring-flash::after {
        animation: none !important;
    }
}

.story-ring-store {
    background: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d);
}

.story-ring-muted {
    background: #dbdbdb;
}

.story-ring-live {
    background: linear-gradient(45deg, #00c853, #00e676, #69f0ae, #00c853);
}

.story-ring-grid {
    width: 64px;
    height: 64px;
    padding: 2px;
}

.story-circle-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-circle-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.story-circle-placeholder {
    background: linear-gradient(145deg, #efefef, #fafafa);
    color: #8e8e8e;
    font-size: 1.5rem;
}

.story-ring-grid .story-circle-placeholder {
    font-size: 1.25rem;
}

.story-live-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    background: #00c853;
    border: 2.5px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.story-circle-label {
    margin-top: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    text-align: center;
    max-width: 76px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
    color: #262626;
}

.story-circle-item:hover .story-ring {
    transform: scale(1.04);
    transition: transform 0.15s ease;
}

/* Quick actions — compact pills */
.ig-action-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.ig-action-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 6px;
    background: #fff;
    border-radius: 14px;
    text-decoration: none;
    color: #262626;
    font-size: 0.72rem;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: transform 0.12s;
}

.ig-action-pill:hover {
    transform: scale(1.03);
    color: #262626;
}

.ig-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Feed cards */
.ig-feed-title {
    font-weight: 600;
    color: #262626;
}

.ig-feed-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.ig-feed-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #efefef;
    font-size: 0.9rem;
}

.ig-feed-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1877f2;
}

.ig-feed-list {
    display: flex;
    flex-direction: column;
}

.ig-feed-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #efefef;
    transition: background 0.12s;
}

.ig-feed-item:last-child {
    border-bottom: none;
}

.ig-feed-item:hover {
    background: #fafafa;
}

/* Browse pages */
.ig-browse-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 4px;
}

.ig-back-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #262626;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    text-decoration: none;
}

.ig-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 576px) {
    .ig-profile-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.ig-profile-grid-card {
    background: #fff;
    border-radius: 14px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: transform 0.12s;
}

.ig-profile-grid-card:hover {
    transform: translateY(-2px);
    color: #262626;
}

.ig-profile-grid-info {
    margin-top: 10px;
    width: 100%;
}

/* Customer content area — lighter feed background on home */
.content-area:has(.ig-home) {
    background: #fafafa;
}

@media (min-width: 992px) {
    .ig-home,
    .ig-browse-page {
        max-width: 520px;
    }
}

/* Customer public store page */
.store-banner-wrap {
    height: 140px;
    background: linear-gradient(135deg, #1877f2, #0d5bbd);
}

.store-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.store-banner-fallback {
    height: 100%;
    background: linear-gradient(135deg, #1877f2, #0d5bbd);
}

.store-public-card {
    margin-top: -24px;
    border-radius: 16px !important;
}

.store-logo-overlap {
    margin-top: -48px;
    margin-bottom: 8px;
}

/* Rider — floating accept buttons */
@keyframes riderAcceptFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes riderAcceptGlow {
    0%, 100% { box-shadow: 0 4px 14px rgba(24, 119, 242, 0.45); }
    50% { box-shadow: 0 10px 28px rgba(24, 119, 242, 0.65); }
}

@keyframes riderAcceptRing {
    0% { transform: scale(1); opacity: 0.7; }
    70% { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
}

.btn-accept-float {
    position: relative;
    animation: riderAcceptFloat 2.2s ease-in-out infinite, riderAcceptGlow 2.2s ease-in-out infinite;
    font-weight: 600;
    min-width: 5.5rem;
}

.btn-accept-float::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    border: 2px solid rgba(24, 119, 242, 0.55);
    animation: riderAcceptRing 2.2s ease-out infinite;
    pointer-events: none;
}

.btn-accept-float:hover {
    animation: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(24, 119, 242, 0.5);
}

.btn-accept-float:active {
    transform: translateY(0);
}

/* Rider push alert banner */
.rider-push-banner {
    position: fixed;
    left: 50%;
    bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%) translateY(120%);
    z-index: 1080;
    width: min(420px, calc(100vw - 1.5rem));
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rider-push-banner.show {
    transform: translateX(-50%) translateY(0);
}

.rider-push-banner .card {
    border-left: 4px solid #ffc107 !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.notif-badge.rider-alert-pulse {
    animation: riderBellPulse 1s ease-in-out 3;
}

@keyframes riderBellPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.25); }
}

/* Customer — nearby rider suggestions */
.nearby-riders-panel {
    background: #fff;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.nearby-riders-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.nearby-rider-card {
    flex: 0 0 140px;
    scroll-snap-align: start;
    background: #f8f9fa;
    border-radius: 14px;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    transition: transform 0.2s, box-shadow 0.2s;
}

.nearby-rider-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(24, 119, 242, 0.15);
}

.nearby-rider-avatar {
    position: relative;
    width: 56px;
    height: 56px;
    margin: 0 auto 0.5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #dee2e6;
}

.nearby-rider-avatar.is-online {
    border-color: #198754;
}

.nearby-rider-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nearby-rider-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #e9ecef;
    color: #6c757d;
    font-size: 1.5rem;
}

.nearby-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #198754;
    border: 2px solid #fff;
    border-radius: 50%;
}

.nearby-riders-compact .nearby-rider-card {
    flex: 0 0 120px;
}

.nearby-riders-compact .nearby-rider-avatar {
    width: 48px;
    height: 48px;
}

.customer-location-pill {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    align-items: center;
    gap: 0.25rem;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-location-pill span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.module-control-card.module-on {
    border-left: 4px solid #198754;
}

.module-control-card.module-off {
    border-left: 4px solid #adb5bd;
    opacity: 0.92;
}
