/* ============================================================
   KasihKreasi — Soft Glassmorphism + Modern SaaS UI
   ============================================================ */

:root {
    --bg-1: #eef1fb;
    --bg-2: #f6f3ff;
    --bg-3: #e8f4fb;
    --ink: #1c2340;
    --ink-soft: #5a6180;
    --muted: #8b91ad;
    --line: rgba(28, 35, 64, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-bg-strong: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.65);
    --shadow: 0 10px 40px rgba(70, 80, 160, 0.10);
    --shadow-soft: 0 4px 20px rgba(70, 80, 160, 0.07);
    --primary: #5b6cff;
    --primary-2: #8b5cf6;
    --primary-grad: linear-gradient(135deg, #5b6cff, #8b5cf6);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;
    --radius: 18px;
    --radius-sm: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 15px; }

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(1200px 600px at 85% -10%, rgba(139, 92, 246, 0.18), transparent 60%),
        radial-gradient(1000px 700px at -10% 20%, rgba(91, 108, 255, 0.15), transparent 55%),
        radial-gradient(900px 500px at 60% 110%, rgba(14, 165, 233, 0.12), transparent 60%),
        linear-gradient(160deg, var(--bg-1), var(--bg-2) 50%, var(--bg-3));
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
.link:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.text-green { color: var(--success); }
.text-red { color: var(--danger); }
.text-orange { color: var(--warning); }
.r { text-align: right; }
.center { text-align: center; }

/* ============ GLASS ============ */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.glass-soft {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-sm);
}

/* ============ APP SHELL ============ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 268px;
    flex-shrink: 0;
    margin: 14px 0 14px 14px;
    padding: 18px 14px;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 14px;
    height: calc(100vh - 28px);
    background: rgba(255, 255, 255, 0.6);
    z-index: 50;
    overflow: hidden;
}

.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px 12px; border-bottom: 1px solid var(--line); flex-shrink: 0; }

.brand-switcher { padding: 10px 4px 2px; }
.switch-form select { font-size: 0.8rem; font-weight: 600; }
.brand-link { gap: 8px; padding: 7px 10px; font-size: 0.8rem; border-radius: 10px; }
.brand-link .muted { font-size: 0.58rem; margin-left: auto; }
.brand-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.brand-dot.dot-ads { background: #5b6cff; box-shadow: 0 0 0 3px rgba(91,108,255,0.18); }
.brand-dot.dot-organic { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,0.15); }
.nav-link.active .brand-dot.dot-ads { background: #fff; box-shadow: none; }
.nav-link.active .brand-dot.dot-organic { background: #fff; box-shadow: none; }

/* Brand list di sidebar: scroll sendiri, batasi tinggi */
.brand-list { max-height: 30vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(28,35,64,0.15) transparent; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.brand-list::-webkit-scrollbar { width: 4px; }
.brand-list::-webkit-scrollbar-thumb { background: rgba(28,35,64,0.15); border-radius: 99px; }
.sidebar-section { flex-shrink: 0; }

.brand-list-divider { height: 1px; background: var(--line); margin: 6px 8px; }
.all-brands-link { color: var(--muted); font-weight: 700; }
.all-brands-link svg { opacity: 0.7; }
.all-brands-link:hover { color: var(--primary); }
.all-brands-link.active { color: #fff; }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(28, 35, 64, 0.4); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
    width: 100%; max-width: 480px; padding: 22px;
    background: var(--glass-bg-strong);
}
.modal .card-head { margin-bottom: 8px; }

.brand-logo {
    width: 42px; height: 42px; border-radius: 13px;
    background: var(--primary-grad);
    color: #fff; font-weight: 800; font-size: 1.25rem;
    display: grid; place-items: center;
    box-shadow: 0 6px 18px rgba(91, 108, 255, 0.4);
}
.brand-logo.large { width: 56px; height: 56px; font-size: 1.6rem; border-radius: 17px; margin: 0 auto 6px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.05rem; }
.brand-text span { font-size: 0.75rem; color: var(--muted); }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; padding-top: 4px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(28,35,64,0.15) transparent; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(28,35,64,0.15); border-radius: 99px; }

.nav-label {
    font-size: 0.6rem; font-weight: 800; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--muted);
    padding: 12px 10px 4px;
    display: flex; align-items: center; gap: 8px;
}
.nav-label:not(:first-child)::before {
    content: ''; flex: 1; height: 1px; background: var(--line);
}
.nav-label:first-child { padding-top: 6px; }

.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: 11px;
    color: var(--ink-soft); font-weight: 600; font-size: 0.86rem;
    transition: all 0.18s ease; position: relative;
}
.nav-link svg { width: 18px; height: 18px; fill: currentColor; opacity: 0.85; flex-shrink: 0; }
.nav-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-link:hover { background: rgba(91, 108, 255, 0.08); color: var(--primary); }
.nav-link.active {
    background: var(--primary-grad); color: #fff;
    box-shadow: 0 8px 20px rgba(91, 108, 255, 0.35);
}
.nav-link.active svg { opacity: 1; }
.nav-link.active::before {
    content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
    width: 4px; height: 60%; border-radius: 0 4px 4px 0;
    background: var(--primary);
}

.nav-badge {
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
    background: rgba(255,255,255,0.85); color: var(--primary);
    font-size: 0.68rem; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
}
.nav-link.active .nav-badge { background: rgba(255,255,255,0.25); color: #fff; }

.sidebar-footer { padding-top: 14px; border-top: 1px solid var(--line); }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-sm); background: rgba(255,255,255,0.5); }
.user-chip .user-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.user-chip .user-meta strong { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-form { display: flex; }

.avatar {
    width: 38px; height: 38px; border-radius: 12px; color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: 0.95rem; flex-shrink: 0;
}
.avatar.lg { width: 52px; height: 52px; font-size: 1.2rem; border-radius: 16px; }

.avatar.bg-gray-800 { background: #334155; } .avatar.bg-blue-500 { background: #3b82f6; }
.avatar.bg-green-500 { background: #22c55e; } .avatar.bg-teal-500 { background: #14b8a6; }
.avatar.bg-amber-500 { background: #f59e0b; } .avatar.bg-rose-500 { background: #f43f5e; }
.avatar.bg-slate-900 { background: #0f172a; } .avatar.bg-indigo-500 { background: #6366f1; }
.avatar.bg-purple-500 { background: #a855f7; } .avatar.bg-cyan-500 { background: #06b6d4; }

/* ============ MAIN ============ */
.main { flex: 1; min-width: 0; padding: 12px 18px 30px; }

.topbar {
    display: flex; align-items: center; gap: 12px;
    padding: 4px 4px 14px;
}
.topbar-title h1 { font-size: 1.1rem; font-weight: 800; }
.topbar-title p { font-size: 0.74rem; color: var(--muted); text-transform: capitalize; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.menu-toggle { display: none; }

.content { display: flex; flex-direction: column; gap: 14px; }

/* ============ PAGE HEAD ============ */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.page-head h2 { font-size: 1.2rem; font-weight: 800; }
.page-head p { color: var(--ink-soft); font-size: 0.84rem; margin-top: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.back-link { font-size: 0.85rem; color: var(--muted); font-weight: 600; display: inline-block; margin-bottom: 6px; }
.back-link:hover { color: var(--primary); }

.btn-group { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline { display: inline; }

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; border-radius: 14px; border: none; cursor: pointer;
    font-family: inherit; font-size: 0.9rem; font-weight: 700;
    transition: all 0.18s ease; white-space: nowrap;
}
.btn-icon { width: 18px; height: 18px; fill: currentColor; }

.btn-primary {
    background: var(--primary-grad); color: #fff;
    box-shadow: 0 8px 22px rgba(91, 108, 255, 0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(91, 108, 255, 0.45); }

.btn-ghost {
    background: rgba(255, 255, 255, 0.6); color: var(--ink-soft);
    border: 1px solid var(--line);
}
.btn-ghost:hover { background: #fff; color: var(--primary); }

.btn-danger-ghost {
    background: rgba(239, 68, 68, 0.08); color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger-ghost:hover { background: rgba(239, 68, 68, 0.15); }

.btn-sm { padding: 7px 14px; font-size: 0.82rem; border-radius: 11px; }
.btn-block { width: 100%; }

.icon-btn {
    width: 36px; height: 36px; border-radius: 11px; border: none; cursor: pointer;
    background: rgba(255,255,255,0.6); display: inline-grid; place-items: center;
    color: var(--ink-soft); transition: all 0.15s ease;
}
.icon-btn svg { width: 19px; height: 19px; fill: currentColor; }
.icon-btn:hover { background: rgba(91, 108, 255, 0.12); color: var(--primary); }
.icon-btn.danger:hover { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.icon-btn.is-disabled { opacity: 0.35; cursor: not-allowed; }

.spinner {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid rgba(91,108,255,0.3); border-top-color: var(--primary);
    border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ BADGES ============ */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: 999px;
    font-size: 0.66rem; font-weight: 700; letter-spacing: 0.02em;
}
.badge-success { background: rgba(16, 185, 129, 0.14); color: #059669; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.badge-danger  { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.badge-info    { background: rgba(14, 165, 233, 0.13); color: #0284c7; }
.badge-primary { background: rgba(91, 108, 255, 0.13); color: #4f5bd9; }
.badge-dark    { background: rgba(15, 23, 42, 0.85); color: #fff; }
.badge-muted   { background: rgba(100, 110, 140, 0.12); color: var(--ink-soft); }
.badge-soft    { background: rgba(255,255,255,0.7); color: var(--ink-soft); border: 1px solid var(--line); }

/* ============ ALERTS ============ */
.alert {
    padding: 13px 18px; border-radius: var(--radius-sm);
    font-size: 0.88rem; font-weight: 600; margin-bottom: 2px;
    backdrop-filter: blur(12px);
}
.alert-success { background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16,185,129,0.3); color: #047857; }
.alert-danger  { background: rgba(239, 68, 68, 0.10); border: 1px solid rgba(239,68,68,0.3); color: #b91c1c; }

/* ============ STAT CARDS ============ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-grid-6 { grid-template-columns: repeat(6, 1fr); }
.stat-grid-4 { grid-template-columns: repeat(4, 1fr); }

.stat-card {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    border-radius: var(--radius);
}
.stat-card.mini { flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; }
.stat-card.mini .stat-label { font-size: 0.68rem; }
.stat-card.mini .stat-value { font-size: 1rem; }
.stat-card.mini small { color: var(--muted); font-size: 0.65rem; }

.stat-icon {
    width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
    display: grid; place-items: center;
}
.stat-icon svg { width: 20px; height: 20px; fill: currentColor; }
.tint-blue   { background: rgba(91, 108, 255, 0.13); color: #4f5bd9; }
.tint-purple { background: rgba(139, 92, 246, 0.13); color: #7c3aed; }
.tint-green  { background: rgba(16, 185, 129, 0.13); color: #059669; }
.tint-orange { background: rgba(245, 158, 11, 0.14); color: #d97706; }

.stat-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-label { font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.stat-info small { color: var(--muted); font-size: 0.7rem; }

/* ============ CARDS ============ */
.card { padding: 16px 18px; border-radius: var(--radius); }
.card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.card-head h3 { font-size: 0.92rem; font-weight: 800; }

.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; align-items: start; }
.grid-2.wide-left { grid-template-columns: 1fr 1fr; }

.legend-inline { display: flex; gap: 12px; font-size: 0.72rem; color: var(--ink-soft); font-weight: 600; }
.legend-inline span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-blue { background: #5b6cff; } .dot-purple { background: #8b5cf6; }
.dot-green { background: #10b981; } .dot-orange { background: #f59e0b; }

.chart-box { position: relative; }
.chart-box.tall { height: 260px; }

/* ============ TABLE ============ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.table-wrap.slim { max-height: 380px; overflow-y: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.table th {
    text-align: left; padding: 8px 10px; font-size: 0.68rem;
    text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted);
    border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.45); }
.table th.r, .table td.r { text-align: right; }

.cell-main { font-weight: 700; color: var(--ink); font-size: 0.84rem; }
.cell-sub { font-size: 0.7rem; color: var(--muted); margin-top: 1px; }

.actions { white-space: nowrap; }
.actions form { display: inline; }

.empty { text-align: center; color: var(--muted); padding: 30px 10px !important; font-size: 0.9rem; }
.empty.full { width: 100%; }

/* ============ FORMS ============ */
.form { display: flex; flex-direction: column; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 0.75rem; font-weight: 700; color: var(--ink-soft); }

.input {
    width: 100%; padding: 9px 12px; border-radius: 11px;
    border: 1px solid var(--line); background: rgba(255, 255, 255, 0.75);
    font-family: inherit; font-size: 0.86rem; color: var(--ink);
    transition: all 0.16s ease; outline: none;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(91, 108, 255, 0.14); background: #fff; }
.input-sm { padding: 6px 10px; font-size: 0.78rem; border-radius: 9px; }
.textarea { resize: vertical; line-height: 1.55; }

.input-wrap { position: relative; }
.input-wrap .input { padding-right: 44px; }
.input-toggle {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; border: none; background: transparent; cursor: pointer;
    color: var(--muted); display: grid; place-items: center; border-radius: 9px;
}
.input-toggle svg { width: 18px; height: 18px; fill: currentColor; }
.input-toggle:hover { background: rgba(91, 108, 255, 0.1); color: var(--primary); }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.span-2 { grid-column: span 2; }
.form-card.narrow { max-width: 640px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }

.check-row { display: flex; gap: 18px; padding-top: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; font-weight: 600; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }

.calc-hint {
    display: flex; gap: 22px; padding: 12px 16px; flex-wrap: wrap;
    font-size: 0.8rem; color: var(--ink-soft);
}
.calc-hint strong { color: var(--primary); font-size: 0.9rem; }

/* ============ FILTER ============ */
.filter-card { padding: 12px 14px; }
.filter-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-form .form-group { min-width: 160px; flex: 1; }
.date-range { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--muted); flex-wrap: wrap; }

/* ============ CONTENT ============ */
.scrap-toolbar {
    display: flex; flex-direction: column; gap: 12px;
    padding: 14px 16px; margin: 4px 0 16px; border-radius: var(--radius-sm);
}
.scrap-row { display: flex; flex-direction: column; gap: 4px; }
.scrap-input-group { display: flex; gap: 8px; }
.scrap-input-group .input { flex: 1; }
.scrap-input-group .btn { flex-shrink: 0; }
.btn-success { background: var(--success); color: #fff; }

.funnel { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 10px; }
.funnel-row { display: flex; align-items: center; gap: 12px; }
.funnel-label { width: 86px; font-size: 0.78rem; color: var(--ink-soft); font-weight: 600; flex-shrink: 0; }
.funnel-bar-wrap { flex: 1; display: flex; align-items: center; gap: 10px; }
.funnel-bar { height: 26px; border-radius: 8px; transition: width .3s ease; }
.funnel-value { font-size: 0.82rem; font-weight: 800; }

.platform-split { display: flex; flex-direction: column; gap: 14px; }
.platform-item { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,0.55); }

.platform-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.platform-card { padding: 16px; border-radius: var(--radius-sm); background: rgba(255,255,255,0.55); border: 1px solid var(--line); }
.platform-card.meta { border-top: 3px solid #5b6cff; }
.platform-card.tiktok { border-top: 3px solid #0f172a; }
.platform-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.platform-card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.platform-card-grid div { display: flex; flex-direction: column; gap: 1px; padding: 8px; border-radius: 8px; background: rgba(255,255,255,0.6); }
.platform-card-grid span { font-size: 0.62rem; color: var(--muted); font-weight: 600; }
.platform-card-grid strong { font-size: 0.82rem; }

.scrape-result { padding-top: 4px; }
.scrape-result .stat-card { padding: 10px 12px; }
.scrape-result .stat-value { font-size: 1rem; }

.scrap-result-cell { background: rgba(255,255,255,0.4); }
.scrap-results { display: flex; gap: 12px; flex-wrap: wrap; }
.scrap-result-card {
    flex: 1; min-width: 220px; padding: 12px 14px;
    border-radius: 12px; background: rgba(255,255,255,0.6); border: 1px solid var(--line);
}
.scrap-result-card.tiktok { border-top: 3px solid #0f172a; }
.scrap-result-card.instagram { border-top: 3px solid #5b6cff; }
.scrap-result-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.scrap-result-head strong { font-size: 0.88rem; }
.scrap-result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.scrap-result-grid div { display: flex; flex-direction: column; gap: 1px; padding: 6px; border-radius: 8px; background: rgba(255,255,255,0.7); }
.scrap-result-grid span { font-size: 0.6rem; color: var(--muted); font-weight: 600; }
.scrap-result-grid strong { font-size: 0.8rem; }

.status-list { display: flex; flex-direction: column; gap: 12px; }
.status-line { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; }
.howto { margin-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 0.85rem; color: var(--ink-soft); line-height: 1.5; }

.narasi-box {
    background: rgba(255, 255, 255, 0.55); border: 1px solid var(--line);
    border-radius: var(--radius-sm); padding: 18px;
    line-height: 1.7; font-size: 0.92rem; white-space: normal;
}
.link-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.link-item { display: flex; flex-direction: column; gap: 4px; font-size: 0.86rem; word-break: break-all; }
.link-item a { font-weight: 600; }

.content-status-grid { display: flex; flex-direction: column; gap: 14px; }
.status-row { display: flex; flex-direction: column; gap: 7px; }
.status-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; }
.status-meta strong { font-size: 0.95rem; }
.status-total {
    margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line);
    display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--muted);
}
.status-total strong { color: var(--ink); font-size: 0.95rem; }

.progress { height: 8px; border-radius: 99px; background: rgba(28, 35, 64, 0.07); overflow: hidden; }
.progress-bar { height: 100%; border-radius: 99px; }
.bar-success { background: var(--success); } .bar-info { background: var(--info); }
.bar-warning { background: var(--warning); } .bar-muted { background: #9aa1bd; }
.bar-primary { background: var(--primary-grad); }

/* ============ BRANDS ============ */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.brand-card { padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.brand-card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-card-head h3 { font-size: 0.86rem; font-weight: 800; line-height: 1.2; }
.brand-card-title { min-width: 0; }
.brand-card-tags { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.brand-avatar {
    width: 32px; height: 32px; border-radius: 10px;
    background: var(--primary-grad); color: #fff; font-weight: 800; font-size: 0.7rem;
    display: grid; place-items: center; flex-shrink: 0;
}
.brand-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.brand-card-stats div { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,0.55); }
.brand-card-stats span { font-size: 0.58rem; color: var(--muted); font-weight: 600; }
.brand-card-stats strong { font-size: 0.76rem; }
.brand-target { display: flex; flex-direction: column; gap: 4px; }
.brand-target .status-meta { font-size: 0.7rem; }
.brand-card-actions { display: flex; gap: 5px; flex-wrap: wrap; padding-top: 3px; border-top: 1px solid var(--line); }
.brand-card-actions .btn-sm { padding: 5px 10px; font-size: 0.72rem; border-radius: 9px; }

/* ============ USERS ============ */
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.user-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.user-card-head { display: flex; align-items: center; gap: 14px; }
.user-card-head h3 { font-size: 1rem; font-weight: 800; }
.user-card-head p { font-size: 0.8rem; }
.user-card-meta { display: flex; align-items: center; gap: 10px; }
.user-card-brands { display: flex; flex-direction: column; gap: 8px; }
.chip-wrap { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
    display: inline-flex; align-items: center; padding: 4px 10px;
    border-radius: 999px; background: rgba(91, 108, 255, 0.1);
    color: #4f5bd9; font-size: 0.72rem; font-weight: 700;
}
.user-card-actions { display: flex; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line); }

.assign-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.assign-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    border-radius: 12px; background: rgba(255,255,255,0.55); cursor: pointer;
    border: 1px solid var(--line); font-size: 0.86rem; font-weight: 600;
}
.assign-item:hover { border-color: var(--primary); }
.assign-item input { accent-color: var(--primary); width: 16px; height: 16px; }
.assign-item .chip { margin-left: 2px; }
.assign-item .badge { margin-left: auto; }

/* ============ AUTH ============ */
.auth-body { display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; overflow: hidden; }
.auth-bg { position: fixed; inset: 0; z-index: 0; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5; }
.blob-1 { width: 460px; height: 460px; background: #8b5cf6; top: -120px; right: -80px; }
.blob-2 { width: 400px; height: 400px; background: #5b6cff; bottom: -100px; left: -60px; }
.blob-3 { width: 300px; height: 300px; background: #0ea5e9; top: 40%; left: 30%; opacity: 0.3; }

.auth-wrap { position: relative; z-index: 1; width: 100%; max-width: 430px; }
.auth-card { padding: 34px 32px; display: flex; flex-direction: column; gap: 20px; background: var(--glass-bg-strong); }
.auth-head { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.auth-head h1 { font-size: 1.4rem; font-weight: 800; }
.auth-head p { color: var(--muted); font-size: 0.85rem; }
.auth-hint { text-align: center; font-size: 0.75rem; color: var(--muted); }

.error-code { font-size: 4.5rem; font-weight: 800; background: var(--primary-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1200px) {
    .stat-grid-6 { grid-template-columns: repeat(3, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed; left: 14px; top: 14px; bottom: 14px;
        transform: translateX(-130%); transition: transform 0.25s ease;
    }
    .sidebar.open { transform: translateX(0); }
    .menu-toggle { display: inline-grid; }
    .stat-grid, .stat-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .form-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .stat-grid, .stat-grid-6, .stat-grid-4, .form-grid-2, .form-grid-3, .link-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
    .main { padding: 12px 14px 30px; }
    .page-head { flex-direction: column; }
}
