:root{--bg:#f5f7fa;--panel:#fff;--text:#111722;--muted:#7d8794;--line:#e8ecf1;--sidebar:#0c1016;--accent:#4e78ff;--green:#16a56b;--red:#e65b63;--orange:#d99031;--shadow:0 10px 30px rgba(17,23,34,.055);--r:18px}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}a{color:inherit;text-decoration:none}button,input,select{font:inherit}.app-shell{display:grid;grid-template-columns:232px 1fr;min-height:100vh}.sidebar{position:sticky;top:0;height:100vh;background:linear-gradient(180deg,#0e131a,#090c11);padding:22px 16px;color:#fff}.brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:18px;margin:0 10px 28px}.logo{display:grid;place-items:center;width:35px;height:35px;border-radius:11px;background:linear-gradient(135deg,#8ba2ff,#385dff);font-weight:900;color:white}.nav-label{margin:22px 12px 8px;text-transform:uppercase;letter-spacing:.12em;font-size:10px;color:var(--theme-muted, #69717d)}.nav-item{display:flex;align-items:center;gap:11px;padding:11px 12px;border-radius:12px;color:var(--theme-muted, #9ca5b2);margin:3px 0;font-size:14px}.nav-item span{width:22px;text-align:center}.nav-item b{font-weight:600}.nav-item:hover,.nav-item.active{background:#171e28;color:#fff}.sidebar-user{position:absolute;left:16px;right:16px;bottom:18px;background:#111822;padding:11px;border-radius:14px;display:grid;grid-template-columns:34px 1fr 20px;align-items:center;gap:9px}.sidebar-user small{display:block;color:var(--theme-muted, #778291);font-size:11px;margin-top:2px}.sidebar-user a{color:var(--theme-muted, #748092)}.avatar,.user-chip{display:inline-grid;place-items:center;border-radius:50%;background:var(--theme-surface-brand, #e3e9f3);color:var(--theme-text, #3a475b);font-weight:800}.avatar{width:34px;height:34px}.user-chip{width:24px;height:24px;font-size:10px;margin-right:7px}.content{padding:23px 26px 36px;min-width:0}.page-head{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:18px}.page-head h1{margin:0;font-size:25px;letter-spacing:-.025em}.page-head p,.panel-head p{margin:4px 0 0;color:var(--muted);font-size:13px}.btn{border:1px solid var(--line);border-radius:11px;background:var(--theme-surface, white);padding:9px 13px;cursor:pointer;font-weight:650;color:var(--theme-text, #3f4855)}.btn:hover{transform:translateY(-1px)}.btn.primary{background:#151b24;color:white;border-color:#151b24}.btn.accent{background:var(--accent);color:white;border-color:var(--accent)}.btn.ghost{background:var(--theme-surface, #fff)}.filterbar{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:15px}.filterbar.compact{margin-top:14px}.filterbar select,.filterbar input,.add-video select,.add-video input,.inline-create input,.user-create input,.user-create select{border:1px solid var(--line);background:var(--theme-surface, #fff);border-radius:11px;padding:9px 11px;outline:none;color:var(--theme-text, #3a4452)}.filterbar input{max-width:150px}.range-arrow{color:var(--theme-muted, #98a1ad)}.metric-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}.metric,.panel,.project-card{background:var(--panel);border:1px solid var(--theme-border, #edf0f4);border-radius:var(--r);box-shadow:var(--shadow)}.metric{padding:18px}.metric>span{display:block;color:var(--muted);font-size:12px;margin-bottom:10px}.metric strong{display:block;font-size:29px;letter-spacing:-.035em}.metric small{display:block;color:var(--theme-muted, #929aa6);font-size:11px;margin-top:8px}.panel{padding:18px;margin-top:14px}.panel.slim{padding:13px}.panel-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.panel-head h2{font-size:16px;margin:0}.chart-box{height:315px;border-radius:14px;background:linear-gradient(180deg,var(--theme-surface-brand, #fbfcff),var(--theme-surface, #fff));position:relative;overflow:hidden;border:1px solid var(--theme-border, #f0f2f6)}.chart-box:before{content:"";position:absolute;inset:20px 16px 32px;background:repeating-linear-gradient(to bottom,transparent 0,transparent 64px,var(--theme-surface-secondary, #edf0f4) 65px);pointer-events:none}#trendChart{position:absolute;inset:18px 14px 32px;width:calc(100% - 28px);height:calc(100% - 50px)}.chart-labels{position:absolute;left:18px;right:18px;bottom:8px;display:flex;justify-content:space-between;color:var(--theme-muted, #99a2af);font-size:10px}.chart-empty{position:absolute;inset:0;display:none;place-items:center;color:var(--theme-muted, #929ba7);font-size:13px}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;font-size:13px}th,td{padding:13px 10px;border-bottom:1px solid var(--line);white-space:nowrap;text-align:left}th{font-size:10px;text-transform:uppercase;letter-spacing:.055em;color:var(--theme-muted, #8e97a4);font-weight:700}tbody tr:hover{background:var(--theme-surface-secondary, #fafbfc)}.empty-row{text-align:center!important;color:var(--theme-muted, #929aa6);padding:32px!important}.platform{display:inline-flex;padding:5px 8px;border-radius:999px;font-size:10px;font-weight:800}.platform.youtube{background:var(--theme-surface-danger, #fff0f0);color:var(--theme-text-danger, #df5057)}.platform.tiktok{background:var(--theme-surface-cyan, #eaffff);color:var(--theme-text-cyan, #078e9e)}.platform.instagram{background:var(--theme-surface-purple, #fff0f7);color:var(--theme-text-purple, #c75488)}.platform.vk{background:var(--theme-surface-brand, #edf4ff);color:var(--theme-text-brand, #3977d8)}.video-cell{display:flex;align-items:center;gap:9px;max-width:390px}.video-cell img,.thumb-placeholder{width:38px;height:38px;border-radius:9px;object-fit:cover;flex:0 0 auto}.thumb-placeholder{display:grid;place-items:center;background:linear-gradient(135deg,#253040,#7895ff);color:#fff}.video-cell strong{overflow:hidden;text-overflow:ellipsis}.status{display:inline-flex;padding:5px 8px;border-radius:999px;font-size:10px;font-weight:750}.status.ok{background:var(--theme-surface-success, #eaf9f2);color:var(--theme-text-success, #168257)}.status.error{background:var(--theme-surface-danger, #fff0f1);color:var(--theme-text-danger, #c94f59)}.status.needs_api_key,.status.connector_pending,.status.pending{background:var(--theme-surface-warning, #fff7e9);color:var(--theme-text-warning, #a66d1f)}.actions{display:flex;gap:5px}.actions form{display:inline}.icon-btn{width:30px;height:30px;border-radius:9px;border:1px solid var(--line);background:var(--theme-surface, #fff);cursor:pointer}.icon-btn.danger{color:var(--theme-text-danger, #d64d56)}.add-video{display:grid;grid-template-columns:190px 1fr auto;gap:9px}.add-video input{min-width:0}.notice{padding:11px 13px;border-radius:11px;background:var(--theme-surface-warning, #fff7e9);color:var(--theme-text-warning, #805a20);border:1px solid var(--theme-border-warning, #f2e2bd);margin:10px 0;font-size:13px}.notice.success{background:var(--theme-surface-success, #edf9f3);color:var(--theme-text-success, #18724e);border-color:var(--theme-border-success, #d3efdf)}.notice.error{background:var(--theme-surface-danger, #fff0f1);color:var(--theme-text-danger, #b64852);border-color:var(--theme-border-danger, #f1d1d4)}.project-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.project-card{padding:18px}.project-card h3{margin:14px 0 16px;font-size:18px}.project-stats{display:flex;gap:26px;margin-bottom:18px}.project-stats b{display:block;font-size:18px}.project-stats span{display:block;color:var(--muted);font-size:11px;margin-top:2px}.project-card>a{font-size:12px;color:var(--theme-text-brand, #4b6fe0);font-weight:700}.inline-create{display:flex;gap:9px}.inline-create input{min-width:310px}.user-create{display:grid;grid-template-columns:1.2fr 1.2fr .8fr auto;gap:9px}.login-body{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at 20% 10%,var(--theme-surface-brand, #e7edff),transparent 35%),var(--theme-surface-secondary, #f4f6f9)}.login-card{width:min(440px,calc(100% - 30px));background:var(--theme-surface, #fff);padding:28px;border-radius:22px;border:1px solid var(--theme-border, #e9edf2);box-shadow:0 25px 60px rgba(24,34,55,.1)}.login-brand{display:flex;gap:13px;align-items:center;margin-bottom:24px}.login-brand .logo{width:46px;height:46px;border-radius:14px}.login-brand h1{font-size:22px;margin:0}.login-brand p{margin:4px 0 0;color:var(--muted);font-size:12px}.btn.big{display:block;width:100%;padding:12px 14px;text-align:center;margin-top:10px}.btn.telegram{background:#229ED9;border-color:#229ED9;color:#fff}.login-help{text-align:center;color:var(--theme-muted, #929ba7);font-size:11px}.login-card code{background:var(--theme-surface-secondary, #f1f3f6);padding:2px 4px;border-radius:4px}@media(max-width:1050px){.metric-grid{grid-template-columns:1fr 1fr}.project-grid{grid-template-columns:1fr 1fr}.user-create{grid-template-columns:1fr 1fr}}@media(max-width:760px){.app-shell{grid-template-columns:72px 1fr}.sidebar{padding:18px 9px}.brand span:last-child,.nav-label,.nav-item b,.sidebar-user div,.sidebar-user>a{display:none}.brand{margin-left:9px}.nav-item{justify-content:center}.sidebar-user{grid-template-columns:1fr;justify-items:center}.content{padding:17px 14px}.metric-grid{grid-template-columns:1fr 1fr}.add-video,.user-create{grid-template-columns:1fr}.project-grid{grid-template-columns:1fr}.inline-create{display:grid}.inline-create input{min-width:0}.filterbar input{max-width:none}.page-head{align-items:flex-start}}@media(max-width:500px){.metric-grid{grid-template-columns:1fr}.filterbar>*{width:100%}.range-arrow{display:none}}

.status-wrap{max-width:360px;white-space:normal}.sync-error{margin-top:6px;color:var(--theme-text-danger, #a34f56);font-size:11px;line-height:1.35;max-width:360px;white-space:normal;overflow-wrap:anywhere}
