/* ALIWEB Ads Manager — brand layer on top of Filament (no build step needed). */
:root {
    --aw-navy: #0B1B3F;
    --aw-navy-2: #12285A;
    --aw-blue: #2563EB;
    --aw-sky: #38BDF8;
    --aw-bg: #F4F6FB;
    --aw-card: #FFFFFF;
    --aw-border: #E3E8F2;
    --aw-text: #0F172A;
    --aw-muted: #64748B;
    --aw-good: #059669;
    --aw-bad: #E11D48;
    --aw-warn: #B45309;
    --aw-radius: 14px;
    --aw-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
}
.dark {
    --aw-bg: #0A1022;
    --aw-card: #111a33;
    --aw-border: #22304f;
    --aw-text: #E5EAF5;
    --aw-muted: #93A0BA;
    --aw-good: #34D399;
    --aw-bad: #FB7185;
    --aw-warn: #FBBF24;
}

/* ── Shell ─────────────────────────────────────────── */
.fi-body { background: var(--aw-bg); }
.fi-sidebar, .fi-sidebar-header { background: var(--aw-navy) !important; }
.fi-sidebar { border-right: 0 !important; }
.fi-sidebar .fi-sidebar-group-label,
.fi-sidebar .fi-sidebar-item-label,
.fi-sidebar .fi-sidebar-item-icon,
.fi-sidebar .fi-sidebar-group-collapse-btn,
.fi-sidebar .fi-sidebar-group-btn { color: #C7D2EA !important; }
.fi-sidebar .fi-sidebar-group-label { text-transform: uppercase; letter-spacing: .06em; font-size: .7rem; opacity: .7; }
.fi-sidebar .fi-sidebar-item-btn:hover { background: rgba(255, 255, 255, .06) !important; }
.fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-btn { background: linear-gradient(90deg, rgba(37, 99, 235, .55), rgba(37, 99, 235, .15)) !important; }
.fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-label,
.fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-icon { color: #fff !important; }
.fi-sidebar .fi-tenant-menu-trigger, .fi-sidebar .fi-tenant-menu-trigger * { color: #fff !important; }
.fi-sidebar .fi-tenant-menu-trigger:hover { background: rgba(255, 255, 255, .06) !important; }
.fi-topbar, .fi-topbar > nav { background: var(--aw-card) !important; box-shadow: none !important; border-bottom: 1px solid var(--aw-border); }
.fi-header-heading { letter-spacing: -.02em; }
.fi-section, .fi-wi-stats-overview-stat, .fi-wi-chart, .fi-ta-ctn {
    border-radius: var(--aw-radius) !important; box-shadow: var(--aw-shadow) !important; border: 1px solid var(--aw-border) !important; --tw-ring-shadow: 0 0 #0000 !important;
}
.fi-wi-stats-overview-stat-value { letter-spacing: -.02em; }
.fi-simple-layout { background: radial-gradient(1200px 600px at 10% -10%, rgba(56, 189, 248, .18), transparent), linear-gradient(160deg, var(--aw-navy), #0E2350 60%, #143272); }
.fi-simple-main { border-radius: 18px !important; box-shadow: 0 20px 60px rgba(0, 0, 0, .35) !important; }

.aw-brand { display: flex; align-items: center; gap: .6rem; font-size: 1.05rem; color: var(--aw-text); white-space: nowrap; }
.aw-brand svg { width: 2rem; height: 2rem; flex: none; }
.fi-sidebar .aw-brand { color: #fff; }
.aw-brand b { font-weight: 800; letter-spacing: .02em; }

/* ── Building blocks ───────────────────────────────── */
.aw { color: var(--aw-text); }
.aw-card { background: var(--aw-card); border: 1px solid var(--aw-border); border-radius: var(--aw-radius); box-shadow: var(--aw-shadow); padding: 1.1rem 1.25rem; }
.aw-card h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }
.aw-card h3 { font-size: 1rem; font-weight: 650; }
.aw-card-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: baseline; justify-content: space-between; margin-bottom: .75rem; }
.aw-card-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--aw-muted); margin-bottom: .4rem; font-weight: 600; }
.aw-h-full { height: 100%; }
.aw-grid { display: grid; gap: 1rem; }
.aw-grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.aw-grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.aw-mt { margin-top: 1rem; }
.aw-mt-s { margin-top: .5rem; }
.aw-muted { color: var(--aw-muted); }
.aw-small { font-size: .8rem; }
.aw-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
.aw-right { text-align: right; white-space: nowrap; }
.aw-error { color: var(--aw-bad); font-size: .8rem; margin-top: .25rem; }
.aw-warn { color: var(--aw-warn); font-weight: 600; }
.aw-good { color: var(--aw-good); font-weight: 700; }
.aw-bad { color: var(--aw-bad); font-weight: 700; }
.aw-empty { padding: 2rem 1rem; text-align: center; color: var(--aw-muted); border: 1px dashed var(--aw-border); border-radius: 10px; }
.aw-note { background: linear-gradient(0deg, rgba(37, 99, 235, .04), rgba(37, 99, 235, .04)), var(--aw-card); }
/* Owner rule: clickable text links are bold + underlined */
.aw-link, .aw a:not(.aw-btn) { color: var(--aw-blue); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.dark .aw-link, .dark .aw a:not(.aw-btn) { color: #7AA7FF; }
.aw-btn { display: inline-flex; align-items: center; gap: .4rem; background: var(--aw-blue); color: #fff; font-weight: 600; padding: .6rem 1rem; border-radius: 10px; text-decoration: none; white-space: nowrap; }
.aw-btn:hover { background: #1D4ED8; }

.aw-badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.aw-badge-success { background: rgba(16, 185, 129, .14); color: #047857; }
.aw-badge-warning { background: rgba(245, 158, 11, .16); color: #B45309; }
.aw-badge-danger { background: rgba(244, 63, 94, .14); color: #BE123C; }
.aw-badge-info { background: rgba(56, 189, 248, .16); color: #0369A1; }
.aw-badge-gray { background: rgba(100, 116, 139, .14); color: #475569; }
.dark .aw-badge-success { color: #6EE7B7; } .dark .aw-badge-warning { color: #FCD34D; } .dark .aw-badge-danger { color: #FDA4AF; }
.dark .aw-badge-info { color: #7DD3FC; } .dark .aw-badge-gray { color: #CBD5E1; }

/* Tables */
.aw-table-wrap { overflow-x: auto; margin: 0 -1.25rem; padding: 0 1.25rem; -webkit-overflow-scrolling: touch; }
.aw-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .85rem; }
.aw-table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--aw-muted); font-weight: 600; padding: .55rem .6rem; border-bottom: 1px solid var(--aw-border); white-space: nowrap; position: sticky; top: 0; background: var(--aw-card); }
.aw-table th.aw-right { text-align: right; }
.aw-table td { padding: .6rem; border-bottom: 1px solid var(--aw-border); vertical-align: top; }
.aw-table tbody tr:hover td { background: rgba(37, 99, 235, .035); }
.aw-row-muted td { opacity: .6; }
.aw-name-cell { display: flex; gap: .6rem; min-width: 220px; max-width: 420px; }
.aw-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; background: var(--aw-border); }
.aw-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Toolbar & inputs */
.aw-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.aw-input { border: 1px solid var(--aw-border); background: var(--aw-card); color: var(--aw-text); border-radius: 10px; padding: .45rem .7rem; font-size: .85rem; min-height: 2.25rem; }
.aw-grow { flex: 1 1 200px; }
.aw-tabs { display: inline-flex; background: var(--aw-card); border: 1px solid var(--aw-border); border-radius: 10px; padding: 3px; }
.aw-tabs button { padding: .35rem .8rem; border-radius: 8px; font-size: .85rem; color: var(--aw-muted); font-weight: 600; }
.aw-tabs button.is-active { background: var(--aw-navy); color: #fff; }

/* Switch */
.aw-switch { width: 40px; height: 22px; border-radius: 999px; background: #CBD5E1; position: relative; transition: background .15s; }
.aw-switch span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.aw-switch.is-on { background: var(--aw-blue); }
.aw-switch.is-on span { transform: translateX(18px); }
.aw-switch:disabled { opacity: .5; cursor: not-allowed; }

/* Progress */
.aw-progress { height: 6px; background: var(--aw-border); border-radius: 999px; overflow: hidden; }
.aw-progress > div { height: 100%; background: linear-gradient(90deg, var(--aw-blue), var(--aw-sky)); transition: width .4s; }

/* Setup / checklist */
.aw-setup { padding: 1.5rem; }
.aw-setup-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.aw-checklist { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; margin-top: 1.25rem; }
.aw-checklist li { display: flex; align-items: center; gap: .6rem; padding: .75rem .9rem; border: 1px solid var(--aw-border); border-radius: 12px; font-weight: 600; }
.aw-checklist li.is-done { border-color: rgba(16, 185, 129, .4); background: rgba(16, 185, 129, .06); }
.aw-check { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; align-items: center; justify-content: center; background: var(--aw-border); font-size: .8rem; flex: none; }
.is-done .aw-check { background: #10B981; color: #fff; }
.aw-steps { list-style: decimal; padding-left: 1.25rem; display: grid; gap: .4rem; margin-top: .5rem; }
.aw-facts { list-style: disc; padding-left: 1.1rem; display: grid; gap: .35rem; font-size: .88rem; }

/* Funnel */
.aw-funnel { display: grid; gap: .55rem; }
.aw-funnel-row { display: grid; grid-template-columns: 9.5rem 1fr 7rem; gap: .6rem; align-items: center; font-size: .85rem; }
.aw-funnel-bar { height: 10px; background: var(--aw-border); border-radius: 999px; overflow: hidden; }
.aw-funnel-bar > div { height: 100%; background: linear-gradient(90deg, var(--aw-navy-2), var(--aw-blue)); border-radius: 999px; }
.aw-funnel-val { text-align: right; font-weight: 600; white-space: nowrap; }

/* AI blocks */
.aw-ai-label { display: inline-flex; align-items: center; gap: .3rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #7C3AED; background: rgba(124, 58, 237, .1); padding: .15rem .5rem; border-radius: 999px; }

@media (max-width: 640px) {
    .aw-card { padding: 1rem; }
    .aw-table-wrap { margin: 0 -1rem; padding: 0 1rem; }
    .aw-funnel-row { grid-template-columns: 7rem 1fr 5.5rem; }
}
