:root{color-scheme:light;--bg:#f3f5f9;--paper:#fff;--ink:#17233a;--muted:#68788f;--line:#e4e9f1;--nav:#111e35;--accent:#4265e7;--accent-hover:#3454d4;--soft:#eef2ff;--green:#15805c;--red:#bd3846;--radius:14px;--shadow:0 3px 12px #142b5010;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",system-ui,sans-serif;font-size:14px}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);line-height:1.5}button,input,select,textarea{font:inherit}button{cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap;padding:9px 14px;border:1px solid #dce3ee;background:#fff;color:#34445c;border-radius:8px;font-weight:600;transition:background .15s,border-color .15s,color .15s}button:hover{background:#f1f4fa;border-color:#c5d1e4}button:disabled{opacity:.55;cursor:not-allowed}button.primary{background:var(--accent);border-color:var(--accent);color:white;box-shadow:0 2px 5px #4265e725}button.primary:hover{background:var(--accent-hover)}button.danger{color:var(--red);border-color:#f1d9dd}button.danger:hover{background:#fff0f1}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,a:focus-visible{outline:3px solid #8299fa;outline-offset:2px}svg{width:19px;height:19px;flex:none;vertical-align:middle}h1,h2,h3,p{margin:0}h1{font-size:29px;letter-spacing:-.035em;line-height:1.25}h2{font-size:19px}h3{font-size:15px;font-weight:700}small{font-size:12px}a{color:var(--accent)}[hidden]{display:none!important}
.shell{display:grid;grid-template-columns:252px minmax(0,1fr);min-height:100vh}.sidebar{background:var(--nav);color:#a7b6ce;position:sticky;top:0;height:100vh;display:flex;flex-direction:column;padding:0 15px;overflow:auto;z-index:20}.brand{display:flex;align-items:center;gap:12px;padding:28px 10px 24px;color:#fff}.brand-icon{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:#4668ed;box-shadow:0 5px 16px #0003}.brand-icon svg{width:25px;height:25px}.brand strong{font-size:20px;line-height:1.2;letter-spacing:-.5px;display:block}.brand small{display:block;color:#a2b3d2;margin-top:3px}.workspace{padding:14px 11px;background:#1a2b47;border:1px solid #2a3b57;border-radius:11px;margin:0 0 20px}.workspace label{display:block;font-size:11px;color:#a2b3d2;margin-bottom:7px}.group-select{display:flex;align-items:center;gap:7px;color:#b4c8ff}.group-select select{width:100%;min-width:0;background:#14233c;color:#fff;border:1px solid #334765;padding:8px 6px;border-radius:7px;font-size:12px}.workspace-status{font-size:11px;color:#a5b4cc;margin-top:10px;overflow-wrap:anywhere;display:flex;align-items:center;gap:6px}.tiny-dot,.status-dot{width:7px;height:7px;display:inline-block;border-radius:50%;background:#8292ac;flex:none}.status-dot.live{background:#45d6a1}.nav-label{color:#8397b5;font-size:10px;letter-spacing:.14em;font-weight:700;padding:15px 12px 7px}nav button{width:100%;justify-content:flex-start;text-align:left;padding:11px 12px;margin:2px 0;border:0;background:transparent;color:#b7c5da;font-weight:500;border-radius:8px;gap:11px}nav button:hover{background:#243653;color:white}nav button.active{background:#304d9d;color:white;box-shadow:inset 3px 0 #88a3ff}nav button svg{width:18px;height:18px}.sidebar-footer{display:flex;align-items:center;gap:7px;font-size:10px;letter-spacing:.08em;margin-top:auto;padding:20px 10px 18px;color:#8497b5}.sidebar-footer span:last-child{margin-left:auto}.main-area{min-width:0;display:flex;flex-direction:column}.topbar{height:70px;position:sticky;top:0;z-index:10;background:#fff;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);padding:0 30px;gap:12px}.breadcrumbs{display:flex;align-items:center;gap:12px;color:var(--muted);min-width:0;white-space:nowrap}.breadcrumbs strong{color:var(--ink);font-weight:600;overflow:hidden;text-overflow:ellipsis}.crumb-slash{color:#c2cad7}.header-actions{display:flex;align-items:center;gap:14px}.icon-button{padding:8px;width:37px;height:37px;color:#576982}.account-box{display:flex;align-items:center;gap:10px;padding-left:14px;border-left:1px solid var(--line)}.avatar{width:36px;height:36px;border-radius:50%;background:#eaf0ff;color:#4163d8;display:grid;place-items:center}.account-text{display:grid;line-height:1.3;max-width:150px}.account-text strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.account-text small{color:var(--muted);margin-top:3px}.logout{border:0;background:none;color:#66778e;padding:8px}.mobile-menu{display:none}.main-content{width:100%;max-width:1600px;margin:0 auto;padding:30px 30px 40px;flex:1}.page-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:18px;margin-bottom:25px}.eyebrow{font-size:10px;letter-spacing:.13em;font-weight:750;color:#6279b9;margin-bottom:8px}.page-heading p{color:var(--muted);margin-top:7px}.actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.main-footer{display:flex;justify-content:space-between;color:#78879b;font-size:12px;padding:16px 30px;border-top:1px solid var(--line)}
.card,.panel,.metric,form.editor{border:1px solid var(--line);border-radius:var(--radius);background:var(--paper);box-shadow:var(--shadow)}.card,.panel{margin-bottom:20px}.card-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 20px;border-bottom:1px solid var(--line)}.card-header p,.hint{color:var(--muted);font-size:12px;margin-top:4px}.card-body{padding:20px}.loading{padding:32px;text-align:center;color:var(--muted)}.metric-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;margin-bottom:20px}.metric{padding:17px 19px;display:grid;gap:9px}.metric-top{display:flex;align-items:center;justify-content:space-between;gap:6px;color:var(--muted);font-size:13px;font-weight:600}.metric-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:9px;color:#4265e7;background:#eef2ff}.metric-icon.green{color:#178060;background:#e7f8f0}.metric-icon.orange{color:#ae651e;background:#fff1df}.metric-icon.red{color:#bf4554;background:#ffedf0}.metric-icon.purple{color:#7856cb;background:#f1ecff}.metric-number{font-size:30px;line-height:1.15;font-weight:750;letter-spacing:-.045em;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.metric-foot{font-size:11px;color:var(--muted)}.dashboard-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:18px;align-items:start}.chart-svg{display:block;width:100%;height:auto;min-height:170px;overflow:visible}.legend{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:12px}.legend-dot{width:9px;height:9px;background:var(--accent);border-radius:3px}.rank-list{display:grid;gap:14px}.rank-row{display:grid;grid-template-columns:26px minmax(0,1fr) auto;align-items:center;gap:10px}.rank-num{color:#687b9e;background:#eef2f8;border-radius:7px;text-align:center;font-size:12px;line-height:26px}.rank-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600;font-size:13px}.rank-track{height:5px;background:#edf1f7;border-radius:8px;margin-top:6px;overflow:hidden}.rank-fill{height:100%;background:#6682ef;border-radius:8px}.rank-value{font-weight:650;font-size:13px;font-variant-numeric:tabular-nums}.table-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 20px;border-bottom:1px solid var(--line)}.table-toolbar input{max-width:320px}.scroll{overflow:auto;max-width:100%;border-radius:0 0 var(--radius) var(--radius)}table{border-collapse:collapse;width:100%;white-space:nowrap;font-size:13px}th,td{text-align:left;padding:13px 16px;border-bottom:1px solid #edf0f5;max-width:310px;overflow:hidden;text-overflow:ellipsis}th{background:#f7f9fc;color:#66768e;font-weight:650;font-size:12px}tbody tr:last-child td{border-bottom:0}tbody tr:hover{background:#f8faff}td.table-actions{overflow:visible;max-width:none;white-space:nowrap}td.table-actions button{font-size:12px;padding:5px 10px;margin-right:6px}td.table-actions button:last-child{margin-right:0}.table-foot{padding:12px 20px;display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;border-top:1px solid var(--line);color:var(--muted);font-size:12px}.table-foot button{font-size:12px;padding:5px 11px}.badge{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border-radius:6px;background:#eef2f8;color:#5d708b;font-size:12px;font-weight:600}.badge.green{background:#e6f6ee;color:#14805c}.badge.red{background:#fcebed;color:#ba4050}.badge.blue{background:#edf1ff;color:#4562cf}.badge.gray{background:#eff2f6;color:#67788e}.empty{text-align:center;padding:34px 16px;color:var(--muted)}.empty-icon{display:grid;place-items:center;margin:0 auto 12px;width:48px;height:48px;border-radius:12px;background:#eef2fa;color:#8394b1}.empty-icon svg{width:24px;height:24px}.empty strong{display:block;color:#43536e;font-size:14px;margin-bottom:4px}.empty p{font-size:12px}
input:not([type=checkbox]),select,textarea{width:100%;min-width:0;border:1px solid #dce3ee;border-radius:8px;background:#fff;padding:10px 12px;color:var(--ink);outline-offset:1px}input::placeholder,textarea::placeholder{color:#98a4b6}textarea{min-height:105px;resize:vertical;line-height:1.65}label.field{display:flex;flex-direction:column;gap:6px;min-width:0;color:#394a62;font-size:13px;font-weight:600}.cols{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:17px 20px}.field.wide{grid-column:1/-1}.check{display:flex!important;flex-direction:row!important;align-items:center;gap:10px!important;min-height:45px;border:1px solid var(--line);border-radius:8px;padding:10px 12px;background:#f9fbfd;cursor:pointer}.check input{appearance:none;width:35px;height:20px;background:#c4cedc;border-radius:15px;position:relative;flex:none;margin:0;cursor:pointer;transition:background .2s}.check input:checked{background:var(--accent)}.check input:before{content:"";position:absolute;left:3px;top:3px;width:14px;height:14px;border-radius:50%;background:white;box-shadow:0 1px 2px #0002;transition:transform .2s}.check input:checked:before{transform:translateX(15px)}.form-section{padding:20px 23px;border-bottom:1px solid var(--line)}.form-section h3{margin-bottom:4px}.form-section .hint{margin:0 0 17px}.form-footer{display:flex;justify-content:flex-end;gap:10px;padding:16px 22px}.editor{margin:0 0 20px}.panel{padding:20px}.panel h3{margin-bottom:12px}.member-tools{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:20px}.member-tools .panel{margin:0}.member-tools .actions{margin-top:12px}.ad-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}.ad-grid .cols{grid-template-columns:1fr}.ad-grid .form-section{padding:18px}.editor-dialog{padding:0;border:1px solid var(--line);border-radius:16px;width:min(720px,calc(100vw - 24px));max-height:calc(100dvh - 40px);color:var(--ink);background:white;box-shadow:0 25px 90px #0d1b3c55;overflow:auto}.editor-dialog::backdrop{background:#111e3599;backdrop-filter:blur(2px)}.dialog-header{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;border-bottom:1px solid var(--line)}.editor-dialog .editor{border:0;box-shadow:none;margin:0}.dialog-error,#notice{padding:12px 16px;border-radius:9px;background:#eaf7f0;color:#176747;border:1px solid #cfe9da;margin:0 0 18px;white-space:pre-wrap;overflow-wrap:anywhere}#notice.error,.dialog-error{background:#fff1f2;color:#a8313d;border-color:#f3d2d7}.dialog-error{margin:15px 22px 0}.scrim{display:none}
/* Sign-in */
.login-page{min-height:100vh;display:grid;grid-template-columns:minmax(360px,1fr) minmax(440px,1fr);background:#fff}.login-brand{background:radial-gradient(ellipse at 15% 20%,#2c4a98 0,transparent 50%),#111e35;color:white;padding:clamp(40px,7vw,100px);display:flex;flex-direction:column;justify-content:space-between;min-height:100vh}.login-brand .brand{padding:0}.login-brand h1{font-size:clamp(34px,4vw,58px);max-width:520px;line-height:1.22;letter-spacing:-.04em}.login-brand p{color:#b9c8e5;max-width:440px;margin-top:20px;font-size:15px}.login-brand .eyebrow{color:#9fb5ff}.login-features{display:grid;gap:11px;margin-top:30px;color:#cbd8f0;font-size:13px}.login-features span:before{content:'✓';color:#7fa1ff;margin-right:10px}.login-main{display:grid;place-items:center;padding:35px}.login-form{width:min(100%,390px);display:grid;gap:20px}.login-form h2{font-size:28px;letter-spacing:-.04em;margin-bottom:8px}.login-form .hint{font-size:14px}.login-form .primary{padding:12px;font-size:15px}.login-note{background:#f4f6fb;padding:14px 16px;border-radius:9px;color:#586c89;font-size:12px;line-height:1.8}.login-alert{padding:10px 12px;border-radius:8px;background:#fff0f1;color:#a8313d;border:1px solid #f3d2d7}.login-alert.success{background:#eaf7f0;color:#176747;border-color:#cfe9da}
@media(max-width:1250px){.ad-grid{grid-template-columns:1fr}.ad-grid .cols{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-grid{grid-template-columns:1fr}}@media(max-width:1000px){.shell{grid-template-columns:218px minmax(0,1fr)}.main-content{padding:24px 20px}.topbar{padding:0 20px}.metric-grid{gap:10px}.metric{padding:13px}.metric-number{font-size:25px}.member-tools{grid-template-columns:1fr}}@media(max-width:760px){.shell{display:block}.sidebar{position:fixed;left:0;top:0;bottom:0;width:252px;height:100dvh;transform:translateX(-100%);transition:transform .2s}.sidebar.open{transform:translateX(0)}.scrim:not([hidden]){display:block;position:fixed;inset:0;background:#111e3566;z-index:15}.mobile-menu{display:inline-flex;flex:none}.topbar{height:60px;padding:0 12px;justify-content:flex-start;gap:9px}.header-actions{margin-left:auto;gap:6px}.account-box{padding-left:6px}.account-text,.logout span:last-child,.breadcrumbs span{display:none}.logout{padding:6px}.main-content{padding:20px 13px 28px}.page-heading{align-items:flex-start;flex-wrap:wrap;gap:12px;margin-bottom:18px}.page-heading h1{font-size:25px}.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.metric{padding:12px}.metric-icon{width:30px;height:30px}.metric-top{font-size:12px}.metric-number{font-size:25px}.main-footer{padding:15px;flex-wrap:wrap;gap:5px}.card-header,.card-body,.table-toolbar,.form-section{padding:15px}.cols,.ad-grid .cols{grid-template-columns:1fr}.table-toolbar{flex-wrap:wrap}.login-page{display:block}.login-brand{min-height:auto;padding:25px}.login-brand h1,.login-brand .login-features,.login-brand .login-intro,.login-brand footer{display:none}.login-main{padding:35px 22px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;scroll-behavior:auto!important}}
.group-select select{background:#14233c;color:#fff;border-color:#334765;padding:8px 6px;font-size:12px}.group-select select option{background:#14233c;color:#fff}.group-select select:disabled{opacity:.65}.rank-list{max-height:360px;overflow:auto}.logout span[data-icon]{display:inline-flex}.logout:hover{color:var(--accent)}

/* Member state v3 */
.badge.orange{background:#fff3dc;color:#9b5d13}.member-select{width:16px;height:16px;accent-color:#5274ea;vertical-align:middle;cursor:pointer}.member-detail{padding:4px 0}.member-facts{display:grid;grid-template-columns:minmax(90px,1fr) 2fr;gap:10px 16px;margin:0 0 24px}.member-facts dt{color:#718096}.member-facts dd{margin:0;overflow-wrap:anywhere}.permission-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px;margin:12px 0 24px}.permission-row{display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid #e6ebf2;border-radius:8px;padding:9px}.member-history{display:grid;gap:8px;margin:12px 0}.member-history>div{display:grid;gap:4px;border-bottom:1px solid #e6ebf2;padding:8px 0;overflow-wrap:anywhere}.member-history small{color:#718096}

/* Live Telegram group permissions */
.permission-note{border:1px solid #dce5f4;background:#f7f9fd;border-radius:10px;padding:15px 16px;margin:14px 0 20px}.permission-note p{margin:6px 0 12px}.permission-tools{flex-wrap:wrap;margin:0 0 12px;gap:10px}.permission-footer{align-items:center;flex-wrap:wrap;justify-content:space-between}.permission-footer button:disabled{opacity:.5;cursor:not-allowed}
