:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e5e7eb;
    --primary: #6d43ff;
    --primary2: #2563eb;
    --green: #16a34a;
    --orange: #f97316;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow: 0 18px 45px rgba(15, 23, 42, .07);
    --radius: 24px;
}

* { box-sizing: border-box; }
html, body {
    margin: 0;
    min-height: 100%;
    font-family: 'Noto Sans Thai', 'Inter', 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a, select, input { pointer-events: auto; }

/* Layout: no Mud drawer, no overlay, no circuit click required */
.ads-app-shell { min-height: 100vh; background: var(--bg); }
.ads-topbar-native {
    position: fixed;
    inset: 0 0 auto 0;
    height: 72px;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 24px;
    background: rgba(255,255,255,.97);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 30px rgba(15,23,42,.04);
}
.ads-sidebar-native {
    position: fixed;
    left: 0;
    top: 72px;
    bottom: 0;
    width: 290px;
    z-index: 20;
    background: #fff;
    border-right: 1px solid var(--border);
    overflow-y: auto;
}
.ads-main-native {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 96px 24px 32px 314px;
    background: var(--bg);
}
.topbar-spacer { flex: 1; }
.mobile-home-link {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 24px;
    font-weight: 900;
}
.brand-box { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-link { text-decoration: none; }
.brand-logo {
    width: 48px; height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white; display: grid; place-items: center;
    font-weight: 900; letter-spacing: .02em;
    flex: 0 0 auto;
}
.brand-box b { display: block; font-size: 17px; line-height: 1.1; }
.brand-box small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.top-user-chip {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-width: 72px; height: 48px; padding: 6px 12px;
    border: 1px solid var(--border); border-radius: 18px; background: #fff;
}
.top-user-chip b { line-height: 1; }
.top-user-chip small { color: var(--muted); margin-top: 4px; font-size: 12px; }
.drawer-head { display: none; }
.native-nav { padding: 18px; display: grid; gap: 8px; }
.native-nav .menu-title { font-size: 12px; color: #94a3b8; letter-spacing: .12em; font-weight: 800; padding: 6px 10px; }
.native-nav a {
    display: flex; align-items: center; gap: 10px;
    min-height: 46px; padding: 12px 14px;
    border-radius: 16px;
    color: #334155;
    font-weight: 750;
}
.native-nav a:hover { background: #eef2ff; color: var(--primary2); }
.native-nav hr { width: 100%; border: 0; border-top: 1px solid var(--border); margin: 10px 0; }

/* Common */
.page-wrap { width: 100%; max-width: 1600px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.page-title { margin: 0; font-size: clamp(28px, 3.2vw, 44px); line-height: 1.1; font-weight: 900; letter-spacing: -.035em; }
.page-subtitle, .muted { color: var(--muted); margin: 6px 0 0; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.native-panel {
    background: rgba(255,255,255,.98);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.native-panel h2 { margin: 0 0 12px; font-size: 22px; }
.mt-3 { margin-top: 18px !important; }
.mt-4 { margin-top: 24px !important; }
.mb-3 { margin-bottom: 18px !important; }
.soft-line { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.loading-line { padding: 18px 20px; border-radius: 16px; background: #eef2ff; color: var(--primary2); font-weight: 800; }
.card-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.card-head h2 { margin-bottom: 4px; }

/* Buttons & forms */
.native-btn, .login-native-button-v2 {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    font-weight: 850;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.native-btn:hover, .login-native-button-v2:hover { transform: translateY(-1px); }
.native-btn-primary, .login-native-button-v2 {
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #8b35ff);
    box-shadow: 0 12px 24px rgba(99, 102, 241, .28);
}
.native-btn-outline { background: #fff; color: #0f172a; border-color: #cbd5e1; }
.native-btn-light { background: #eef2ff; color: #3730a3; border-color: #dbe4ff; }
.native-btn.full { width: 100%; }
.logout-btn { min-width: 104px; }
.native-label { display: block; margin: 14px 0 7px; color: #334155; font-weight: 800; }
.native-input, .native-select {
    width: 100%; min-height: 48px;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    outline: none;
    box-shadow: none;
}
.native-input:focus, .native-select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(109,67,255,.12); }
.native-select { appearance: auto; cursor: pointer; }
.native-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 750; color: #334155; }
.native-check input { width: 18px; height: 18px; accent-color: var(--primary); }
.native-form { display: grid; gap: 2px; }
.native-grid-form { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto auto; align-items: end; gap: 14px; }
.native-user-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.native-check-form { min-height: 48px; align-self: end; }
.form-actions-row, .native-form-actions, .tenant-actions, .api-setting-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.native-form-actions { align-self: end; }
.inline-form { display: inline; margin: 0; }
.link-danger { border: 0; background: transparent; color: var(--danger); cursor: pointer; padding: 0; font-weight: 800; }
.table-link { color: #2563eb; font-weight: 850; }
.native-actions-inline { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* alerts & chips */
.native-alert { padding: 14px 16px; border-radius: 16px; margin: 0 0 18px; border: 1px solid transparent; font-weight: 750; }
.native-alert-success { background: #ecfdf5; color: #047857; border-color: #bbf7d0; }
.native-alert-error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.native-alert-info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.native-alert-warn { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.native-chip {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 28px; padding: 5px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 850; white-space: nowrap;
}
.native-chip.ok { background: #dcfce7; color: #15803d; }
.native-chip.warn { background: #fef3c7; color: #b45309; }
.native-chip.off { background: #f1f5f9; color: #64748b; }
.native-chip.fb-chip { background: #dbeafe; color: #1d4ed8; }

/* Login */
.login-shell { min-height: 100vh; }
.auth-page-v2 {
    min-height: 100vh;
    display: grid; place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 15% 15%, rgba(109,67,255,.20), transparent 32%),
        radial-gradient(circle at 85% 82%, rgba(236,72,153,.16), transparent 30%),
        linear-gradient(135deg, #f8fafc, #eef2ff);
}
.auth-card-v2 {
    width: min(1100px, 100%);
    display: grid; grid-template-columns: 1.05fr .95fr;
    border-radius: 32px;
    overflow: hidden;
    background: rgba(255,255,255,.95);
    border: 1px solid rgba(226,232,240,.9);
    box-shadow: 0 28px 80px rgba(15,23,42,.14);
}
.auth-left-v2 {
    padding: 48px;
    background:
        linear-gradient(135deg, rgba(79,70,229,.94), rgba(139,53,255,.88)),
        radial-gradient(circle at 20% 20%, rgba(255,255,255,.35), transparent 28%);
    color: #fff;
}
.auth-left-v2 .brand-box small { color: rgba(255,255,255,.78); }
.auth-left-v2 .brand-logo { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.24); }
.auth-left-v2 h1 { margin: 54px 0 14px; font-size: clamp(36px, 5vw, 58px); line-height: 1.05; letter-spacing: -.05em; }
.auth-left-v2 p { color: rgba(255,255,255,.84); font-size: 18px; line-height: 1.7; max-width: 560px; }
.feature-list-v2 { display: grid; gap: 12px; margin-top: 30px; }
.feature-list-v2 span { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); border-radius: 16px; padding: 12px 14px; font-weight: 800; }
.auth-right-v2 { padding: 48px; display: flex; flex-direction: column; justify-content: center; }
.auth-right-v2 h2 { margin: 0; font-size: 34px; letter-spacing: -.03em; }
.login-form-v2 { margin-top: 22px; }
.login-options-v2 { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0; }
.login-options-v2 a { color: var(--primary); font-weight: 800; }
.login-native-button-v2 { width: 100%; min-height: 56px; font-size: 18px; margin-top: 6px; border: 0; }
.demo-text-v2 { color: var(--muted); text-align: center; margin-top: 20px; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.kpi-card { display: flex; justify-content: space-between; align-items: center; min-height: 138px; }
.kpi-card span { color: #ff3c77; font-weight: 800; }
.kpi-card h2 { margin: 10px 0 4px; font-size: 30px; line-height: 1; }
.kpi-card b { color: var(--green); font-size: 14px; }
.kpi-icon { width: 62px; height: 62px; border-radius: 20px; color: #fff; display: grid; place-items: center; font-style: normal; font-weight: 900; }
.kpi-icon.blue { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.kpi-icon.green { background: linear-gradient(135deg, #16a34a, #86efac); }
.kpi-icon.orange { background: linear-gradient(135deg, #f97316, #fdba74); }
.kpi-icon.purple { background: linear-gradient(135deg, #7c3aed, #c084fc); }

/* Tables */
.native-table-wrap, .campaign-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.native-table, .campaign-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.native-table th, .native-table td, .campaign-table th, .campaign-table td {
    padding: 14px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle;
}
.native-table th, .campaign-table th { color: #475569; font-size: 13px; font-weight: 900; background: #f8fafc; }
.native-table tr:hover td, .campaign-table tr:hover td { background: #fafafa; }
.selected-row td { background: #eef2ff !important; }

/* Tenant */
.tenant-grid { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0,1fr); gap: 18px; align-items: start; }
.tenant-main-col { min-width: 0; }
.brand-access-box { grid-column: 1 / -1; background: #f8fafc; border: 1px solid var(--border); border-radius: 18px; padding: 14px; }
.brand-access-list { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.two-col-grid { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(320px,.75fr); gap: 18px; align-items: start; }
.api-setting-head, .connection-row, .api-left, .platform-summary > div { display: flex; align-items: center; gap: 12px; }
.api-logo, .api-dot { width: 44px; height: 44px; border-radius: 16px; color: white; display: grid; place-items: center; font-weight: 900; }
.api-logo.fb, .api-dot.fb { background: #1877f2; }
.connection-row { justify-content: space-between; padding: 14px 0; }
.api-left small { display: block; color: var(--muted); margin-top: 4px; }

/* Customer dashboard */
.brand-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.brand-tile { display: grid; gap: 18px; }
.brand-tile-top { display: flex; gap: 14px; align-items: flex-start; }
.brand-tile-icon { width: 64px; height: 64px; border-radius: 22px; background: linear-gradient(135deg, #4f46e5, #8b35ff); color: white; display: grid; place-items: center; font-weight: 900; font-size: 20px; flex: 0 0 auto; }
.brand-tile h2 { margin-bottom: 4px; }

/* Facebook page */
.fb-actions { align-items: stretch; }
.fb-native-filter-form {
    display: grid;
    grid-template-columns: minmax(180px, 260px) auto auto;
    gap: 10px;
    align-items: end;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 10px;
}
.fb-date-native-label { grid-column: 1 / -1; color: var(--primary); font-size: 13px; font-weight: 850; margin-left: 8px; margin-bottom: -5px; }
.fb-date-native-select { min-height: 48px; border-radius: 14px; border: 1px solid #cbd5e1; padding: 10px 14px; background: #fff; }
.fb-main-grid { display: grid; grid-template-columns: minmax(0,2fr) minmax(320px,1fr); gap: 18px; align-items: start; }
.chart-card { min-height: 360px; }
.graph-legend { display: flex; gap: 18px; justify-content: flex-end; margin-bottom: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.graph-legend span { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.spend { background: #1877f2; }
.dot.clicks { background: #22c55e; }
.dot.leads { background: #f97316; }
.dot.ctr { background: #a855f7; }
.line-chart { height: 310px; border-radius: 24px; background: radial-gradient(circle at 20% 20%, rgba(24,119,242,.12), transparent 28%), linear-gradient(180deg, #f8fbff, #f1f5ff); padding: 14px; overflow: hidden; }
.line-chart svg { width: 100%; height: 100%; }
.grid-line { stroke: rgba(148,163,184,.35); stroke-width: 1; }
.area-path { fill: url(#fbArea) !important; }
.spend-line, .click-line, .lead-line, .ctr-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.spend-line { stroke: #1877f2; stroke-width: 5; }
.click-line { stroke: #22c55e; stroke-width: 4; }
.lead-line { stroke: #f97316; stroke-width: 4; }
.ctr-line { stroke: #a855f7; stroke-width: 4; stroke-dasharray: 8 8; }
.point { stroke: #fff; stroke-width: 3; }
.spend-point { fill: #1877f2; } .click-point { fill: #22c55e; } .lead-point { fill: #f97316; } .ctr-point { fill: #a855f7; }
.x-axis { display: grid; grid-template-columns: repeat(7, 1fr); margin-top: 12px; padding: 0 10px; color: var(--muted); font-size: 13px; text-align: center; }
.mini-metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini-metric { background: #f8fafc; border: 1px solid var(--border); border-radius: 16px; padding: 14px; display: grid; gap: 6px; }
.mini-metric small { color: var(--muted); }
.mini-metric b { font-size: 20px; }
.platform-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.platform-summary small { display: block; color: var(--muted); }
.campaign-card { margin-top: 18px; }
.campaign-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.campaign-icon { width: 58px; height: 58px; border-radius: 18px; background: linear-gradient(135deg, #dbeafe, #eef2ff); color: #2563eb; display: grid; place-items: center; font-weight: 900; }
.campaign-kpi-row { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.mini-kpi { border-radius: 18px; padding: 16px; display: grid; gap: 8px; background: #f8fafc; border: 1px solid var(--border); }
.mini-kpi span { color: var(--muted); font-size: 13px; font-weight: 800; }
.mini-kpi b { font-size: 20px; }
.mini-kpi small { color: var(--muted); }
.mini-kpi.blue { border-color: #bfdbfe; background: #eff6ff; }
.mini-kpi.purple { border-color: #ddd6fe; background: #f5f3ff; }
.mini-kpi.green { border-color: #bbf7d0; background: #f0fdf4; }
.mini-kpi.orange { border-color: #fed7aa; background: #fff7ed; }
.mini-kpi.cyan { border-color: #a5f3fc; background: #ecfeff; }
.mini-kpi.pink { border-color: #fbcfe8; background: #fdf2f8; }
.platform-cell, .ad-name-cell { display: flex; align-items: center; gap: 10px; }
.fb-circle { width: 30px; height: 30px; border-radius: 50%; background: #1877f2; color: #fff; display: grid; place-items: center; font-weight: 900; }
.tag { display: inline-flex; margin-top: 6px; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 850; }
.tag-blue { background: #dbeafe; color: #1d4ed8; }
.status { display: inline-flex; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 850; background: #f1f5f9; color: #475569; }
.status.good, .status.active, .status.success { background: #dcfce7; color: #15803d; }
.status.medium, .status.warning { background: #fef3c7; color: #b45309; }
.status.bad, .status.danger { background: #fee2e2; color: #b91c1c; }
.campaign-note { margin-top: 14px; color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.empty-ads-link { display: flex; gap: 14px; align-items: center; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 18px; padding: 20px; }
.empty-ads-link span { display: block; color: var(--muted); margin-top: 4px; }
.ad-thumb, .ad-thumb-placeholder { width: 54px; height: 54px; border-radius: 16px; object-fit: cover; flex: 0 0 auto; }
.ad-thumb-placeholder { display: grid; place-items: center; background: #eef2ff; color: #4f46e5; font-weight: 900; }
.ad-title-wrap { display: grid; gap: 3px; }
.ad-title-wrap small { color: var(--muted); }
.ad-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ad-link-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 850; }
.ad-link-btn.manager { background: #dbeafe; color: #1d4ed8; }
.ad-link-btn.content { background: #dcfce7; color: #15803d; }
.ad-link-btn.disabled { background: #f1f5f9; color: #94a3b8; }

/* Mobile responsive */
@media (max-width: 1180px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .campaign-kpi-row { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .brand-card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .two-col-grid, .fb-main-grid, .tenant-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .ads-topbar-native { height: 64px; padding: 0 12px; gap: 10px; }
    .mobile-home-link { display: inline-flex; }
    .ads-sidebar-native {
        position: sticky; top: 64px; left: 0; right: 0; bottom: auto;
        width: 100%; z-index: 10; border-right: 0; border-bottom: 1px solid var(--border);
        overflow-x: auto; overflow-y: hidden;
    }
    .native-nav { display: flex; align-items: center; gap: 8px; padding: 8px 12px; white-space: nowrap; }
    .native-nav .menu-title, .native-nav hr { display: none; }
    .native-nav a { min-height: 40px; padding: 9px 12px; background: #fff; border: 1px solid var(--border); }
    .ads-main-native { padding: 144px 12px 22px; }
    .brand-box small { display: none; }
    .brand-logo { width: 40px; height: 40px; border-radius: 14px; }
    .top-user-chip { min-width: auto; padding: 4px 9px; height: 42px; }
    .logout-btn { min-width: 76px; padding-left: 10px; padding-right: 10px; }
    .page-head { flex-direction: column; align-items: stretch; }
    .head-actions, .fb-actions { width: 100%; justify-content: stretch; }
    .head-actions .native-btn { flex: 1 1 auto; }
    .native-panel { padding: 18px; border-radius: 20px; }
    .kpi-grid, .brand-card-grid { grid-template-columns: 1fr; }
    .kpi-card { min-height: 110px; }
    .auth-page-v2 { padding: 14px; place-items: start center; }
    .auth-card-v2 { grid-template-columns: 1fr; border-radius: 24px; }
    .auth-left-v2 { padding: 28px; }
    .auth-left-v2 h1 { margin-top: 30px; }
    .auth-right-v2 { padding: 28px; }
    .login-options-v2 { align-items: flex-start; flex-direction: column; }
    .tenant-grid, .two-col-grid, .fb-main-grid { gap: 14px; }
    .native-grid-form, .native-user-form { grid-template-columns: 1fr; }
    .native-form-actions, .form-actions-row { display: grid; grid-template-columns: 1fr; }
    .native-btn, .login-native-button-v2 { width: 100%; }
    .fb-native-filter-form { width: 100%; grid-template-columns: 1fr; }
    .fb-date-native-label { grid-column: auto; margin: 0; }
    .fb-date-native-select { width: 100%; }
    .campaign-kpi-row { grid-template-columns: 1fr; }
    .mini-metric-grid { grid-template-columns: 1fr; }
    .platform-summary { align-items: flex-start; flex-direction: column; }
    .campaign-head { align-items: flex-start; }
    .line-chart { height: 240px; }
    .x-axis { font-size: 11px; }
    .campaign-table { min-width: 900px; }

    .responsive-cards-table .native-table { min-width: 0; }
    .responsive-cards-table .native-table thead { display: none; }
    .responsive-cards-table .native-table, .responsive-cards-table .native-table tbody, .responsive-cards-table .native-table tr, .responsive-cards-table .native-table td { display: block; width: 100%; }
    .responsive-cards-table .native-table tr { border: 1px solid var(--border); border-radius: 18px; padding: 12px; margin-bottom: 12px; background: #fff; }
    .responsive-cards-table .native-table td { border: 0; padding: 8px 0; }
    .responsive-cards-table .native-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; font-weight: 850; margin-bottom: 4px; }
    .native-actions-inline { gap: 10px; }
}
@media (max-width: 430px) {
    .ads-main-native { padding-top: 142px; }
    .page-title { font-size: 28px; }
    .brand-box b { font-size: 14px; }
    .top-user-chip small { display: none; }
    .logout-btn { font-size: 13px; }
}

/* =========================
   V12 Easy UX overrides
   ========================= */
.eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 900;
    font-size: 12px;
    letter-spacing: .04em;
}
.compact-head { margin-bottom: 14px; }
.admin-stat-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.stat-pill {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 10px 28px rgba(15,23,42,.05);
}
.stat-pill b { display: block; font-size: 26px; line-height: 1; }
.stat-pill span { color: var(--muted); font-weight: 800; font-size: 13px; }
.easy-admin-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.client-picker-panel { padding: 18px; position: sticky; top: 92px; }
.section-title-row { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-title-row h2 { margin: 0; }
.mini-add-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 900;
    text-decoration: none;
}
.client-card-list { display: grid; gap: 10px; max-height: calc(100vh - 260px); overflow: auto; padding-right: 2px; }
.client-pick-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: #fff;
    text-decoration: none;
    color: var(--text);
}
.client-pick-card:hover,
.client-pick-card.active {
    border-color: #a78bfa;
    background: linear-gradient(135deg, #f5f3ff, #fff);
    box-shadow: 0 12px 26px rgba(79,70,229,.10);
}
.client-avatar,
.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    background: linear-gradient(135deg, #4f46e5, #8b35ff);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 900;
}
.client-pick-main { min-width: 0; }
.client-pick-main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-pick-main span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.client-work-panel { min-width: 0; display: grid; gap: 16px; }
.selected-client-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px;
}
.selected-client-banner h2 { margin: 8px 0 0; font-size: clamp(24px, 3vw, 36px); }
.quick-tabs {
    display: inline-flex;
    gap: 6px;
    padding: 6px;
    border-radius: 18px;
    background: #f1f5f9;
    border: 1px solid var(--border);
}
.quick-tabs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 14px;
    text-decoration: none;
    color: #475569;
    font-weight: 900;
    white-space: nowrap;
}
.quick-tabs a.active {
    background: #fff;
    color: #4f46e5;
    box-shadow: 0 8px 18px rgba(15,23,42,.08);
}
.easy-section { padding: 22px; }
.easy-section-head { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.easy-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}
.easy-form.two-fields { grid-template-columns: minmax(0, 1fr) minmax(220px, 280px); }
.brand-easy-form { grid-template-columns: minmax(0, 1fr) minmax(220px, 320px) minmax(180px, 220px); }
.user-easy-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full-row { grid-column: 1 / -1; }
.big-input { min-height: 54px; border-radius: 16px; font-size: 16px; }
.toggle-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: #334155;
    font-weight: 850;
}
.toggle-card input { width: 20px; height: 20px; accent-color: var(--primary); }
.simple-card-list,
.brand-manage-grid,
.user-card-grid { display: grid; gap: 12px; }
.simple-row-card,
.manage-brand-card,
.user-manage-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    padding: 14px;
    box-shadow: 0 10px 24px rgba(15,23,42,.04);
}
.simple-row-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.simple-row-card.selected { border-color: #a78bfa; background: #f5f3ff; }
.simple-row-card b,
.manage-brand-card b,
.user-manage-card b { display: block; font-size: 17px; }
.simple-row-card span,
.manage-brand-card span,
.user-main span,
.user-main small { color: var(--muted); font-size: 13px; }
.row-actions,
.brand-card-actions,
.user-card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.danger-soft {
    background: #fff1f2;
    color: #e11d48;
    border-color: #fecdd3;
}
.brand-manage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.manage-brand-card { display: grid; gap: 14px; }
.brand-card-top { display: flex; align-items: center; gap: 12px; }
.brand-tile-icon.small { width: 46px; height: 46px; border-radius: 16px; font-size: 15px; }
.brand-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #f8fafc; }
.api-status-text { color: #475569; font-weight: 800; font-size: 13px; }
.big-check-list { gap: 10px; }
.access-check {
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}
.empty-state {
    padding: 18px;
    border-radius: 18px;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    color: #64748b;
    font-weight: 800;
}
.user-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.user-manage-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}
.user-main { min-width: 0; }
.user-main b,
.user-main span,
.user-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-main small { display: block; margin-top: 4px; }

/* Easier Facebook filter: no dropdown dependency */
.date-pill-filter {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    padding: 8px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: #fff;
}
.date-pill-filter span {
    padding: 0 8px;
    color: #64748b;
    font-size: 13px;
    font-weight: 900;
}
.date-pill-filter a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 13px;
    background: #f8fafc;
    color: #334155;
    font-weight: 900;
    text-decoration: none;
    border: 1px solid transparent;
}
.date-pill-filter a.active {
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #8b35ff);
    box-shadow: 0 8px 18px rgba(79,70,229,.22);
}
.date-pill-filter a.sync-pill {
    background: #ecfdf5;
    color: #047857;
    border-color: #bbf7d0;
}

/* Cleaner login */
.login-clean-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
    background:
        radial-gradient(circle at 12% 20%, rgba(109,67,255,.20), transparent 30%),
        radial-gradient(circle at 88% 82%, rgba(14,165,233,.16), transparent 32%),
        linear-gradient(135deg, #f8fafc, #eef2ff);
}
.login-clean-card {
    width: min(480px, 100%);
    padding: 34px;
    border-radius: 30px;
    border: 1px solid rgba(226,232,240,.92);
    background: rgba(255,255,255,.96);
    box-shadow: 0 28px 75px rgba(15,23,42,.14);
}
.login-clean-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}
.brand-logo.big { width: 58px; height: 58px; border-radius: 20px; font-size: 18px; }
.login-clean-brand b { display: block; font-size: 20px; }
.login-clean-brand span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.login-clean-card h1 { margin: 0; font-size: 36px; letter-spacing: -.04em; }
.login-clean-form { margin-top: 20px; }
.login-input { min-height: 56px; border-radius: 17px; font-size: 16px; }
.login-clean-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 18px; color: var(--muted); font-size: 13px; }
.login-clean-btn {
    width: 100%;
    min-height: 58px;
    border: 0;
    border-radius: 18px;
    color: #fff;
    font-size: 18px;
    font-weight: 950;
    cursor: pointer;
    background: linear-gradient(135deg, #4f46e5, #8b35ff);
    box-shadow: 0 18px 34px rgba(79,70,229,.28);
}
.login-demo-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 18px;
}
.login-demo-box > div {
    border: 1px solid var(--border);
    background: #f8fafc;
    border-radius: 16px;
    padding: 12px;
}
.login-demo-box b,
.login-demo-box span { display: block; }
.login-demo-box span { color: #64748b; font-size: 13px; margin-top: 3px; }

@media (max-width: 1180px) {
    .admin-stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .easy-admin-layout { grid-template-columns: 1fr; }
    .client-picker-panel { position: static; }
    .client-card-list { max-height: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .brand-manage-grid,
    .user-card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .admin-stat-row { grid-template-columns: 1fr 1fr; }
    .selected-client-banner { display: grid; }
    .quick-tabs { width: 100%; overflow-x: auto; justify-content: flex-start; }
    .client-card-list { grid-template-columns: 1fr; }
    .easy-form,
    .easy-form.two-fields,
    .brand-easy-form,
    .user-easy-form { grid-template-columns: 1fr; }
    .simple-row-card,
    .user-manage-card { display: grid; grid-template-columns: 1fr; }
    .row-actions,
    .brand-card-actions,
    .user-card-actions { justify-content: stretch; display: grid; grid-template-columns: 1fr; }
    .row-actions .native-btn,
    .brand-card-actions .native-btn,
    .user-card-actions .native-btn { width: 100%; }
    .date-pill-filter { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
    .date-pill-filter a { white-space: nowrap; }
    .login-clean-card { padding: 24px; border-radius: 24px; }
    .login-demo-box { grid-template-columns: 1fr; }
}
@media (max-width: 430px) {
    .admin-stat-row { grid-template-columns: 1fr; }
    .client-pick-card { grid-template-columns: 40px minmax(0,1fr); }
    .client-pick-card .native-chip { grid-column: 2; width: fit-content; }
}

/* ===== Brand -> User admin simplification + platform launcher ===== */
.brand-user-admin-page .page-subtitle,
.dashboard-platform-page .page-subtitle {
    max-width: 760px;
}

.brand-user-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    margin-top: 18px;
}

.brand-list-panel {
    position: sticky;
    top: 18px;
}

.brand-side-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.brand-side-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    text-decoration: none;
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, .08);
    background: #fff;
    transition: .18s ease;
}

.brand-side-item:hover,
.brand-side-item.active {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, .30);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
}

.brand-side-item.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, .10), rgba(14, 165, 233, .08));
}

.brand-side-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #2563eb;
    color: #fff;
    font-weight: 800;
    flex: 0 0 auto;
}

.brand-side-item b,
.brand-side-item span {
    display: block;
}

.brand-side-item span {
    color: #64748b;
    font-size: 12px;
    margin-top: 2px;
}

.brand-user-main {
    min-width: 0;
}

.brand-tabs {
    margin-bottom: 14px;
}

.brand-form-grid,
.user-easy-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.full-row {
    grid-column: 1 / -1;
}

.selected-brand-box {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, .08);
}

.brand-manage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.brand-manage-card {
    padding: 16px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 18px;
    background: #fff;
}

.brand-card-head-mini {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.brand-card-head-mini h3 {
    margin: 0 0 4px;
    font-size: 18px;
}

.brand-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.link-danger-button {
    border: 0;
    background: transparent;
    color: #dc2626;
    cursor: pointer;
    font-weight: 700;
    padding: 0;
}

.empty-state-mini {
    padding: 14px;
    border-radius: 14px;
    background: #f8fafc;
    color: #64748b;
    border: 1px dashed rgba(15, 23, 42, .18);
}

.platform-brand-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.platform-brand-tile {
    overflow: hidden;
}

.platform-launcher {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.platform-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 16px;
    text-decoration: none;
    border: 1px solid rgba(15, 23, 42, .08);
    background: #fff;
    color: #111827;
    transition: .18s ease;
}

.platform-card.active:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .10);
}

.platform-card.disabled {
    opacity: .55;
    cursor: not-allowed;
    user-select: none;
    background: #f8fafc;
}

.platform-icon {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: white;
    flex: 0 0 auto;
}

.platform-card.fb .platform-icon { background: #1877f2; }
.platform-card.tiktok .platform-icon { background: #111827; }
.platform-card.youtube .platform-icon { background: #ff0033; }

.platform-card b {
    display: block;
    font-size: 14px;
}

.platform-card span {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.native-nav .nav-disabled {
    display: block;
    padding: 10px 12px;
    color: #94a3b8;
    cursor: not-allowed;
    opacity: .75;
}

@media (max-width: 900px) {
    .brand-user-layout {
        grid-template-columns: 1fr;
    }

    .brand-list-panel {
        position: static;
    }

    .brand-form-grid,
    .user-easy-form {
        grid-template-columns: 1fr;
    }

    .selected-brand-box {
        display: block;
    }

    .brand-card-actions .native-btn,
    .brand-card-actions form,
    .brand-card-actions button {
        width: 100%;
    }
}

/* =========================================================
   Clean Admin User Page - แบบที่ 1 ตามรูปอ้างอิง
   ========================================================= */
.admin-clean-shell {
    min-height: 100vh;
    background: #ffffff;
    color: #0f172a;
}

.admin-clean-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 254px;
    z-index: 50;
    background: rgba(255, 255, 255, .96);
    border-right: 1px solid #e5eaf2;
    box-shadow: 12px 0 34px rgba(15, 23, 42, .035);
}

.admin-clean-main {
    min-height: 100vh;
    margin-left: 254px;
    padding: 22px 28px 28px;
    background: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, .035), transparent 34%), #ffffff;
}

.clean-side-nav {
    min-height: 100%;
    padding: 31px 20px 24px;
    display: flex;
    flex-direction: column;
}

.clean-logo {
    width: 44px;
    height: 44px;
    margin: 0 0 58px 4px;
    display: grid;
    place-items: center;
    color: #0b69ff;
    font-size: 35px;
    line-height: 1;
    font-weight: 1000;
    letter-spacing: -.08em;
    text-decoration: none;
}

.clean-nav-links {
    display: grid;
    gap: 10px;
}

.clean-nav-item {
    min-height: 52px;
    padding: 12px 13px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 13px;
    color: #253247;
    font-weight: 650;
    text-decoration: none;
    transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.clean-nav-item:hover {
    background: #eef5ff;
    color: #075eea;
}

.clean-nav-item.active {
    background: linear-gradient(90deg, #eaf3ff, #e5f0ff);
    color: #0064ff;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .05);
}

.clean-nav-item.disabled {
    opacity: .55;
    cursor: not-allowed;
}

.clean-nav-item.logout {
    margin-top: auto;
    border-top: 1px solid #e5eaf2;
    border-radius: 0;
    padding-top: 28px;
    color: #253247;
}

.nav-ico {
    width: 24px;
    min-width: 24px;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 21px;
    line-height: 1;
}

.clean-admin-page {
    width: 100%;
    max-width: 1138px;
    margin: 0 auto;
}

.clean-user-card {
    min-height: calc(100vh - 44px);
    padding: 43px 38px 34px;
    border: 1px solid #dde6f2;
    border-radius: 22px;
    background: rgba(255,255,255,.98);
    box-shadow: 0 18px 48px rgba(15, 23, 42, .055);
}

.clean-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 34px;
}

.clean-card-top h1 {
    margin: 0;
    font-size: clamp(34px, 4vw, 47px);
    line-height: 1.06;
    letter-spacing: -.06em;
    font-weight: 950;
    color: #10192d;
}

.clean-brand-select-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 22px;
    color: #111827;
}

.clean-brand-select {
    max-width: 300px;
    border: 0;
    background: transparent;
    color: #111827;
    font-size: 22px;
    font-weight: 650;
    outline: 0;
    cursor: pointer;
    padding: 0 4px;
}

.clean-primary-btn,
.clean-secondary-btn {
    min-height: 57px;
    padding: 0 25px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.clean-primary-btn {
    color: #fff;
    background: linear-gradient(180deg, #086cff, #005bdc);
    box-shadow: 0 13px 28px rgba(0, 96, 230, .24);
}

.clean-secondary-btn {
    color: #0f172a;
    background: #fff;
    border-color: #d9e2ef;
}

.clean-filter-bar {
    min-height: 115px;
    padding: 27px 23px;
    border: 1px solid #dde6f2;
    border-radius: 13px;
    display: grid;
    grid-template-columns: minmax(250px, 1fr) 232px auto;
    align-items: center;
    gap: 23px;
    margin-bottom: 23px;
    background: #fff;
}

.clean-search-box {
    height: 58px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #d8e2ef;
    border-radius: 11px;
    padding: 0 17px;
    color: #8795ad;
    background: #fff;
}

.clean-search-box span {
    font-size: 31px;
    line-height: 1;
    transform: rotate(-12deg);
}

.clean-search-box input {
    width: 100%;
    height: 100%;
    border: 0;
    outline: 0;
    color: #0f172a;
    font-size: 16px;
    background: transparent;
}

.clean-search-box input::placeholder {
    color: #8795ad;
}

.clean-status-select {
    height: 58px;
    border: 1px solid #d8e2ef;
    border-radius: 11px;
    background: #fff;
    color: #111827;
    padding: 0 17px;
    font-weight: 700;
    outline: 0;
}

.clean-filter-submit {
    height: 58px;
    padding: 0 18px;
    border: 1px solid #d8e2ef;
    border-radius: 11px;
    background: #f8fbff;
    font-weight: 800;
    cursor: pointer;
}

.clean-table-wrap {
    border: 1px solid #dde6f2;
    border-radius: 13px;
    overflow: hidden;
    background: #fff;
}

.clean-user-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.clean-user-table th {
    height: 72px;
    background: #fff;
    color: #111827;
    text-align: left;
    font-size: 16px;
    font-weight: 800;
    padding: 0 24px;
    border-bottom: 1px solid #dfe7f1;
}

.clean-user-table td {
    height: 110px;
    padding: 0 24px;
    border-bottom: 1px solid #e4eaf3;
    color: #1f2937;
    vertical-align: middle;
}

.clean-user-table tr:last-child td {
    border-bottom: 0;
}

.clean-user-table th:nth-child(1),
.clean-user-table td:nth-child(1) { width: 31%; }
.clean-user-table th:nth-child(2),
.clean-user-table td:nth-child(2) { width: 31%; }
.clean-user-table th:nth-child(3),
.clean-user-table td:nth-child(3) { width: 16%; }
.clean-user-table th:nth-child(4),
.clean-user-table td:nth-child(4) { width: 15%; }
.clean-user-table th:nth-child(5),
.clean-user-table td:nth-child(5) { width: 120px; }

.clean-user-name {
    display: flex;
    align-items: center;
    gap: 17px;
    min-width: 0;
}

.clean-user-name b {
    font-size: 17px;
    font-weight: 850;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clean-avatar {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    font-size: 21px;
    background: linear-gradient(135deg, #6c8cff, #7c3aed);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.35), 0 8px 16px rgba(15,23,42,.10);
}

.clean-user-table tbody tr:nth-child(2n) .clean-avatar { background: linear-gradient(135deg, #fb7185, #f97316); }
.clean-user-table tbody tr:nth-child(3n) .clean-avatar { background: linear-gradient(135deg, #38bdf8, #2563eb); }
.clean-user-table tbody tr:nth-child(4n) .clean-avatar { background: linear-gradient(135deg, #34d399, #059669); }

.clean-email {
    color: #475569;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.clean-role,
.clean-status {
    min-height: 40px;
    padding: 8px 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 800;
}

.clean-role.admin {
    color: #045ee7;
    background: #eaf2ff;
    border: 1px solid #cfe0ff;
}

.clean-role.user {
    color: #045ee7;
    background: #eaf2ff;
    border: 1px solid #cfe0ff;
}

.clean-status.active {
    color: #008943;
    background: #eafaf1;
    border: 1px solid #c7f0d8;
}

.clean-status.inactive {
    color: #e30613;
    background: #fff0f2;
    border: 1px solid #ffd3d9;
}

.clean-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
}

.clean-edit,
.clean-dots,
.clean-icon-btn {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: #0064ff;
    font-size: 25px;
    line-height: 1;
    font-weight: 900;
    cursor: pointer;
    text-decoration: none;
}

.clean-dots {
    color: #0f172a;
    font-size: 32px;
    transform: translateY(-1px);
}

.clean-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 24px;
    color: #475569;
    font-size: 16px;
}

.clean-pager {
    display: flex;
    align-items: center;
    gap: 15px;
}

.clean-pager span,
.clean-pager b {
    width: 55px;
    height: 55px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid #dfe7f1;
    background: #fff;
    color: #64748b;
    font-size: 32px;
    font-weight: 500;
}

.clean-pager b {
    color: #fff;
    background: linear-gradient(180deg, #086cff, #005bdc);
    border-color: #0064ff;
    font-size: 21px;
    font-weight: 850;
    box-shadow: 0 10px 20px rgba(0, 96, 230, .20);
}

.clean-empty-inline,
.clean-empty-box {
    padding: 30px;
    display: grid;
    gap: 6px;
    color: #64748b;
}

.clean-empty-inline b,
.clean-empty-box b {
    color: #0f172a;
    font-size: 20px;
}

.clean-user-form-card,
.clean-brand-card .clean-brand-form {
    margin-top: 26px;
    padding: 25px;
    border: 1px solid #dde6f2;
    border-radius: 17px;
    background: #fbfdff;
}

.clean-form-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.clean-form-head h2 { margin: 0; font-size: 27px; }
.clean-form-head p { margin: 4px 0 0; color: #64748b; }
.clean-close-link { color: #0064ff; font-weight: 850; }

.clean-user-form,
.clean-brand-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: end;
}

.clean-user-form label,
.clean-brand-form label:not(.clean-check-line) {
    display: block;
    margin-bottom: 8px;
    font-weight: 800;
    color: #334155;
}

.clean-input {
    width: 100%;
    height: 55px;
    border: 1px solid #d8e2ef;
    border-radius: 11px;
    background: #fff;
    outline: 0;
    padding: 0 16px;
    color: #0f172a;
}

.clean-input:focus {
    border-color: #0064ff;
    box-shadow: 0 0 0 4px rgba(0, 100, 255, .10);
}

.clean-check-line {
    min-height: 55px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    border: 1px solid #d8e2ef;
    border-radius: 11px;
    background: #fff;
    font-weight: 800;
}

.clean-check-line input {
    width: 18px;
    height: 18px;
    accent-color: #0064ff;
}

.clean-form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.clean-brand-line {
    margin: 12px 0 0;
    font-size: 18px;
    color: #64748b;
}

.clean-brand-list {
    margin-top: 24px;
    display: grid;
    gap: 12px;
}

.clean-brand-row {
    min-height: 76px;
    padding: 12px 15px;
    border: 1px solid #dde6f2;
    border-radius: 14px;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto auto auto auto;
    align-items: center;
    gap: 13px;
}

.brand-avatar { background: linear-gradient(135deg, #0b69ff, #7c3aed); }
.brand-row-info { display: grid; gap: 2px; min-width: 0; }
.brand-row-info b { font-size: 18px; }
.brand-row-info span { color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-right { text-align: right !important; }

@media (max-width: 980px) {
    .admin-clean-sidebar {
        width: 88px;
    }
    .admin-clean-main {
        margin-left: 88px;
        padding: 16px;
    }
    .clean-side-nav { padding: 22px 12px; }
    .clean-logo { margin-left: auto; margin-right: auto; margin-bottom: 34px; }
    .clean-nav-item { justify-content: center; }
    .clean-nav-item span:not(.nav-ico) { display: none; }
    .clean-filter-bar { grid-template-columns: 1fr; }
    .clean-user-table { min-width: 780px; }
    .clean-table-wrap { overflow-x: auto; }
    .clean-user-form, .clean-brand-form { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .admin-clean-sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid #e5eaf2;
    }
    .admin-clean-main {
        margin-left: 0;
        padding: 12px;
    }
    .clean-side-nav {
        min-height: auto;
        padding: 12px;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        overflow-x: auto;
    }
    .clean-logo { margin: 0 10px 0 0; min-width: 44px; }
    .clean-nav-links { display: flex; gap: 8px; }
    .clean-nav-item.logout { margin-top: 0; border-top: 0; padding-top: 12px; min-width: 52px; }
    .clean-user-card { padding: 24px 16px; min-height: auto; }
    .clean-brand-select-form { flex-wrap: wrap; }
    .clean-card-top { flex-direction: column; }
    .clean-card-top h1 { font-size: 34px; }
    .clean-brand-select-form, .clean-brand-select { font-size: 18px; }
    .clean-primary-btn { width: 100%; }
    .clean-table-footer { flex-direction: column; align-items: stretch; }
    .clean-pager { justify-content: flex-end; }
}

.clean-brand-select-submit {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 9px;
    border: 1px solid #d8e2ef;
    background: #f8fbff;
    color: #075eea;
    font-weight: 850;
    cursor: pointer;
}

.clean-user-form-card-top {
    margin-top: 0;
    margin-bottom: 23px;
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #f8fbff, #ffffff);
}
.dash-page {
    width: 100%;
    min-height: 100vh;
    padding: 32px 42px 38px;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, .12), transparent 34%), linear-gradient(180deg, #f8fbff 0%, #ffffff 48%, #f8fbff 100%);
    color: #0f172a;
}

.dash-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 28px;
}

    .dash-topbar h1 {
        margin: 0;
        font-size: clamp(34px, 4vw, 52px);
        line-height: 1.08;
        font-weight: 900;
        letter-spacing: -1.2px;
        color: #0f172a;
    }

    .dash-topbar p {
        margin: 8px 0 0;
        color: #64748b;
        font-size: 17px;
        font-weight: 500;
    }

.dash-top-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dash-lang-pill,
.dash-profile-pill {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(148, 163, 184, .22);
    background: rgba(255, 255, 255, .86);
    border-radius: 18px;
    padding: 10px 16px;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .06);
    backdrop-filter: blur(12px);
}

    .dash-lang-pill b {
        color: #1167ff;
    }

    .dash-lang-pill span:last-child {
        color: #334155;
        font-weight: 700;
    }

.dash-profile-avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 16px 28px rgba(37, 99, 235, .24);
}

.dash-profile-pill b,
.dash-profile-pill span {
    display: block;
}

.dash-profile-pill b {
    font-weight: 900;
}

.dash-profile-pill span {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.dash-hero-card {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 26px;
    padding: 28px 30px;
    border-radius: 28px;
    background: rgba(255, 255, 255, .9);
    border: 1px solid rgba(148, 163, 184, .2);
    box-shadow: 0 28px 80px rgba(15, 23, 42, .08);
    overflow: hidden;
    margin-bottom: 24px;
}

    .dash-hero-card::after {
        content: "";
        position: absolute;
        right: -90px;
        top: -90px;
        width: 360px;
        height: 360px;
        background: radial-gradient(circle, rgba(37, 99, 235, .16), transparent 65%);
        pointer-events: none;
    }

.dash-brand-info {
    position: relative;
    z-index:, 99, 235, .16), transparent 65%);
    pointer-events: none;
}

1;
display: flex;
align-items: center;
gap: 22px;
}

.dash-brand-avatar {
    width: 82px;
    height: 82px;
    flex: 0 0 82px;
    border-radius: 28px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #7c3aed 0%, #5b5df7 48%, #2563eb 100%);
    color: #fff;
    font-size: 32px;
    font-weight: 950;
    box-shadow: 0 18px 40px rgba(124, 58, 237, .26);
}

.dash-brand-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

    .dash-brand-title h2 {
        margin: 0;
        font-size: 30px;
        font-weight: 950;
        letter-spacing: -.5px;
    }

    .dash-brand-title span {
        padding: 7px 13px;
        border-radius: 999px;
        background: #eaf3ff;
        color: #1167ff;
        font-weight: 900;
    }

.dash-brand-info p {
    margin: 6px 0 12px;
    color: #64748b;
    font-size: 17px;
    font-weight: 600;
}

.dash-status-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    padding: 9px 14px;
    font-weight: 900;
    font-size: 14px;
    text-decoration: none;
}

    .dash-status-badge.success {
        background: #dcfce7;
        color: #15803d;
    }

    .dash-status-badge.warning {
        background: #fff0c2;
        color: #b45309;
    }

.link-badge:hover {
    filter: brightness(.98);
    transform: translateY(-1px);
}

.dash-hero-art {
    position: relative;
    z-index: 1;
    width: min(410px, 36vw);
    min-height: 140px;
}

.dash-browser-mock {
    position: absolute;
    right: 190px;
    top: 12px;
    width: 210px;
    height: 126px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(148, 163, 184, .18);
    box-shadow: 0 22px 48px rgba(37, 99, 235, .12);
    padding: 18px;
}

    .dash-browser-mock > span {
        display: inline-block;
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #c4b5fd;
        margin-right: 5px;
    }

        .dash-browser-mock > span:nth-child(2) {
            background: #fde68a;
        }

        .dash-browser-mock > span:nth-child(3) {
            background: #67e8f9;
        }

.dash-bars {
    height: 70px;
    display: flex;
    align-items: end;
    gap: 10px;
    margin-top: 20px;
}

    .dash-bars i {
        display: block;
        width: 28px;
        border-radius: 9px 9px 4px 4px;
        background: linear-gradient(180deg, #2563eb, #a855f7);
    }

        .dash-bars i:nth-child(1) {
            height: 28px;
            opacity: .55;
        }

        .dash-bars i:nth-child(2) {
            height: 48px;
            opacity: .75;
        }

        .dash-bars i:nth-child(3) {
            height: 68px;
        }

        .dash-bars i:nth-child(4) {
            height: 86px;
        }

.dash-chart-mock {
    position: absolute;
    right: 55px;
    top: 16px;
    width: 136px;
    height: 118px;
    border-radius: 18px;
    background: linear-gradient(135deg, transparent 45%, rgba(37, 99, 235, .2) 45% 55%, transparent 55%), linear-gradient(180deg, #fff, #eef5ff);
    border: 1px solid rgba(148, 163, 184, .18);
    box-shadow: 0 20px 44px rgba(37, 99, 235, .12);
}

.dash-donut-mock {
    position: absolute;
    right: 0;
    top: 78px;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: conic-gradient(#2563eb 0 34%, #a855f7 34% 66%, #fb7185 66% 82%, #dbeafe 82% 100%);
    box-shadow: 0 18px 40px rgba(37, 99, 235, .18);
}

    .dash-donut-mock::after {
        content: "";
        position: absolute;
        inset: 21px;
        border-radius: 50%;
        background: #fff;
    }

.dash-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.dash-metric-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px;
    border-radius: 24px;
    background: rgba(255, 255, 255, .9);
    border: 1px solid rgba(148, 163, 184, .18);
    box-shadow: 0 22px 60px rgba(15, 23, 42, .07);
}

.dash-metric-icon {
    width: 68px;
    height: 68px;
    flex: 0 0 68px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    font-size: 30px;
    font-weight: 950;
}

    .dash-metric-icon.blue {
        background: #eaf3ff;
        color: #2563eb;
    }

    .dash-metric-icon.mint {
        background: #dffcf4;
        color: #14b8a6;
    }

    .dash-metric-icon.purple {
        background: #f0e7ff;
        color: #7c3aed;
    }

    .dash-metric-icon.amber {
        background: #fff1d7;
        color: #f59e0b;
    }

.dash-metric-card span,
.dash-metric-card small {
    display: block;
}

.dash-metric-card span {
    color: #64748b;
    font-weight: 800;
    margin-bottom: 3px;
}

.dash-metric-card b {
    font-size: 25px;
    font-weight: 950;
    letter-spacing: -.4px;
}

.dash-metric-card small {
    color: #16a34a;
    font-weight: 800;
    margin-top: 4px;
}

.dash-platform-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dash-platform-card {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) 210px auto;
    align-items: center;
    gap: 22px;
    padding: 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(148, 163, 184, .18);
    box-shadow: 0 22px 60px rgba(15, 23, 42, .07);
}

.dash-platform-left {
    display: flex;
    align-items: center;
    gap: 22px;
}

.dash-platform-logo {
    width: 78px;
    height: 78px;
    flex: 0 0 78px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 42px;
    font-weight: 950;
    box-shadow: 0 16px 34px rgba(15, 23, 42, .18);
}

    .dash-platform-logo.facebook {
        background: linear-gradient(135deg, #1877f2, #0f5bd8);
    }

    .dash-platform-logo.tiktok {
        background: linear-gradient(135deg, #0f172a, #020617);
    }

    .dash-platform-logo.youtube {
        background: linear-gradient(135deg, #ff2d2d, #ff0050);
    }

.dash-platform-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

    .dash-platform-title h3 {
        margin: 0;
        font-size: 22px;
        font-weight: 950;
    }

.dash-connected,
.dash-soon {
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
}

.dash-connected {
    background: #dcfce7;
    color: #15803d;
}

.dash-soon {
    background: #e5e7eb;
    color: #64748b;
}

.dash-platform-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(90px, 1fr));
    gap: 18px;
}

    .dash-platform-stats div {
        border-right: 1px solid #e2e8f0;
        padding-right: 18px;
    }

        .dash-platform-stats div:last-child {
            border-right: none;
        }

    .dash-platform-stats b,
    .dash-platform-stats span {
        display: block;
    }

    .dash-platform-stats b {
        font-size: 20px;
        font-weight: 950;
    }

    .dash-platform-stats span {
        color: #64748b;
        font-weight: 700;
        margin-top: 3px;
    }

    .dash-platform-stats.muted {
        opacity: .55;
    }

.dash-spark {
    height: 76px;
    border-radius: 18px;
    overflow: hidden;
    opacity: .95;
}

.facebook-line {
    background: linear-gradient(135deg, transparent 20%, rgba(37, 99, 235, .65) 21% 25%, transparent 26% 42%, rgba(37, 99, 235, .75) 43% 47%, transparent 48%), linear-gradient(180deg, transparent, rgba(37, 99, 235, .12));
}

.tiktok-line {
    background: linear-gradient(135deg, transparent 20%, rgba(20, 184, 166, .55) 21% 25%, transparent 26% 42%, rgba(20, 184, 166, .65) 43% 47%, transparent 48%), linear-gradient(180deg, transparent, rgba(20, 184, 166, .12));
}

.youtube-line {
    background: linear-gradient(135deg, transparent 20%, rgba(239, 68, 68, .55) 21% 25%, transparent 26% 42%, rgba(239, 68, 68, .65) 43% 47%, transparent 48%), linear-gradient(180deg, transparent, rgba(239, 68, 68, .12));
}

.dash-detail-btn,
.dash-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 22px;
    border-radius: 16px;
    border: 1px solid #dbeafe;
    background: #fff;
    color: #1167ff;
    font-weight: 950;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(37, 99, 235, .08);
}

.dash-primary-btn {
    background: #1167ff;
    color: #fff;
    border-color: #1167ff;
}

    .dash-detail-btn:hover,
    .dash-primary-btn:hover {
        transform: translateY(-1px);
    }

.dash-detail-btn.disabled {
    color: #94a3b8;
    background: #f8fafc;
    cursor: not-allowed;
    box-shadow: none;
}

.disabled-card {
    opacity: .82;
}

.dash-loading-card,
.dash-empty-card {
    max-width: 720px;
    margin: 60px auto;
    padding: 34px;
    border-radius: 26px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 26px 70px rgba(15, 23, 42, .08);
}

    .dash-empty-card h2 {
        margin: 0 0 8px;
        font-size: 28px;
        font-weight: 950;
    }

    .dash-empty-card p {
        color: #64748b;
        font-weight: 700;
        margin-bottom: 20px;
    }

.dash-footer {
    text-align: center;
    color: #64748b;
    font-weight: 700;
    padding: 44px 0 10px;
}

@media (max-width: 1180px) {
    .dash-metric-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .dash-platform-card {
        grid-template-columns: 1fr;
    }

    .dash-spark {
        display: none;
    }
}

@media (max-width: 780px) {
    .dash-page {
        padding: 22px 16px 28px;
    }

    .dash-topbar {
        flex-direction: column;
    }

    .dash-top-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .dash-hero-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 22px;
    }

    .dash-brand-info {
        align-items: flex-start;
    }

    .dash-brand-avatar {
        width: 66px;
        height: 66px;
        flex-basis: 66px;
        border-radius: 22px;
        font-size: 24px;
    }

    .dash-hero-art {
        width: 100%;
        min-height: 120px;
    }

    .dash-browser-mock {
        right: 95px;
    }

    .dash-chart-mock {
        right: 18px;
    }

    .dash-donut-mock {
        right: 0;
    }

    .dash-metric-grid {
        grid-template-columns: 1fr;
    }

    .dash-platform-left {
        align-items: flex-start;
    }

    .dash-platform-logo {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
        font-size: 30px;
        border-radius: 18px;
    }

    .dash-platform-stats {
        grid-template-columns: repeat(2, minmax(90px, 1fr));
    }

        .dash-platform-stats div {
            border-right: none;
            border-bottom: 1px solid #e2e8f0;
            padding: 0 0 10px;
        }
}