@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
    --font: 'Plus Jakarta Sans', system-ui, sans-serif;
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #818cf8;
    --accent: #f97316;
    --accent-soft: #ffedd5;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
    --radius: 14px;
    --radius-sm: 10px;
    --sidebar-w: 260px;
    --topbar-h: 64px;
    --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

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

/* ── Buttons ── */
.btn-brand {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.65rem 1.35rem; border-radius: 999px; font-weight: 600; font-size: 0.925rem;
    border: none; cursor: pointer; transition: all var(--transition);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}
.btn-brand:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4); color: #fff; }

.btn-outline-brand {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.65rem 1.35rem; border-radius: 999px; font-weight: 600; font-size: 0.925rem;
    border: 2px solid var(--primary); color: var(--primary); background: transparent;
    transition: all var(--transition);
}
.btn-outline-brand:hover { background: var(--primary); color: #fff; }

.btn-accent {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.65rem 1.35rem; border-radius: 999px; font-weight: 600;
    background: var(--accent); color: #fff; border: none;
    transition: all var(--transition);
}
.btn-accent:hover { background: #ea580c; color: #fff; transform: translateY(-1px); }

.btn-ghost {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1rem; border-radius: var(--radius-sm); font-weight: 500;
    background: transparent; border: 1px solid var(--border); color: var(--text);
    transition: all var(--transition); cursor: pointer;
}
.btn-ghost:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: var(--radius-sm); }

/* ── Public Nav ── */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,0.85); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.site-nav {
    max-width: 1200px; margin: 0 auto; padding: 0 1.25rem;
    height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.site-logo {
    font-weight: 800; font-size: 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.site-links { display: flex; align-items: center; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.site-links a {
    padding: 0.5rem 1rem; border-radius: 999px; font-weight: 500; font-size: 0.925rem; color: var(--text-muted);
}
.site-links a:hover, .site-links a.active { color: var(--primary); background: rgba(79,70,229,0.08); }
.site-actions { display: flex; align-items: center; gap: 0.5rem; }
.nav-toggle {
    display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text);
}

.site-menu {
    display: flex; align-items: center; gap: 1.5rem;
}

@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .site-menu {
        position: fixed; inset: 68px 0 auto 0; background: var(--surface);
        border-bottom: 1px solid var(--border); padding: 1rem 1.25rem 1.25rem;
        flex-direction: column; align-items: stretch !important;
        transform: translateY(-110%); opacity: 0; pointer-events: none;
        transition: all 0.3s ease; box-shadow: var(--shadow-lg);
    }
    .site-menu.open { transform: translateY(0); opacity: 1; pointer-events: all; }
    .site-links { flex-direction: column; }
    .site-links a { display: block; padding: 0.75rem 1rem; }
    .site-actions { flex-direction: column; margin-top: 0.75rem; }
    .site-actions .btn-brand, .site-actions .btn-outline-brand, .site-actions .btn-ghost { width: 100%; justify-content: center; }
}

/* ── Hero ── */
.hero {
    max-width: 1200px; margin: 0 auto; padding: 3rem 1.25rem 4rem;
    display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.35rem 0.85rem; border-radius: 999px;
    background: var(--accent-soft); color: #c2410c; font-size: 0.8rem; font-weight: 600;
    margin-bottom: 1rem;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; line-height: 1.15; margin-bottom: 1rem; }
.hero h1 span { color: var(--primary); }
.hero p { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 1.75rem; max-width: 480px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-visual {
    position: relative; border-radius: var(--radius); overflow: hidden;
    aspect-ratio: 4/3; background: linear-gradient(135deg, #eef2ff, #fef3c7);
    display: grid; place-items: center; box-shadow: var(--shadow-lg);
}
.hero-visual-inner { text-align: center; padding: 2rem; }
.hero-visual-inner svg { width: 80px; height: 80px; color: var(--primary); opacity: 0.6; }

@media (max-width: 768px) {
    .hero { grid-template-columns: 1fr; padding: 2rem 1.25rem 3rem; gap: 2rem; }
    .hero-visual { order: -1; aspect-ratio: 16/9; }
}

/* ── Section ── */
.section { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem 4rem; }
.section-header { display: flex; justify-content: space-between; align-items: end; margin-bottom: 1.75rem; flex-wrap: wrap; gap: 1rem; }
.section-header h2 { font-size: 1.75rem; font-weight: 800; margin: 0; }
.section-header p { color: var(--text-muted); margin: 0.25rem 0 0; }

/* ── Blog Cards ── */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.blog-card {
    background: var(--surface); border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border); transition: all var(--transition);
    display: flex; flex-direction: column;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.blog-card-img { height: 200px; background: linear-gradient(135deg, #e0e7ff, #fce7f3); overflow: hidden; }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; }
.blog-card-body { padding: 1.35rem; flex: 1; display: flex; flex-direction: column; }
.blog-card-tag {
    display: inline-block; padding: 0.2rem 0.65rem; border-radius: 999px;
    background: rgba(79,70,229,0.1); color: var(--primary); font-size: 0.75rem; font-weight: 600;
    margin-bottom: 0.65rem; align-self: flex-start;
}
.blog-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.5rem; line-height: 1.35; }
.blog-card p { color: var(--text-muted); font-size: 0.9rem; flex: 1; margin-bottom: 1rem; }
.blog-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--text-muted); }
.blog-card-meta .read-link { color: var(--primary); font-weight: 600; font-size: 0.875rem; }

/* ── Category pills ── */
.category-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.category-pill {
    padding: 0.45rem 1.1rem; border-radius: 999px; font-size: 0.875rem; font-weight: 500;
    border: 1px solid var(--border); color: var(--text-muted); background: var(--surface);
    transition: all var(--transition);
}
.category-pill:hover, .category-pill.active {
    background: var(--primary); color: #fff; border-color: var(--primary);
}

/* ── Article ── */
.article-wrap { max-width: 760px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.article-back { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--text-muted); font-weight: 500; margin-bottom: 1.5rem; }
.article-back:hover { color: var(--primary); }
.article-hero-img { border-radius: var(--radius); overflow: hidden; margin-bottom: 2rem; max-height: 420px; }
.article-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.article-tag { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 999px; background: rgba(79,70,229,0.1); color: var(--primary); font-size: 0.8rem; font-weight: 600; margin-bottom: 0.75rem; }
.article-title { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; line-height: 1.2; margin-bottom: 0.75rem; }
.article-meta { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }

/* ── Like & Share ── */
.blog-engage {
    display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
    margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border);
}
.blog-engage-compact {
    margin: 0.75rem 0 0; padding: 0; border: none; gap: 0.65rem;
}
.blog-like-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.45rem 0.9rem; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text-muted); font-size: 0.875rem; font-weight: 600;
    cursor: pointer; transition: all var(--transition);
}
.blog-like-btn:hover { border-color: #f43f5e; color: #f43f5e; }
.blog-like-btn.liked { background: rgba(244,63,94,0.1); border-color: #f43f5e; color: #f43f5e; }
.blog-like-btn:disabled { opacity: 0.6; cursor: wait; }
.blog-share-group { display: inline-flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.blog-share-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-right: 0.25rem; }
.blog-share-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text-muted); transition: all var(--transition);
}
.blog-share-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(79,70,229,0.08); }
.article-lead { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 2rem; line-height: 1.7; }
.article-content { font-size: 1.05rem; line-height: 1.85; color: #334155; }
.article-content p { margin-bottom: 1.25rem; }

/* ── Comments ── */
.comments-section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.comments-section h3 { font-size: 1.35rem; font-weight: 700; margin-bottom: 1.25rem; }
.comment-item {
    display: flex; gap: 1rem; padding: 1.15rem; background: var(--surface);
    border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 0.75rem;
}
.comment-avatar {
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 0.9rem;
}
.comment-body strong { font-weight: 600; }
.comment-author { color: var(--primary); font-size: 0.95rem; }
.comment-posting-as { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.comment-body time { font-size: 0.8rem; color: var(--text-muted); margin-left: 0.5rem; }
.comment-body p { margin: 0.35rem 0 0; color: #475569; }
.comment-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem; }
.comment-reply-badge { font-size: 0.7rem; font-weight: 600; color: var(--primary); background: #eef2ff; padding: 0.1rem 0.45rem; border-radius: 999px; }
.comment-actions { display: flex; gap: 0.35rem; margin-top: 0.5rem; flex-wrap: wrap; }
.comment-reply-details { margin-top: 0.65rem; }
.comment-reply-summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center;
    padding: 0.35rem 0.75rem; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600;
    color: var(--text-muted); border: 1px solid var(--border); background: var(--surface);
    user-select: none;
}
.comment-reply-summary::-webkit-details-marker { display: none; }
.comment-reply-summary:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.comment-reply-details[open] .comment-reply-summary { color: var(--primary); border-color: var(--primary); background: #eef2ff; }
.comment-reply-form { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px dashed var(--border); }
.comment-reply { border-left: 2px solid #e2e8f0; padding-left: 0.75rem; }

.category-tree { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.category-tree-group { display: flex; flex-direction: column; gap: 0.5rem; }
.category-tree-children { display: flex; flex-direction: column; gap: 0.65rem; margin-left: 1rem; padding-left: 1rem; border-left: 2px solid #e2e8f0; }
.category-tree-sub { display: flex; flex-direction: column; gap: 0.45rem; }
.category-tree-grandchildren { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-left: 0.5rem; }

/* ── Category cards (Amazon / Flipkart style) ── */
.category-breadcrumb {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem;
    font-size: 0.85rem; margin-bottom: 1rem; color: var(--text-muted);
}
.category-breadcrumb a { color: var(--primary); font-weight: 500; text-decoration: none; }
.category-breadcrumb a:hover { text-decoration: underline; }
.category-breadcrumb-sep { opacity: 0.5; }
.category-breadcrumb-current { font-weight: 600; color: #334155; }
.category-cards-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1rem; gap: 0.75rem;
}
.category-cards-header h3 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.category-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.85rem;
}
.category-card {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 1rem 0.75rem; background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); text-decoration: none; color: inherit;
    transition: all var(--transition); position: relative; min-height: 130px;
}
.category-card:hover {
    transform: translateY(-3px); box-shadow: var(--shadow-lg);
    border-color: var(--primary); color: inherit;
}
.category-card-icon {
    width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
    font-size: 1.25rem; font-weight: 800; color: #fff; margin-bottom: 0.65rem;
    background: linear-gradient(135deg, hsl(var(--cat-hue, 240) 70% 55%), hsl(calc(var(--cat-hue, 240) + 40) 70% 45%));
}
.category-card-body strong { display: block; font-size: 0.85rem; line-height: 1.3; margin-bottom: 0.2rem; }
.category-card-body span { font-size: 0.72rem; color: var(--text-muted); }
.category-card-arrow { position: absolute; top: 0.5rem; right: 0.5rem; opacity: 0.35; }

/* ── Home features ── */
.hero-stats {
    display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: 1.75rem;
}
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1rem; color: var(--primary); }
.hero-stats span { font-size: 0.78rem; color: var(--text-muted); }
.feature-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem;
}
.feature-card {
    padding: 1.35rem; background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); transition: box-shadow var(--transition);
}
.feature-card:hover { box-shadow: var(--shadow); }
.feature-icon { font-size: 1.75rem; margin-bottom: 0.65rem; }
.feature-card h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.feature-card p { font-size: 0.875rem; color: var(--text-muted); margin: 0; line-height: 1.5; }
.steps-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem;
}
.step-card {
    padding: 1.5rem; background: linear-gradient(135deg, #f8fafc, #fff);
    border: 1px solid var(--border); border-radius: var(--radius); text-align: center;
}
.step-num {
    display: inline-grid; place-items: center; width: 36px; height: 36px;
    border-radius: 50%; background: var(--primary); color: #fff;
    font-weight: 800; font-size: 0.95rem; margin-bottom: 0.75rem;
}
.step-card h4 { margin: 0 0 0.4rem; font-size: 1rem; }
.step-card p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }
.cta-banner {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius); padding: 3rem 2rem; text-align: center; color: #fff;
}
.cta-banner h2 { font-size: 1.75rem; font-weight: 800; margin-bottom: 0.75rem; }
.cta-banner p { opacity: 0.9; max-width: 560px; margin: 0 auto; line-height: 1.6; }

/* ── Profile avatar with photo ── */
.user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.vendor-avatar {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; display: grid; place-items: center; font-weight: 700; overflow: hidden;
}
.vendor-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-preview {
    width: 96px; height: 96px; border-radius: 50%; overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; display: grid; place-items: center; font-size: 2rem; font-weight: 700;
    margin-bottom: 1rem;
}
.profile-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.category-pill-root { font-weight: 700; }
.category-pill-sub { font-size: 0.85rem; }
.category-pill-child { font-size: 0.78rem; padding: 0.35rem 0.75rem; }

.comment-form {
    background: var(--surface); border-radius: var(--radius); padding: 1.5rem;
    border: 1px solid var(--border); margin-top: 1.5rem;
}
.comment-form h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }

/* ── Forms ── */
.form-group { margin-bottom: 1.15rem; }
.form-label { display: block; font-weight: 600; font-size: 0.875rem; margin-bottom: 0.4rem; color: var(--text); }
.form-control {
    width: 100%; padding: 0.7rem 1rem; border-radius: var(--radius-sm);
    border: 1px solid var(--border); font-family: var(--font); font-size: 0.95rem;
    background: var(--surface); color: var(--text); transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.15); }
textarea.form-control { min-height: 120px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 576px) { .form-row { grid-template-columns: 1fr; } }

.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check input { width: 18px; height: 18px; accent-color: var(--primary); }

/* ── Alerts ── */
.alert {
    padding: 0.85rem 1.15rem; border-radius: var(--radius-sm); font-size: 0.925rem;
    margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.5rem;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

.empty-state {
    text-align: center; padding: 3rem 1.5rem; background: var(--surface);
    border-radius: var(--radius); border: 2px dashed var(--border);
}
.empty-state svg { width: 56px; height: 56px; color: var(--text-muted); opacity: 0.4; margin: 0 auto 1rem; }
.empty-state h3 { font-size: 1.15rem; margin-bottom: 0.35rem; }
.empty-state p { color: var(--text-muted); font-size: 0.925rem; }

/* ── Footer ── */
.site-footer {
    background: var(--text); color: #94a3b8; padding: 2.5rem 1.25rem;
    margin-top: 2rem;
}
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-inner a { color: #cbd5e1; }
.footer-inner a:hover { color: #fff; }

/* ══════════════════════════════════════
   ADMIN PANEL
   ══════════════════════════════════════ */
.admin-body { background: #f1f5f9; min-height: 100vh; }

.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: var(--sidebar-w); background: var(--text); color: #cbd5e1;
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
    display: flex; flex-direction: column; transition: transform 0.3s ease;
    overflow-y: auto;
}
.sidebar-brand {
    padding: 1.25rem 1.35rem; font-weight: 800; font-size: 1.1rem; color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; gap: 0.5rem;
}
.sidebar-brand span { color: var(--primary-light); }
.sidebar-nav { padding: 1rem 0.75rem; flex: 1; }
.sidebar-section { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #475569; padding: 0.75rem 0.75rem 0.35rem; }
.sidebar-link {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.65rem 0.85rem; border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 500; color: #94a3b8;
    transition: all var(--transition); margin-bottom: 0.15rem;
}
.sidebar-link:hover { background: rgba(255,255,255,0.06); color: #e2e8f0; }
.sidebar-link.active { background: var(--primary); color: #fff; }
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-footer { padding: 1rem 0.75rem; border-top: 1px solid rgba(255,255,255,0.08); }

.admin-main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }

.admin-topbar {
    height: var(--topbar-h); background: var(--surface);
    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: 50;
}
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-title { font-size: 1.1rem; font-weight: 700; margin: 0; }
.sidebar-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text); padding: 0.25rem; }
.topbar-user { display: flex; align-items: center; gap: 0.75rem; font-size: 0.875rem; color: var(--text-muted); }
.topbar-user-menu { position: relative; }
.user-menu-trigger {
    display: flex; align-items: center; gap: 0.65rem;
    background: none; border: none; cursor: pointer; padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm); color: var(--text-muted); font: inherit;
}
.user-menu-trigger:hover { background: #f1f5f9; color: var(--text); }
.user-menu-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-chevron { transition: transform 0.2s; flex-shrink: 0; }
.user-menu-trigger[aria-expanded="true"] .user-menu-chevron { transform: rotate(180deg); }
.user-menu-dropdown {
    position: absolute; right: 0; top: calc(100% + 0.5rem); min-width: 240px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 0.5rem; z-index: 100;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}
.user-menu-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.user-menu-header {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border); margin-bottom: 0.35rem;
}
.user-menu-header strong { display: block; font-size: 0.9rem; color: var(--text); }
.user-menu-header span { display: block; font-size: 0.78rem; color: var(--text-muted); word-break: break-all; }
.user-avatar-lg { width: 42px; height: 42px; font-size: 1rem; flex-shrink: 0; }
.user-role-badge { margin-top: 0.35rem; }
.user-menu-item {
    display: flex; align-items: center; gap: 0.65rem; width: 100%;
    padding: 0.65rem 0.75rem; border-radius: var(--radius-sm);
    color: var(--text); text-decoration: none; font-size: 0.875rem;
    background: none; border: none; cursor: pointer; text-align: left;
}
.user-menu-item svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-muted); }
.user-menu-item:hover { background: #f8fafc; color: var(--primary); }
.user-menu-item:hover svg { color: var(--primary); }
.user-menu-divider { height: 1px; background: var(--border); margin: 0.35rem 0; }
.user-menu-logout { margin: 0; }
.user-menu-logout-btn { color: #dc2626; }
.user-menu-logout-btn:hover { background: #fef2f2; color: #dc2626; }
.sidebar-logout-form { margin: 0; }
.sidebar-logout-btn { width: 100%; font: inherit; }
.sidebar-logout-btn:hover { color: #dc2626; }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 0.85rem;
}

.admin-content { padding: 1.5rem; }

@media (max-width: 992px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .admin-main { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .sidebar-overlay {
        position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 199;
        opacity: 0; pointer-events: none; transition: opacity 0.3s;
    }
    .sidebar-overlay.open { opacity: 1; pointer-events: all; }
}

/* ── Admin Stats ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.stat-card {
    background: var(--surface); border-radius: var(--radius); padding: 1.25rem;
    border: 1px solid var(--border); display: flex; align-items: flex-start; gap: 1rem;
}
.stat-icon {
    width: 48px; height: 48px; border-radius: var(--radius-sm);
    display: grid; place-items: center; flex-shrink: 0;
}
.stat-icon.purple { background: #eef2ff; color: var(--primary); }
.stat-icon.green { background: #ecfdf5; color: var(--success); }
.stat-icon.orange { background: #fff7ed; color: var(--accent); }
.stat-icon.blue { background: #eff6ff; color: #3b82f6; }
.stat-icon svg { width: 22px; height: 22px; }
.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; margin-bottom: 0.2rem; }
.stat-label { font-size: 0.825rem; color: var(--text-muted); }

/* ── Admin Table ── */
.admin-card {
    background: var(--surface); border-radius: var(--radius);
    border: 1px solid var(--border); overflow: hidden;
}
.admin-card-header {
    padding: 1.15rem 1.35rem; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem;
}
.admin-card-header h2 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.admin-card-body { padding: 0; }

.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th {
    text-align: left; padding: 0.85rem 1.25rem; font-weight: 600; font-size: 0.8rem;
    text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted);
    background: #f8fafc; border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fafbfc; }

.badge {
    display: inline-flex; align-items: center; padding: 0.25rem 0.65rem;
    border-radius: 999px; font-size: 0.75rem; font-weight: 600;
}
.badge-success { background: #ecfdf5; color: #065f46; }
.badge-warning { background: #fffbeb; color: #92400e; }
.badge-danger { background: #fef2f2; color: #991b1b; }
.badge-primary { background: #eef2ff; color: var(--primary-dark); }

.label-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.75rem; }
.label-chip {
    display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px;
    font-size: 0.72rem; font-weight: 600; background: #fff7ed; color: #c2410c;
    border: 1px solid #fed7aa;
}

.table-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.manage-settings-body {
    display: grid; grid-template-columns: 200px 1fr; gap: 1.5rem; padding: 1.35rem;
}
.manage-settings-nav .nav { gap: 0.25rem; }
.manage-settings-nav .nav-link {
    border-radius: var(--radius-sm); color: var(--text-muted); font-size: 0.875rem; padding: 0.55rem 0.85rem;
}
.manage-settings-nav .nav-link.active,
.manage-settings-nav .nav-link:hover { background: #eef2ff; color: var(--primary); }
.manage-settings-content h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 1rem; }
@media (max-width: 768px) {
    .manage-settings-body { grid-template-columns: 1fr; }
    .user-menu-name { display: none; }
}

/* ── Auth Pages ── */
.auth-page {
    min-height: 100vh; display: grid; place-items: center;
    padding: 2rem 1.25rem;
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 50%, #fff7ed 100%);
}
.auth-card {
    width: 100%; max-width: 440px; background: var(--surface);
    border-radius: var(--radius); padding: 2.25rem;
    box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.auth-logo { text-align: center; margin-bottom: 1.75rem; }
.auth-logo h1 {
    font-size: 1.5rem; font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.auth-logo p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.35rem; }
.auth-footer { text-align: center; margin-top: 1.25rem; font-size: 0.875rem; color: var(--text-muted); }
.auth-footer a { color: var(--primary); font-weight: 600; }

/* ── Image preview ── */
.img-preview { border-radius: var(--radius-sm); overflow: hidden; max-height: 200px; margin-top: 0.5rem; border: 1px solid var(--border); }
.img-preview img { width: 100%; height: 200px; object-fit: cover; }

/* ── Pending page ── */
.pending-page { max-width: 520px; margin: 4rem auto; padding: 0 1.25rem; text-align: center; }
.pending-icon { width: 80px; height: 80px; margin: 0 auto 1.5rem; color: var(--warning); }

/* ── Vendor Network / Chat ── */
.vendor-request-card {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.vendor-request-card:last-child { border-bottom: none; }
.vendor-chat-list { display: flex; flex-direction: column; }
.vendor-chat-list-item {
    display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border); text-decoration: none; color: inherit;
}
.vendor-chat-list-item:hover { background: #f8fafc; }
.vendor-chat-list-avatar {
    width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; display: grid; place-items: center; font-weight: 700;
}
.vendor-chat-list-body { flex: 1; min-width: 0; }
.vendor-chat-list-body p { margin: 0.2rem 0 0; font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vendor-chat-list-item time { font-size: 0.75rem; color: var(--text-muted); flex-shrink: 0; }
.vendor-chat-room .admin-card-body { padding: 0; }
.vendor-chat-messages {
    height: 420px; overflow-y: auto; padding: 1.25rem; background: #f8fafc;
    display: flex; flex-direction: column; gap: 0.65rem;
}
.vendor-chat-row { display: flex; width: 100%; }
.vendor-chat-row.mine { justify-content: flex-start; }
.vendor-chat-row.theirs { justify-content: flex-end; }
.vendor-chat-bubble {
    max-width: min(75%, 520px); padding: 0.65rem 0.95rem; border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06); cursor: pointer;
    transition: box-shadow var(--transition), transform var(--transition);
}
.chat-bubble-selectable:hover { box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1); }
.chat-bubble-active { outline: 2px solid var(--primary); outline-offset: 2px; }
.vendor-chat-row.mine .vendor-chat-bubble {
    background: #eef2ff; border: 1px solid #c7d2fe;
    border-bottom-left-radius: 4px;
}
.vendor-chat-row.theirs .vendor-chat-bubble {
    background: #fff; border: 1px solid var(--border);
    border-bottom-right-radius: 4px;
}
.vendor-chat-row.mine .vendor-chat-meta { text-align: left; }
.vendor-chat-row.theirs .vendor-chat-meta { text-align: right; }
.vendor-chat-row.theirs .vendor-chat-text { text-align: right; }
.vendor-chat-meta { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.vendor-chat-text { font-size: 0.9rem; color: #334155; white-space: pre-wrap; word-break: break-word; }
.vendor-chat-compose {
    padding: 1rem 1.25rem; border-top: 1px solid var(--border);
    display: flex; gap: 0.75rem; align-items: flex-end;
}
.vendor-chat-compose form { display: flex; gap: 0.75rem; width: 100%; align-items: flex-end; }
.vendor-chat-compose textarea { flex: 1; resize: none; min-height: 44px; max-height: 120px; }
.chat-sender-name { color: #334155; font-weight: 700; font-size: 0.78rem; }
.chat-edited-tag { font-size: 0.68rem; color: var(--text-muted); font-style: italic; }
.chat-deleted-text { font-style: italic; color: var(--text-muted) !important; }

/* WhatsApp-style chat menu & delete modal */
.chat-context-menu {
    position: fixed; z-index: 10000; min-width: 200px;
    background: #fff; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    padding: 0.35rem 0; overflow: hidden;
}
.chat-context-menu.hidden { display: none; }
.chat-menu-item {
    display: flex; align-items: center; gap: 0.85rem; width: 100%;
    padding: 0.75rem 1.1rem; border: none; background: none;
    font-size: 0.9rem; color: #334155; cursor: pointer; text-align: left;
}
.chat-menu-item:hover { background: #f1f5f9; }
.chat-menu-item.danger { color: #dc2626; }
.chat-menu-item svg { flex-shrink: 0; opacity: 0.75; }

.chat-modal {
    position: fixed; inset: 0; z-index: 10001;
    display: flex; align-items: center; justify-content: center;
}
.chat-modal.hidden { display: none; }
.chat-modal-backdrop {
    position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45);
}
.chat-modal-sheet {
    position: relative; background: #fff; border-radius: 14px;
    padding: 1.25rem 1rem 1rem; min-width: min(320px, 90vw);
    box-shadow: 0 20px 50px rgba(0,0,0,0.2); text-align: center;
}
.chat-modal-sheet h4 {
    margin: 0 0 1rem; font-size: 1.05rem; font-weight: 700; color: #334155;
}
.chat-modal-btn {
    display: block; width: 100%; padding: 0.85rem 1rem; margin-bottom: 0.5rem;
    border: none; border-radius: 999px; font-size: 0.95rem; font-weight: 600;
    cursor: pointer; background: #f1f5f9; color: #334155;
}
.chat-modal-btn:last-child { margin-bottom: 0; }
.chat-modal-btn:hover { background: #e2e8f0; }
.chat-modal-danger { color: #dc2626; background: #fef2f2; }
.chat-modal-danger:hover { background: #fee2e2; }
.chat-modal-cancel { color: var(--text-muted); }

.chat-reply-bar {
    padding: 0.5rem 1.25rem 0; border-top: 1px solid var(--border);
    background: #f8fafc;
}
.chat-reply-bar.hidden { display: none; }
.chat-reply-bar-inner {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem;
    padding: 0.5rem 0.75rem; border-left: 3px solid var(--primary);
    background: #fff; border-radius: 0 8px 8px 0;
}
.chat-reply-bar-inner strong { display: block; font-size: 0.8rem; color: var(--primary); }
.chat-reply-bar-inner p { margin: 0.15rem 0 0; font-size: 0.78rem; color: var(--text-muted); }

.icon-btn {
    display: inline-grid; place-items: center; width: 26px; height: 26px;
    border: 1px solid var(--border); border-radius: 6px; background: #fff;
    color: var(--text-muted); cursor: pointer; padding: 0; transition: all var(--transition);
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); background: #f8fafc; }
.icon-btn-danger:hover { border-color: var(--danger); color: var(--danger); background: #fef2f2; }
