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

:root {
    /* Color Palette - Light Mode Default */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --secondary: #0ea5e9;
    --accent: #f43f5e;
    --accent-light: #ffe4e6;
    
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-nav: rgba(255, 255, 255, 0.85);
    --border: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #ffffff;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.25rem;
    --radius-full: 9999px;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-height: 80px;
}

[data-theme="dark"] {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #1e1b4b;
    --secondary: #38bdf8;
    --accent: #fb7185;
    --accent-light: #4c0519;
    
    --bg-main: #0b0f19;
    --bg-card: #151f32;
    --bg-nav: rgba(11, 15, 25, 0.9);
    --border: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

/* Reset and Core Layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
    padding-top: var(--nav-height);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-main);
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

/* Custom Navbar */
.navbar-custom {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background-color: var(--bg-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    display: flex;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-logo span { color: var(--text-main); }

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-menu-link {
    font-weight: 600;
    padding: 0.5rem 0;
    position: relative;
}
.nav-menu-link:hover, .nav-menu-link.active {
    color: var(--primary);
}
.nav-menu-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: var(--transition);
}
.nav-menu-link:hover::after, .nav-menu-link.active::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-action-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.nav-action-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.badge-cart {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--accent);
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px var(--bg-card);
}

/* Button UI */
.btn-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}
.btn-custom-primary {
    background-color: var(--primary);
    color: var(--text-light);
}
.btn-custom-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.btn-custom-secondary {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
}
.btn-custom-secondary:hover {
    background-color: var(--border);
}
.btn-custom-danger {
    background-color: var(--accent);
    color: var(--text-light);
}
.btn-custom-danger:hover {
    background-color: #e11d48;
}
.btn-custom-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

/* Admin Panel */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.admin-header h1 {
    font-size: 2rem;
}

.admin-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}
.admin-section h2 {
    font-size: 1.35rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.admin-table th,
.admin-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table th {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.admin-table tbody tr:hover {
    background-color: var(--bg-main);
}

.admin-table-img {
    width: 48px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background-color: var(--bg-main);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    background-color: var(--bg-main);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.status-pending { background-color: #fef3c7; color: #92400e; border-color: #fde68a; }
.status-processing { background-color: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.status-shipped { background-color: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.status-delivered { background-color: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.status-cancelled { background-color: #ffe4e6; color: #9f1239; border-color: #fecdd3; }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 3rem;
    opacity: 0.2;
    margin-bottom: 1rem;
}

/* Admin Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.form-group-full {
    grid-column: 1 / -1;
}
.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}
.form-input {
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
textarea.form-input {
    resize: vertical;
}
.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.cover-preview {
    display: inline-block;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    background-color: var(--bg-main);
}
.cover-preview img {
    width: 120px;
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}
.text-danger {
    color: var(--accent);
    font-size: 0.85rem;
}

/* Hero Section */
.hero-banner {
    text-align: center;
    padding: 2rem 1rem;
    background: radial-gradient(circle at top right, var(--primary-light), transparent 60%);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
}
.hero-banner h1 {
    font-size: 2.25rem;
    margin-bottom: 0;
    letter-spacing: -0.03em;
}
.hero-banner h1 span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Filter Bar */
.control-bar {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-sm);
}
.search-input-box {
    position: relative;
    flex-grow: 1;
}
.search-input-box input {
    width: 100%;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
}
.search-input-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.dropdown-select {
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    padding: 0.75rem 2rem 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
}

/* Category Tabs */
.tabs-badges {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-top: 1rem;
}
.tab-badge-btn {
    padding: 0.4rem 1.1rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}
.tab-badge-btn.active, .tab-badge-btn:hover {
    background-color: var(--primary);
    color: var(--text-light);
    border-color: var(--primary);
}

/* Books Grid & Cards */
.catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
}
.product-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}
.card-badge-discount {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: var(--accent);
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    z-index: 5;
}
.card-image-box {
    width: 100%;
    aspect-ratio: 3 / 4;
    background-color: var(--border);
    overflow: hidden;
}
.card-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-details {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.card-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.25rem;
}
.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-rating-stars {
    color: #eab308;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}
.card-price-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    margin-bottom: 1rem;
}
.price-tag-current { font-size: 1.25rem; font-weight: 800; }
.price-tag-original { font-size: 0.9rem; text-decoration: line-through; color: var(--text-muted); }

/* SVG Dynamic Cover Fallback */
.svg-cover-container {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 1.5rem;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}
.svg-cover-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 15px;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.15), rgba(255,255,255,0.05) 50%, rgba(0,0,0,0.05));
}

/* Drawer Cart Panel */
.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
}
.drawer-backdrop.active { display: block; }

.cart-drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 440px;
    height: 100%;
    background-color: var(--bg-card);
    box-shadow: var(--shadow-xl);
    z-index: 201;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.cart-drawer-panel.active { transform: translateX(0); }

.drawer-title-row {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.drawer-items-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
}
.drawer-footer-totals {
    padding: 1.5rem;
    background-color: var(--bg-main);
    border-top: 1px solid var(--border);
}

.cart-row-item {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}
.cart-row-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}
.cart-row-img {
    width: 50px;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background-color: var(--border);
}
.quantity-box {
    display: flex;
    border: 1px solid var(--border);
    background-color: var(--bg-main);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.quantity-box-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
}
.quantity-box-btn:hover { background-color: var(--border); }
.quantity-box-val { width: 30px; text-align: center; font-size: 0.85rem; font-weight: 600; line-height: 26px; }

/* Form Controls & Labels */
.form-input-group {
    margin-bottom: 1.25rem;
}
.form-input-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.form-input-control {
    width: 100%;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    color: inherit;
    transition: var(--transition);
}
.form-input-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Modals */
.modal-overlay-custom {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.modal-overlay-custom.active { display: flex; }

.modal-content-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 650px;
    position: relative;
    overflow: hidden;
}

/* Admin Dashboard Grids */
.dashboard-grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
@media (min-width: 992px) {
    .dashboard-grid-layout {
        grid-template-columns: 240px 1fr;
    }
}

.dashboard-sidebar {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: fit-content;
}
.dashboard-menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    color: var(--text-muted);
}
.dashboard-menu-link:hover, .dashboard-menu-link.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

.dashboard-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.stat-item-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-item-icon {
    width: 48px;
    height: 48px;
    background-color: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Tables */
.custom-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.custom-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.custom-data-table th, .custom-data-table td {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.custom-data-table th {
    background-color: var(--bg-main);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}
.custom-data-table tr:last-child td {
    border-bottom: none;
}
.custom-data-table tr:hover td {
    background-color: rgba(79, 70, 229, 0.02);
}

/* Details Page Grid */
.detail-grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2.5rem;
}
@media (min-width: 640px) {
    .detail-grid-layout {
        grid-template-columns: 200px 1fr;
    }
}
.detail-cover-box {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

/* Footer Section */
.custom-footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 4rem 0 3rem 0;
    margin-top: 6rem;
    text-align: center;
}

/* Account Cards */
.auth-panel-card {
    max-width: 440px;
    margin: 4rem auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
}
/* Admin Layout */
.admin-body {
    padding-top: 0;
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: width 0.3s ease;
}

.admin-sidebar.collapsed {
    width: 72px;
}

.admin-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
}

.admin-logo i {
    color: var(--primary);
    font-size: 1.5rem;
}

.admin-logo span span {
    color: var(--primary);
}

.admin-nav {
    flex-grow: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    text-decoration: none;
}

.admin-nav-link:hover,
.admin-nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

.admin-nav-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.admin-sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.admin-wrapper {
    flex-grow: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.sidebar-collapsed .admin-wrapper {
    margin-left: 72px;
}

.admin-topbar {
    height: 70px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 900;
}

.admin-sidebar-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: var(--bg-main);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.admin-sidebar-toggle:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-topbar-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: var(--bg-main);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.admin-topbar-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.admin-user-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.admin-user-pill i {
    color: var(--primary);
}

.admin-main {
    flex-grow: 1;
    padding: 1.5rem;
    background-color: var(--bg-main);
}

.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-page-header h1 {
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Dashboard Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.blue { background-color: #dbeafe; color: #1e40af; }
.stat-icon.green { background-color: #d1fae5; color: #065f46; }
.stat-icon.purple { background-color: #e0e7ff; color: #3730a3; }
.stat-icon.orange { background-color: #ffedd5; color: #9a3412; }

.stat-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.15rem;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Responsive Admin */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        width: 260px;
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-wrapper {
        margin-left: 0;
    }

    .sidebar-collapsed .admin-wrapper {
        margin-left: 0;
    }
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: var(--bg-card);
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.user-dropdown-trigger:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 200px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 200;
}

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

.user-dropdown-menu a,
.user-dropdown-logout {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background-color 0.15s;
}

.user-dropdown-menu a:hover,
.user-dropdown-logout:hover {
    background-color: var(--bg-main);
    color: var(--primary);
}

.user-dropdown-divider {
    height: 1px;
    background-color: var(--border);
    margin: 0.35rem 0;
}

/* Order Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background-color: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--border);
    border: 2px solid var(--bg-card);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.timeline-item.active .timeline-dot {
    background-color: var(--primary);
}

.timeline-item.cancelled .timeline-dot {
    background-color: var(--accent);
}

.timeline-content strong {
    font-size: 0.95rem;
    color: var(--text-main);
}

.timeline-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0.15rem 0 0 0;
}

.timeline-item.active .timeline-content strong {
    color: var(--primary);
}

.timeline-item.cancelled .timeline-content strong {
    color: var(--accent);
}
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Color Palette - Light Mode Default */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --secondary: #0ea5e9;
    --accent: #f43f5e;
    --accent-light: #ffe4e6;
    
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-nav: rgba(255, 255, 255, 0.85);
    --border: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #ffffff;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.25rem;
    --radius-full: 9999px;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-height: 80px;
}

[data-theme="dark"] {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #1e1b4b;
    --secondary: #38bdf8;
    --accent: #fb7185;
    --accent-light: #4c0519;
    
    --bg-main: #0b0f19;
    --bg-card: #151f32;
    --bg-nav: rgba(11, 15, 25, 0.9);
    --border: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

/* Reset and Core Layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
    padding-top: var(--nav-height);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-main);
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

/* Custom Navbar */
.navbar-custom {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background-color: var(--bg-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    display: flex;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-logo span { color: var(--text-main); }

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-menu-link {
    font-weight: 600;
    padding: 0.5rem 0;
    position: relative;
}
.nav-menu-link:hover, .nav-menu-link.active {
    color: var(--primary);
}
.nav-menu-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: var(--transition);
}
.nav-menu-link:hover::after, .nav-menu-link.active::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-action-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.nav-action-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.badge-cart {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--accent);
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px var(--bg-card);
}

/* Button UI */
.btn-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}
.btn-custom-primary {
    background-color: var(--primary);
    color: var(--text-light);
}
.btn-custom-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.btn-custom-secondary {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
}
.btn-custom-secondary:hover {
    background-color: var(--border);
}
.btn-custom-danger {
    background-color: var(--accent);
    color: var(--text-light);
}
.btn-custom-danger:hover {
    background-color: #e11d48;
}
.btn-custom-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

/* Admin Panel */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.admin-header h1 {
    font-size: 2rem;
}

.admin-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}
.admin-section h2 {
    font-size: 1.35rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.admin-table th,
.admin-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table th {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.admin-table tbody tr:hover {
    background-color: var(--bg-main);
}

.admin-table-img {
    width: 48px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background-color: var(--bg-main);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    background-color: var(--bg-main);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.status-pending { background-color: #fef3c7; color: #92400e; border-color: #fde68a; }
.status-processing { background-color: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.status-shipped { background-color: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.status-delivered { background-color: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.status-cancelled { background-color: #ffe4e6; color: #9f1239; border-color: #fecdd3; }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 3rem;
    opacity: 0.2;
    margin-bottom: 1rem;
}

/* Admin Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.form-group-full {
    grid-column: 1 / -1;
}
.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}
.form-input {
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
textarea.form-input {
    resize: vertical;
}
.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.cover-preview {
    display: inline-block;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    background-color: var(--bg-main);
}
.cover-preview img {
    width: 120px;
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}
.text-danger {
    color: var(--accent);
    font-size: 0.85rem;
}

/* Hero Section */
.hero-banner {
    text-align: center;
    padding: 2rem 1rem;
    background: radial-gradient(circle at top right, var(--primary-light), transparent 60%);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
}
.hero-banner h1 {
    font-size: 2.25rem;
    margin-bottom: 0;
    letter-spacing: -0.03em;
}
.hero-banner h1 span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Filter Bar */
.control-bar {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-sm);
}
.search-input-box {
    position: relative;
    flex-grow: 1;
}
.search-input-box input {
    width: 100%;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
}
.search-input-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.dropdown-select {
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    padding: 0.75rem 2rem 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
}

/* Category Tabs */
.tabs-badges {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-top: 1rem;
}
.tab-badge-btn {
    padding: 0.4rem 1.1rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}
.tab-badge-btn.active, .tab-badge-btn:hover {
    background-color: var(--primary);
    color: var(--text-light);
    border-color: var(--primary);
}

/* Books Grid & Cards */
.catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
}
.product-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}
.card-badge-discount {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: var(--accent);
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    z-index: 5;
}
.card-image-box {
    width: 100%;
    aspect-ratio: 3 / 4;
    background-color: var(--border);
    overflow: hidden;
}
.card-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-details {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.card-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.25rem;
}
.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-rating-stars {
    color: #eab308;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}
.card-price-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    margin-bottom: 1rem;
}
.price-tag-current { font-size: 1.25rem; font-weight: 800; }
.price-tag-original { font-size: 0.9rem; text-decoration: line-through; color: var(--text-muted); }

/* SVG Dynamic Cover Fallback */
.svg-cover-container {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 1.5rem;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}
.svg-cover-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 15px;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.15), rgba(255,255,255,0.05) 50%, rgba(0,0,0,0.05));
}

/* Drawer Cart Panel */
.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
}
.drawer-backdrop.active { display: block; }

.cart-drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 440px;
    height: 100%;
    background-color: var(--bg-card);
    box-shadow: var(--shadow-xl);
    z-index: 201;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.cart-drawer-panel.active { transform: translateX(0); }

.drawer-title-row {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.drawer-items-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
}
.drawer-footer-totals {
    padding: 1.5rem;
    background-color: var(--bg-main);
    border-top: 1px solid var(--border);
}

.cart-row-item {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}
.cart-row-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}
.cart-row-img {
    width: 50px;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background-color: var(--border);
}
.quantity-box {
    display: flex;
    border: 1px solid var(--border);
    background-color: var(--bg-main);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.quantity-box-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
}
.quantity-box-btn:hover { background-color: var(--border); }
.quantity-box-val { width: 30px; text-align: center; font-size: 0.85rem; font-weight: 600; line-height: 26px; }

/* Form Controls & Labels */
.form-input-group {
    margin-bottom: 1.25rem;
}
.form-input-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.form-input-control {
    width: 100%;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    color: inherit;
    transition: var(--transition);
}
.form-input-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Modals */
.modal-overlay-custom {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.modal-overlay-custom.active { display: flex; }

.modal-content-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 650px;
    position: relative;
    overflow: hidden;
}

/* Admin Dashboard Grids */
.dashboard-grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
@media (min-width: 992px) {
    .dashboard-grid-layout {
        grid-template-columns: 240px 1fr;
    }
}

.dashboard-sidebar {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: fit-content;
}
.dashboard-menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    color: var(--text-muted);
}
.dashboard-menu-link:hover, .dashboard-menu-link.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

.dashboard-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.stat-item-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-item-icon {
    width: 48px;
    height: 48px;
    background-color: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Tables */
.custom-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.custom-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.custom-data-table th, .custom-data-table td {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.custom-data-table th {
    background-color: var(--bg-main);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}
.custom-data-table tr:last-child td {
    border-bottom: none;
}
.custom-data-table tr:hover td {
    background-color: rgba(79, 70, 229, 0.02);
}

/* Details Page Grid */
.detail-grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2.5rem;
}
@media (min-width: 640px) {
    .detail-grid-layout {
        grid-template-columns: 200px 1fr;
    }
}
.detail-cover-box {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

/* Footer Section */
.custom-footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 4rem 0 3rem 0;
    margin-top: 6rem;
    text-align: center;
}

/* Account Cards */
.auth-panel-card {
    max-width: 440px;
    margin: 4rem auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
}
/* Admin Layout */
.admin-body {
    padding-top: 0;
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: width 0.3s ease;
}

.admin-sidebar.collapsed {
    width: 72px;
}

.admin-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
}

.admin-logo i {
    color: var(--primary);
    font-size: 1.5rem;
}

.admin-logo span span {
    color: var(--primary);
}

.admin-nav {
    flex-grow: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    text-decoration: none;
}

.admin-nav-link:hover,
.admin-nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

.admin-nav-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.admin-sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.admin-wrapper {
    flex-grow: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.sidebar-collapsed .admin-wrapper {
    margin-left: 72px;
}

.admin-topbar {
    height: 70px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 900;
}

.admin-sidebar-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: var(--bg-main);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.admin-sidebar-toggle:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-topbar-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: var(--bg-main);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.admin-topbar-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.admin-user-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.admin-user-pill i {
    color: var(--primary);
}

.admin-main {
    flex-grow: 1;
    padding: 1.5rem;
    background-color: var(--bg-main);
}

.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-page-header h1 {
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Dashboard Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.blue { background-color: #dbeafe; color: #1e40af; }
.stat-icon.green { background-color: #d1fae5; color: #065f46; }
.stat-icon.purple { background-color: #e0e7ff; color: #3730a3; }
.stat-icon.orange { background-color: #ffedd5; color: #9a3412; }

.stat-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.15rem;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Responsive Admin */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        width: 260px;
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-wrapper {
        margin-left: 0;
    }

    .sidebar-collapsed .admin-wrapper {
        margin-left: 0;
    }
}

/* Reviews */
.review-stats-bar {
    padding: 1rem;
    background-color: var(--bg-main);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.review-card {
    padding: 1rem;
    background-color: var(--bg-main);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.review-form-section {
    padding: 1.25rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.15rem;
    unicode-bidi: bidi-override;
}

.star-rating-input input {
    display: none;
}

.star-rating-input label {
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--border);
    transition: color 0.15s;
}

.star-rating-input label i {
    pointer-events: none;
}

.star-rating-input input:checked ~ label,
.star-rating-input label:hover,
.star-rating-input label:hover ~ label {
    color: #eab308;
}

/* ── SQYRA-style Homepage Sections ── */

/* Hero Slider */
.hero-slider {
    position: relative;
    width: 100%;
    height: 340px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
}
@media (min-width: 768px) {
    .hero-slider { height: 380px; }
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.8s ease;
}
.hero-slide.active { opacity: 1; }

.hero-slide-overlay {
    text-align: center;
    padding: 2rem;
    max-width: 600px;
    z-index: 2;
}

.hero-slide-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hero-slide-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
    margin: 0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.hero-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--transition);
}
.hero-slider-arrow:hover { background: rgba(255,255,255,0.4); }
.hero-slider-prev { left: 1rem; }
.hero-slider-next { right: 1rem; }

.hero-slider-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}
.hero-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: var(--transition);
}
.hero-dot.active { background: #fff; transform: scale(1.2); }

/* Homepage Sections */
.homepage-section {
    margin-bottom: 2.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Horizontal Scroll Product Row */
.section-scroll-row {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.section-scroll-row::-webkit-scrollbar {
    height: 4px;
}
.section-scroll-row::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

.scroll-product-card {
    min-width: 200px;
    max-width: 220px;
    flex-shrink: 0;
    scroll-snap-align: start;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.scroll-product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}
.scroll-product-card .card-image-box {
    width: 100%;
    aspect-ratio: 3 / 4;
}
.scroll-product-card .card-details {
    padding: 0.85rem;
}
.scroll-product-card .card-title {
    font-size: 0.9rem;
}
.scroll-product-card .card-price-row {
    margin-bottom: 0.75rem;
}
.scroll-product-card .price-tag-current {
    font-size: 1.05rem;
}

/* Trust Badges */
.trust-badges-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 2.5rem 0;
}
@media (min-width: 768px) {
    .trust-badges-row { grid-template-columns: repeat(4, 1fr); }
}

.trust-badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1.5rem 1rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.trust-badge-item i {
    font-size: 1.75rem;
    color: var(--primary);
}
.trust-badge-item span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

/* About Section */
.about-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin: 2.5rem 0;
    box-shadow: var(--shadow-sm);
}
.about-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.8;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 1.5rem auto;
}
.about-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    max-width: 500px;
    margin: 0 auto;
}
@media (min-width: 640px) {
    .about-features { grid-template-columns: repeat(4, 1fr); max-width: 700px; }
}
.about-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}
.about-feature i {
    color: var(--primary);
    font-size: 0.9rem;
}

/* Footer Grid */
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
@media (min-width: 768px) {
    .footer-grid { grid-template-columns: 2fr 1fr 1.5fr 1fr; }
}

/* ── Header Search Bar ── */
.nav-search-form {
    flex: 1;
    max-width: 420px;
    margin: 0 1.5rem;
}
.nav-search-box {
    display: flex;
    align-items: center;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}
.nav-search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.nav-search-box i {
    position: absolute;
    left: 0.85rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 1;
}
.nav-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.6rem 0.75rem 0.6rem 2.2rem;
    font-size: 0.9rem;
    color: var(--text-main);
    outline: none;
    font-family: inherit;
    min-width: 0;
}
.nav-search-box input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}
.nav-search-btn {
    padding: 0.6rem 1.1rem;
    background-color: var(--primary);
    color: var(--text-light);
    border: none;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: inherit;
}
.nav-search-btn:hover {
    background-color: var(--primary-hover);
}

/* ── Category Dropdown Panel ── */
.nav-category-dropdown {
    position: relative;
}
.nav-category-trigger {
    display: flex;
    align-items: center;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
}
.nav-category-panel {
    position: absolute;
    top: calc(100% + 1rem);
    left: 50%;
    transform: translateX(-50%);
    min-width: 260px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 300;
    overflow: hidden;
}
.nav-category-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.nav-category-panel-inner {
    padding: 0.5rem 0;
    max-height: 360px;
    overflow-y: auto;
}
.nav-category-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1.15rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    transition: background-color 0.15s, color 0.15s;
}
.nav-category-link:hover {
    background-color: var(--bg-main);
    color: var(--primary);
}
.nav-category-link i {
    font-size: 0.7rem;
    color: var(--text-muted);
    width: 14px;
    text-align: center;
}
.nav-category-link:hover i {
    color: var(--primary);
}
.nav-category-viewall {
    border-top: 1px solid var(--border);
    margin-top: 0.35rem;
    padding-top: 0.7rem;
    font-weight: 600;
    color: var(--primary);
}
.nav-category-viewall i {
    color: var(--primary);
}

/* Responsive: hide search bar on small screens */
@media (max-width: 768px) {
    .nav-search-form {
        display: none;
    }
    .nav-category-panel {
        min-width: 220px;
    }
}
