/* Nabdex.space - Main Stylesheet */
:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --secondary: #ff6b35;
    --accent: #34a853;
    --danger: #ea4335;
    --warning: #fbbc04;
    --dark: #202124;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f4;
    --gray-200: #e8eaed;
    --gray-300: #dadce0;
    --gray-400: #bdc1c6;
    --gray-500: #9aa0a6;
    --gray-600: #80868b;
    --gray-700: #5f6368;
    --gray-800: #3c4043;
    --gray-900: #202124;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.2s ease;
    --font-ar: 'Tajawal', sans-serif;
    --font-en: 'Poppins', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-ar);
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    padding-bottom: 70px;
    overflow-x: hidden;
}

[dir="ltr"] body {
    font-family: var(--font-en);
}

a {
    text-decoration: none;
    color: inherit;
}

ul { list-style: none; }
img { max-width: 100%; height: auto; }

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Flash Messages */
.flash-message {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s ease;
    max-width: 90vw;
}
.flash-success { background: #e6f4ea; color: #1e7e34; border: 1px solid #b7e1cd; }
.flash-error { background: #fce8e6; color: #c5221f; border: 1px solid #f5c6c2; }
.flash-info { background: #e8f0fe; color: #1a73e8; border: 1px solid #c5d9f8; }
.flash-warning { background: #fef7e0; color: #ea8600; border: 1px solid #fde7b6; }
.flash-message button {
    background: none; border: none; font-size: 20px; cursor: pointer;
    color: inherit; opacity: 0.7; line-height: 1;
}

@keyframes slideDown {
    from { transform: translate(-50%, -100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* ===== HEADER ===== */
.main-header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}

.header-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-700);
    cursor: pointer;
    padding: 4px;
}

.logo {
    flex-shrink: 0;
}
.logo-text {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -1px;
}
.logo-text::after {
    content: '.space';
    color: var(--secondary);
    font-weight: 500;
    font-size: 16px;
}

.search-bar {
    flex: 1;
    max-width: 560px;
}
.search-form {
    display: flex;
    border: 2px solid var(--gray-200);
    border-radius: 50px;
    overflow: hidden;
    transition: var(--transition);
}
.search-form:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.search-form input {
    flex: 1;
    padding: 10px 18px;
    border: none;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    background: transparent;
}
.search-form button {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}
.search-form button:hover {
    background: var(--primary-dark);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.lang-switcher {
    display: flex;
    gap: 4px;
}
.lang-btn {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    border: 1px solid var(--gray-300);
    transition: var(--transition);
}
.lang-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.header-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--gray-700);
    transition: var(--transition);
    position: relative;
    font-size: 14px;
}
.header-action-btn:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.cart-btn { position: relative; }
.cart-badge, .bottom-cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}
[dir="rtl"] .cart-badge {
    right: auto;
    left: -2px;
}

.user-name {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

/* User Dropdown */
.user-menu-dropdown {
    position: relative;
}
.user-btn {
    cursor: pointer;
}
.user-btn i:last-child {
    font-size: 10px;
    margin-left: 2px;
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 8px 0;
    display: none;
    z-index: 100;
    border: 1px solid var(--gray-200);
}
[dir="rtl"] .dropdown-menu {
    left: auto;
    right: 0;
}
.user-menu-dropdown:hover .dropdown-menu,
.user-menu-dropdown:focus-within .dropdown-menu {
    display: block;
}
.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--gray-800);
    transition: var(--transition);
}
.dropdown-menu a:hover {
    background: var(--gray-50);
    color: var(--primary);
}
.dropdown-menu a i {
    width: 18px;
    text-align: center;
    color: var(--gray-500);
}
.dropdown-menu a:hover i {
    color: var(--primary);
}
.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 4px 0;
}
.admin-link {
    color: var(--danger) !important;
    font-weight: 600;
}
.admin-link i {
    color: var(--danger) !important;
}

/* Main Navigation */
.main-nav {
    background: var(--white);
    border-bottom: 1px solid var(--gray-100);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.main-nav::-webkit-scrollbar { height: 0; }
.nav-list {
    display: flex;
    gap: 4px;
    white-space: nowrap;
    padding: 0;
}
.nav-list li a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}
.nav-list li a:hover,
.nav-list li a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.nav-list li a i {
    margin-right: 6px;
}
[dir="rtl"] .nav-list li a i {
    margin-right: 0;
    margin-left: 6px;
}

/* Mobile language switcher in nav */
.nav-lang-switcher { display: none; }

/* Mobile Bottom Nav */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 6px 0;
    z-index: 999;
    justify-content: space-around;
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    color: var(--gray-500);
    padding: 4px 12px;
    position: relative;
    transition: var(--transition);
}
.bottom-nav-item.active {
    color: var(--primary);
}
.bottom-nav-item i {
    font-size: 20px;
}
.bottom-cart-badge {
    position: absolute;
    top: 0;
    right: 4px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 20px 0;
}

/* ===== HERO SECTION ===== */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, #4a90d9 100%);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 30px;
    color: white;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}
.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}
.hero-content {
    position: relative;
    z-index: 1;
}
.hero-content h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}
.hero-content p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 20px;
}
.hero-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.btn-primary, .btn-secondary, .btn-outline, .btn-danger, .btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: inherit;
    text-decoration: none;
}
.btn-primary {
    background: var(--secondary);
    color: white;
}
.btn-primary:hover {
    background: #e55a2b;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-secondary {
    background: rgba(255,255,255,0.2);
    color: white;
    backdrop-filter: blur(4px);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.3);
}
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: white;
}
.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover {
    background: #d33426;
}
.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}
.btn-block {
    display: flex;
    width: 100%;
    justify-content: center;
}

/* Button variants used across admin + dashboard (theme-aware tokens) */
.btn-success {
    background: var(--success, #1b7a3d);
    color: #fff;
}
.btn-success:hover {
    background: #16632f;
}
.btn-warning {
    background: rgba(245,158,11,0.15);
    color: #f59e0b;
}
.btn-warning:hover {
    background: rgba(245,158,11,0.25);
}
.btn-info {
    background: var(--primary);
    color: #fff;
}
.btn-info:hover {
    background: var(--primary-dark, #1557b0);
}

/* Notification dropdown + rows (theme-aware) */
.notif-dropdown .dropdown-menu {
    min-width: 320px;
    max-width: 92vw;
}
.notif-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary, #111);
    border: 1px solid var(--border-color, #e8eaed);
    background: var(--white, #fff);
    transition: background .2s, border-color .2s;
}
.notif-row:hover {
    border-color: var(--primary);
}
.notif-row .notif-icon {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--primary-light, #eaf1ff);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.notif-row .notif-title { font-size: 14px; font-weight: 600; }
.notif-row .notif-msg { font-size: 13px; color: var(--text-muted, #6b7280); margin-top: 2px; font-weight: 400; }
.notif-row .notif-time { font-size: 11px; color: var(--gray-400, #bdc1c6); margin-top: 4px; font-weight: 400; }
.notif-row .notif-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 6px; }
.notif-unread {
    background: rgba(91,155,255,0.08);
    font-weight: 600;
}

/* ===== SECTION TITLES ===== */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.section-title h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
}
.section-title .view-all {
    font-size: 14px;
    color: var(--primary);
    font-weight: 500;
}
.section-title .view-all:hover {
    text-decoration: underline;
}

/* ===== CATEGORY GRID ===== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 40px;
}
.category-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 20px 12px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--gray-100);
}
.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}
.category-card .cat-icon {
    font-size: 36px;
    margin-bottom: 8px;
    color: var(--primary);
}
.category-card h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
}
.category-card .count {
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ===== PRODUCT GRID ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}
.product-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--gray-100);
    position: relative;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.product-card .product-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
}
[dir="rtl"] .product-card .product-badge {
    left: auto;
    right: 8px;
}
.badge-featured, .badge-new, .badge-sale {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: white;
}
.badge-featured { background: var(--primary); }
.badge-new { background: var(--accent); }
.badge-sale { background: var(--danger); }

.product-card .wishlist-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    background: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    color: var(--gray-400);
    transition: var(--transition);
    font-size: 16px;
}
[dir="rtl"] .product-card .wishlist-btn {
    right: auto;
    left: 8px;
}
.product-card .wishlist-btn:hover,
.product-card .wishlist-btn.active {
    color: var(--danger);
    box-shadow: var(--shadow-md);
}

.product-image {
    width: 100%;
    aspect-ratio: 1;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}
.product-card:hover .product-image img {
    transform: scale(1.05);
}
.product-image .no-image {
    font-size: 48px;
    color: var(--gray-400);
}

.product-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-info h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: 40px;
}
.product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}
.current-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--danger);
}
.original-price {
    font-size: 13px;
    color: var(--gray-500);
    text-decoration: line-through;
}
.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--gray-600);
}
.product-rating .stars {
    color: #fbbc04;
}
.product-card .add-cart-btn {
    width: 100%;
    padding: 8px;
    border: none;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    border-top: 1px solid var(--gray-100);
}
.product-card .add-cart-btn:hover {
    background: var(--primary);
    color: white;
}

/* ===== HORIZONTAL SCROLL SECTIONS ===== */
.scroll-section {
    position: relative;
    margin-bottom: 30px;
}
.scroll-wrapper {
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}
.scroll-wrapper::-webkit-scrollbar {
    height: 4px;
}
.scroll-wrapper::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}
.scroll-inner {
    display: flex;
    gap: 12px;
    width: max-content;
    padding: 4px 0;
}
.scroll-inner .product-card {
    width: 200px;
    flex-shrink: 0;
    scroll-snap-align: start;
}

/* ===== AUTH PAGES ===== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding: 20px;
}
.auth-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 40px;
    width: 100%;
    max-width: 440px;
}
.auth-container h1 {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}
.auth-container .subtitle {
    text-align: center;
    color: var(--gray-600);
    margin-bottom: 24px;
    font-size: 14px;
}
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-control.error {
    border-color: var(--danger);
}
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: white;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235f6368' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 32px;
}
[dir="rtl"] .form-select {
    background-position: right 12px center;
    padding-left: 16px;
    padding-right: 32px;
}
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--gray-500);
    font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.social-auth {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid var(--gray-200);
    background: white;
    font-family: inherit;
}
.social-btn:hover {
    border-color: var(--primary);
    background: var(--gray-50);
}
.social-btn.google {
    color: #ea4335;
}
.social-btn.facebook {
    color: #1877f2;
}
.social-btn i {
    font-size: 20px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--gray-600);
}
.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

/* ===== PRODUCT PAGE ===== */
.product-page {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 24px;
}
.product-gallery {
    position: relative;
}
.product-gallery .main-image {
    width: 100%;
    aspect-ratio: 1;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 12px;
}
.product-gallery .main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-detail-info h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}
.product-detail-info .price-section {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 16px 0;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
}
.product-detail-info .price-section .current-price {
    font-size: 28px;
}
.product-detail-info .price-section .original-price {
    font-size: 16px;
}
.product-detail-info .delivery-info {
    color: var(--accent);
    font-size: 14px;
    margin: 8px 0;
}
.product-detail-info .description {
    color: var(--gray-700);
    line-height: 1.8;
    margin: 16px 0;
    font-size: 14px;
}
.product-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.product-actions .btn-primary,
.product-actions .btn-outline {
    flex: 1;
    justify-content: center;
    min-width: 160px;
}

/* ===== CART PAGE ===== */
.cart-page {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
}
.cart-items {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.cart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
}
.cart-item:last-child {
    border-bottom: none;
}
.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cart-item-info {
    flex: 1;
}
.cart-item-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}
.cart-item-info .item-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--danger);
}
.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.quantity-control button {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-50);
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
    color: var(--gray-700);
}
.quantity-control button:hover {
    background: var(--gray-200);
}
.quantity-control input {
    width: 40px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--gray-300);
    border-right: 1px solid var(--gray-300);
    font-size: 14px;
    font-family: inherit;
    height: 32px;
}
[dir="rtl"] .quantity-control input {
    border-left: 1px solid var(--gray-300);
    border-right: 1px solid var(--gray-300);
}
.cart-item-remove {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    transition: var(--transition);
}
.cart-item-remove:hover {
    color: var(--danger);
}

.cart-summary {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    position: sticky;
    top: 100px;
}
.cart-summary h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
}
.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: var(--gray-700);
}
.summary-row.total {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    border-top: 1px solid var(--gray-200);
    padding-top: 12px;
    margin-top: 8px;
}

/* ===== CHECKOUT PAGE ===== */
.checkout-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.checkout-section {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
}
.checkout-section h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
}
.delivery-type-select {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.delivery-option {
    flex: 1;
    padding: 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: white;
    font-family: inherit;
    font-size: 14px;
}
.delivery-option:hover {
    border-color: var(--primary-light);
}
.delivery-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}
.delivery-option i {
    font-size: 24px;
    color: var(--primary);
    display: block;
    margin-bottom: 6px;
}

/* ===== DASHBOARD ===== */
.dashboard-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
}
.dashboard-sidebar {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.dashboard-sidebar .user-info {
    padding: 20px;
    text-align: center;
    background: var(--primary);
    color: white;
}
.dashboard-sidebar .user-info .avatar {
    font-size: 48px;
    margin-bottom: 8px;
}
.dashboard-sidebar .user-info h3 {
    font-size: 16px;
    font-weight: 600;
}
.dashboard-sidebar .user-info p {
    font-size: 12px;
    opacity: 0.8;
}
.dashboard-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    font-size: 14px;
    color: var(--gray-700);
    transition: var(--transition);
    border-right: 3px solid transparent;
}
[dir="rtl"] .dashboard-nav a {
    border-right: none;
    border-left: 3px solid transparent;
}
.dashboard-nav a:hover,
.dashboard-nav a.active {
    background: var(--gray-50);
    color: var(--primary);
    border-right-color: var(--primary);
}
[dir="rtl"] .dashboard-nav a:hover,
[dir="rtl"] .dashboard-nav a.active {
    border-right-color: transparent;
    border-left-color: var(--primary);
}
.dashboard-nav a i {
    width: 20px;
    text-align: center;
    color: var(--gray-500);
}
.dashboard-nav a:hover i {
    color: var(--primary);
}

.dashboard-content {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
}
.dashboard-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}
.stat-card {
    background: white;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
}
.stat-card .stat-icon {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 8px;
}
.stat-card .stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--gray-900);
}
.stat-card .stat-label {
    font-size: 13px;
    color: var(--gray-600);
    margin-top: 4px;
}

/* ===== TABLE ===== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table th {
    background: var(--gray-50);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
}
[dir="rtl"] .table th {
    text-align: right;
}
.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-800);
}
.table tr:hover td {
    background: var(--gray-50);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}
.status-pending { background: #fef7e0; color: #ea8600; }
.status-processing, .status-confirmed { background: #e8f0fe; color: #1a73e8; }
.status-shipped { background: #e6f4ea; color: #1e7e34; }
.status-delivered, .status-paid, .status-approved { background: #e6f4ea; color: #1e7e34; }
.status-cancelled, .status-cancelled { background: #fce8e6; color: #c5221f; }

/* Dark mode: status badges need tinted dark backgrounds + bright text (hardcoded light bg breaks in dark) */
[data-theme="dark"] .status-badge { color: #fff; }
[data-theme="dark"] .status-pending { background: rgba(234,134,0,0.22); color: #ffb74d; }
[data-theme="dark"] .status-processing,
[data-theme="dark"] .status-confirmed { background: rgba(26,115,232,0.25); color: #8ab4f8; }
[data-theme="dark"] .status-shipped,
[data-theme="dark"] .status-delivered,
[data-theme="dark"] .status-paid,
[data-theme="dark"] .status-approved { background: rgba(30,126,52,0.25); color: #81c995; }
[data-theme="dark"] .status-cancelled { background: rgba(197,34,31,0.28); color: #f28b82; }
[data-theme="dark"] .status-refunded { background: rgba(120,120,120,0.28); color: #cfcfcf; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-state i {
    font-size: 64px;
    color: var(--gray-300);
    margin-bottom: 16px;
}
.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}
.empty-state p {
    color: var(--gray-500);
    margin-bottom: 20px;
}

/* ===== PAGE HEADER ===== */
.page-header {
    margin-bottom: 24px;
}
.page-header h1 {
    font-size: 26px;
    font-weight: 700;
}
.breadcrumb {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 8px;
}
.breadcrumb a {
    color: var(--primary);
}
.breadcrumb span {
    color: var(--gray-600);
}

/* ===== AFFILIATE PAGE ===== */
.affiliate-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-lg);
    padding: 40px;
    color: white;
    margin-bottom: 30px;
    text-align: center;
}
.affiliate-hero h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}
.affiliate-hero p {
    opacity: 0.9;
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto 20px;
}

.commission-rule {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    margin: 12px 0;
}
.commission-rule .arrow {
    font-size: 24px;
    color: var(--accent);
    font-weight: 700;
}

/* ===== ADMIN ===== */
/* ===== ADMIN LAYOUT (responsive: sidebar desktop, drawer mobile) ===== */
.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    align-items: start;
}
.admin-toggle {
    display: none;
    position: fixed;
    top: 70px;
    right: 16px;
    z-index: 1200;
    width: 44px; height: 44px;
    border-radius: 10px;
    border: 1px solid var(--border, #e5e7eb);
    background: var(--white, #fff);
    color: var(--primary, #1a73e8);
    font-size: 18px;
    cursor: pointer;
    align-items: center; justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
[dir="rtl"] .admin-toggle { right: auto; left: 16px; }
.admin-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1100;
}
.admin-sidebar {
    background: #0f1a2e;
    border-radius: var(--radius-md, 10px);
    overflow: hidden;
    position: sticky;
    top: 100px;
    align-self: start;
}
.admin-sidebar .admin-header {
    padding: 20px;
    color: #fff;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center; gap: 8px;
    position: relative;
}
.admin-sidebar .admin-header h3 { font-size: 16px; margin: 0; }
.admin-sidebar .admin-close {
    display: none;
    position: absolute; top: 12px; right: 12px;
    background: transparent; border: none; color: rgba(255,255,255,.8);
    font-size: 18px; cursor: pointer;
}
[dir="rtl"] .admin-sidebar .admin-close { right: auto; left: 12px; }
.admin-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.75);
    font-size: 14px;
    transition: var(--transition, .2s);
    border-left: 3px solid transparent;
}
[dir="rtl"] .admin-nav a { border-left: none; border-right: 3px solid transparent; }
.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-left-color: var(--primary, #1a73e8);
}
[dir="rtl"] .admin-nav a:hover,
[dir="rtl"] .admin-nav a.active { border-left-color: transparent; border-right-color: var(--primary, #1a73e8); }
.admin-nav a i { width: 20px; text-align: center; }

/* Dark mode: keep admin sidebar a deep navy (do NOT remap to light) */
[data-theme="dark"] .admin-sidebar { background: #0a1120 !important; border: 1px solid rgba(255,255,255,0.08); }
[data-theme="dark"] .admin-sidebar .admin-header { color: #fff !important; }
[data-theme="dark"] .admin-nav a { color: rgba(255,255,255,0.78) !important; }
[data-theme="dark"] .admin-nav a:hover,
[data-theme="dark"] .admin-nav a.active { background: rgba(255,255,255,0.12) !important; color: #fff !important; }


/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    box-shadow: var(--shadow-md);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99;
    transition: var(--transition);
}
.back-to-top.show {
    display: flex;
}
.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}
[dir="rtl"] .back-to-top {
    right: auto;
    left: 20px;
}

/* ===== PWA OFFLINE ===== */
.offline-page {
    text-align: center;
    padding: 60px 20px;
}
.offline-page i {
    font-size: 80px;
    color: var(--gray-300);
    margin-bottom: 20px;
}

/* ===== FOOTER ===== */
.main-footer {
    background: var(--gray-900);
    color: rgba(255,255,255,0.8);
    padding: 40px 0 20px;
    margin-top: 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}
.footer-col h4 {
    color: white;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}
.footer-col ul li {
    margin-bottom: 8px;
}
.footer-col ul li a {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    transition: var(--transition);
}
.footer-col ul li a:hover {
    color: white;
}
.social-links {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}
.social-links a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
}
.social-links a:hover {
    background: var(--primary);
}
.footer-about p {
    font-size: 14px;
    line-height: 1.8;
}
.payment-methods {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.payment-badge {
    padding: 4px 12px;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    font-size: 12px;
    font-weight: 600;
}
.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .container { padding: 0 12px; }

    .mobile-menu-toggle { display: block; }
    .header-row { gap: 12px; }
    .search-bar { display: none; }
    /* Language switcher visible in top bar on mobile — like PC */
    .lang-switcher { display: flex; gap: 4px; }
    .lang-switcher .lang-btn {
        padding: 3px 8px;
        font-size: 11px;
        min-width: unset;
    }
    .user-name { display: none; }
    .header-action-btn { padding: 8px; }
    .login-btn span { display: none; }

    .logo-text { font-size: 22px; }
    .logo-text::after { font-size: 13px; }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: var(--shadow-lg);
        max-height: 70vh;
        overflow-y: auto;
        z-index: 999;
    }
    .main-nav.open { display: block; }
    .nav-list {
        flex-direction: column;
        padding: 8px 0;
    }
    .nav-list li a {
        padding: 12px 20px;
        border-bottom: 1px solid var(--gray-100);
    }
    .nav-list li a.active {
        color: var(--primary);
        background: var(--primary-light);
    }

    /* Language switcher in mobile nav */
    .nav-lang-switcher {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 20px;
        border-top: 1px solid var(--gray-100);
        background: var(--gray-50);
    }
    .nav-lang-switcher .nav-lang-label {
        font-size: 13px;
        color: var(--gray-600);
        display: flex;
        align-items: center;
        gap: 6px;
        margin-left: 8px;
    }
    .nav-lang-switcher .nav-lang-btn {
        display: inline-block;
        padding: 4px 12px;
        border-radius: var(--radius-sm);
        font-size: 13px;
        font-weight: 600;
        text-decoration: none;
        background: white;
        color: var(--gray-700);
        border: 1px solid var(--gray-200);
    }
    .nav-lang-switcher .nav-lang-btn:hover {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

    .mobile-bottom-nav { display: flex; }

    .hero-section { padding: 24px; border-radius: var(--radius-md); }
    .hero-content h1 { font-size: 24px; }
    .hero-content p { font-size: 14px; }

    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .category-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .category-card { padding: 12px 8px; }
    .category-card .cat-icon { font-size: 28px; }

    .product-detail { grid-template-columns: 1fr; gap: 16px; padding: 16px; }
    .product-detail-info h1 { font-size: 20px; }

    .cart-page { grid-template-columns: 1fr; }
    .cart-summary { position: static; }

    .checkout-form { grid-template-columns: 1fr; }

    .dashboard-layout { grid-template-columns: 1fr; }
    .dashboard-sidebar { display: none; }
    .dashboard-mobile-nav { display: block; }

    .admin-layout { display: block; }
    .admin-toggle { display: flex; }
    .admin-sidebar {
        position: fixed;
        top: 0; bottom: 0; right: 0;
        width: 260px; max-width: 82vw;
        border-radius: 0;
        z-index: 1150;
        transform: translateX(110%);
        transition: transform .3s ease;
        overflow-y: auto;
        box-shadow: -4px 0 24px rgba(0,0,0,.3);
    }
    [dir="rtl"] .admin-sidebar { right: auto; left: 0; transform: translateX(-110%); }
    body.admin-nav-open .admin-sidebar { transform: translateX(0); }
    [dir="rtl"] body.admin-nav-open .admin-sidebar { transform: translateX(0); }
    body.admin-nav-open .admin-overlay { display: block; }
    .admin-sidebar .admin-close { display: block; }
    .admin-sidebar { top: 0; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    .auth-container { padding: 24px; }

    .footer-grid { grid-template-columns: 1fr; }

    .cart-item { flex-wrap: wrap; }
    .cart-item-actions { width: 100%; justify-content: space-between; }

    .product-actions { flex-direction: column; }
    .product-actions .btn-primary,
    .product-actions .btn-outline { min-width: auto; }

    .section-title h2 { font-size: 18px; }

    /* FIX: Button overflow on mobile — prevent buttons from going too far right */
    .dashboard-content .btn-sm,
    .dashboard-content .btn-primary,
    .dashboard-content .btn-outline,
    .dashboard-content .btn-danger {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
        max-width: 100%;
    }
    .dashboard-content .table .btn-sm {
        width: auto;
        display: inline-flex;
        padding: 6px 14px;
        font-size: 12px;
    }
    .header-actions {
        gap: 4px;
    }
    .header-action-btn {
        padding: 6px;
        font-size: 14px;
    }
    .dropdown-menu {
        min-width: 200px;
        right: 0;
        left: auto;
    }
    [dir="rtl"] .dropdown-menu {
        left: 0;
        right: auto;
    }
    .dropdown-menu a {
        white-space: normal;
        word-break: break-word;
        font-size: 13px;
        padding: 10px 14px;
    }
    .dashboard-content {
        padding: 16px;
    }
    .dashboard-content .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .dashboard-content .stat-card {
        padding: 12px;
    }
    .dashboard-content .stat-value {
        font-size: 18px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1025px) {
    .product-grid { grid-template-columns: repeat(4, 1fr); }
    .product-grid .product-card:nth-child(5),
    .product-grid .product-card:nth-child(6) {
        /* Show first 6 products */ }
}

/* ===== DASHBOARD FILTER BAR ===== */
.dashboard-filter-bar {
    background: white;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.filter-form .filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.filter-form .filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    flex: 1;
    min-width: 140px;
}
.filter-form .filter-group i {
    position: absolute;
    left: 10px;
    color: var(--gray-400);
    font-size: 13px;
    pointer-events: none;
}
.filter-form .filter-group input,
.filter-form .filter-group select {
    width: 100%;
    padding: 8px 12px;
    padding-left: 32px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: white;
    font-family: inherit;
}
.filter-form .filter-group select {
    padding-left: 12px;
    cursor: pointer;
}
.filter-form .filter-group input:focus,
.filter-form .filter-group select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}

/* Table toolbar */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.result-count {
    font-size: 13px;
    color: var(--gray-600);
}
.result-count strong { color: var(--gray-900); }

/* Dashboard stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: white;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.stat-card .stat-icon {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 8px;
}
.stat-card .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
}
.stat-card .stat-label {
    font-size: 13px;
    color: var(--gray-600);
    margin-top: 4px;
}

/* Dashboard layout */
.dashboard-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.dashboard-sidebar {
    width: 260px;
    min-width: 260px;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-100);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    position: sticky;
    top: 90px;
}
.dashboard-sidebar .user-info {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 24px 20px;
    text-align: center;
}
.dashboard-sidebar .user-info .avatar {
    font-size: 40px;
    margin-bottom: 8px;
}
.dashboard-sidebar .user-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}
.dashboard-sidebar .user-info p {
    font-size: 12px;
    opacity: 0.8;
    margin: 4px 0 0;
    word-break: break-all;
}
.dashboard-nav {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}
.dashboard-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    font-size: 14px;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.2s;
}
.dashboard-nav a:hover {
    background: var(--gray-50);
    color: var(--primary);
}
.dashboard-nav a.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    border-right: 3px solid var(--primary);
}
.dashboard-nav a i { width: 20px; text-align: center; font-size: 15px; }
.dashboard-nav .admin-link { color: var(--accent); }
.dashboard-nav .dropdown-divider { height: 1px; background: var(--gray-100); margin: 8px 16px; }

.dashboard-content {
    flex: 1;
    min-width: 0;
}
.dashboard-content h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

/* Admin layout */
.admin-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.admin-sidebar {
    width: 240px;
    min-width: 240px;
    background: #0f1a2e;
    color: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: sticky;
    top: 90px;
}
.admin-sidebar .admin-header {
    padding: 20px;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.admin-sidebar .admin-header h3 {
    font-size: 16px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.admin-nav {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}
.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
}
.admin-nav a:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}
.admin-nav a.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

/* ===== RESPONSIVE: Dashboard & Admin on Mobile ===== */
@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }
    .dashboard-sidebar {
        width: 100%;
        min-width: unset;
        position: static;
        top: unset;
        margin-bottom: 16px;
    }
    .dashboard-sidebar .user-info {
        padding: 16px;
    }
    .dashboard-sidebar .user-info .avatar {
        font-size: 30px;
    }
    .dashboard-sidebar .user-info h3 {
        font-size: 14px;
    }
    .dashboard-nav a {
        padding: 10px 16px;
        font-size: 13px;
    }
    .dashboard-mobile-nav {
        display: block;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .stat-card {
        padding: 14px;
    }
    .stat-card .stat-value {
        font-size: 22px;
    }
    .stat-card .stat-icon {
        font-size: 22px;
    }

    .dashboard-filter-bar {
        padding: 10px;
    }
    .filter-form .filter-row {
        flex-direction: column;
        gap: 6px;
    }
    .filter-form .filter-group {
        width: 100%;
        min-width: unset;
    }
    .filter-form .filter-group input,
    .filter-form .filter-group select {
        font-size: 14px;
        padding: 10px 12px;
    }

    .table thead { display: none; }
    .table tbody tr {
        display: block;
        padding: 12px;
        background: white;
        border: 1px solid var(--gray-100);
        border-radius: var(--radius-md);
        margin-bottom: 10px;
    }
    .table tbody tr td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border: none;
        font-size: 13px;
    }
    .table tbody tr td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--gray-600);
        font-size: 12px;
    }
    .table tbody tr td:last-child {
        border-top: 1px solid var(--gray-100);
        padding-top: 10px;
        margin-top: 6px;
    }
}

/* Admin sidebar toggle */
.admin-toggle {
    display: none;
    background: var(--gray-900);
    color: white;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    width: 100%;
    text-align: center;
    font-size: 14px;
    cursor: pointer;
    border: none;
    margin-bottom: 16px;
}

/* Mobile sidebar */
.dashboard-mobile-nav {
    display: none;
    margin-bottom: 16px;
}
.dashboard-mobile-nav select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: white;
}
