/* ──────────────────────────────────────────────────────────────
   Vendor Console — design tokens + chrome
   ────────────────────────────────────────────────────────────── */
:root {
    --bg:           #F1F5F9;
    --surface:      #FFFFFF;
    --surface-alt:  #F8FAFC;
    --border:       #E2E8F0;
    --text:         #0F172A;
    --text-muted:   #64748B;
    --primary:      #5B45D9;
    --primary-dark: #4338CA;
    --success:      #16A34A;
    --warn:         #B45309;
    --danger:       #DC2626;
    --gold:         #B45309;
    --shadow:       0 2px 8px rgba(15, 23, 42, .04);
    --radius:       10px;
}

* { box-sizing: border-box; }
html, body { margin:0; padding:0; }
body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    color: var(--text);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Auth screen ───────────────────────────────────────────── */
.auth-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #2A1F7E 0%, #5B45D9 50%, #7B61FF 100%);
    padding: 20px;
}
.auth-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 24px 48px rgba(0,0,0,.16), 0 8px 16px rgba(0,0,0,.08);
    width: 100%; max-width: 400px;
}
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; border-radius: 14px;
    background: linear-gradient(135deg, #5B45D9, #7B61FF);
    color: white; font-weight: 700; font-size: 22px;
    margin-bottom: 12px;
}
.auth-title { font-size: 22px; font-weight: 700; margin: 0; }
.auth-sub { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.auth-form input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    width: 100%;
}
.auth-form input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91,69,217,.12);
}
.auth-btn {
    background: linear-gradient(135deg, #5B45D9, #7B61FF);
    color: white; border: none; padding: 12px;
    border-radius: 8px; font-weight: 600; font-size: 14px;
    cursor: pointer; margin-top: 8px;
}
.auth-btn:hover { background: linear-gradient(135deg, #4338CA, #6D4FE6); }
.auth-error {
    background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B;
    padding: 10px 12px; border-radius: 8px; font-size: 13px;
}
.auth-hint { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 12px; }

/* ── Shell ─────────────────────────────────────────────────── */
body.with-shell { display: flex; min-height: 100vh; }
.vc-sidebar {
    width: 240px; flex-shrink: 0;
    background: #0F172A;
    color: #E2E8F0;
    display: flex; flex-direction: column;
    padding: 18px 0;
}
.vc-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 0 18px 18px;
    border-bottom: 1px solid #1E293B;
}
.vc-brand-mark {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, #5B45D9, #7B61FF);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: white; font-size: 14px;
}
.vc-brand-name { font-weight: 700; font-size: 14px; color: white; }
.vc-brand-sub { font-size: 11px; color: #94A3B8; }

.vc-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.vc-nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    color: #CBD5E1;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    margin-bottom: 2px;
}
.vc-nav-item:hover { background: #1E293B; color: white; text-decoration: none; }
.vc-nav-item.active { background: #5B45D9; color: white; }
.vc-nav-item.disabled { color: #64748B; cursor: not-allowed; }
.vc-nav-item.disabled:hover { background: transparent; color: #64748B; }
.vc-nav-item .ico { font-size: 16px; width: 20px; text-align: center; }
.vc-nav-section {
    font-size: 10px; color: #64748B;
    text-transform: uppercase; letter-spacing: .6px;
    padding: 16px 12px 6px; font-weight: 700;
}

.vc-user {
    padding: 14px 18px; border-top: 1px solid #1E293B;
    display: flex; flex-direction: column; gap: 4px;
}
.vc-user-name { font-size: 13px; font-weight: 600; color: white; }
.vc-logout { font-size: 12px; color: #94A3B8; }
.vc-logout:hover { color: white; }

.vc-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.vc-topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex; align-items: center; justify-content: space-between;
}
.vc-page-title { font-size: 19px; font-weight: 700; margin: 0; color: var(--text); }
.vc-content { padding: 24px 28px; flex: 1; }

.vc-toast { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; font-weight: 500; }
.vc-toast-ok { background: #DCFCE7; border: 1px solid #86EFAC; color: #15803D; }
.vc-toast-err { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-hdr { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.card-title { font-size: 14px; font-weight: 700; color: var(--text); }
.card-body { padding: 18px; }
.card-body.p0 { padding: 0; }

/* ── KPI tiles ─────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; box-shadow: var(--shadow);
}
.kpi-lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.kpi-val { font-size: 26px; font-weight: 700; margin-top: 4px; color: var(--text); }
.kpi-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.kpi.warn .kpi-val { color: var(--warn); }
.kpi.danger .kpi-val { color: var(--danger); }
.kpi.ok .kpi-val { color: var(--success); }

/* ── Tables ────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
table.tbl th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); font-weight: 700; background: var(--surface-alt); }
table.tbl tr:hover { background: var(--surface-alt); }
table.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.tag { display: inline-block; font-size: 10.5px; padding: 2px 7px; border-radius: 999px; background: #EDE9FE; color: #5B21B6; font-weight: 600; }
.tag-gold { background: #FEF3C7; color: #92400E; }
.tag-mfi { background: #DBEAFE; color: #1E40AF; }
.tag-both { background: #DCFCE7; color: #166534; }
.tag-inactive { background: #FEE2E2; color: #991B1B; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.form-group input, .form-group select, .form-group textarea {
    padding: 8px 11px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: white;
}
.form-group textarea { min-height: 70px; resize: vertical; }
.btn { padding: 9px 16px; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: white; }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; }

/* ── Filter row ─────────────────────────────────────────────── */
.filter-row { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.filter-row input, .filter-row select { padding: 8px 11px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }

/* ── New-module utilities ───────────────────────────────────── */
.vc-nav-sep { height: 1px; background: #1E293B; margin: 8px 10px; }
.vc-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.vc-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.vc-table th, .vc-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.vc-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); font-weight: 700; background: var(--surface-alt); }
.vc-table tr:hover { background: var(--surface-alt); }
.vc-table .total-row td { font-weight: 700; background: var(--surface-alt); }
.vc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.vc-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1rem; }
.vc-card-title { font-size: 15px; font-weight: 700; margin-bottom: .75rem; }
.vc-detail-grid { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }
.vc-detail-main { min-width: 0; }
.vc-detail-side { min-width: 0; }
@media (max-width: 900px) { .vc-detail-grid { grid-template-columns: 1fr; } }
.vc-form-wrap { max-width: 720px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 2px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.form-input { padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: white; width: 100%; }
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,69,217,.1); }
.field-error { color: var(--danger); font-size: 12px; }
.form-actions { display: flex; gap: 10px; margin-top: 1.5rem; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 500; padding-top: 20px; }
.vc-info-box { background: #EFF6FF; border: 1px solid #BFDBFE; border-radius: 6px; padding: 10px 14px; font-size: 13px; color: #1E40AF; margin: 1rem 0; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-secondary { background: var(--surface-alt); border-color: var(--border); color: var(--text); }
.btn-warn { background: #FEF3C7; border-color: #FDE68A; color: var(--warn); }
.btn-danger { background: #FEF2F2; border-color: #FECACA; color: var(--danger); }
.btn-block { display: block; width: 100%; text-align: center; margin-bottom: .5rem; }
.badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.badge-green  { background: #DCFCE7; color: #166534; }
.badge-red    { background: #FEE2E2; color: #991B1B; }
.badge-blue   { background: #DBEAFE; color: #1E40AF; }
.badge-gray   { background: #F1F5F9; color: #64748B; }
.badge-warn   { background: #FEF3C7; color: #92400E; }
.row-muted td { opacity: .55; }
.row-warn td { background: #FFFBEB !important; }
.row-done td { background: #F0FDF4 !important; }
.action-cell { white-space: nowrap; }
.text-muted  { color: var(--text-muted); }
.text-green  { color: var(--success); }
.text-red    { color: var(--danger); }
.text-orange { color: var(--warn); }
.text-center { text-align: center; }
.vc-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.vc-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.vc-stat-val { font-size: 24px; font-weight: 700; }
.vc-stat-lbl { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.vc-tab-bar { display: flex; gap: 4px; flex-wrap: wrap; }
.vc-tab { padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); border: 1px solid var(--border); background: var(--surface); }
.vc-tab:hover { background: var(--surface-alt); text-decoration: none; }
.vc-tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.progress-bar-wrap { background: #E2E8F0; border-radius: 999px; height: 6px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary), #7B61FF); border-radius: 999px; transition: width .3s; }
.detail-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1rem; }
.detail-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 700; margin-bottom: 2px; }
