@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary-green: #2ecc71;
    --dark-green: #1e5631;
    --light-green: #e9f7ef;
    --accent-green: #27ae60;
    --white: #ffffff;
    --gray-bg: #f8f9fa;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    background-color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-green);
    color: var(--white);
    border: 2px solid var(--primary-green);
}

.btn-primary:hover {
    background-color: var(--dark-green);
    border-color: var(--dark-green);
    transform: translateY(-2px);
}


.btn-outline {
    background-color: transparent;
    color: var(--dark-green);
    border: 2px solid var(--dark-green);
}

.btn-outline:hover {
    background-color: var(--dark-green);
    color: var(--white);
    transform: translateY(-2px);
}

.section-padding {
    padding: 80px 0;
}

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

.heading-primary {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark-green);
    margin-bottom: 20px;
}

.subtext {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

/* Header */
header {
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-green);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    color: var(--primary-green);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-dark);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-green);
}

.nav-icons {
    display: flex;
    align-items: center;
    /* Vertically center all icons */
    gap: 20px;
    font-size: 1.2rem;
    color: var(--text-dark);
}

/* Hero Section — New Responsive Background Image */
.hero {
    position: relative;
    height: 100vh;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    width: 100%;
    background-image: url('https://images.unsplash.com/photo-1542601906990-b4d3fb778b09?auto=format&fit=crop&q=80&w=2013');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Overlay — Soft tint for readability while maintaining photo vibrancy */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    z-index: 1;
}

/* Hero content — centered layout */
.hero>.container {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 3.5rem;
    color: var(--dark-green);
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-content.text-center {
    text-align: center;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.hero-content.text-center .hero-buttons {
    justify-content: center;
}


/* Key Highlights */
.highlights {
    background: var(--white);
    margin-top: 0;
    padding-top: 80px;
    padding-bottom: 80px;
    position: relative;
    z-index: 10;
}

.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.highlight-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    transition: var(--transition);
}

.highlight-card:hover {
    transform: translateY(-10px);
}

.highlight-icon {
    font-size: 2.5rem;
    color: var(--primary-green);
    margin-bottom: 20px;
}

.highlight-card h3 {
    margin-bottom: 15px;
    color: var(--dark-green);
}

.highlight-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Categories */
.categories {
    background-color: var(--light-green);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.category-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
}

.category-card:hover {
    box-shadow: var(--shadow-md);
    transform: scale(1.05);
}

.category-card h3 {
    margin-top: 10px;
    font-size: 1.1rem;
    color: var(--dark-green);
}

/* Trending Products */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.product-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    transition: var(--transition);
    position: relative;
}

.product-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-green);
}

.product-img {
    background: var(--gray-bg);
    height: 200px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 3rem;
}

.product-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.product-rating {
    color: #f1c40f;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    font-weight: 700;
    color: var(--primary-green);
    font-size: 1.2rem;
}

.add-btn {
    background: var(--light-green);
    color: var(--dark-green);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.add-btn:hover {
    background: var(--primary-green);
    color: var(--white);
}

/* Why Choose Us */
.why-choose {
    background-color: var(--gray-bg);
    text-align: center;
}

.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 50px;
}

.why-item i {
    font-size: 3rem;
    color: var(--primary-green);
    margin-bottom: 20px;
}

/* Footer */
footer {
    background-color: var(--dark-green);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-col .logo {
    color: var(--white);
    font-size: 1.5rem;
    margin-bottom: 15px;
    display: inline-flex;
}

.footer-col .logo i {
    color: var(--primary-green);
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #ccc;
}

.footer-col ul li a:hover {
    color: var(--primary-green);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 20px;
    }

    .nav-links {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .hero {
        height: 100vh;
        min-height: 100vh;
        margin-top: 0;
        padding: 0;
    }

    .hero-content h1 {
        font-size: 2.5rem;
        color: var(--dark-green);
        text-shadow: none;
    }

    .hero-content p {
        color: var(--text-dark);
    }

    .btn-outline {
        color: var(--dark-green);
        border-color: var(--dark-green);
    }
}

@media (max-width: 480px) {
    .hero {
        height: 100vh;
        min-height: 100vh;
    }

    .hero-content h1 {
        font-size: 2rem;
        color: var(--dark-green);
    }

    .hero-content p {
        font-size: 1.1rem;
        color: var(--text-dark);
    }

    .hero-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .btn {
        width: 100%;
    }
}

/* Smallest phones (≤360px) — font size and overflow fixes */
@media (max-width: 360px) {
    .hero-content h1 {
        font-size: 1.75rem;
        line-height: 1.2;
        color: var(--dark-green);
    }

    .hero-content p {
        font-size: 1rem;
        line-height: 1.4;
        color: var(--text-dark);
    }

    /* Prevent overflow */
    .container {
        padding: 0 15px;
        /* Slightly reduced padding for very small screens */
        max-width: 100%;
        width: 100%;
    }

    .section-padding {
        padding: 40px 0;
        /* Reduced vertical padding */
    }

    .heading-primary {
        font-size: 2rem;
    }

    .highlight-card,
    .product-card,
    .category-card {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: 100%;
    }

    .products-grid,
    .category-grid,
    .highlights-grid {
        gap: 15px;
    }
}

/* Global Image and Container Fixes */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Page Wrapper to prevent horizontal overflow */
.page-wrapper {
    width: 100%;
    overflow-x: hidden;
    position: relative;
}

/* Toast and Wishlist Styles */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #1e5631;
    color: #ffffff;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

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

.wishlist-btn {
    background: transparent;
    color: #e74c3c;
    border: 1px solid #e74c3c;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.wishlist-btn:hover {
    background: #e74c3c;
    color: #ffffff;
}


/* Mobile Navigation styles */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #1e5631;
}

@media (max-width: 768px) {
    .navbar {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        padding: 15px 0;
    }

    /* Logo stays on the left */
    .logo {
        flex-grow: 1;
        /* Pushes icons to the right if needed, but margin-left: auto on group is better */
        order: 1;
    }

    /* Nav links hidden by default */
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-lg);
        text-align: center;
        z-index: 1001;
        border-top: 1px solid var(--border-color);
    }

    .nav-links.active {
        display: flex;
        animation: slideDown 0.3s ease forwards;
    }

    /* Nav Icons Group */
    .nav-icons {
        order: 2;
        display: flex;
        align-items: center;
        margin-left: auto;
        margin-right: 15px;
        /* Equal spacing with hamburger menu */
        gap: 15px;
        /* Equal spacing between internal icons */
    }

    /* Hide Wishlist and search icons on mobile to keep navbar clean */
    .nav-icons a[href="wishlist.html"],
    .nav-icons a:has(.ph-magnifying-glass) {
        display: none;
    }

    /* Menu Toggle */
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        order: 3;
        font-size: 1.8rem;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Password Visibility Toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-control {
    padding-right: 45px;
    /* Space for the icon */
    width: 100%;
}

.password-toggle-icon {
    position: absolute;
    right: 15px;
    cursor: pointer;
    color: var(--text-light);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    transition: var(--transition);
    user-select: none;
    z-index: 5;
}

.password-toggle-icon:hover {
    color: var(--primary-green);
}

/* User Dropdown */
.user-dropdown-container {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 1050;
    /* Always above hero overlays and section backgrounds */
}

.user-dropdown-toggle {
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: inherit;
    font-size: inherit;
    line-height: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    pointer-events: auto;
    /* Ensure no parent overlay blocks clicks */
}

.user-dropdown-toggle:hover {
    color: var(--primary-green);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--white);
    min-width: 190px;
    box-shadow: var(--shadow-lg);
    border-radius: 8px;
    padding: 8px 0;
    margin-top: 15px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1100;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-item {
    display: block;
    padding: 10px 20px;
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.user-dropdown-item:hover {
    background-color: var(--light-green);
    color: var(--primary-green);
}

/* Divider inside dropdown */
.user-dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 6px 0;
}

/* Ensure dropdown is properly positioned on mobile */
@media (max-width: 768px) {
    .user-dropdown-menu {
        position: fixed;
        top: 70px;
        right: 10px;
        left: auto;
        min-width: 190px;
        width: auto;
    }
}

@media (max-width: 360px) {
    .user-dropdown-menu {
        right: 5px;
        min-width: 180px;
    }
}

/* -------------------------------------------
   Admin Dashboard Custom Styling
   ------------------------------------------- */

/* Logout sidebar item — separator above it, then red-tinted link */
body.admin-dashboard .sidebar-menu .logout-item {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* Logout link inherits ALL the same layout as other sidebar links */
body.admin-dashboard .sidebar-item-logout a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    color: rgba(255, 107, 107, 0.9) !important;
    transition: var(--transition);
}

body.admin-dashboard .sidebar-item-logout a:hover {
    background-color: rgba(255, 107, 107, 0.15) !important;
    color: #ff6b6b !important;
}

/* At ≤1024px: hide the duplicate Logout inside the header user-dropdown
   so only the sidebar logout is visible */
@media (max-width: 1024px) {
    body.admin-dashboard .user-dropdown-menu .user-dropdown-logout {
        display: none !important;
    }
}

/* -------------------------------------------
   Admin/User Dashboard Responsive Sidebar
   ------------------------------------------- */

/* ≤ 992px: collapse the two-column grid to single column */
@media (max-width: 992px) {
    .dashboard-layout .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ≤ 768px: convert sidebar to off-canvas slide-in panel */
@media (max-width: 768px) {

    /* ── ADMIN dashboard ─────────────────────────────── */
    body.admin-dashboard .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    body.admin-dashboard .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        width: min(280px, 85vw);
        height: 100vh;
        height: 100dvh;
        z-index: 2000;
        border-radius: 0;
        padding-top: 70px;
        overflow-y: auto;
        overflow-x: hidden;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        max-width: 100vw;
    }

    body.admin-dashboard .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
    }

    /* Hamburger toggle — admin */
    body.admin-dashboard .sidebar-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 1.8rem;
        color: var(--dark-green);
        margin-right: 15px;
        z-index: 2001;
        position: relative;
        flex-shrink: 0;
    }

    /* ── USER dashboard ──────────────────────────────── */
    body.dashboard-layout:not(.admin-dashboard) .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    body.dashboard-layout:not(.admin-dashboard) .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        width: min(280px, 85vw);
        height: 100vh;
        height: 100dvh;
        z-index: 2000;
        border-radius: 0 !important;
        padding: 70px 24px 30px !important;
        /* top clears header */
        overflow-y: auto;
        overflow-x: hidden;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        max-width: 100vw;
        /* Restore visible background (inline sticky styles use white) */
        background: var(--white) !important;
        box-shadow: none;
    }

    body.dashboard-layout:not(.admin-dashboard) .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    }

    /* Hamburger toggle — user dashboard */
    body.dashboard-layout:not(.admin-dashboard) .sidebar-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 1.8rem;
        color: var(--dark-green);
        margin-right: 12px;
        z-index: 2001;
        position: relative;
        flex-shrink: 0;
    }

    /* ── Shared overlay + close button ──────────────── */

    /* Backdrop overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.52);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        z-index: 1999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Close ✕ button injected inside sidebar by JS */
    .sidebar-close {
        display: flex !important;
        position: absolute;
        top: 18px;
        right: 16px;
        cursor: pointer;
        font-size: 1.4rem;
        z-index: 2001;
        padding: 4px;
        border-radius: 4px;
        transition: color 0.2s ease, background 0.2s ease;
    }

    /* Admin close icon: white on dark sidebar */
    body.admin-dashboard .sidebar-close {
        color: rgba(255, 255, 255, 0.8);
    }

    body.admin-dashboard .sidebar-close:hover {
        color: var(--white);
        background: rgba(255, 255, 255, 0.15);
    }

    /* User dashboard close icon: dark on white sidebar */
    body.dashboard-layout:not(.admin-dashboard) .sidebar-close {
        color: var(--text-dark);
    }

    body.dashboard-layout:not(.admin-dashboard) .sidebar-close:hover {
        color: var(--dark-green);
        background: var(--light-green);
    }
}

/* Default: hide toggle and close icons on desktop */
.sidebar-toggle,
.sidebar-close {
    display: none;
}

/* Body scroll lock when sidebar is open */
body.sidebar-open {
    overflow: hidden !important;
    /* iOS Safari: prevent background scroll without layout jump */
    position: fixed;
    width: 100%;
}


/* -------------------------------------------
   Dashboard Navbar — Base layout
   Logo left · Nav-actions right on desktop.
   Works for both user and admin dashboards.
   ------------------------------------------- */
.dashboard-layout .navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Logo anchored to the left, no extra margin */
.dashboard-layout .navbar .logo {
    order: 1;
    /* always first (left) */
    margin: 0;
    flex-shrink: 0;
}

/* Hamburger anchored to the right on mobile */
.dashboard-layout .sidebar-toggle {
    order: 3;
    /* always last (right) on mobile */
    margin: 0;
    flex-shrink: 0;
}

/* Nav-actions sits between logo and hamburger on desktop;
   on mobile it is empty (cart hidden, logout hidden) so hide it */
.dashboard-layout .nav-actions {
    order: 2;
    font-size: 1.5rem;
    /* middle slot */
    margin-left: auto;
    /* pushes hamburger to far right on desktop  */
    display: flex;
    align-items: center;
    gap: 10px;
}

/* On mobile: nav-actions is visually empty (cart + logout both hidden)
   Remove it from layout flow entirely so only logo + hamburger remain  */
@media (max-width: 1024px) {
    body.dashboard-layout:not(.admin-dashboard) .nav-actions {
        display: none;
    }
}


/* -------------------------------------------
   Dashboard Sticky Footer — Flex Column Layout
   Applies to ALL dashboard pages (user + admin).
   Footer is always pinned to the bottom.
   ------------------------------------------- */
body.dashboard-layout .page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Main content area grows to fill available space,
   naturally pushing the footer to the bottom       */
body.dashboard-layout main {
    flex: 1;
}


/* -------------------------------------------
   User Dashboard Header — Logout clean up
   Hide Logout button from header at ≤1024px.
   Logout remains accessible inside the sidebar.
   Scoped to user dashboard only (not admin).
   ------------------------------------------- */
@media (max-width: 1024px) {
    body.dashboard-layout:not(.admin-dashboard) .nav-actions .btn-outline {
        display: none !important;
    }
}




/* -------------------------------------------
   Admin Customers & Orders — Responsive Tables
   Targets only .customer-table and .order-table.
   No other page or table is affected.
   ------------------------------------------- */

/* Wrapper: scrolls horizontally inside the card;
   the page itself never scrolls horizontally.    */
body.admin-dashboard .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* iOS momentum scroll */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

body.admin-dashboard .table-responsive::-webkit-scrollbar {
    height: 5px;
}

body.admin-dashboard .table-responsive::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* ── Customer table (5 cols) ─────────────────── */
body.admin-dashboard .customer-table {
    min-width: 620px;
    width: 100%;
    border-collapse: collapse;
}

body.admin-dashboard .customer-table th,
body.admin-dashboard .customer-table td {
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    vertical-align: middle;
}

body.admin-dashboard .customer-table th {
    background-color: var(--gray-bg);
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

body.admin-dashboard .customer-table tbody tr:hover {
    background-color: var(--light-green);
}

body.admin-dashboard .customer-info {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

/* ── Orders table (6 cols) ──────────────────── */
body.admin-dashboard .order-table {
    min-width: 700px;
    width: 100%;
    border-collapse: collapse;
}

body.admin-dashboard .order-table th,
body.admin-dashboard .order-table td {
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    vertical-align: middle;
}

body.admin-dashboard .order-table th {
    background-color: var(--gray-bg);
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

body.admin-dashboard .order-table tbody tr:hover {
    background-color: var(--light-green);
}

/* ── Mobile tweaks shared by both tables ────── */
@media (max-width: 768px) {
    body.admin-dashboard .table-responsive {
        max-width: 100%;
        /* Right-edge fade: visual cue that table scrolls */
        -webkit-mask-image: linear-gradient(to right, black 88%, transparent 100%);
        mask-image: linear-gradient(to right, black 88%, transparent 100%);
    }

    body.admin-dashboard .customer-table th,
    body.admin-dashboard .customer-table td,
    body.admin-dashboard .order-table th,
    body.admin-dashboard .order-table td {
        padding: 11px 14px;
    }
}

@media (max-width: 360px) {

    body.admin-dashboard .customer-table th,
    body.admin-dashboard .customer-table td,
    body.admin-dashboard .order-table th,
    body.admin-dashboard .order-table td {
        padding: 9px 12px;
        font-size: 0.88rem;
    }
}


/* -------------------------------------------
   Admin Dashboard — Horizontal Overflow Prevention
   Scoped strictly to body.admin-dashboard.
   Does NOT affect any other page on the site.
   ------------------------------------------- */


/* 1. Clip overflow at every layout wrapper level */
body.admin-dashboard,
body.admin-dashboard .page-wrapper,
body.admin-dashboard main,
body.admin-dashboard .dashboard-container {
    max-width: 100%;
    overflow-x: clip;
    /* clip: unlike hidden, never creates a scroll context */
}

/* 2. Ensure the grid and ALL its children never expand beyond the viewport */
body.admin-dashboard .dashboard-grid {
    max-width: 100%;
    min-width: 0;
    /* prevents grid tracks from growing past their bounds */
}

body.admin-dashboard .dashboard-grid>* {
    min-width: 0;
    /* grid children (sidebar, main-content) can shrink freely */
    max-width: 100%;
    box-sizing: border-box;
}


/* 3. Sidebar is position:fixed on mobile — confirm it never adds document width */
body.admin-dashboard .sidebar {
    max-width: 100vw;
    box-sizing: border-box;
}

/* 4. Main content: prevent inner padding from creating overflow */
body.admin-dashboard .main-content {
    min-width: 0;
    /* grid child must be allowed to shrink */
    box-sizing: border-box;
    overflow-x: hidden;
    word-break: break-word;
}

/* 5. All table wrappers: internal horizontal scroll only —
      the page never scrolls horizontally because of a table */
body.admin-dashboard .main-content table {
    min-width: 0;
    /* let the table compress if wrapper allows it  */
}

/*    Any div directly wrapping a table gets overflow-x:auto             */
body.admin-dashboard .main-content>div[style*="overflow"],
body.admin-dashboard .main-content div:has(> table) {
    overflow-x: auto;
    max-width: 100%;
}

/* 6. Stats cards — never overflow on narrow screens */
body.admin-dashboard .stat-card {
    min-width: 0;
    box-sizing: border-box;
    word-break: break-word;
}

/* 7. Tighter container padding at 360px for admin */
@media (max-width: 360px) {
    body.admin-dashboard .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    body.admin-dashboard .main-content {
        padding: 16px !important;
    }

    body.admin-dashboard .sidebar {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

/* 8. At 768px reduce main-content padding so it fits beside sidebar gutter */
@media (max-width: 768px) {
    body.admin-dashboard .main-content {
        padding: 20px !important;
    }

    body.admin-dashboard .container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* -------------------------------------------
   Admin Dashboard — Recent Activity Table
   ------------------------------------------- */
.admin-dashboard .recent-activity .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    background: var(--white);
}

.admin-dashboard .activity-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    /* Stable layout on desktop/tablet */
    table-layout: auto;
}

.admin-dashboard .activity-table th,
.admin-dashboard .activity-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.admin-dashboard .activity-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--text-dark);
}

.admin-dashboard .activity-table .badge {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.admin-dashboard .activity-table .badge-delivered {
    background: #dff9fb;
    color: #130f40;
}

.admin-dashboard .activity-table .badge-processing {
    background: #fef9e7;
    color: #9a7d0a;
}

.admin-dashboard .activity-table .badge-shipped {
    background: #ebf5fb;
    color: #21618c;
}

.admin-dashboard .activity-table .view-link {
    color: var(--primary-green);
    font-weight: 500;
    text-decoration: none;
}

/* ── Mobile View (≤768px and ≤360px) ────────────────── */
@media (max-width: 768px) {

    /* Keep table but apply smaller padding/font */
    .admin-dashboard .activity-table th,
    .admin-dashboard .activity-table td {
        padding: 12px 10px;
        font-size: 0.9rem;
    }
}

@media (max-width: 360px) {

    /* (B) Convert each row into a stacked "card row" on 360px */
    .admin-dashboard .activity-table,
    .admin-dashboard .activity-table thead,
    .admin-dashboard .activity-table tbody,
    .admin-dashboard .activity-table th,
    .admin-dashboard .activity-table td,
    .admin-dashboard .activity-table tr {
        display: block;
    }

    .admin-dashboard .activity-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .admin-dashboard .activity-table tr {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 10px;
        background: #fff;
    }

    .admin-dashboard .activity-table td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
        white-space: normal;
        min-height: 40px;
        display: flex;
        align-items: center;
    }

    .admin-dashboard .activity-table td:last-child {
        border-bottom: 0;
    }

    .admin-dashboard .activity-table td:before {
        position: absolute;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: var(--text-dark);
        content: attr(data-label);
    }

    /* Shorten Order ID with ellipsis if needed */
    .admin-dashboard .activity-table td[data-label="Order ID"] {
        font-family: monospace;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* -------------------------------------------
   Sidebar User Info Styling
   ------------------------------------------- */

@media (max-width: 360px) {
    body.admin-dashboard .nav-actions {
        display: none !important;
    }

    body.admin-dashboard .navbar {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100%;
        padding: 15px 0 !important;
    }

    body.admin-dashboard .sidebar-toggle {
        display: flex !important;
        order: 2;
        margin-right: 0 !important;
    }

    body.admin-dashboard .logo {
        order: 1;
        font-size: 1.1rem !important;
        gap: 5px !important;
    }

    body.admin-dashboard .logo span {
        display: none !important;
    }
}

/* Sidebar User Info Styling */
.sidebar-user-info {
    display: none;
    padding-bottom: 25px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.admin-dashboard .sidebar-user-info {
    display: block;
}

.sidebar-user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user-avatar {
    width: 42px;
    height: 42px;
    background: var(--primary-green);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sidebar-user-details p {
    margin: 0;
    line-height: 1.3;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--white);
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}