/* =========================================================================
   Vendor Dashboard styles (vendor.elinommarketplace.com)
   Mobile-first; layered on top of mobile-responsive.css.
   ========================================================================= */

:root {
    --vd-primary: #ff6b00;
    --vd-primary-dark: #ea580c;
    --vd-bg: #f5f7fa;
    --vd-surface: #ffffff;
    --vd-border: #e2e8f0;
    --vd-text: #1e293b;
    --vd-muted: #64748b;
    --vd-success: #10b981;
    --vd-warning: #f59e0b;
    --vd-danger: #ef4444;
    --vd-radius: 10px;
    --vd-shadow: 0 2px 6px rgba(15,23,42,0.06);
}

* { box-sizing: border-box; }

body.vendor-dashboard {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--vd-bg);
    color: var(--vd-text);
    -webkit-font-smoothing: antialiased;
}

/* ── Shell ─────────────────────────────────────────────────── */
.vd-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.vd-sidebar {
    background: #0b1020;
    color: #cbd5e1;
    padding: 20px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.vd-brand {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 16px;
}
.vd-brand-title { font-size: 18px; font-weight: 700; color: #fff; margin: 0; }
.vd-brand-sub { font-size: 11px; color: #94a3b8; margin-top: 4px; letter-spacing: 0.06em; text-transform: uppercase; }

.vd-nav { padding: 0; margin: 0; list-style: none; }
.vd-nav-section {
    padding: 16px 20px 6px;
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.vd-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #cbd5e1;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.vd-nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.vd-nav-item.active {
    background: linear-gradient(90deg, rgba(255,107,0,0.25), transparent);
    color: #fff;
    border-left: 3px solid var(--vd-primary);
    padding-left: 17px;
}
.vd-nav-item i { width: 18px; text-align: center; }

.vd-main { padding: 20px 28px 60px; min-width: 0; }

.vd-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.vd-topbar h1 { font-size: 22px; margin: 0; font-weight: 700; }
.vd-topbar .vd-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.vd-sync-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16,185,129,0.1);
    color: var(--vd-success);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
}
.vd-sync-pill::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--vd-success);
    animation: vd-pulse 1.6s ease-in-out infinite;
}
.vd-sync-pill.stale { background: rgba(239,68,68,0.1); color: var(--vd-danger); }
.vd-sync-pill.stale::before { background: var(--vd-danger); animation: none; }

@keyframes vd-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── KPI cards ─────────────────────────────────────────────── */
.vd-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.vd-kpi {
    background: var(--vd-surface);
    border: 1px solid var(--vd-border);
    border-radius: var(--vd-radius);
    padding: 16px;
    box-shadow: var(--vd-shadow);
}
.vd-kpi-label { font-size: 12px; color: var(--vd-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.vd-kpi-value { font-size: 26px; font-weight: 700; margin-top: 6px; }
.vd-kpi-delta { font-size: 12px; margin-top: 6px; color: var(--vd-success); }
.vd-kpi-delta.neg { color: var(--vd-danger); }

/* ── Panels ────────────────────────────────────────────────── */
.vd-panel {
    background: var(--vd-surface);
    border: 1px solid var(--vd-border);
    border-radius: var(--vd-radius);
    padding: 18px;
    box-shadow: var(--vd-shadow);
    margin-bottom: 18px;
}
.vd-panel-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px; gap: 10px; flex-wrap: wrap;
}
.vd-panel-head h2 { margin: 0; font-size: 16px; font-weight: 600; }

.vd-section { display: none; }
.vd-section.active { display: block; }

.vd-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.vd-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.vd-table th, .vd-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--vd-border);
    font-size: 14px;
}
.vd-table th {
    background: #f8fafc;
    font-size: 12px;
    color: var(--vd-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.vd-table tr:hover td { background: #f8fafc; }

.vd-badge {
    display: inline-block; padding: 3px 8px; border-radius: 999px;
    font-size: 11px; font-weight: 600; text-transform: capitalize;
}
.vd-badge.active { background: rgba(16,185,129,0.12); color: var(--vd-success); }
.vd-badge.pending { background: rgba(245,158,11,0.15); color: var(--vd-warning); }
.vd-badge.suspended, .vd-badge.inactive { background: rgba(239,68,68,0.1); color: var(--vd-danger); }
.vd-badge.verified { background: rgba(59,130,246,0.12); color: #3b82f6; }

.vd-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 8px;
    border: 1px solid var(--vd-border);
    background: var(--vd-surface); color: var(--vd-text);
    font-size: 13px; font-weight: 500; cursor: pointer;
    transition: all 0.15s;
}
.vd-btn:hover { background: #f1f5f9; }
.vd-btn.primary { background: var(--vd-primary); color: #fff; border-color: var(--vd-primary); }
.vd-btn.primary:hover { background: var(--vd-primary-dark); }
.vd-btn.danger { background: var(--vd-danger); color: #fff; border-color: var(--vd-danger); }
.vd-btn.sm { padding: 5px 10px; font-size: 12px; }

.vd-empty { text-align: center; padding: 40px 20px; color: var(--vd-muted); }
.vd-empty i { font-size: 36px; opacity: 0.3; margin-bottom: 10px; display: block; }

/* ── My Store profile ─────────────────────────────────────── */
.vd-store-empty,
.vd-shopfront-empty {
    text-align: center;
    padding: 48px 24px;
    background: var(--vd-surface);
    border: 1px dashed var(--vd-border);
    border-radius: var(--vd-radius);
}
.vd-store-empty i,
.vd-shopfront-empty i {
    font-size: 42px;
    color: var(--vd-primary);
    opacity: 0.85;
    margin-bottom: 12px;
}
.vd-store-empty h3,
.vd-shopfront-empty h3 { margin: 0 0 8px; font-size: 20px; }
.vd-store-empty p,
.vd-shopfront-empty p { margin: 0 0 18px; color: var(--vd-muted); max-width: 520px; margin-inline: auto; }
.vd-store-hero {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 20px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, rgba(255,107,0,0.08), rgba(59,130,246,0.06));
    border: 1px solid var(--vd-border);
    border-radius: var(--vd-radius);
}
.vd-store-hero-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: var(--vd-primary);
    color: #fff;
    font-size: 28px;
    flex-shrink: 0;
}
.vd-store-hero-copy h2 { margin: 0 0 4px; font-size: 22px; }
.vd-store-hero-copy p { margin: 0 0 8px; color: var(--vd-muted); font-size: 14px; }
.vd-store-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}
.vd-store-meta {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 14px;
}
.vd-store-meta code {
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

/* ── Shopfront settings cards ─────────────────────────────── */
.vd-shopfront-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 16px;
}
.vd-shopfront-card {
    background: var(--vd-surface);
    border: 1px solid var(--vd-border);
    border-radius: var(--vd-radius);
    padding: 20px;
    box-shadow: var(--vd-shadow);
}
.vd-shopfront-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.vd-shopfront-card-head h2 { margin: 0; font-size: 18px; }
.vd-shopfront-pill {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 999px;
}
.vd-shopfront-pill.live { background: rgba(16,185,129,0.15); color: var(--vd-success); }
.vd-shopfront-pill.draft { background: rgba(245,158,11,0.15); color: var(--vd-warning); }
.vd-shopfront-lead { color: var(--vd-muted); margin: 0 0 16px; line-height: 1.5; }
.vd-shopfront-facts {
    display: grid;
    gap: 10px;
    margin: 0 0 18px;
}
.vd-shopfront-facts div {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px;
    font-size: 14px;
}
.vd-shopfront-facts dt { margin: 0; color: var(--vd-muted); font-weight: 600; }
.vd-shopfront-facts dd { margin: 0; }
.vd-shopfront-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.vd-shopfront-help h3 { margin: 0 0 10px; font-size: 15px; }
.vd-shopfront-help ul { margin: 0; padding-left: 18px; color: var(--vd-muted); font-size: 14px; line-height: 1.6; }
.vd-shopfront-help li { margin-bottom: 8px; }
.vd-shopfront-tip {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(59,130,246,0.08);
    color: #1d4ed8;
    font-size: 13px;
}
.vd-shopfront-status.is-live { border-color: rgba(16,185,129,0.35); }

@media (max-width: 900px) {
    .vd-shopfront-grid { grid-template-columns: 1fr; }
    .vd-store-hero { flex-direction: column; text-align: center; }
}

/* ── Mobile hamburger ──────────────────────────────────────── */
.vd-menu-toggle {
    display: none;
    background: var(--vd-surface);
    border: 1px solid var(--vd-border);
    width: 40px; height: 40px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    /* Stay above global live-chat (z-index ~100050) so the hamburger
       remains tappable on phones when the chat panel is open. */
    position: relative;
    z-index: 100060;
}

/* Mobile drawer scrim — must not participate in the desktop CSS grid
   (otherwise it consumes the 1fr column and leaves .vd-main blank). */
.vd-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    pointer-events: none;
}
.vd-scrim.show {
    display: block;
    pointer-events: auto;
}
@media (min-width: 901px) {
    .vd-scrim { display: none !important; pointer-events: none !important; }
}

/* ── Mobile breakpoints ────────────────────────────────────── */
@media (max-width: 900px) {
    .vd-shell {
        grid-template-columns: 1fr;
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    .vd-sidebar {
        position: fixed;
        left: -260px;
        top: 0; bottom: 0;
        width: 240px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.25s ease;
        box-shadow: 4px 0 16px rgba(0,0,0,0.15);
    }
    .vd-sidebar.open { left: 0; }
    .vd-menu-toggle { display: inline-flex; }
    .vd-main {
        padding: 16px;
        min-width: 0;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    .vd-topbar {
        position: sticky;
        top: 0;
        z-index: 100055;
        background: var(--vd-bg);
        padding-bottom: 8px;
    }
    .vd-topbar h1 { font-size: 18px; }
    .vd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .vd-table-wrap {
        margin-inline: -4px;
        padding-bottom: 4px;
    }
}

@media (max-width: 600px) {
    .vd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .vd-kpi { padding: 12px; min-width: 0; }
    .vd-kpi-value { font-size: 20px; word-break: break-word; }
    .vd-panel { padding: 14px; }
    .vd-panel-head h2 { font-size: 15px; }
    .vd-btn { padding: 7px 10px; font-size: 12px; }
    .vd-store-actions { flex-direction: column; align-items: stretch; }
    .vd-store-actions .vd-btn { justify-content: center; }
}

@media (max-width: 360px) {
    .vd-kpis { grid-template-columns: 1fr; }
}

/* ── Login page ────────────────────────────────────────────── */
body.vendor-login {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f766e 0%, #0b1020 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.vd-login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.vd-login-card h1 { margin: 0 0 6px; font-size: 22px; }
.vd-login-card p { margin: 0 0 20px; color: var(--vd-muted); font-size: 13px; }
.vd-field { margin-bottom: 14px; }
.vd-field label { display: block; font-size: 12px; color: var(--vd-muted); margin-bottom: 4px; }
.vd-field input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--vd-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}
.vd-field input:focus { outline: none; border-color: var(--vd-primary); box-shadow: 0 0 0 3px rgba(15,118,110,0.15); }
.vd-login-card .vd-btn { width: 100%; justify-content: center; padding: 11px; font-size: 14px; }
.vd-login-error {
    background: rgba(239,68,68,0.1);
    color: var(--vd-danger);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
}
.vd-login-error.show { display: block; }

/* ── Product modal ─────────────────────────────────────────── */
.vd-modal[hidden] { display: none !important; }
.vd-modal {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.55);
}
.vd-modal-card {
    width: min(480px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
    padding: 18px 20px 20px;
}
.vd-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.vd-modal-head h2 { margin: 0; font-size: 18px; }
.vd-form { display: grid; gap: 10px; }
.vd-form label {
    display: grid;
    gap: 4px;
    font-size: 13px;
    color: #334155;
    font-weight: 600;
}
.vd-form input,
.vd-form select,
.vd-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 11px;
    border: 1px solid var(--vd-border, #e2e8f0);
    border-radius: 8px;
    font: inherit;
    font-weight: 400;
    color: #0f172a;
}
.vd-form .vd-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}
.vd-form .vd-check input { width: auto; }
.vd-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
}
.vd-form-msg { margin: 0; font-size: 13px; color: #b91c1c; }
.vd-form-msg.ok { color: #047857; }
.vd-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 5000;
    background: #0f172a;
    color: #fff;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 13px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3);
}
.vd-badge.listed { background: #ecfdf5; color: #047857; }
.vd-badge.unlisted { background: #fff7ed; color: #c2410c; }

