.tokens-compact-table tbody .token-row.token-row-readonly > td { background-color:#1c3048; }
.tokens-compact-table tbody .token-row.token-row-readonly:hover > td { background-color:#223b57; }
.tokens-compact-table tbody .token-row.token-row-readonly > td:first-child { box-shadow:inset -3px 0 0 #60a5fa; }
@media(max-width:767px) { .tokens-compact-table tbody .token-row.token-row-readonly { background:#1c3048; border-right:3px solid #60a5fa; } }
.token-readonly-badge { display:inline-flex; align-items:center; gap:5px; padding:3px 8px; border-radius:6px; color:#bfdbfe; background:rgba(96,165,250,.16); font-size:.76rem; white-space:nowrap; }
.token-readonly-label,.token-usage-refresh { color:#93c5fd; }
.token-readonly-hint { color:#bfdbfe; }
[data-readonly-hide][hidden] { display:none!important; }
.token-actions form { margin:0; }
.cleaner-queue-summary { display:flex; align-items:center; flex-wrap:wrap; gap:10px 18px; padding:14px 16px; background:#172232; border:1px solid #35445b; border-radius:10px; color:#cbd5e1; }
.cleaner-queue-pill { display:inline-flex; gap:6px; align-items:center; padding:4px 8px; border-radius:6px; font-size:.8rem; white-space:nowrap; }
.cleaner-queue-pill.force { color:#d2b8ff; background:#352d4c; }
.cleaner-queue-pill.normal { color:#b6c6dd; background:#28364b; }
.cleaner-queue-pill.instructions { color:#fed7aa; background:rgba(251,146,60,.16); }
.queue-current { color:#a5d1ff; min-width:0; overflow-wrap:anywhere; }
.queue-selection-reason { color:#a9b7cd; }
.queue-selection-reason:empty { display:none; }
.cleaner-result-tabs { display:flex; gap:22px; overflow-x:auto; border-bottom:1px solid #35445b; margin-top:10px; }
.cleaner-result-tab { padding:14px 0; color:#a9b7cd; background:transparent; border:0; border-bottom:2px solid transparent; }
.cleaner-result-tab[aria-selected="true"] { color:#f1f5f9; border-bottom-color:#93c5fd; }
.cleaner-result-tab { display:inline-flex; align-items:center; gap:8px; white-space:nowrap; font-size:.85rem; }
.cleaner-result-tab b { min-width:22px; padding:2px 6px; border-radius:6px; background:#28364b; font-size:.75rem; }
.cleaner-result-tab:focus-visible { outline:2px solid #93c5fd; outline-offset:-2px; }
.cleaner-results-shell [hidden] { display:none!important; }
.modal-content:has(.cleaner-results-shell > [data-cleaner-results]:not([hidden])) { max-height:calc(100dvh - 2 * var(--bs-modal-margin)); }
.app-modal .modal-body.cleaner-results-shell:has(> [data-cleaner-results]:not([hidden])) { display:flex; flex-direction:column; min-height:0; overflow:hidden; }
.cleaner-results-shell:has(> [data-cleaner-results]:not([hidden])) > :not([data-cleaner-results]) { flex-shrink:0; }
.cleaner-results-shell > [data-cleaner-results] { min-height:0; overflow-y:auto; overscroll-behavior-y:contain; scrollbar-gutter:stable; }
.cleaner-results-table-wrap { margin-top:0; }
.cleaner-results-table { min-width:700px; margin-bottom:0; }
.cleaner-results-table th { font-weight:500; font-size:.82rem; color:#a9b7cd; }
.cleaner-results-table td { vertical-align:middle; font-size:.85rem; }
.cleaner-results-table td strong,.cleaner-results-table td small { display:block; }
.cleaner-results-table td small { margin-top:5px; color:#a9b7cd; font-size:.78rem; }
.cleaner-results-table tr.is-selected > td { background:#20364e; }
.cleaner-result-delay { color:#f8cd79!important; white-space:nowrap; }
.cleaner-result-status.success { color:#92dfb3; }
.cleaner-result-status.failed,.cleaner-result-issue { color:#ffb3bc; }
.cleaner-result-status.warning { color:#f8cd79; }
.cleaner-result-status.skipped,.cleaner-result-status.interrupted { color:#a9b7cd; }
.cleaner-result-detail { padding:18px; background:#172232; border:1px solid #35445b; border-radius:0 0 10px 10px; }
.cleaner-results-table .cleaner-result-detail-row > td { padding:0; border:0; }
.cleaner-detail-title { display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; }
.cleaner-detail-title span { color:#a9b7cd; font-size:.82rem; }
.cleaner-detail-times { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:18px 0; }
.cleaner-detail-times small { display:block; color:#a9b7cd; margin-bottom:7px; }
.cleaner-detail-times bdi { font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.cleaner-detail-summary { border-top:1px solid #35445b; padding-top:12px; line-height:2; overflow-wrap:anywhere; }
.cleaner-result-note { color:#a9b7cd; font-size:.8rem; margin-top:12px; }
@media(max-width:575px) { .cleaner-detail-times { grid-template-columns:1fr; } .cleaner-result-detail { padding:12px; } }
@font-face {
    font-family: "Vazir";
    src: url("../fonts/Vazir.woff2") format("woff2"),
         url("../fonts/Vazir.woff") format("woff"),
         url("../fonts/Vazir.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root { --bg:#111827; --panel:#1b2435; --panel-2:#212c3f; --line:#303c51; --text:#f1f5f9; --muted:#94a3b8; --accent:#6366f1; --accent-2:#818cf8; --sidebar:260px; --header:70px; --bs-body-font-family:"Vazir",Tahoma,Arial,sans-serif; }
* { box-sizing:border-box; }
html { font-size:14px; min-height:100%; }
body { min-height:100vh; margin:0; font-family:"Vazir",Tahoma,Arial,sans-serif; color:var(--text); background:radial-gradient(circle at 15% 0%,#202b43 0,transparent 35%),var(--bg); }
a { text-decoration:none; }
.topbar { position:fixed; top:0; right:0; left:0; height:var(--header); z-index:1040; display:flex; align-items:center; padding:0 25px; border-bottom:1px solid var(--line); background:rgba(20,29,45,.92); backdrop-filter:blur(12px); box-shadow:0 10px 30px rgba(0,0,0,.18); }
.brand { display:flex; align-items:center; gap:11px; color:#fff; font-weight:700; font-size:1.12rem; }
.brand:hover { color:#fff; }
.brand-mark { display:grid; place-items:center; width:38px; height:38px; border-radius:11px; background:linear-gradient(135deg,var(--accent),#8b5cf6); box-shadow:0 8px 22px rgba(99,102,241,.4); }
.topbar-user { margin-right:auto; display:flex; align-items:center; gap:9px; color:#cbd5e1; }
.topbar-user-menu { display:flex; align-items:center; gap:9px; min-height:40px; padding:6px 11px; border:1px solid transparent; border-radius:11px; color:#cbd5e1; background:transparent; transition:.18s ease; }
.topbar-user-menu:hover,.topbar-user-menu[aria-expanded="true"] { color:#fff; border-color:#3b4a62; background:#202c3f; }
.user-menu-chevron { color:#718096; font-size:1.05rem; transition:transform .18s ease; }
.topbar-user-menu[aria-expanded="true"] .user-menu-chevron { transform:rotate(180deg); }
.user-dropdown-menu { min-width:205px; margin-top:10px!important; padding:8px; color:var(--text); background:#1b2638; border:1px solid #35445b; border-radius:13px; box-shadow:0 18px 40px rgba(0,0,0,.38); }
.user-dropdown-menu .dropdown-item { display:flex; align-items:center; gap:10px; padding:10px 12px; border:0; border-radius:9px; color:#d7e0ec; background:transparent; text-align:right; }
.user-dropdown-menu .dropdown-item:hover { color:#fff; background:#29374c; }
.user-dropdown-menu .dropdown-divider { border-color:#35445b; }
.user-dropdown-menu form { margin:0; }
.user-dropdown-menu .user-logout-item { width:100%; color:#fda4af; }
.notification-button { display:grid; place-items:center; width:36px; height:36px; margin-left:4px; padding:0; border:1px solid #3b4a62; border-radius:10px; color:#cbd5e1; background:#202c3f; transition:.18s ease; }
.notification-button:hover { color:#fff; border-color:#64748b; background:#2b3950; }
.notification-button.enabled { color:#fde68a; border-color:rgba(245,158,11,.45); background:rgba(245,158,11,.12); }
.notification-button.denied { color:#fda4af; border-color:rgba(244,63,94,.4); }
.token-notification-toast { position:fixed; left:24px; bottom:24px; z-index:2000; display:grid; grid-template-columns:1fr auto; gap:5px 18px; min-width:320px; max-width:440px; padding:16px 18px; color:#fecdd3; background:#321b27; border:1px solid rgba(251,113,133,.5); border-radius:14px; box-shadow:0 18px 45px rgba(0,0,0,.45); }
.token-notification-toast strong,.token-notification-toast span { grid-column:1; }
.token-notification-toast a { grid-column:1; margin-top:5px; color:#bfdbfe; font-size:.82rem; }
.token-notification-toast button { grid-column:2; grid-row:1/4; align-self:start; border:0; color:#fda4af; background:transparent; font-size:1.4rem; }
.app-action-toast.success { color:#bbf7d0; background:#153524; border-color:rgba(74,222,128,.5); }
.app-action-toast.success button { color:#86efac; }
.cleaner-interrupted-toast { color:#fde68a; background:#352615; border-color:rgba(245,158,11,.55); }
.cleaner-interrupted-toast button { color:#fcd34d; }
.status-dot { width:9px; height:9px; border-radius:50%; background:#22c55e; box-shadow:0 0 0 4px rgba(34,197,94,.12); }
.sidebar-toggle { display:none; margin-left:12px; border:0; color:#fff; background:transparent; font-size:1.6rem; }
.sidebar { position:fixed; right:0; top:var(--header); bottom:0; width:var(--sidebar)!important; color:var(--text); background:linear-gradient(180deg,#182235,#131b2a); border-left:1px solid var(--line); box-shadow:-14px 0 35px rgba(0,0,0,.12); }
.sidebar-body { display:flex; flex-direction:column; width:100%; padding:25px 16px; }
.sidebar-title { padding:0 12px 14px; color:#64748b; font-size:.78rem; letter-spacing:.04em; }
.side-nav { display:flex; flex-direction:column; gap:7px; }
.side-link { display:flex; width:100%; align-items:center; gap:12px; padding:13px 14px; border:1px solid transparent; border-radius:12px; color:#aebbd0; background:transparent; transition:.2s ease; }
.side-link:hover { color:#fff; background:rgba(255,255,255,.05); transform:translateX(-2px); }
.side-link.active { color:#fff; border-color:rgba(129,140,248,.25); background:linear-gradient(90deg,rgba(99,102,241,.24),rgba(99,102,241,.08)); box-shadow:inset -3px 0 0 var(--accent-2); }
.side-icon { display:grid; place-items:center; width:25px; height:25px; color:var(--accent-2); font-size:1.15rem; }
.btn i,.action-btn i,.dropdown-item i { margin-left:5px; }
.action-btn { display:inline-grid; place-items:center; width:35px; min-width:35px; height:35px; padding:0; }
.action-btn i { margin:0; }
.logout-form { margin-top:auto; }
.logout-link { border:0; color:#fda4af; }
.sidebar-footer { margin-top:14px; padding:18px 8px 2px; border-top:1px solid var(--line); color:#64748b; font-size:.76rem; text-align:center; direction:ltr; }
.main-content { min-height:100vh; padding:calc(var(--header) + 28px) calc(var(--sidebar) + 30px) 35px 30px; }
.impersonation-banner { position:fixed; z-index:1100; top:76px; left:24px; display:flex; align-items:center; gap:8px; padding:10px 14px; color:#fef3c7; background:#3a2a16; border:1px solid rgba(245,158,11,.5); border-radius:11px; box-shadow:0 12px 30px rgba(0,0,0,.3); }
.impersonation-banner button { margin-right:8px; padding:4px 9px; border:1px solid rgba(251,191,36,.45); border-radius:7px; color:#fde68a; background:transparent; }
.profile-grid { display:grid; grid-template-columns:minmax(280px,360px) minmax(0,1fr); gap:24px; align-items:start; }
.system-settings-card { width:min(100%,1217px); max-width:1217px; padding:24px; }
.system-settings-card .section-heading { padding-bottom:18px; border-bottom:1px solid var(--line); }
.settings-tabs { gap:6px; border-bottom-color:var(--line); }
.header-instructions-text { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.9; text-align:start; }
.settings-tabs .nav-link { padding:11px 16px; color:var(--muted); border-color:transparent; border-radius:10px 10px 0 0; background:transparent; }
.settings-tabs .nav-link:hover { color:#fff; border-color:#3b4a62 #3b4a62 transparent; }
.settings-tabs .nav-link.active { color:#fff; border-color:var(--line) var(--line) var(--panel); background:var(--panel); }
.settings-tabs .nav-link i { margin-left:6px; }
.proxy-list-wrap { overflow:auto; border:1px solid var(--line); border-radius:12px; }
.proxy-list-table { --bs-table-bg:transparent; margin:0; }
.telegram-proxy-table { width:100%; min-width:0; table-layout:fixed; }
.telegram-proxy-table th,.telegram-proxy-table td { min-width:0; }
.telegram-proxy-table th:nth-child(1) { width:auto; }
.telegram-proxy-table th:nth-child(2) { width:116px; }
.telegram-proxy-table th:nth-child(3) { width:150px; }
.telegram-proxy-address { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.telegram-proxy-table .proxy-actions { justify-content:flex-end; flex-wrap:nowrap; }
.telegram-proxy-table .proxy-status { max-width:100%; overflow:hidden; text-overflow:ellipsis; }
.proxy-list-table th,.proxy-list-table td { padding:11px 14px; border-color:var(--line); }
.proxy-list-table thead th { color:var(--muted); font-size:.82rem; font-weight:600; }
.proxy-list-table .empty-row td { color:var(--muted); text-align:center; padding:24px; }
.proxy-status { display:inline-flex; align-items:center; gap:6px; font-size:.82rem; white-space:nowrap; }
.proxy-status.success { color:#54d391; }
.proxy-status.failed { color:#ff8585; }
.proxy-status.loading { color:#7dd3fc; }
.proxy-status .spinner-border { width:12px; height:12px; flex-shrink:0; }
.proxy-test-wrap { overflow:hidden; }
.proxy-test-table { width:100%; min-width:0; table-layout:fixed; }
.proxy-test-table th,.proxy-test-table td { min-width:0; }
.proxy-test-table th:nth-child(1),.proxy-test-table td:nth-child(1) { width:42px; padding-right:8px; padding-left:8px; text-align:center; }
.proxy-test-table th:nth-child(2) { width:56%; }
.proxy-test-table th:nth-child(3) { width:auto; }
.proxy-test-table .proxy-test-address { overflow:hidden; color:#94a3b8; font-size:.64rem; line-height:1.3; text-overflow:ellipsis; white-space:nowrap; }
.proxy-test-table .proxy-status { max-width:100%; overflow:hidden; font-size:.72rem; text-overflow:ellipsis; white-space:nowrap; }
.proxy-test-table .proxy-check { width:1.1rem; height:1.1rem; margin:0; cursor:pointer; accent-color:#22c55e; }
.proxy-actions { display:inline-flex; align-items:center; gap:6px; }
.proxy-actions .action-btn { justify-content:center; flex:0 0 35px; width:35px; height:35px; padding:0; line-height:1; }
.proxy-actions .action-btn i { margin:0; width:1em; line-height:1; text-align:center; }
.settings-tab-content { min-height:390px; }
.settings-tab-content .section-heading { padding-top:22px; }
.settings-pane-body { padding-top:22px; }
.settings-actions { padding-top:20px; border-top:1px solid var(--line); }
.settings-icon { display:grid; place-items:center; width:46px; height:46px; flex:0 0 46px; border:1px solid rgba(99,102,241,.28); border-radius:13px; color:#c7d2fe; background:rgba(99,102,241,.14); font-size:1.15rem; }
.settings-field { max-width:440px; }
.settings-interval-input { direction:ltr; }
.settings-interval-input .form-control { min-height:46px; text-align:left!important; }
.settings-interval-input .input-group-text { color:#cbd5e1; border-color:#46536a; background:#263247; }
.settings-request-count { min-height:46px; }
.settings-effective-interval { color:#a5b4fc; }
.settings-instructions { min-height:190px; resize:vertical; line-height:1.8; }
.settings-instructions-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
@media (max-width:767.98px) { .settings-instructions-grid { grid-template-columns:1fr; } }
.profile-summary-card,.profile-password-card { padding:25px; }
.profile-summary-card { text-align:center; }
.profile-avatar { display:grid; place-items:center; width:78px; height:78px; margin:0 auto 15px; border-radius:24px; color:#fff; background:linear-gradient(135deg,var(--accent),#8b5cf6); box-shadow:0 12px 30px rgba(99,102,241,.35); font-size:2rem; font-weight:800; }
.profile-summary-card h2 { margin:0 0 7px; font-size:1.35rem; }
.profile-summary-card > div > span { color:var(--muted); }
.profile-details { display:grid; gap:0; margin:25px 0 0; text-align:right; }
.profile-details div { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:14px 0; border-top:1px solid var(--line); }
.profile-details dt { color:var(--muted); font-weight:400; }
.profile-details dd { margin:0; color:var(--text); }
.profile-api-key { margin-top:20px; padding-top:20px; border-top:1px solid var(--line); text-align:right; }
.profile-api-key .input-group { flex-wrap:nowrap; }
.profile-api-key .form-text { margin-top:7px; color:var(--muted); font-size:.77rem; }
.profile-mobile-field .form-text { margin-top:7px; color:var(--muted); font-size:.77rem; }
.username-label-hint { color:#74839a; font-size:.88em; font-weight:400; }
.profile-password-divider { display:flex; align-items:center; gap:12px; margin:4px 0 20px; color:var(--muted); font-size:.82rem; }
.profile-password-divider:before,.profile-password-divider:after { content:""; height:1px; flex:1; background:var(--line); }
.profile-password-card form { max-width:620px; }
.content-shell { max-width:1400px; margin:0 auto; }
.page-heading { margin-bottom:25px; }
.page-heading h1 { margin:0 0 7px; font-size:1.75rem; font-weight:700; }
.page-heading p { margin:0; color:var(--muted); }
.card,.panel { color:var(--text); background:linear-gradient(145deg,rgba(34,45,65,.96),rgba(25,35,52,.96)); border:1px solid var(--line); border-radius:16px; box-shadow:0 15px 35px rgba(0,0,0,.22); }
.stat-card { position:relative; overflow:hidden; padding:25px; min-height:145px; }
.stat-card:after { content:""; position:absolute; width:110px; height:110px; left:-35px; bottom:-50px; border-radius:50%; background:var(--glow,#6366f1); opacity:.12; filter:blur(2px); }
.stat-label { color:var(--muted); }
.stat-value { margin:13px 0 0; font-size:2.35rem; font-weight:800; }
.token-stat-card { display:grid; grid-template-columns:1fr 1fr; padding:0; }
.token-stat-part { display:flex; min-width:0; flex-direction:column; justify-content:center; padding:25px; }
.active-token-stat { border-right:1px solid var(--line); }
.system-users-stat { border-right:1px solid var(--line); }
.system-stat-three { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); padding:0; }
.system-stat-three .token-stat-part { padding:18px 12px; text-align:center; }
.system-stat-three .stat-label { font-size:.8rem; }
.system-stat-three .stat-value { font-size:2rem; }
.system-active-stat { position:relative; overflow:hidden; border-right:1px solid rgba(52,211,153,.28); background:linear-gradient(145deg,rgba(16,100,76,.58),rgba(18,72,61,.42)); box-shadow:inset 0 0 24px rgba(34,197,94,.08); }
.system-active-stat:after { content:""; position:absolute; width:72px; height:72px; left:-28px; bottom:-32px; border-radius:50%; background:#22c55e; opacity:.14; }
.system-active-stat .stat-label { position:relative; z-index:1; color:#a7f3d0; }
.system-active-stat .stat-value { position:relative; z-index:1; color:#dcfce7; text-shadow:0 0 18px rgba(74,222,128,.22); }
.system-stat-card .stat-value { color:#e0e7ff; }
.active-token-stat .stat-label { display:flex; align-items:center; gap:8px; color:#a7f3d0; }
.active-token-stat .stat-value { color:#dcfce7; }
.active-stat-dot { width:8px; height:8px; flex:0 0 8px; border-radius:50%; background:#22c55e; box-shadow:0 0 0 4px rgba(34,197,94,.12); }
.btn-primary,.btn-success { border:0; background:linear-gradient(135deg,var(--accent),#7c3aed); box-shadow:0 8px 18px rgba(99,102,241,.25); }
.btn-primary:hover,.btn-success:hover { background:linear-gradient(135deg,#7477f5,#8b5cf6); }
.btn-outline-secondary { color:#cbd5e1; border-color:#475569; }
.btn-outline-secondary:hover { background:#334155; border-color:#64748b; }
.token-heading-actions .btn { white-space:nowrap; }
.token-type-badge { display:inline-flex; align-items:center; justify-content:center; min-width:58px; padding:5px 9px; border-radius:8px; font-size:.78rem; font-weight:700; }
.token-type-badge.web { color:#bfdbfe; background:rgba(59,130,246,.14); border:1px solid rgba(96,165,250,.3); }
.token-type-badge.codex { color:#ddd6fe; background:rgba(139,92,246,.14); border:1px solid rgba(167,139,250,.3); }
.form-control,.form-select { color:var(--text); background:#111a29; border-color:#344157; }
.form-control:focus,.form-select:focus { color:#fff; background:#111a29; border-color:var(--accent-2); box-shadow:0 0 0 .2rem rgba(99,102,241,.18); }
.form-control::placeholder { color:#66758d; }
.form-select option { background:#182235; }
.table-panel { overflow:auto; background:#1d283a; }
.table { margin:0; color:#edf2f7; --bs-table-color:#edf2f7; --bs-table-bg:#202c3f; --bs-table-striped-bg:#27354a; --bs-table-striped-color:#f8fafc; --bs-table-hover-bg:#30405a; --bs-table-hover-color:#fff; --bs-table-border-color:#3b4a62; }
.table thead th { padding:16px; color:#f1f5f9; font-weight:600; background:#2b3950; border-bottom:1px solid #4b5d78; }
.table tbody tr { transition:background-color .15s ease; }
.table tbody tr:hover > * { color:#fff; background-color:#30405a; }
.table td { padding:15px 16px; vertical-align:middle; color:#e5edf7; }
.token-cell { direction:ltr; text-align:left; max-width:360px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.token-name { min-width:120px; max-width:210px; overflow:hidden; color:#e2e8f0; font-weight:600; text-overflow:ellipsis; white-space:nowrap; }
.tokens-table { width:100%; min-width:0; table-layout:fixed; }
.tokens-table .token-cell { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tokens-table .token-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.usage-cell { display:flex; min-width:0; flex-direction:column; gap:5px; direction:ltr; }
.usage-cell strong { color:#dbeafe; font-size:.78rem; font-variant-numeric:tabular-nums; text-align:center; }
.usage-track { display:block; width:100%; height:5px; overflow:hidden; border-radius:999px; background:rgba(100,116,139,.32); }
.usage-track > span { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#22c55e,#38bdf8); }
.usage-unavailable { display:block; color:#64748b; text-align:center; }
.usage-reset { direction:rtl; font-size:.75rem; font-variant-numeric:tabular-nums; text-align:center; }
.usage-invalid { position:relative; color:transparent!important; background-image:repeating-linear-gradient(135deg,rgba(248,113,113,.1) 0,rgba(248,113,113,.1) 6px,rgba(15,23,42,.07) 6px,rgba(15,23,42,.07) 12px)!important; }
.tokens-table .token-row > td.usage-invalid { position:relative!important; }
.usage-invalid > * { visibility:hidden; }
.usage-invalid::after { content:"نامعتبر"; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#fecaca; font-size:.68rem; font-weight:700; letter-spacing:0; }
.tokens-table tbody .token-row.cleanup-failed-row > td { color:#ffe4e6; background-color:rgba(127,29,29,.56); border-top-color:rgba(251,113,133,.55); border-bottom-color:rgba(251,113,133,.55); }
.tokens-table tbody .token-row.cleanup-failed-row:hover > td { color:#fff1f2; background-color:rgba(153,27,27,.7); }
.tokens-table tbody .token-row.cleanup-failed-row > td:first-child { box-shadow:inset -4px 0 0 #fb7185; }
.tokens-table tbody .token-row { transition:opacity .18s ease,filter .18s ease; }
.tokens-table tbody .token-row.token-row-inactive { opacity:.58; filter:saturate(.35); }
.tokens-table tbody .token-row.token-row-inactive > td { background-color:rgba(100,116,139,.08); }
.tokens-table tbody .token-row.token-row-inactive:hover { opacity:.76; }
.tokens-table .device-badges { display:inline-flex; max-width:calc(100% - 38px); overflow:hidden; vertical-align:middle; white-space:nowrap; }
.ignore-device-count { display:inline-grid; place-items:center; min-width:25px; height:25px; margin-left:7px; padding:0 7px; border:1px solid rgba(34,211,238,.3); border-radius:8px; color:#a5f3fc; background:rgba(6,182,212,.12); font-size:.76rem; font-weight:700; }
.custom-instructions-heading { line-height:1.45; white-space:normal; }
.custom-instructions-cell { text-align:center; }
.grid-setting-check { width:1.15rem; height:1.15rem; margin:0; vertical-align:middle; accent-color:#6366f1; }
.grid-setting-check:disabled { opacity:1; filter:none; }
.tokens-table th:last-child,.tokens-table td:last-child { padding-left:6px; padding-right:6px; white-space:nowrap; }
.tokens-table .token-actions { display:flex; flex-wrap:nowrap; align-items:center; gap:4px; white-space:nowrap; }
.tokens-table .action-btn { justify-content:center; width:31px; min-width:31px; height:31px; padding:0; }
.tokens-table + * { clear:both; }
.tokens-table.table { min-width:0!important; }
.tokens-table { overflow:visible; }
.tokens-table .token-actions { justify-content:flex-start; }
.token-toggle-group { display:inline-flex; flex:0 0 auto; align-items:center; direction:rtl; }
.token-toggle-group > form .token-toggle-button { border-radius:0 8px 8px 0; }
.tokens-table .token-toggle-group .token-disable-menu-button { flex:0 0 18px; width:18px; min-width:18px; padding:0; border-right:0; border-radius:8px 0 0 8px; color:#fde68a; }
.token-disable-menu-button.dropdown-toggle::after { display:none; }
.token-disable-menu-button i { font-size:.58rem; }
.token-disable-menu { min-width:120px; padding:6px; color:var(--text); background:#1b2638; border:1px solid #35445b; border-radius:10px; box-shadow:0 16px 35px rgba(0,0,0,.4); }
.token-disable-menu form { display:block; width:100%; }
.token-disable-menu .dropdown-item { width:100%; padding:8px 10px; border:0; border-radius:7px; color:#d7e0ec; background:transparent; text-align:right; font-size:.8rem; }
.token-disable-menu .dropdown-item:hover,.token-disable-menu .dropdown-item:focus { color:#fff; background:#29374c; }
.tokens-grid-panel { width:110%; margin-right:-5%; margin-left:-5%; overflow:visible; }
.tokens-grid-panel:has(.token-disable-menu.show) { overflow:visible; }
.tokens-table .token-row:has(.token-disable-menu.show) { position:relative; z-index:4; overflow:visible; }
.token-scope-tabs { display:inline-flex; margin:0 0 16px; padding:5px; gap:5px; border:1px solid var(--line); border-radius:12px; background:rgba(15,23,42,.55); }
.token-scope-tab { display:inline-flex; min-height:40px; padding:8px 16px; align-items:center; justify-content:center; gap:8px; border:1px solid transparent; border-radius:9px; color:var(--muted); text-decoration:none; font-weight:700; transition:.18s ease; }
.token-scope-tab:hover { color:#e2e8f0; background:rgba(71,85,105,.22); }
.token-scope-tab.active { color:#e0e7ff; border-color:rgba(99,102,241,.38); background:linear-gradient(135deg,rgba(79,70,229,.3),rgba(37,99,235,.2)); box-shadow:0 5px 16px rgba(15,23,42,.3); }
.token-owner { display:flex; min-width:0; flex-direction:column; gap:3px; }
.token-owner strong,.token-owner small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.token-owner strong { color:#e2e8f0; font-size:.82rem; }
.token-owner small { color:var(--muted); direction:ltr; font-size:.7rem; text-align:right; }
@media (max-width:991.98px) { .tokens-grid-panel { width:100%; margin-right:0; margin-left:0; } }
.login-layout { display:grid; min-height:100vh; place-items:center; padding:24px; background:radial-gradient(circle at 50% 10%,#293652,transparent 42%); }
.login-card { width:min(100%,430px); padding:34px; border:1px solid var(--line); border-radius:20px; background:linear-gradient(145deg,rgba(34,45,65,.98),rgba(24,33,50,.98)); box-shadow:0 24px 65px rgba(0,0,0,.38); }
.login-brand { display:flex; align-items:center; justify-content:center; gap:14px; margin-bottom:30px; }
.login-brand h1 { margin:0 0 5px; color:#fff; font-size:1.35rem; font-weight:800; direction:ltr; text-align:right; }
.login-brand p { margin:0; color:var(--muted); font-size:.88rem; }
.login-form .form-label { margin-bottom:8px; color:#cbd5e1; }
.login-form .form-control { min-height:50px; border-radius:11px; font-size:.95rem; }
.login-form .login-ltr-input { direction:ltr!important; text-align:left!important; }
.login-form .btn { min-height:50px; border-radius:11px; font-size:1rem; }
.text-danger { color:#fda4af!important; }
.validation-box:empty { display:none; }
.validation-box { padding:11px 14px; color:#fecdd3; background:rgba(244,63,94,.12); border:1px solid rgba(251,113,133,.3); border-radius:10px; }
.validation-box ul { margin:0; padding-right:18px; }
.app-alert { color:#bbf7d0; background:rgba(34,197,94,.12); border-color:rgba(34,197,94,.28); border-radius:12px; }
.dashboard-telegram-alert { display:flex; align-items:center; gap:13px; margin:0 0 20px; padding:14px 16px; color:#dbeafe; background:linear-gradient(110deg,rgba(14,116,144,.2),rgba(30,41,59,.55)); border:1px solid rgba(56,189,248,.34); border-radius:13px; box-shadow:0 10px 25px rgba(8,47,73,.14); }
.dashboard-telegram-alert-icon { display:grid; flex:0 0 38px; width:38px; height:38px; place-items:center; color:#67e8f9; background:rgba(8,145,178,.15); border-radius:10px; font-size:1.15rem; }
.dashboard-telegram-alert-copy { display:flex; min-width:0; flex:1; flex-direction:column; gap:4px; }
.dashboard-telegram-alert-copy strong { color:#f0f9ff; font-size:.88rem; }
.dashboard-telegram-alert-copy span { color:#a5b4c8; font-size:.76rem; line-height:1.8; }
.dashboard-telegram-alert-action { flex:0 0 auto; white-space:nowrap; }
@media (max-width:767.98px) { .dashboard-telegram-alert { align-items:flex-start; flex-wrap:wrap; } .dashboard-telegram-alert-action { width:100%; margin-right:51px; } }
.app-error-alert { color:#fecdd3; background:rgba(244,63,94,.12); border:1px solid rgba(251,113,133,.3); border-radius:12px; }
.token-actions { display:flex; flex-wrap:nowrap; align-items:center; gap:6px; white-space:nowrap; }
.token-actions form { display:inline-flex; flex:0 0 auto; margin:0; }
.action-btn { display:inline-flex; align-items:center; gap:5px; min-height:34px; padding:6px 9px; border:1px solid #46536a; border-radius:8px; color:#cbd5e1; background:#263247; font-size:.78rem; transition:.18s ease; }
.action-btn:hover { color:#fff; border-color:#718096; background:#33415a; }
.action-btn.edit { color:#bfdbfe; }
.action-btn.fetch-codex-account { color:#86efac; }
.action-btn.fetch-grid-device { color:#67e8f9; }
.action-btn.toggle { color:#fde68a; }
.action-btn.delete { color:#fda4af; }
.action-btn.delete:hover { border-color:#fb7185; background:rgba(244,63,94,.15); }
.token-actions .action-btn { flex:0 0 35px; width:35px; min-width:35px; height:35px; padding:0; justify-content:center; }
.log-count { padding:8px 13px; color:#c7d2fe; background:rgba(99,102,241,.12); border:1px solid rgba(129,140,248,.22); border-radius:999px; font-size:.82rem; }
.log-date { direction:ltr; text-align:right; white-space:nowrap; color:#cbd5e1; }
.log-token { display:inline-block; min-width:34px; padding:4px 8px; text-align:center; direction:ltr; color:#bfdbfe; background:rgba(59,130,246,.11); border-radius:7px; }
.log-token-info { display:flex; max-width:280px; align-items:center; gap:7px; direction:ltr; }
.log-token-info code { overflow:hidden; color:#94a3b8; text-overflow:ellipsis; white-space:nowrap; }
.log-status { display:inline-block; padding:5px 9px; color:#fde68a; background:rgba(245,158,11,.11); border:1px solid rgba(245,158,11,.18); border-radius:8px; font-size:.78rem; }
.log-description { min-width:240px; max-width:480px; color:#aebbd0; white-space:normal; line-height:1.7; }
.empty-state { display:flex; min-height:230px; align-items:center; justify-content:center; flex-direction:column; gap:9px; color:var(--muted); }
.empty-state > span { display:grid; place-items:center; width:52px; height:52px; margin-bottom:4px; border-radius:14px; color:var(--accent-2); background:rgba(99,102,241,.12); font-size:1.8rem; }
.empty-state strong { color:#dbe4f0; font-size:1rem; }
.empty-state small { color:#718096; }
.user-name { display:flex; align-items:center; gap:9px; }
.user-name small { padding:3px 6px; color:#a5b4fc; background:rgba(99,102,241,.12); border-radius:6px; font-size:.68rem; }
.user-avatar { display:grid; place-items:center; width:32px; height:32px; border-radius:9px; color:#fff; background:linear-gradient(135deg,#6366f1,#8b5cf6); font-size:.8rem; font-weight:700; }
.role-badge { display:inline-block; padding:5px 9px; border-radius:8px; font-size:.76rem; }
.role-badge.admin { color:#fde68a; background:rgba(245,158,11,.12); border:1px solid rgba(245,158,11,.2); }
.role-badge.user { color:#bfdbfe; background:rgba(59,130,246,.11); border:1px solid rgba(59,130,246,.18); }
.ltr-value { direction:ltr; text-align:right; }
.action-btn:disabled { opacity:.35; cursor:not-allowed; }
.cleaner-section { margin-top:34px; }
.dashboard-cleaner-layout > [class*="col-"] { display:flex; }
.dashboard-token-panel,.dashboard-cleaner-panel { width:100%; }
.dashboard-token-panel { padding:18px 20px 8px; overflow:hidden; }
.dashboard-panel-heading { margin-bottom:10px; }
.dashboard-token-link { display:inline-flex; align-items:center; gap:7px; color:#a5b4fc; font-size:.78rem; white-space:nowrap; }
.dashboard-token-link:hover { color:#e0e7ff; }
.dashboard-token-link i { font-size:.62rem; }
.dashboard-token-table-wrap { max-height:330px; overflow:auto; }
.dashboard-token-table { min-width:820px; margin:0; font-size:.76rem; }
.dashboard-token-table th { position:sticky; top:0; z-index:1; padding:9px 10px; color:#8290a5; background:#202c3f; font-size:.68rem; font-weight:600; white-space:nowrap; }
.dashboard-token-table td { padding:10px; border-color:rgba(71,85,105,.35); white-space:nowrap; }
.dashboard-token-table tbody tr:last-child td { border-bottom:0; }
.dashboard-token-table tbody tr { transition:opacity .18s ease,background-color .18s ease; }
.dashboard-token-table tbody tr.dashboard-token-row-inactive { opacity:.58; background:rgba(100,116,139,.08); filter:saturate(.35); }
.dashboard-token-table tbody tr.dashboard-token-row-inactive:hover { opacity:.76; }
.dashboard-token-name { max-width:180px; overflow:hidden; color:#e2e8f0; font-weight:700; text-overflow:ellipsis; }
.dashboard-token-usage { color:#a5f3fc; font-weight:800; direction:ltr; }
.dashboard-usage-cell { min-width:64px; }
.dashboard-token-reset { color:#94a3b8; direction:rtl; font-size:.7rem; }
.dashboard-token-status { display:inline-flex; padding:4px 7px; border-radius:7px; font-size:.68rem; font-weight:700; }
.dashboard-token-status.active { color:#bbf7d0; background:rgba(34,197,94,.13); }
.dashboard-token-status.inactive { color:#cbd5e1; background:rgba(100,116,139,.18); }
.dashboard-cleanup-status,.dashboard-instructions-status { display:inline-flex; padding:4px 7px; border-radius:7px; font-size:.68rem; font-weight:700; white-space:nowrap; }
.dashboard-cleanup-status.success,.dashboard-instructions-status.active { color:#bbf7d0; background:rgba(34,197,94,.13); }
.dashboard-cleanup-status.failed { color:#fecdd3; background:rgba(244,63,94,.13); }
.dashboard-cleanup-status.pending,.dashboard-instructions-status.inactive { color:#cbd5e1; background:rgba(100,116,139,.18); }
.dashboard-token-empty td { height:110px; color:var(--muted); text-align:center; }
.dashboard-cleaner-panel { display:flex; padding:18px 20px; flex-direction:column; }
.dashboard-cleaner-panel .script-grid { grid-template-columns:1fr; }
.dashboard-cleaner-panel .script-card { flex-wrap:wrap; background:rgba(15,23,42,.32); box-shadow:none; }
.dashboard-cleaner-panel .script-card form { flex:1 0 auto; }
.dashboard-cleaner-panel .script-card .btn { width:100%; }
.section-heading { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.section-heading h2 { margin:0 0 5px; font-size:1.25rem; }
.section-heading p { margin:0; color:var(--muted); font-size:.85rem; }
.live-indicator { display:flex; align-items:center; gap:7px; color:#86efac; font-size:.78rem; }
.live-indicator i { width:8px; height:8px; border-radius:50%; background:#22c55e; box-shadow:0 0 0 4px rgba(34,197,94,.12); }
.script-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:14px; }
.script-card { display:flex; align-items:center; gap:13px; padding:16px; }
.script-icon { display:grid; place-items:center; width:43px; height:43px; border-radius:11px; color:#fff; background:linear-gradient(135deg,#2563eb,#0891b2); font-size:.78rem; font-weight:800; }
.script-info { display:flex; min-width:0; flex:1; flex-direction:column; gap:4px; }
.script-info strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; direction:ltr; text-align:right; }
.script-info span { color:var(--muted); font-size:.75rem; }
.empty-script { grid-column:1/-1; display:flex; padding:24px; flex-direction:column; gap:7px; color:var(--muted); }
.empty-script strong { color:#dbe4f0; }
.jobs-heading { margin-top:28px; }
.script-name { max-width:230px; overflow:hidden; direction:ltr; text-align:right; text-overflow:ellipsis; white-space:nowrap; }
.job-status { display:inline-block; padding:5px 9px; border-radius:8px; font-size:.75rem; white-space:nowrap; }
.status-running,.status-pending,.status-stopping { color:#fde68a; background:rgba(245,158,11,.12); border:1px solid rgba(245,158,11,.22); }
.status-completed { color:#bbf7d0; background:rgba(34,197,94,.12); border:1px solid rgba(34,197,94,.22); }
.status-failed,.status-interrupted { color:#fecdd3; background:rgba(244,63,94,.12); border:1px solid rgba(244,63,94,.22); }
.status-cancelled { color:#cbd5e1; background:rgba(100,116,139,.18); border:1px solid rgba(148,163,184,.2); }
.console-label { margin-bottom:8px; color:#86efac; font-size:.78rem; direction:ltr; text-align:left; }
.console-label.error { margin-top:18px; color:#fda4af; }
.cleaner-output { min-height:150px; max-height:430px; margin:0; padding:17px; overflow:auto; color:#d1fae5; background:#080d14; border:1px solid #263247; border-radius:12px; direction:ltr; text-align:left; white-space:pre-wrap; font:13px/1.7 Consolas,monospace; }
.cleaner-output.error { color:#fecdd3; }
.history-all-body { max-height:70vh; overflow:auto; }
.history-output-entry { margin-bottom:22px; padding-bottom:20px; border-bottom:1px solid var(--line); }
.history-output-entry:last-child { margin-bottom:0; padding-bottom:0; border-bottom:0; }
.history-output-entry-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; color:#dbeafe; }
.history-output-entry-heading span { color:var(--muted); font-size:.8rem; }
.console-live-note { display:flex; align-items:center; gap:7px; margin-bottom:14px; color:#94a3b8; font-size:.76rem; }
.console-live-note span { width:7px; height:7px; border-radius:50%; background:#22c55e; box-shadow:0 0 0 4px rgba(34,197,94,.1); animation:livePulse 1.6s infinite; }
@keyframes livePulse { 50% { opacity:.4; transform:scale(.8); } }
@media (max-width:767.98px) { .jobs-table{min-width:950px}.script-card{align-items:flex-start;flex-wrap:wrap}.script-card form{width:100%}.script-card .btn{width:100%} }
.app-modal { color:var(--text); background:linear-gradient(145deg,#222d41,#182234); border:1px solid var(--line); border-radius:18px; box-shadow:0 30px 80px rgba(0,0,0,.55); }
.app-modal .modal-header,.app-modal .modal-footer { border-color:var(--line); padding:20px 24px; }
.modal .modal-header { position:relative; padding-left:64px; }
.modal .modal-header .btn-close { position:absolute; top:50%; left:22px; right:auto; margin:0; transform:translateY(-50%); }
.app-modal .modal-body { padding:24px; }
.app-modal .modal-header small { display:block; margin-top:6px; color:var(--muted); }
.token-textarea { resize:vertical; min-height:145px; direction:ltr; text-align:left; }
.app-check { display:flex; min-height:46px; padding:11px 14px; align-items:center; gap:10px; border:1px solid var(--line); border-radius:11px; background:rgba(11,18,30,.28); }
.app-check .form-check-input { width:1.15rem; height:1.15rem; margin:0; float:none; flex:0 0 auto; cursor:pointer; }
.app-check .form-check-label { color:#dbe4f0; cursor:pointer; }
.device-section { padding:18px; border:1px solid var(--line); border-radius:14px; background:rgba(11,18,30,.28); }
.device-section-title { display:flex; align-items:center; justify-content:space-between; margin-bottom:13px; }
.device-section-title span { color:var(--muted); font-size:.78rem; }
.device-row { display:grid; grid-template-columns:minmax(0,1fr) 42px 42px; gap:8px; margin-top:9px; direction:rtl; }
.device-row:first-child { margin-top:0; }
.device-action { display:grid; place-items:center; width:42px; height:42px; padding:0; border:1px solid #46536a; border-radius:10px; color:#dbe4f0; background:#263247; font-size:1.3rem; transition:.18s ease; }
.device-action:hover { color:#fff; border-color:var(--accent-2); background:#33415a; }
.remove-device { color:#fda4af; font-size:1.05rem; }
.remove-device:hover { border-color:#fb7185; background:rgba(244,63,94,.15); }
.device-action[hidden] { display:none; }
.device-badges { display:flex; max-width:320px; flex-wrap:wrap; gap:6px; }
.device-badge { display:inline-block; max-width:210px; padding:5px 9px; overflow:hidden; color:#c4b5fd; background:rgba(139,92,246,.12); border:1px solid rgba(167,139,250,.2); border-radius:8px; font-size:.76rem; direction:ltr; text-overflow:ellipsis; white-space:nowrap; }
.empty-value { color:#64748b; }
.cleanup-status { display:inline-flex; align-items:center; gap:5px; padding:5px 9px; border-radius:8px; font-size:.75rem; white-space:nowrap; }
.cleanup-status.success { color:#bbf7d0; background:rgba(34,197,94,.12); border:1px solid rgba(34,197,94,.22); }
.cleanup-status.instructions-changed { color:#fed7aa; background:rgba(251,146,60,.18); border:1px solid rgba(251,146,60,.3); }
.cleanup-status.failed { color:#fecdd3; background:rgba(244,63,94,.12); border:1px solid rgba(244,63,94,.22); }
.cleanup-status.warning { color:#fde68a; background:rgba(245,158,11,.12); border:1px solid rgba(245,158,11,.25); }
.cleanup-status.pending { color:#cbd5e1; background:rgba(100,116,139,.14); border:1px solid rgba(148,163,184,.16); }
.action-btn.logs { color:#c4b5fd; }
.action-btn.logs b { display:grid; place-items:center; min-width:18px; height:18px; padding:0 4px; border-radius:9px; color:#fff; background:#7c3aed; font-size:.65rem; }
.token-logs-wrap { max-height:520px; overflow:auto; }
.token-logs-table { min-width:760px; }
.token-logs-table thead { position:sticky; top:0; z-index:1; }
.token-log-modal-body { display:flex; max-height:72vh; padding:20px!important; overflow-y:auto; flex-direction:column; gap:16px; }
.token-history-modal .modal-dialog { width:auto; max-width:min(1254px,calc(100vw - 2rem)); }
.token-log-tabs { flex:0 0 auto; border-color:var(--line); }
.token-log-tabs .nav-link { display:flex; align-items:center; gap:7px; padding:10px 18px; color:var(--muted); border-color:transparent; }
.token-log-tabs .nav-link:hover { color:#e2e8f0; border-color:transparent; background:rgba(71,85,105,.18); }
.token-log-tabs .nav-link.active { color:#e0e7ff; border-color:var(--line) var(--line) #182234; background:#182234; }
.token-log-tab-content { min-height:280px; }
.token-log-tab-content > .tab-pane { padding-top:8px; }
.token-log-tab-content .token-event-logs { margin-top:24px; }
.session-auth-failure-alert { display:flex; margin-bottom:14px; padding:13px 15px; align-items:center; gap:12px; color:#fecdd3; border:1px solid rgba(251,113,133,.35); border-radius:11px; background:rgba(127,29,29,.28); }
.session-auth-failure-alert > i { font-size:1.15rem; }
.session-auth-failure-alert div { display:flex; flex-direction:column; gap:3px; }
.session-auth-failure-alert span { color:#fda4af; font-size:.75rem; }
.session-snapshot-heading { display:flex; margin-bottom:12px; align-items:center; justify-content:space-between; gap:16px; }
.session-snapshot-heading h3 { margin:0 0 4px; color:#f8fafc; font-size:1rem; }
.session-snapshot-heading p { margin:0; color:var(--muted); font-size:.76rem; }
.session-snapshot-heading > div:last-child { display:flex; align-items:flex-end; flex-direction:column; gap:4px; }
.session-snapshot-heading span { color:#a7f3d0; font-size:.75rem; font-weight:700; }
.session-snapshot-heading time { color:#94a3b8; direction:ltr; font-size:.72rem; }
.session-snapshot-wrap { border:1px solid var(--line); border-radius:12px; overflow:visible; }
.session-snapshot-table { width:100%; min-width:0; margin:0; table-layout:fixed; }
.session-snapshot-table thead { background:#121c2d; }
.session-snapshot-table th { color:#93c5fd; font-size:.72rem; white-space:nowrap; }
.session-snapshot-table th:nth-child(1) { width:17%; }
.session-snapshot-table th:nth-child(2) { width:9%; }
.session-snapshot-table th:nth-child(3) { width:15%; }
.session-snapshot-table th:nth-child(4) { width:14.5%; }
.session-snapshot-table th:nth-child(5) { width:17%; }
.session-snapshot-table th:nth-child(6) { width:19.5%; }
.session-snapshot-table th:nth-child(7) { width:8%; }
.session-snapshot-table td { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.session-snapshot-table td > strong,.session-snapshot-table td > small { display:block; }
.session-snapshot-table td > small { margin-top:3px; color:var(--muted); font-size:.7rem; }
.session-app-badges { display:flex; max-width:210px; flex-wrap:wrap; gap:4px; }
.session-app-badges b { padding:3px 7px; color:#ddd6fe; border:1px solid rgba(167,139,250,.24); border-radius:6px; background:rgba(139,92,246,.12); font-size:.68rem; font-weight:700; }
.session-app-badges > span { color:var(--muted); }
.snapshot-identifiers-button { margin:auto; }
.snapshot-identifiers-row > td { padding:0!important; overflow:visible!important; border:0; }
.snapshot-identifiers-details { display:grid; width:calc(100% - 24px); margin:0 12px 12px; padding:14px 16px; grid-template-columns:minmax(0,1fr); gap:10px; border:1px solid rgba(167,139,250,.22); border-radius:10px; background:rgba(15,23,42,.72); }
.snapshot-identifiers-details code { display:block; width:100%; max-width:none; margin:0; overflow:visible; overflow-wrap:anywhere; direction:ltr; text-align:left; text-overflow:clip; white-space:normal; word-break:break-all; line-height:1.7; }
.session-snapshot-empty { min-height:260px; }
.token-log-section-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:11px; }
.token-log-section-heading h3 { margin:0 0 3px; color:#f8fafc; font-size:1rem; }
.token-log-section-heading p { margin:0; color:var(--muted); font-size:.76rem; }
.token-log-section-heading > span { padding:5px 9px; color:#c4b5fd; background:rgba(139,92,246,.12); border:1px solid rgba(167,139,250,.2); border-radius:8px; font-size:.72rem; white-space:nowrap; }
.token-log-search { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-bottom:12px; }
.token-log-search-input { position:relative; min-width:220px; max-width:440px; margin:0; flex:1; }
.token-log-search-input i { position:absolute; top:50%; right:13px; z-index:1; color:#7c8aa0; transform:translateY(-50%); pointer-events:none; }
.token-log-search-input .form-control { height:42px; padding-right:39px; }
.token-log-revoke-filter { display:flex; height:42px; margin:0; padding:0 13px; align-items:center; gap:8px; color:#dbe4f0; border:1px solid var(--line); border-radius:10px; background:rgba(11,18,30,.4); cursor:pointer; white-space:nowrap; }
.token-log-revoke-filter .form-check-input { margin:0; cursor:pointer; }
.cleaner-runs-filter-result { margin-right:auto; color:var(--muted); font-size:.76rem; white-space:nowrap; }
.token-cleaner-runs-wrap { border:1px solid var(--line); border-radius:12px; overflow:auto; }
.token-cleaner-runs-table { min-width:930px; margin:0; }
.token-cleaner-runs-table thead { background:#121c2d; }
.token-cleaner-runs-table th { white-space:nowrap; }
.cleaner-run-row td:first-child,.revoked-sessions-table td:nth-child(2),.revoked-sessions-table td:nth-child(3) { display:table-cell; }
.cleaner-run-row td:first-child strong,.cleaner-run-row td:first-child small,.revoked-sessions-table td strong,.revoked-sessions-table td small { display:block; }
.cleaner-run-row td:first-child small,.revoked-sessions-table td small { margin-top:3px; color:var(--muted); font-size:.7rem; }
.revoke-count { display:inline-grid; min-width:28px; height:28px; place-items:center; border-radius:8px; color:#cbd5e1; background:rgba(100,116,139,.14); }
.revoke-count.success { color:#bbf7d0; background:rgba(34,197,94,.13); }
.revoke-count.failed { color:#fecdd3; background:rgba(244,63,94,.13); }
.cleaner-run-details-button { white-space:nowrap; }
.cleaner-run-details-button i { margin-left:4px; transition:transform .18s ease; }
.cleaner-run-details-button[aria-expanded="true"] i { transform:rotate(180deg); }
.cleaner-run-details { margin:0 12px 12px; padding:15px; border:1px solid rgba(56,189,248,.2); border-radius:11px; background:rgba(8,15,27,.72); }
.revoke-details-summary { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:12px; }
.revoke-details-summary strong { color:#bbf7d0; }
.revoke-details-summary span { color:#fbbf24; font-size:.74rem; }
.revoke-details-empty { padding:17px; color:var(--muted); border:1px dashed #334155; border-radius:9px; text-align:center; }
.revoked-sessions-table { min-width:1050px; margin:0; }
.revoked-sessions-table th { color:#93c5fd; font-size:.72rem; white-space:nowrap; }
.session-identifiers { max-width:290px; }
.session-identifiers code { display:block; max-width:270px; margin-top:4px; overflow:hidden; color:#a5b4fc; direction:ltr; text-align:left; text-overflow:ellipsis; white-space:nowrap; }
.token-event-logs { padding-top:20px; border-top:1px solid var(--line); }
.empty-state.compact { min-height:110px; }
@media (max-width:767.98px) { .sidebar-toggle{display:block}.topbar{padding:0 15px}.topbar-username{display:none}.sidebar{top:0;height:100vh}.main-content{padding:calc(var(--header) + 20px) 15px 25px}.page-heading{align-items:flex-start!important;gap:15px;flex-direction:column}.page-heading .btn{width:100%}.profile-grid{grid-template-columns:1fr}.login-layout{padding:16px}.login-card{padding:27px 22px} }

/* Mobile and tablet layout */
@media (max-width:991.98px) {
    html,body { max-width:100%; overflow-x:hidden; }
    .content-shell { width:100%; min-width:0; }
    .system-settings-card { width:100%; max-width:none; }
    .row.g-4 > [class*="col-"] { min-width:0; }
    .token-stat-card,.system-stat-three { min-height:130px; }
    .token-stat-part { padding:18px 14px; }
    .stat-value { font-size:1.9rem; }
    .script-grid { grid-template-columns:1fr; }
    .dashboard-cleaner-layout > [class*="col-"] { display:block; }
    .table-panel { max-width:100%; overflow-x:auto; overscroll-behavior-inline:contain; -webkit-overflow-scrolling:touch; }
    .table-panel::-webkit-scrollbar { height:7px; }
    .table-panel::-webkit-scrollbar-thumb { border-radius:8px; background:#475569; }
    .tokens-grid-panel { width:100%; margin:0; overflow-x:auto; }
    .token-history-modal .modal-dialog { width:auto; max-width:calc(100vw - 1rem); margin:.5rem; }
    .session-snapshot-wrap { overflow-x:auto; overflow-y:visible; }
    .session-snapshot-table { min-width:1050px; table-layout:auto; }
    .tokens-table { min-width:940px!important; }
    .tokens-table th:last-child,.tokens-table td:last-child { position:sticky; left:0; z-index:2; background:#202c3f; box-shadow:8px 0 18px rgba(5,10,20,.32); }
    .tokens-table th:last-child { z-index:3; background:#2b3950; }
    .tokens-table.table-striped tbody tr:nth-of-type(odd) td:last-child { background:#27354a; }
    .jobs-table { min-width:900px; }
}

@media (max-width:767.98px) {
    :root { --header:62px; }
    .topbar { gap:8px; padding:0 10px; }
    .brand { font-size:1rem; }
    .brand-mark { width:34px; height:34px; }
    .topbar-user { gap:4px; }
    .topbar-user-menu { min-width:38px; padding:5px 8px; }
    .notification-button { width:34px; height:34px; margin:0; }
    .main-content { padding:calc(var(--header) + 16px) 10px 22px; }
    .page-heading { margin-bottom:18px; }
    .page-heading h1 { font-size:1.45rem; }
    .token-heading-actions { width:100%; flex-wrap:wrap; }
    .token-heading-actions .btn { flex:1 1 145px; width:auto; }
    .token-scope-tabs { display:grid; width:100%; grid-template-columns:1fr 1fr; }
    .token-scope-tab { padding:8px 10px; font-size:.82rem; }
    .card,.panel { border-radius:13px; }
    .token-stat-card { grid-template-columns:1fr 1fr; }
    .system-stat-three { grid-template-columns:1fr; }
    .system-stat-three .token-stat-part { min-height:82px; }
    .system-active-stat,.system-users-stat { border-right:0; border-top:1px solid var(--line); }
    .section-heading { align-items:flex-start; gap:10px; }
    .section-heading h2 { font-size:1.15rem; }
    .live-indicator { white-space:nowrap; }
    .script-card { padding:16px; }
    .modal-dialog { width:calc(100% - 16px); max-width:none; margin:8px auto; }
    .modal-dialog-centered { min-height:calc(100% - 16px); }
    .app-modal { max-height:calc(100vh - 16px); border-radius:14px; }
    .app-modal .modal-header,.app-modal .modal-footer,.app-modal .modal-body { padding:16px; }
    .modal .modal-header { padding-left:52px; }
    .modal .modal-header .btn-close { left:16px; }
    .app-modal .modal-body { overflow-y:auto; }
    .device-section { padding:12px; }
    .device-row { grid-template-columns:minmax(0,1fr) 38px 38px; gap:6px; }
    .device-action { width:38px; height:38px; }
    .profile-summary-card,.profile-password-card { padding:18px; }
    .profile-details div { align-items:flex-start; flex-direction:column; gap:5px; }
    .token-notification-toast { right:10px; left:10px; bottom:10px; min-width:0; max-width:none; }
    .impersonation-banner { right:10px; left:10px; top:68px; justify-content:space-between; }
    .cleaner-output { max-height:52vh; padding:12px; font-size:12px; }
    .tokens-grid-panel { overflow:visible; background:transparent; border:0; box-shadow:none; }
    .tokens-table { display:block; min-width:0!important; background:transparent; }
    .tokens-table thead { display:none; }
    .tokens-table tbody { display:grid; grid-template-columns:1fr; gap:12px; }
    .tokens-table .token-row { display:grid; grid-template-columns:1fr 1fr; gap:0; overflow:hidden; border:1px solid var(--line); border-radius:14px; background:linear-gradient(145deg,#222d41,#182234); box-shadow:0 10px 25px rgba(0,0,0,.2); }
    .tokens-table .token-row > td { position:static!important; display:flex; min-width:0; min-height:52px; padding:11px 12px; align-items:center; justify-content:space-between; gap:10px; color:var(--text); background:transparent!important; border:0; border-bottom:1px solid rgba(71,85,105,.45); box-shadow:none!important; }
    .tokens-table .token-row > td:before { content:attr(data-label); flex:0 0 auto; color:var(--muted); font-size:.75rem; font-weight:600; }
    .tokens-table .token-row > td:nth-last-child(-n+2) { border-bottom:0; }
    .tokens-table .token-name,.tokens-table .token-cell { max-width:none; }
    .tokens-table .token-cell { direction:ltr; text-align:left; }
    .tokens-table .token-operations-cell { grid-column:1/-1; min-height:58px; justify-content:space-between; border-top:1px solid var(--line); }
    .tokens-table .token-operations-cell .token-actions { gap:8px; }
    .tokens-table .action-btn { width:38px; min-width:38px; height:38px; }
}

@media (max-width:430px) {
    .tokens-table .token-row { grid-template-columns:1fr; }
    .tokens-table .token-row > td:nth-last-child(2) { border-bottom:1px solid rgba(71,85,105,.45); }
    .tokens-table .token-operations-cell { grid-column:1; }
}

@media (max-width:767.98px) {
    .users-grid-panel { overflow:visible; background:transparent; border:0; box-shadow:none; }
    .users-table { display:block; min-width:0!important; background:transparent; }
    .users-table thead { display:none; }
    .users-table tbody { display:grid; grid-template-columns:1fr; gap:12px; }
    .users-table .user-card-row { display:grid; grid-template-columns:1fr 1fr; overflow:hidden; border:1px solid var(--line); border-radius:14px; background:linear-gradient(145deg,#222d41,#182234); box-shadow:0 10px 25px rgba(0,0,0,.2); }
    .users-table .user-card-row > td { display:flex; min-width:0; min-height:54px; padding:11px 13px; align-items:center; justify-content:space-between; gap:10px; color:var(--text); background:transparent!important; border:0; border-bottom:1px solid rgba(71,85,105,.45); }
    .users-table .user-card-row > td:before { content:attr(data-label); flex:0 0 auto; color:var(--muted); font-size:.75rem; font-weight:600; }
    .users-table .user-display-cell { grid-column:1/-1; min-height:68px; }
    .users-table .user-name { margin-right:auto; }
    .users-table .user-operations-cell { grid-column:1/-1; border-bottom:0; border-top:1px solid var(--line); }
    .users-table .user-operations-cell .token-actions { gap:8px; }
    .users-table .action-btn { width:38px; min-width:38px; height:38px; }
}

@media (max-width:430px) {
    .users-table .user-card-row { grid-template-columns:1fr; }
    .users-table .user-display-cell,.users-table .user-operations-cell { grid-column:1; }
}

/* Compact token grid: six columns, with secondary details inside each cell. */
.tokens-compact-panel { width:99%; margin:0 .5%; overflow:visible; border:1px solid #35445b; background:#192536; }
.token-grid-toolbar { display:flex; align-items:center; gap:12px; padding:20px; border-bottom:1px solid #35445b; }
.token-search-wrap { position:relative; flex:1 1 340px; max-width:480px; }
.token-search-wrap > i { position:absolute; right:15px; top:50%; transform:translateY(-50%); color:#94a3b8; pointer-events:none; }
.token-search-wrap .form-control { padding-right:42px; }
.token-grid-toolbar .form-control,.token-grid-toolbar .form-select { min-height:44px; border-radius:9px; background-color:#172232; }
.token-grid-toolbar .form-select { width:190px; flex:0 1 190px; }
.token-grid-scroll { overflow:visible; }
.tokens-compact-table { table-layout:fixed; width:100%; }
.tokens-compact-table thead th { padding:20px 18px; font-size:.86rem; background:#223147; border-bottom:1px solid #35445b; }
.tokens-compact-table th:nth-child(1) { width:18%; }
.tokens-compact-table th:nth-child(2),.tokens-compact-table th:nth-child(3) { width:15.3%; }
.tokens-compact-table th:nth-child(4) { width:13%; }
.tokens-compact-table th:nth-child(5) { width:13.5%; }
.tokens-compact-table th:nth-child(6) { width:24.9%; }
.tokens-compact-table tbody .token-row > td { padding:20px 18px; background:#192536; border-color:#35445b; }
.tokens-compact-table tbody .token-row:hover > td { background:#213047; }
.tokens-compact-table .token-identity { display:flex; min-width:0; flex-direction:column; align-items:flex-start; gap:8px; }
.tokens-compact-table .token-name { display:block; width:100%; min-width:0; max-width:none; font-size:1rem; font-weight:700; text-align:right; }
.token-status-badges { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.token-status-badges .badge,.token-plan-status { display:inline-flex; align-items:center; gap:5px; padding:5px 8px; border-radius:8px; font-size:.72rem; line-height:1.5; }
.token-status-badges .bg-success { color:#86efac; background:rgba(22,163,74,.14)!important; border:1px solid rgba(34,197,94,.5); }
.token-status-badges .bg-secondary { color:#cbd5e1; background:rgba(100,116,139,.2)!important; border:1px solid #64748b; }
.token-plan-status.is-plus { color:#c4b5fd; background:rgba(139,92,246,.12); border:1px solid #8b5cf6; }
.token-plan-status.is-free { color:#fff; background:rgba(255,255,255,.12); border:1px solid #fff; }
.token-plan-status[hidden] { display:none; }
.token-identity-meta { color:#94a3b8; font-size:.69rem; overflow-wrap:anywhere; }
.token-consumption { display:flex; min-width:0; flex-direction:column; gap:9px; }
.tokens-compact-table .usage-cell { gap:9px; }
.tokens-compact-table .usage-cell strong { color:#f1f5f9; font-size:1.2rem; text-align:right; }
.tokens-compact-table .usage-cell .usage-unavailable { color:#94a3b8; }
.tokens-compact-table .usage-track { height:7px; background:#2b3b50; }
.tokens-compact-table .usage-track > span { background:#22d3ee; }
.token-reset-line { color:#a8b6c9; font-size:.72rem; line-height:1.9; }
.token-settings { display:flex; flex-direction:column; gap:12px; font-size:.78rem; }
.token-settings > span { display:flex; align-items:center; gap:6px; }
.tokens-compact-table .ignore-device-count { display:inline; min-width:0; height:auto; padding:0; margin:0; border:0; background:none; color:inherit; font-size:inherit; font-weight:inherit; }
.token-instructions { color:#a8b6c9; }
.token-instructions > i { color:#94a3b8; font-size:.65rem; }
.token-instructions.is-enabled > i { color:#4ade80; }
.token-check-summary { display:flex; flex-direction:column; align-items:flex-start; gap:9px; }
.tokens-compact-table .cleanup-status { display:inline-flex; align-items:center; gap:6px; font-size:.76rem; white-space:nowrap; }
.tokens-compact-table button.cleanup-status { cursor:pointer; }
.tokens-compact-table button.cleanup-status:hover { filter:brightness(1.2); }
.tokens-compact-table .token-last-fetched { color:#a8b6c9; font-size:.71rem; direction:ltr; font-variant-numeric:tabular-nums; white-space:normal; }
.tokens-compact-table tbody .token-row.cleanup-failed-row > td { background:rgba(248,113,113,.055); border-color:#35445b; }
.tokens-compact-table tbody .token-row.cleanup-failed-row:hover > td { background:rgba(248,113,113,.1); }
.tokens-compact-table tbody .token-row.cleanup-failed-row > td:first-child { box-shadow:inset -3px 0 #fb7185; }
.tokens-compact-table tbody .token-row.token-row-inactive { opacity:.8; filter:none; }
.tokens-compact-table th:last-child,.tokens-compact-table td:last-child { position:static; padding:16px 10px; box-shadow:none; white-space:normal; }
.tokens-compact-table .token-actions { gap:6px; flex-wrap:wrap; }
.tokens-compact-table .token-actions .token-revoke-button { width:auto; min-width:82px; padding:0 8px; flex:0 0 auto; color:#fda4af; }
@property --revoke-glow-angle { syntax:"<angle>"; initial-value:0deg; inherits:false; }
.tokens-compact-table .token-actions .token-revoke-button:is([data-revoke-mode="force"],[data-revoke-mode="after-reset"],[data-revoke-mode="after-me"]) { position:relative; color:#c4b5fd; border-color:rgba(167,139,250,.4); box-shadow:0 0 10px rgba(139,92,246,.14); }
.token-revoke-button:is([data-revoke-mode="force"],[data-revoke-mode="after-reset"],[data-revoke-mode="after-me"])::before { content:""; position:absolute; inset:-2px; padding:1.5px; border-radius:inherit; pointer-events:none; background:conic-gradient(from var(--revoke-glow-angle),transparent 0deg 240deg,rgba(255,255,255,.15) 275deg,rgba(255,255,255,.95) 320deg,transparent 360deg); -webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0); -webkit-mask-composite:xor; mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0); mask-composite:exclude; animation:revokeGlowOrbit 3.5s linear infinite; }
.token-row:is([data-active="false"],[data-auth-status="401"]) .token-revoke-button::before { content:none; animation:none; }
@keyframes revokeGlowOrbit { to { --revoke-glow-angle:360deg; } }
@media (prefers-reduced-motion:reduce) { .token-revoke-button::before { animation:none!important; } }
#tokenRevokeModal .form-text { color:var(--muted); line-height:1.9; }
#tokenRevokeForm { display:flex; flex-direction:column; min-height:0; max-height:calc(100dvh - 3.5rem); }
#tokenRevokeModal .modal-body { min-height:0; overflow-y:auto; }
.token-edit-modal form { display:flex; flex-direction:column; min-height:0; max-height:calc(100dvh - 3.5rem); }
.token-edit-modal .modal-body { min-height:0; overflow-y:auto; }
.token-edit-modal .text-muted { color:var(--muted)!important; line-height:1.9; }
.token-edit-modal .modal-dialog { max-width:1012px; }
.token-edit-modal .modal-header,.token-edit-modal .modal-footer { flex-shrink:0; padding-top:16px; padding-bottom:16px; }
.token-edit-modal .modal-body { padding:18px 24px; }
.token-edit-modal .tab-content { display:grid; }
.token-edit-modal .tab-content > .tab-pane:not([hidden]) { display:block; grid-area:1/1; min-width:0; visibility:hidden; }
.token-edit-modal .tab-content > .tab-pane.active:not([hidden]) { visibility:visible; }
.token-edit-modal .token-edit-tabs { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:18px; padding:4px; border:1px solid var(--line); border-radius:12px; background:rgba(11,18,30,.28); }
.token-edit-modal .token-edit-tabs .nav-link { border:0; border-radius:8px; padding:9px 18px; color:var(--muted); }
.token-edit-modal .token-edit-tabs .nav-link.active { color:#ede9fe; background:rgba(139,92,246,.2); box-shadow:inset 0 0 0 1px rgba(167,139,250,.3); }
.token-edit-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:16px; align-items:start; }
.token-edit-section { min-width:0; padding:16px; border:1px solid var(--line); border-radius:12px; background:rgba(11,18,30,.2); }
.token-edit-section h3 { display:flex; align-items:center; gap:8px; margin:0 0 16px; font-size:.9rem; font-weight:700; color:#e2e8f0; }
.token-edit-section h3 i { color:#a78bfa; font-size:.85rem; }
.token-edit-modal .form-label { font-size:.82rem; }
.token-edit-modal .form-text { color:#a8b8ce; font-size:.75rem; line-height:1.85; }
.token-field-optional { margin-inline-start:6px; font-size:.72rem; font-weight:400; color:var(--muted); }
.token-secret-input { min-height:84px; max-height:180px; resize:vertical; overflow-wrap:anywhere; font-family:Consolas,monospace; text-align:left; }
.token-edit-modal .fetch-schedule-row { gap:10px; }
.token-edit-modal .fetch-schedule-row .app-check { flex:1; }
.token-edit-modal .fetch-interval-wrap { flex:0 1 115px; }
.token-edit-modal .app-check { min-height:42px; padding:9px 10px; font-size:.78rem; }
.token-edit-behavior-column { display:flex; min-width:0; flex-direction:column; gap:16px; }
.token-edit-identity-column { display:flex; min-width:0; flex-direction:column; gap:16px; }
.token-instructions-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; direction:ltr; align-items:start; }
.token-instructions-layout > * { direction:rtl; min-width:0; }
.token-instructions-updates .app-check { margin-bottom:12px !important; }
.token-instructions-updates .app-check:last-child { margin-bottom:0 !important; }
.token-instructions-layout-create { margin-bottom:4px; }
.token-edit-devices { padding:14px 16px; }
.token-edit-devices h3 { font-size:.82rem; }
.token-edit-devices h3 bdi { margin-inline-start:6px; color:var(--muted); font-size:.74rem; font-weight:400; }
.token-edit-devices .edit-device-list { max-height:126px; overflow-y:auto; }
@media (max-width:575.98px) {
    .token-edit-modal .modal-dialog { margin:8px; }
    .token-edit-modal form { max-height:calc(100dvh - 16px); }
    .token-edit-modal .modal-body { padding:12px; }
    .token-edit-grid { grid-template-columns:minmax(0,1fr); gap:12px; }
    .token-edit-section { padding:14px; }
    .token-instructions-layout { grid-template-columns:minmax(0,1fr); gap:0; }
    .token-edit-modal .token-edit-tabs .nav-link { padding:8px 10px; font-size:.78rem; }
    .token-edit-modal .modal-footer { padding:12px; }
}
.fetch-schedule-row { display:flex; align-items:center; gap:16px; }
.fetch-schedule-row .app-check { flex:0 0 auto; }
.fetch-schedule-row .fetch-interval-wrap { flex:1; min-width:0; max-width:220px; }
.fetch-schedule-row .form-select:disabled { opacity:.5; cursor:not-allowed; }
.token-notification-stack { position:fixed; left:24px; bottom:24px; z-index:2000; display:flex; flex-direction:column; gap:10px; width:min(440px,calc(100vw - 48px)); max-height:calc(100dvh - 48px); overflow-y:auto; pointer-events:none; }
.token-notification-stack .token-notification-toast { position:relative; left:auto; right:auto; bottom:auto; min-width:0; width:100%; flex-shrink:0; pointer-events:auto; }
.token-notification-stack .reset-notification-toast { color:#c7d2fe; background:#1b263e; border-color:rgba(129,140,248,.5); }
@media (max-width:767.98px) { .token-notification-stack { left:10px; bottom:10px; width:calc(100vw - 20px); max-height:calc(100dvh - 20px); } }
.token-revoke-option { display:flex; align-items:flex-start; gap:10px; margin:10px 0; padding:14px; border:1px solid var(--line); border-radius:10px; cursor:pointer; }
.token-revoke-option input { margin-top:5px; flex-shrink:0; }
.token-revoke-option span { display:flex; flex-direction:column; align-items:flex-start; gap:8px; }
.token-revoke-option small { color:var(--muted); line-height:1.9; }
.tokens-compact-table .action-btn { width:34px; min-width:34px; height:36px; border:1px solid #40516a; background:transparent; color:#cbd5e1; border-radius:8px; }
.tokens-compact-table .action-btn:hover { background:#334155; color:white; }
.token-more-menu { min-width:220px; max-height:none; overflow:visible; direction:rtl; text-align:right; padding:8px; background:#1b293c; color:#e2e8f0; border:1px solid #40516a; border-radius:12px; box-shadow:0 14px 28px rgba(0,0,0,.35); z-index:1050; }
.token-more-menu form { display:block; width:100%; }
.token-more-menu .dropdown-item { display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:6px; color:#dbe4f0; font-size:.8rem; text-align:right; }
.token-more-menu .dropdown-item:hover,.token-more-menu .dropdown-item:focus { background:#334155; color:#fff; }
.token-more-menu .dropdown-item i { width:18px; text-align:center; }
.token-more-menu .dropdown-header { color:#94a3b8; font-size:.72rem; text-align:right; }
.token-more-menu .dropdown-divider { border-color:#40516a; }
.token-more-menu .token-delete-item { color:#fda4af; }
.tokens-compact-table .token-row:has(.token-more-menu.show) { position:relative; z-index:5; overflow:visible; }
.token-grid-footer { padding:14px 20px; color:#94a3b8; font-size:.78rem; border-top:1px solid #35445b; }
#tokenGridEmpty td { text-align:center; padding:40px; color:#94a3b8; }
#tokenGridEmpty p { margin:12px 0 0; }
.tokens-compact-panel [hidden] { display:none!important; }
@media (max-width:1199.98px) {
    .tokens-compact-panel { width:100%; max-width:100%; margin:0; background:transparent; border:0; }
    .tokens-compact-table { display:block; min-width:0!important; background:transparent; }
    .tokens-compact-table thead { display:none; }
    .tokens-compact-table tbody { display:grid; grid-template-columns:1fr; gap:12px; }
    .token-grid-toolbar { display:flex; flex-wrap:wrap; padding:12px; margin-bottom:12px; border:1px solid #35445b; border-radius:12px; background:#192536; gap:10px; }
    .token-search-wrap { flex:1 1 100%; max-width:none; }
    .token-grid-toolbar .form-select { flex:1 1 120px; width:auto; font-size:.8rem; }
    .tokens-compact-table .token-row { display:grid; grid-template-columns:1fr 1fr; border:1px solid #35445b; border-radius:12px; background:#192536; }
    .tokens-compact-table .token-row > td { position:static!important; display:flex; min-width:0; flex-direction:column; align-items:stretch; gap:9px; padding:15px; background:transparent!important; box-shadow:none!important; border:0; border-bottom:1px solid #35445b; }
    .tokens-compact-table .token-row > td:before { content:attr(data-label); color:#94a3b8; }
    .tokens-compact-table .token-row > td.token-identity-cell { grid-column:1/-1; }
    .tokens-compact-table .token-identity-cell:before { display:none; }
    .tokens-compact-table .token-row > td:before { font-size:.72rem; }
    .tokens-compact-table .token-operations-cell { grid-column:1/-1; flex-direction:row!important; align-items:center!important; justify-content:space-between; border:0!important; }
    .tokens-compact-table .token-actions { gap:8px; }
    .tokens-compact-table .action-btn { width:38px; min-width:38px; height:38px; }
    .tokens-compact-table tbody .token-row.cleanup-failed-row > td:first-child { box-shadow:none; border-right:3px solid #fb7185; }
    .token-grid-footer { border:0; padding:14px 4px; }
}

/* Token list: quiet palette, separate activation state and inspection result. */
.tokens-compact-panel { width:100%; margin:0; background:#152131; border-color:#2c3b50; border-radius:12px; }
.token-grid-header { display:flex; align-items:center; flex-wrap:wrap; gap:16px; padding:18px; border-bottom:1px solid #2c3b50; }
.token-scope-switch { display:inline-flex; flex-shrink:0; border:1px solid #40516a; border-radius:8px; overflow:hidden; }
.token-scope-switch button { padding:11px 22px; border:0; border-inline-end:1px solid #40516a; background:transparent; color:#b9c6d8; font-size:.85rem; }
.token-scope-switch button:last-child { border-inline-end:0; }
.token-scope-switch button.is-selected { color:#eef2ff; background:#303f75; box-shadow:inset 0 0 0 1px #6976bc; }
.token-scope-switch button:hover { background:#2b3851; }
.token-scope-switch button:focus-visible,.token-filter-button:focus-visible { outline:2px solid #a5b4fc; outline-offset:-3px; }
.token-scope-count,.token-refresh-note { color:#94a3b8; font-size:.76rem; }
.token-filter-controls { margin-inline-start:auto; display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.token-filter-controls .form-select { width:180px; min-height:42px; background-color:#142031; font-size:.8rem; }
.token-filter-button { border:1px solid #40516a; color:#d5deeb; font-size:.8rem; padding:11px 15px; }
.token-filter-button:hover { color:#fff; background:#27354a; border-color:#64748b; }
#tokenFilterCount { display:inline-grid; place-items:center; min-width:20px; height:20px; background:#3c4b66; border-radius:10px; margin-inline-start:5px; }
.token-advanced-filters { display:flex; align-items:center; flex-wrap:wrap; gap:12px; padding:16px 18px; background:#182536; border-bottom:1px solid #2c3b50; }
.token-advanced-filters label { color:#a9b7ca; font-size:.78rem; }
.token-advanced-filters .form-select { width:155px; background-color:#142031; font-size:.8rem; }
.token-reset-filters { color:#b9c6d8; font-size:.75rem; }
.token-reset-filters:hover { color:#fff; text-decoration:underline; }
.tokens-compact-panel .token-grid-toolbar { padding:14px 18px; margin:0; border:0; border-bottom:1px solid #2c3b50; border-radius:0; background:transparent; justify-content:space-between; }
.tokens-compact-panel .token-search-wrap { max-width:520px; }
.tokens-compact-panel .token-search-wrap .form-control { background:#142031; font-size:.82rem; }
.tokens-compact-panel .tokens-compact-table { margin:0; }
.tokens-compact-table thead th { background:#182536; padding:16px 12px; font-size:.77rem; color:#cbd5e1; }
.tokens-compact-table th:nth-child(1) { width:20%; }
.tokens-compact-table th:nth-child(2) { width:22%; }
.tokens-compact-table th:nth-child(3) { width:10%; }
.tokens-compact-table th:nth-child(4) { width:12%; }
.tokens-compact-table th:nth-child(5) { width:14%; }
.tokens-compact-table th:nth-child(6) { width:22%; }
.tokens-compact-table tbody .token-row > td { background:#152131; padding:14px 12px; border-color:#2c3b50; }
.tokens-compact-table tbody .token-row:hover > td { background:#1b293c; }
.tokens-compact-table tbody .token-row.token-row-readonly > td { background:#152131; }
.tokens-compact-table tbody .token-row.token-row-readonly:hover > td { background:#1b293c; }
.tokens-compact-table tbody .token-row.token-row-readonly > td:first-child { box-shadow:none; }
.tokens-compact-table tbody .token-row.cleanup-failed-row > td:first-child { box-shadow:none; }
.tokens-compact-table tbody .token-row.token-row-inactive { opacity:1; }
.tokens-compact-table tbody .token-row.token-row-inactive > td { background:#202935; color:#aeb9c8; }
.tokens-compact-table tbody .token-row.token-row-inactive:hover > td { background:#26313f; }
.tokens-compact-table tbody .token-row.cleanup-failed-row > td { background:#2b252f; border-color:#3e3441; }
.tokens-compact-table tbody .token-row.cleanup-failed-row:hover > td { background:#352b35; }
.tokens-compact-table .token-identity { gap:7px; }
.tokens-compact-table .token-name { font-size:.9rem; }
.tokens-compact-table .token-status-badges { gap:6px; }
.tokens-compact-table .token-plan-status,.tokens-compact-table .token-readonly-badge { padding:3px 7px; font-size:.69rem; border:1px solid #596b81; background:rgba(148,163,184,.06); color:#ccd5e2; border-radius:5px; }
.tokens-compact-table .token-plan-status.is-plus { color:#f4a3ad; background:rgba(244,163,173,.055); border-color:rgba(244,163,173,.5); }
.token-quota-window { display:grid; grid-template-columns:48px minmax(0,1fr); align-items:start; gap:10px; }
.token-quota-window + .token-quota-window { margin-top:9px; }
.token-window-label { font-size:.7rem; color:#a6b5c8; padding-top:3px; white-space:nowrap; }
.tokens-compact-table .token-consumption { gap:2px; }
.tokens-compact-table .usage-cell { display:flex; flex-direction:row; align-items:center; gap:10px; }
.tokens-compact-table .usage-cell strong { width:36px; flex:0 0 36px; font-size:.9rem; color:#dce3ed; font-variant-numeric:tabular-nums; }
.tokens-compact-table .usage-track { flex:1; min-width:35px; height:7px; background:#29374a; }
.tokens-compact-table .usage-track > span { background:#7b8ba6; }
.tokens-compact-table .weekly-usage { --quota-color:#94a3b8; }
.tokens-compact-table .weekly-usage[data-usage-level="low"] { --quota-color:#f16f7e; }
.tokens-compact-table .weekly-usage[data-usage-level="warning"] { --quota-color:#efa44f; }
.tokens-compact-table .weekly-usage[data-usage-level="healthy"] { --quota-color:#83ba91; }
.tokens-compact-table .weekly-usage strong { color:var(--quota-color); }
.tokens-compact-table .weekly-usage .usage-track > span { background:var(--quota-color); }
.tokens-compact-table .token-reset-line { font-size:.65rem; color:#97a7bb; }
.token-stale-usage,.token-disabled-until { display:block; font-size:.65rem; color:#a6b4c6; margin-top:7px; line-height:1.8; }
.token-active-status { display:inline-flex; align-items:center; gap:7px; color:#d6deea; font-size:.77rem; white-space:nowrap; }
.token-active-status::before { content:""; width:7.2px; height:7.2px; flex-shrink:0; border-radius:50%; background:#8d9bb0; }
.token-active-status.is-active::before { background:#80bc96; }
.token-active-status.is-inactive { color:#f4a3ad; }
.tokens-compact-table .token-settings { font-size:.7rem; color:#a9b7ca; gap:9px; }
.tokens-compact-table .token-readonly-label,.tokens-compact-table .token-instructions > i,.tokens-compact-table .token-instructions.is-enabled > i { color:#94a3b8; }
.tokens-compact-table .token-instructions.is-enabled > i { color:#b5c0d0; }
.tokens-compact-table .cleanup-status { color:#c2cddd; border:0; background:transparent; padding:0; font-size:.72rem; }
.tokens-compact-table .cleanup-status.success i { display:none; }
.tokens-compact-table .cleanup-status.failed { color:#ef8793; white-space:normal; text-align:right; }
.tokens-compact-table .cleanup-status.failed:hover { text-decoration:underline; }
.tokens-compact-table .cleanup-status.pending { color:#94a3b8; }
.tokens-compact-table .token-actions { gap:5px; }
.tokens-compact-table .action-btn,.tokens-compact-table .action-btn.toggle,.tokens-compact-table .token-disable-menu-button,.tokens-compact-table .action-btn.edit,.tokens-compact-table .fetch-codex-account,.tokens-compact-table .token-usage-refresh,.telegram-proxy-table .action-btn { color:#b9c6d8; border-color:#3a4b61; background:transparent; }
.tokens-compact-table .token-actions .token-revoke-button { color:#f4a3ad; background:rgba(244,163,173,.055); border-color:rgba(244,163,173,.5); min-width:78px; }
.tokens-compact-table .token-actions .token-revoke-button:is([data-revoke-mode="force"],[data-revoke-mode="after-reset"],[data-revoke-mode="after-me"]) { color:#f4a3ad; border-color:#f4a3ad; box-shadow:none; background:rgba(244,163,173,.12); }
.tokens-compact-table .token-actions .token-revoke-button:hover { background:rgba(244,163,173,.15); }
@media(min-width:1200px) and (max-width:1550px) {
    .tokens-compact-table th:nth-child(1) { width:18%; }
    .tokens-compact-table th:nth-child(2) { width:20%; }
    .tokens-compact-table th:nth-child(3) { width:10%; }
    .tokens-compact-table th:nth-child(4) { width:11%; }
    .tokens-compact-table th:nth-child(5) { width:15%; }
    .tokens-compact-table th:nth-child(6) { width:26%; }
    .tokens-compact-table .token-actions .action-btn:not(.token-revoke-button):not(.token-disable-menu-button) { width:30px; min-width:30px; height:32px; flex-basis:30px; }
}
@media(max-width:1199.98px) {
    .tokens-compact-panel { border:1px solid #2c3b50; background:#152131; }
    .tokens-compact-panel .token-grid-scroll { padding:12px; }
    .token-grid-header { padding:14px; gap:12px; }
    .token-filter-controls { flex:1 1 100%; margin:0; }
    .token-filter-controls .form-select { flex:1; width:auto; }
    .tokens-compact-panel .token-search-wrap { max-width:none; flex:1 1 100%; }
    .token-refresh-note { display:none; }
    .tokens-compact-table tbody .token-row { background:#152131; }
    .tokens-compact-table tbody .token-row.token-row-readonly { background:#152131; border-right:1px solid #35445b; }
    .tokens-compact-table tbody .token-row.token-row-inactive { background:#202935; }
    .tokens-compact-table tbody .token-row.cleanup-failed-row { background:#2b252f; border-color:#3e3441; }
    .tokens-compact-table tbody .token-row.cleanup-failed-row:hover { background:#352b35; }
    .tokens-compact-table tbody .token-row.cleanup-failed-row > td:first-child { border-right:0; }
    .token-quota-window { grid-template-columns:48px minmax(0,1fr); }
}
@media(max-width:575.98px) {
    .token-scope-switch { width:100%; }
    .token-scope-switch button { flex:1; padding:10px 12px; }
    .token-advanced-filters { display:grid; grid-template-columns:auto minmax(0,1fr); }
    .token-advanced-filters .form-select { width:100%; }
    .token-reset-filters { grid-column:1/-1; }
    .tokens-compact-table .token-quota-cell { grid-column:1/-1; }
}
.auth-test-drop { display:flex; flex-direction:column; align-items:center; gap:12px; width:100%; padding:30px 16px; border:2px dashed #5c7393; border-radius:14px; background:rgba(96,165,250,.05); color:inherit; text-align:center; transition:background .15s,border-color .15s; }
.auth-test-drop > i { font-size:2rem; color:#93c5fd; }
.auth-test-drop > span { font-size:.8rem; color:#a6b5c8; }
.auth-test-drop:hover,.auth-test-drop.is-dragging,.auth-test-drop:focus-visible { background:rgba(96,165,250,.15); border-color:#93c5fd; }
.auth-test-drop:disabled { opacity:.6; cursor:wait; }
#authTestResult { overflow-wrap:anywhere; }
.extension-card { width:min(130%, 988px); max-width:none; }
.extension-panels { display:flex; flex-direction:column; gap:20px; align-items:flex-start; }
.extension-panel-icon { color:#a5b4fc; font-size:1.35rem; }
.extension-download-button { margin-bottom:20px; }
.extension-install-title { margin:22px 0 12px; padding-top:18px; border-top:1px solid var(--line); }
.extension-card-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:18px; }
.extension-card-heading h2 { color:var(--text); }
.extension-ready-badge { display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border:1px solid rgba(74,222,128,.35); border-radius:999px; color:#86efac; background:rgba(34,197,94,.1); font-size:.78rem; white-space:nowrap; }
.extension-meta { display:flex; align-items:center; justify-content:space-between; gap:12px; color:var(--muted); }
.extension-version { display:inline-flex; align-items:center; gap:7px; padding:8px 13px; border:1px solid rgba(167,139,250,.55); border-radius:10px; color:#f5f3ff; background:linear-gradient(135deg,rgba(124,58,237,.38),rgba(79,70,229,.22)); box-shadow:0 6px 18px rgba(79,70,229,.18); font-size:.92rem; font-weight:700; letter-spacing:.02em; white-space:nowrap; }
.extension-version i { color:#ddd6fe; font-size:.82rem; }
.extension-drop { padding:27px 16px; }
.extension-drop > i { color:#c084fc; }
.extension-upload-actions { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-top:12px; }
.extension-file-name { min-width:0; overflow:hidden; color:var(--muted); font-size:.82rem; text-overflow:ellipsis; white-space:nowrap; }
@media (max-width:900px) { .extension-card { width:100%; } }
@media (max-width:575.98px) { .extension-card-heading,.extension-upload-actions { align-items:stretch; flex-direction:column; } .extension-ready-badge { align-self:flex-start; } .extension-upload-actions .btn { width:100%; } }
.auth-test-description { color:#b8c6d9; line-height:1.9; }
@media(max-width:420px) {
    .topbar .brand > span:last-child { display:none; }
    .topbar .brand,.topbar .topbar-user { flex-shrink:0; }
    .topbar .topbar-user-menu { min-width:30px; justify-content:center; padding:6px; gap:0; }
    .topbar .user-menu-chevron { display:none; }
}
