@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');
*{box-sizing:border-box}html{font-family:Vazirmatn,Tahoma,Arial,sans-serif}body{margin:0;background:#f5f7fb;color:#172033;font-size:14px}button,input,textarea,select{font:inherit}.app{min-height:100vh}.sidebar{position:fixed;right:0;top:0;bottom:0;width:260px;background:#111827;color:#dbe3f1;padding:22px 16px;display:flex;flex-direction:column;z-index:20}.logo{display:flex;gap:11px;align-items:center;padding:4px 7px 22px;border-bottom:1px solid #253044}.logo>span{display:grid;place-items:center;width:42px;height:42px;background:#315efb;border-radius:13px;font-size:22px}.logo b,.logo small{display:block}.logo b{font-size:15px;color:#fff}.logo small{color:#8ea0ba;margin-top:5px}.sidebar nav{padding-top:18px;display:flex;flex-direction:column;gap:6px}.sidebar nav a{color:#aebbd0;text-decoration:none;padding:12px 13px;border-radius:11px;display:flex;gap:10px;align-items:center;transition:.15s}.sidebar nav a:hover,.sidebar nav a.active{background:#24304a;color:#fff}.sidebar-foot{margin-top:auto;border-top:1px solid #253044;padding-top:16px}.admin-name{color:#cbd5e1;margin-bottom:9px}.sidebar-foot a{color:#fb7185;text-decoration:none}.main{margin-right:260px;min-height:100vh}.topbar{height:92px;background:#fff;border-bottom:1px solid #e7eaf0;display:flex;align-items:center;padding:0 30px;gap:14px}.topbar h1{font-size:22px;margin:0 0 5px}.topbar p{margin:0;color:#8a94a6}.menu-btn{display:none;border:0;background:#f0f3f8;border-radius:10px;width:42px;height:42px;cursor:pointer}.content{padding:28px;max-width:1500px;margin:auto}.alert{padding:13px 15px;border-radius:12px;margin-bottom:18px;line-height:1.8}.alert-success{background:#ecfdf3;color:#087443;border:1px solid #c7f1d6}.alert-danger{background:#fff1f2;color:#a11c34;border:1px solid #ffd7df}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:17px;margin-bottom:20px}.stat{background:#fff;border:1px solid #e7eaf0;border-radius:16px;padding:19px;display:flex;gap:14px;align-items:center}.stat-icon{width:46px;height:46px;border-radius:13px;background:#eef2ff;display:grid;place-items:center;font-size:21px;flex:0 0 auto}.stat span{display:block;color:#7c8799;font-size:12px;margin-bottom:6px}.stat strong{font-size:23px}.stat .small-strong{font-size:15px;word-break:break-all}.card{background:#fff;border:1px solid #e7eaf0;border-radius:17px;padding:22px;margin-bottom:20px}.card.narrow{max-width:650px}.card-head{display:flex;justify-content:space-between;gap:15px;margin-bottom:20px}.card-head h2{font-size:17px;margin:0 0 7px}.card-head p{margin:0;color:#7e899b;line-height:1.8}.quick-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.quick-grid a{padding:18px;border:1px solid #e6eaf0;border-radius:13px;text-decoration:none;color:#24314a;background:#fafbfc}.two-col{display:grid;grid-template-columns:minmax(320px,440px) 1fr;gap:20px;align-items:start}.field{margin-bottom:16px}.field label{display:block;font-weight:700;font-size:13px;margin-bottom:7px}.field input,.field textarea{width:100%;border:1px solid #d7dce5;border-radius:11px;padding:11px 12px;outline:0;background:#fff;color:#172033}.field textarea{resize:vertical;line-height:1.9;direction:rtl}.field input:focus,.field textarea:focus{border-color:#5577ff;box-shadow:0 0 0 3px rgba(85,119,255,.09)}.field small{display:block;color:#8993a4;font-size:11px;margin-top:6px;line-height:1.7}.switch-row{display:flex;align-items:center;gap:9px;margin:3px 0 18px;cursor:pointer}.switch-row input{width:18px;height:18px}.actions{display:flex;gap:9px}.btn{border:0;padding:11px 17px;border-radius:10px;text-decoration:none;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;font-weight:700}.btn-primary{background:#315efb;color:#fff}.btn-light{background:#eef1f5;color:#364152}.btn-block{width:100%}.channel-list{display:flex;flex-direction:column;gap:10px}.channel-item{border:1px solid #e6eaf0;border-radius:13px;padding:13px;display:grid;grid-template-columns:1fr auto auto;gap:14px;align-items:center}.channel-main{display:flex;align-items:center;gap:10px;min-width:0}.channel-avatar{display:grid;place-items:center;width:40px;height:40px;background:#eff4ff;border-radius:11px}.channel-main b,.channel-main code{display:block}.channel-main code{direction:ltr;text-align:left;color:#7b8698;font-size:11px;margin-top:6px}.channel-meta{display:flex;gap:8px;align-items:center;color:#7e899b;font-size:11px}.badge{padding:5px 8px;border-radius:999px}.badge-green{background:#e9fbef;color:#12723d}.badge-gray{background:#f0f2f5;color:#657083}.row-actions{display:flex;gap:5px}.row-actions form{margin:0}.icon-btn{width:34px;height:34px;border:1px solid #e2e6ed;background:#fff;border-radius:9px;display:grid;place-items:center;text-decoration:none;cursor:pointer}.icon-btn.danger{background:#fff5f5}.empty{padding:40px 20px;text-align:center;color:#7e899b;display:flex;flex-direction:column;gap:8px;font-size:25px}.empty b{font-size:15px;color:#465166}.empty span{font-size:12px}.text-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.info-list{display:grid;gap:10px;margin-bottom:18px}.info-list>div{background:#f8fafc;border:1px solid #e7ebf0;border-radius:11px;padding:12px;display:grid;grid-template-columns:140px 1fr;gap:10px}.info-list span{color:#7a8698}.info-list code{overflow:auto}.login-body{min-height:100vh;display:grid;place-items:center;background:#f4f6fb;padding:18px}.login-card{width:min(420px,100%);background:#fff;border:1px solid #e6eaf0;border-radius:20px;padding:30px;box-shadow:0 20px 50px rgba(30,41,59,.08)}.login-card .brand-icon{width:58px;height:58px;border-radius:17px;background:#315efb;display:grid;place-items:center;font-size:29px;margin-bottom:18px}.login-card h1{font-size:21px;margin:0 0 8px}.login-card>p{color:#7b8698;margin:0 0 22px;line-height:1.8}@media(max-width:1100px){.stats{grid-template-columns:1fr 1fr}.two-col{grid-template-columns:1fr}.text-grid{grid-template-columns:1fr}}@media(max-width:900px){.sidebar{transform:translateX(105%);transition:.2s;box-shadow:-12px 0 30px rgba(0,0,0,.16)}.sidebar.open{transform:none}.main{margin-right:0}.menu-btn{display:block}.topbar{height:78px;padding:0 16px}.content{padding:16px}}@media(max-width:620px){.stats{grid-template-columns:1fr}.quick-grid{grid-template-columns:1fr}.channel-item{grid-template-columns:1fr}.channel-meta,.row-actions{justify-content:flex-start}.text-grid{grid-template-columns:1fr}.card{padding:16px;border-radius:14px}.content{padding:12px}.info-list>div{grid-template-columns:1fr}.topbar p{display:none}}

/* Users management */
.users-head{align-items:center;padding-bottom:18px;margin-bottom:0;border-bottom:1px solid #edf0f4}
.users-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.per-page-form{display:flex;align-items:center;gap:8px;margin:0}
.per-page-form label{color:#647085;font-size:12px;font-weight:700;white-space:nowrap}
.per-page-form select{min-width:78px;height:40px;border:1px solid #d7dce5;border-radius:10px;background:#fff;padding:0 10px;outline:0;color:#172033;cursor:pointer}
.per-page-form select:focus{border-color:#5577ff;box-shadow:0 0 0 3px rgba(85,119,255,.09)}
.btn-success{background:#159455;color:#fff}
.btn-success:hover{background:#107d47}
.users-table-wrap{width:100%;margin-top:18px;overflow:visible}
.users-table{width:100%!important;max-width:none!important;border-collapse:separate;border-spacing:0;table-layout:fixed;border:1px solid #e4e9f0;border-radius:13px;overflow:hidden;background:#fff}
.users-table thead{display:table-header-group}
.users-table tbody{display:table-row-group}
.users-table tr{display:table-row}
.users-table th,.users-table td{display:table-cell;padding:14px 16px;text-align:right;vertical-align:middle;border-bottom:1px solid #edf0f4;line-height:1.7}
.users-table th{background:#f7f9fc;color:#4d596c;font-size:12px;font-weight:700;white-space:nowrap}
.users-table td{color:#263247;font-size:13px;overflow-wrap:anywhere}
.users-table tbody tr:last-child td{border-bottom:0}
.users-table tbody tr:nth-child(even){background:#fbfcfe}
.users-table tbody tr:hover{background:#f7faff}
.users-table .col-row{width:80px;text-align:center}
.users-table .col-name{width:32%}
.users-table .col-username{width:30%}
.users-table .col-chatid{width:30%}
.users-table .username,.users-table .chat-id{display:inline-flex;align-items:center;direction:ltr;unicode-bidi:isolate;max-width:100%}
.users-table .username{color:#315efb;font-weight:700}
.users-table .chat-id{background:#f1f5f9;border:1px solid #e4e9ef;border-radius:8px;padding:5px 9px;color:#334155;font-size:12px;white-space:nowrap}
.muted{color:#a0a8b5}
.pagination{display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:wrap;padding-top:20px}
.pagination a,.pagination span{min-width:36px;height:36px;padding:0 10px;border:1px solid #e1e6ee;border-radius:9px;display:inline-flex;align-items:center;justify-content:center;text-decoration:none;color:#435066;background:#fff}
.pagination a:hover{border-color:#9fb1ff;color:#315efb}
.pagination a.active{background:#315efb;color:#fff;border-color:#315efb}
.pagination span{border-color:transparent;background:transparent;color:#8d97a7}

@media(max-width:780px){
.users-head{align-items:flex-start;flex-direction:column;gap:14px}
.users-tools{width:100%;justify-content:space-between}
.users-table-wrap{overflow:visible;margin-top:14px}
.users-table{display:block!important;border:0;border-radius:0;background:transparent;table-layout:auto}
.users-table thead{display:none}
.users-table tbody{display:block;width:100%}
.users-table tr{display:block;width:100%;border:1px solid #e4e9f0;border-radius:13px;padding:5px 14px;margin-bottom:10px;background:#fff;box-shadow:0 2px 8px rgba(30,41,59,.025)}
.users-table tbody tr:nth-child(even),.users-table tbody tr:hover{background:#fff}
.users-table td,.users-table td.col-row,.users-table td.col-name,.users-table td.col-username,.users-table td.col-chatid{display:flex;width:100%;min-height:44px;border-bottom:1px dashed #e8ebf0;padding:10px 0;align-items:center;justify-content:space-between;gap:16px;text-align:left;overflow:visible}
.users-table td:last-child{border-bottom:0}
.users-table td::before{content:attr(data-label);flex:0 0 92px;font-weight:700;color:#6f7b8e;font-size:12px;text-align:right}
.users-table td>strong,.users-table td>span,.users-table td>code{min-width:0;max-width:calc(100% - 108px);text-align:left}
.users-table .chat-id{white-space:normal;word-break:break-all}
.pagination{justify-content:center}
.quick-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:520px){
.users-tools{align-items:stretch;flex-direction:column}
.per-page-form{justify-content:space-between;width:100%}
.per-page-form select{min-width:96px}
.btn-success{width:100%}
.users-table tr{padding:4px 12px}
.users-table td::before{flex-basis:82px}
.users-table td>strong,.users-table td>span,.users-table td>code{max-width:calc(100% - 98px)}
.quick-grid{grid-template-columns:1fr}
}
@media(min-width:781px){.quick-grid{grid-template-columns:repeat(4,1fr)}}

/* Inline SVG icon system */
.svg-icon{width:20px;height:20px;display:block;flex:0 0 auto;color:inherit}
.logo .logo-mark .svg-icon{width:24px;height:24px;color:#fff}
.sidebar .nav-icon{width:22px;height:22px;display:grid;place-items:center;flex:0 0 22px}
.sidebar .nav-icon .svg-icon{width:19px;height:19px}
.admin-name,.sidebar-foot>a{display:flex;align-items:center;gap:8px}
.admin-name .svg-icon,.sidebar-foot>a .svg-icon{width:17px;height:17px}
.menu-btn{display:none;align-items:center;justify-content:center;color:#445169}
.menu-btn .svg-icon{width:21px;height:21px}
.stat-icon{color:#315efb;font-size:inherit}
.stat-icon .svg-icon{width:23px;height:23px}
.quick-grid a{display:flex;align-items:center;gap:10px;transition:.15s}
.quick-grid a:hover{border-color:#cbd5ff;background:#f7f8ff;color:#315efb}
.quick-grid a .svg-icon{width:20px;height:20px;color:#52637d}
.quick-grid a:hover .svg-icon{color:#315efb}
.btn{gap:8px}
.btn .svg-icon{width:18px;height:18px}
.channel-avatar{color:#315efb}
.channel-avatar .svg-icon{width:20px;height:20px}
.icon-btn{color:#516077}
.icon-btn:hover{border-color:#b9c5d8;background:#f8fafc;color:#315efb}
.icon-btn.danger{color:#d63c51}
.icon-btn.danger:hover{border-color:#ffcbd3;background:#fff0f2;color:#b91c35}
.icon-btn .svg-icon{width:17px;height:17px}
.empty{font-size:inherit}
.empty .empty-icon{width:38px;height:38px;color:#94a0b2;margin:0 auto 3px}
.login-card .brand-icon{color:#fff;font-size:inherit}
.login-card .brand-icon .svg-icon{width:30px;height:30px}
@media(max-width:900px){.menu-btn{display:flex}}

/* Security hardening UI helpers */
.logout-form,.export-form{margin:0}
.logout-button{appearance:none;border:0;background:transparent;padding:0;color:#fb7185;text-decoration:none;cursor:pointer;display:flex;align-items:center;gap:8px;font:inherit}
.logout-button:hover{color:#fda4af}
.logout-button .svg-icon{width:17px;height:17px}
