:root{font:15px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#172236;background:#f4f6fb;color-scheme:light;--ink:#172236;--muted:#536179;--muted2:#63718b;--line:#e0e6f0;--surface:#fff;--accent:#4b45d0;--accent-dark:#3632a1;--teal:#08775e;--nav:#131b32;--nav-dim:#acb8d7;--shadow:0 2px 5px rgba(31,46,82,.035);font-synthesis:none}
*,*::before,*::after{box-sizing:border-box}
body{margin:0;min-width:280px}
[hidden]{display:none!important}
button,select,input,textarea{font:inherit}
button{cursor:pointer}
a{color:var(--accent-dark)}
button:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible,a:focus-visible{outline:2px solid #766ef0;outline-offset:2px}
button[disabled]{opacity:.55;cursor:wait}
h1,h2,h3,p{margin:0}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.app{display:grid;grid-template-columns:190px minmax(0,1fr);min-height:100vh}
.sidebar{background:var(--nav);color:#fff;min-width:0;position:sticky;top:0;min-height:650px;height:100vh;padding:24px 14px 15px;display:flex;flex-direction:column}
.brand{display:flex;align-items:center;gap:11px;font-weight:760;font-size:1.25rem;letter-spacing:-.045em;padding:0 5px;white-space:nowrap}
.brand.on-light{padding:0;color:var(--ink)}
.mark{display:inline-grid;width:32px;height:32px;place-items:center;border-radius:9px;background:#7167ec;position:relative;flex:none}
.mark i,.mark b{display:block;position:absolute;background:#fff;border-radius:100px;transform:rotate(43deg);width:5px;height:17px;top:7px;left:11px}
.mark b{left:18px;top:12px;height:13px;background:#d1c7ff}
.project-label{padding:16px 7px 15px;margin:23px 0 5px;border-top:1px solid #2d3655;border-bottom:1px solid #2d3655;color:#c8cff0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;min-height:49px;font-size:.9rem}
#navigation{display:grid;gap:4px;margin-top:10px}
.nav-button{border:0;border-radius:9px;background:none;color:var(--nav-dim);text-align:left;width:100%;padding:10px 9px;min-height:40px;font-weight:570;display:flex;align-items:center;gap:9px;white-space:nowrap}
.nav-button:hover{background:#263354;color:#fff}
.nav-button[aria-current="page"]{background:#302d67;color:#fff}
.nav-icon{font-size:1.02rem;display:inline-flex;justify-content:center;width:18px;flex:none;color:#bcb7fc}
.sidebar-bottom{margin-top:auto;padding-top:18px}
.environment{display:flex;align-items:center;gap:8px;color:#c0cbe8;font-size:.83rem;padding:11px 6px 3px;white-space:nowrap}
.environment span{width:7px;height:7px;border-radius:50%;background:#86dcc4}
.release-button{background:#232e51;color:#f0eeff;font-size:.86rem;justify-content:space-between}
.shell{min-width:0}
.topbar{background:#fff;border-bottom:1px solid var(--line);height:64px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 clamp(14px,3vw,35px)}
.where{display:flex;align-items:center;gap:11px;white-space:nowrap;font-size:.9rem;color:var(--muted)}
.where b{color:var(--ink);font-weight:650;padding-left:11px;border-left:1px solid #dfe5ef}
.toolbar{display:flex;align-items:center;gap:8px}
.toolbar select{max-width:220px;white-space:nowrap}
.workspace{max-width:1560px;margin:0 auto;padding:29px clamp(14px,3vw,35px) 45px}
.title-row{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:22px}
.title-row h1,.login h1{font-size:clamp(1.66rem,3vw,2.25rem);font-weight:770;line-height:1.15;letter-spacing:-.049em}
.title-row p{margin-top:6px;color:var(--muted);font-size:.98rem}
.button,.text-button,.icon-button{min-height:39px;border:0;border-radius:8px;font-weight:670;line-height:1.2;white-space:nowrap}
.button{display:inline-flex;align-items:center;justify-content:center;padding:9px 12px;gap:8px}
.button.primary{background:var(--accent);color:#fff}
.button.primary:hover{background:var(--accent-dark)}
.button.secondary{border:1px solid #d6dfec;background:#fff;color:#263754}
.button.secondary:hover{background:#eff1ff;border-color:#bdbaf4}
.button.danger{background:#a3223e;color:#fff}
.button.compact{min-height:34px;padding:7px 9px}
.text-button,.icon-button{background:transparent;padding:7px;color:var(--accent-dark)}
.text-button:hover,.icon-button:hover{background:#eeedfb}
.icon-button{width:38px;font-size:1.35rem}
.filters{display:flex;align-items:end;flex-wrap:wrap;gap:10px 12px;margin-bottom:20px}
label{display:grid;gap:5px;color:#364764;font-size:.89rem;font-weight:630}
input,select,textarea{width:100%;color:#243350;border:1px solid #d6dfec;background:#fff;border-radius:8px;min-height:39px;padding:7px 10px;font-size:.93rem;max-width:100%;font-weight:500}
select{appearance:none;padding-right:33px;background-image:linear-gradient(45deg,transparent 49%,#556381 52%),linear-gradient(135deg,#556381 49%,transparent 52%);background-position:calc(100% - 14px) 50%,calc(100% - 9px) 50%;background-size:5px 5px;background-repeat:no-repeat;text-overflow:ellipsis}
textarea{min-height:85px;resize:vertical}
::placeholder{color:#6a7892}
.filters label{min-width:98px}
.filters input{min-width:130px}
.grid-kpi{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px}
.kpi,.card{background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);min-width:0}
.kpi{padding:15px 13px 13px;min-height:106px;overflow:hidden}
.kpi p{color:var(--muted);font-weight:660;font-size:.86rem;display:flex;align-items:center;gap:6px}
.kpi-dot,.legend-dot{display:inline-block;width:8px;height:8px;flex:none;border-radius:50%;background:#766be9}
.kpi.revenue .kpi-dot,.legend-dot.revenue{background:#1a9d7c}
.kpi.cost .kpi-dot,.legend-dot.spent{background:#776beb}
.kpi.roas .kpi-dot{background:#c76c33}
.kpi.cpa .kpi-dot{background:#407ab9}
.kpi-value{display:block;color:var(--ink);font-size:clamp(1.1rem,2.25vw,1.78rem);font-weight:780;letter-spacing:-.053em;line-height:1.2;margin:7px 0 4px;overflow-wrap:anywhere}
.kpi.revenue .kpi-value{color:#08694f}
.kpi small{color:var(--muted2);font-size:.81rem}
.overview-grid{display:grid;grid-template-columns:minmax(0,2.1fr) minmax(0,1fr);gap:13px;margin-bottom:16px}
.card{padding:16px;margin-bottom:14px}
.overview-grid .card{margin:0}
.card-title{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap;margin-bottom:13px}
.card h2{font-size:1.13rem;letter-spacing:-.025em;font-weight:740}
.card h3{font-size:1rem;font-weight:720}
.card-title p,.help{color:var(--muted2);font-size:.88rem;margin-top:4px}
.legend{display:flex;align-items:center;gap:9px;flex-wrap:wrap;color:var(--muted);font-size:.81rem;white-space:nowrap}
.legend span{display:flex;align-items:center;gap:5px}
.chart{height:245px;width:100%;display:block;touch-action:pan-y}
.funnel{display:grid;gap:12px;margin:4px 0 0}
.funnel-row{display:grid;gap:5px}
.funnel-name{display:flex;justify-content:space-between;align-items:baseline;gap:7px;color:#34425c;font-size:.88rem}
.funnel-name strong{font-variant-numeric:tabular-nums;color:#13213c}
progress{border-radius:20px;height:7px;width:100%;background:#e9ecf8;appearance:none;accent-color:#6d61e0}
progress::-webkit-progress-bar{border-radius:20px;background:#e9ecf8}
progress::-webkit-progress-value{border-radius:20px;background:#776be9}
progress::-moz-progress-bar{border-radius:20px;background:#776be9}
.funnel-row:nth-child(even) progress::-webkit-progress-value{background:#299984}
.funnel-row:nth-child(even) progress::-moz-progress-bar{background:#299984}
.channels-list{display:grid;gap:0;margin-top:7px}
.channels-row{padding:10px 0;border-bottom:1px solid #e9edf4;display:flex;align-items:center;justify-content:space-between;gap:12px}
.channels-row:last-child{border-bottom:0}
.channel{display:inline-flex;align-items:center;gap:7px;white-space:nowrap;color:#3c4c68;font-size:.84rem}
.channel i{width:21px;height:21px;display:grid;place-items:center;border-radius:6px;background:#edf0fa;color:#445678;font-style:normal;font-weight:800;flex:none;font-size:.73rem}
.channel.meta i{background:#e8efff;color:#2859ba}.channel.google i{background:#e6f3ec;color:#207743}.channel.tiktok i{background:#eeeafa;color:#5737a2}.channel.whatsapp i{background:#dbf3e7;color:#117142}
.table-wrap{overflow:auto;margin:0 -2px;scrollbar-width:thin}
table{border-collapse:collapse;width:100%;font-size:.9rem;white-space:nowrap}
th{font-size:.83rem;color:var(--muted);font-weight:670;text-align:left;background:#f3f6fc}
th,td{padding:10px 8px;border-bottom:1px solid #e8edf5}
td{color:#2b3a56}
td:first-child,th:first-child{padding-left:11px}
td:last-child,th:last-child{padding-right:11px}
td strong{font-weight:650;color:#192842}
td.num,th.num{text-align:right;font-variant-numeric:tabular-nums}
tbody tr:last-child td{border-bottom:0}
tbody tr:hover td{background:#f9faff}
.table-empty{white-space:normal;text-align:center;color:var(--muted);min-height:75px;padding:25px 12px}
.pill{display:inline-flex;border-radius:100px;background:#eef0f8;color:#435573;padding:3px 8px;line-height:1.2;font-size:.79rem;font-weight:660;white-space:nowrap}
.pill.good{background:#e2f3ec;color:#16634e}.pill.bad{background:#fbe9e9;color:#9d2845}.pill.wait{background:#fff0dc;color:#865315}
.columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px 12px}
.full{grid-column:1/-1}
.check{display:flex;align-items:center;gap:7px;font-weight:550}
.check input{width:16px;height:16px;min-height:0;accent-color:var(--accent);margin:0}
.actions,.controls-inline{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.actions{margin-top:15px}
.stack{display:grid;gap:9px}
.integration{border:1px solid var(--line);border-radius:9px;padding:10px;display:flex;justify-content:space-between;gap:8px;align-items:center}
.integration strong{display:block;color:#253754;font-weight:670}
.integration p{font-size:.81rem;color:var(--muted2);margin-top:3px;overflow-wrap:anywhere}
.integration .text-button{min-height:32px}
.controls-inline input[type="search"]{width:min(200px,100%)}
.controls-inline select{width:auto}
.code{font:13px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace;background:#f4f6fc;min-height:52px;resize:vertical;overflow-wrap:anywhere}
.notice{background:#eeeffb;border:1px solid #dbddf7;color:#3a447a;border-radius:8px;padding:10px 12px;font-size:.9rem;margin:8px 0 12px}
.empty{padding:32px 14px;text-align:center}
.empty p{color:var(--muted);margin-bottom:13px}
.login{min-height:100vh;display:grid;place-items:center;padding:18px;background:radial-gradient(ellipse at 32% 24%,#e1dfff,transparent 50%),#f1f5fd}
.login-card{background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:0 12px 38px #31336819;width:min(100%,410px);padding:28px}
.login-card h1{margin:22px 0 17px;font-size:1.75rem}
.login-card form{display:grid;gap:13px}
.login-card .text-button{margin-top:10px}
dialog{border:1px solid var(--line);border-radius:14px;width:min(94vw,565px);padding:19px;color:var(--ink);box-shadow:0 16px 54px #18213b38;max-height:90vh;overflow:auto}
dialog::backdrop{background:#10172bbb}
.modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.modal-head h2{font-size:1.25rem;letter-spacing:-.025em}
.toast{position:fixed;bottom:17px;right:17px;background:#1c2546;color:#fff;border-radius:9px;box-shadow:0 5px 24px #12203d38;padding:11px 15px;max-width:min(90vw,480px);z-index:20;font-size:.93rem}
.toast.error{background:#8a2845}
.form-error{color:#a01f39;font-size:.85rem;margin:8px 0}
.muted{color:var(--muted)}
@media(max-width:900px){.app{grid-template-columns:155px minmax(0,1fr)}.sidebar{padding-inline:10px}.nav-button{font-size:.85rem;padding-inline:7px}.overview-grid{grid-template-columns:minmax(0,1.7fr) minmax(0,1fr)}.card{padding:12px}.grid-kpi{gap:8px}}
@media(max-width:735px){.app{display:block}.sidebar{position:static;min-height:auto;height:auto;padding:11px 14px 9px}.sidebar .brand{font-size:1.12rem}.sidebar .mark{width:29px;height:29px}.project-label{display:none}#navigation{display:flex;gap:3px;overflow-x:auto;scrollbar-width:thin;margin-top:8px}.nav-button{width:auto;flex:none}.sidebar-bottom{display:flex;justify-content:space-between;padding:3px 0 0;gap:4px}.environment{padding:4px 4px 0}.release-button{min-height:30px;padding:6px 8px}.topbar{height:auto;min-height:48px;padding-block:7px}.where{display:none}.toolbar{justify-content:space-between;width:100%}.toolbar select{flex:1;max-width:260px}.workspace{padding-top:19px}.title-row{margin-bottom:15px}}
@media(max-width:540px){.workspace{padding-inline:12px}.columns,.overview-grid{grid-template-columns:1fr}.grid-kpi{grid-template-columns:repeat(2,minmax(0,1fr))}.kpi{min-height:91px}.kpi-value{font-size:1.35rem}.chart{height:212px}.title-row{align-items:start}.title-row .button{font-size:.79rem}.fields{gap:8px}.filters{gap:7px;margin-bottom:12px}.filters label{min-width:0}.filters select{font-size:.86rem}}
