*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root{
    --bg:#09090b;
    --bg2:#0f0f12;
    --surface:#141419;
    --surface2:#1a1a22;
    --border:#252530;
    --border2:#2e2e3a;
    --text:#f4f4f5;
    --muted:#8b8b9e;
    --muted2:#63637a;
    --blue:#3b82f6;
    --blue2:#2563eb;
    --green:#22c55e;
    --orange:#f97316;
    --red:#ef4444;
    --purple:#a855f7;
    --teal:#14b8a6;
    --radius:10px;
    --radius-lg:14px;
    --shadow:0 4px 24px rgba(0,0,0,.45);
    --sidebar:240px;
    --topbar:64px;
    --font:'Inter',system-ui,sans-serif;
}

html{font-size:14px}
body{font-family:var(--font);background:var(--bg);color:var(--text);min-height:100vh;-webkit-font-smoothing:antialiased}

.main-wrap{background:var(--bg)}
.content{background:var(--bg)}

body.light-theme{display:none!important}

@media(max-width:900px){
    .sidebar{position:fixed;z-index:100;transform:translateX(-100%);transition:transform .2s}
    .sidebar.open{transform:translateX(0)}
    .main-wrap{margin-left:0!important;width:100%}
    .shell{flex-direction:column}
    .apps-split{grid-template-columns:1fr!important}
    .stat-row{grid-template-columns:repeat(2,1fr)!important}
    .content{padding:16px!important}
}

a{color:inherit;text-decoration:none}
button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit}
input,select,textarea{font-family:inherit;font-size:14px;color:var(--text)}

.shell{display:flex;min-height:100vh}

.sidebar{
    width:var(--sidebar);
    background:var(--bg2);
    border-right:1px solid var(--border);
    display:flex;
    flex-direction:column;
    position:fixed;
    top:0;left:0;bottom:0;
    z-index:50;
    padding:20px 14px;
}

.logo{display:flex;align-items:center;gap:10px;padding:4px 8px 20px;font-weight:700;font-size:17px}
.logo-icon{
    width:34px;height:34px;
    background:linear-gradient(135deg,var(--blue),#6366f1);
    border-radius:9px;
    display:grid;place-items:center;
}
.logo-icon svg{width:18px;height:18px;color:#fff}

.side-block{margin-bottom:16px;padding:0 4px}
.side-label{display:block;font-size:11px;font-weight:600;color:var(--muted2);text-transform:uppercase;letter-spacing:.06em;margin-bottom:8px;padding-left:4px}

.app-select{
    width:100%;
    padding:9px 12px;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:var(--radius);
    outline:none;
    transition:border .15s;
}
.app-select:focus{border-color:var(--blue)}
.app-select:disabled{opacity:.45;cursor:not-allowed}

.side-nav{flex:1;display:flex;flex-direction:column;gap:2px;overflow-y:auto}
.side-app-nav{display:flex;flex-direction:column;gap:2px}
.side-app-nav.hidden,.side-app-only.hidden{display:none}
.side-link{
    display:flex;align-items:center;gap:10px;
    padding:10px 12px;
    border-radius:var(--radius);
    font-size:13px;font-weight:500;
    color:var(--muted);
    transition:all .15s;
    text-align:left;
    width:100%;
}
.side-link svg{width:16px;height:16px;flex-shrink:0}
.side-link:hover:not(:disabled){background:var(--surface);color:var(--text)}
.side-link.active{background:rgba(59,130,246,.12);color:var(--blue)}
.side-link:disabled{opacity:.35;cursor:not-allowed}
.side-link.muted{color:var(--muted2)}

.side-foot{padding-top:12px;border-top:1px solid var(--border);margin-top:8px}

.main-wrap{flex:1;margin-left:var(--sidebar);display:flex;flex-direction:column;min-height:100vh}

.topbar{
    height:var(--topbar);
    border-bottom:1px solid var(--border);
    background:rgba(9,9,11,.85);
    backdrop-filter:blur(12px);
    display:flex;align-items:center;justify-content:space-between;
    padding:0 28px;
    position:sticky;top:0;z-index:40;
}

.search-wrap{
    display:flex;align-items:center;gap:10px;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:var(--radius);
    padding:0 14px;
    width:360px;
    transition:border .15s;
}
.search-wrap:focus-within{border-color:var(--blue)}
.search-wrap svg{width:16px;height:16px;color:var(--muted2);flex-shrink:0}
.search-wrap input{
    flex:1;background:none;border:none;outline:none;
    padding:10px 0;color:var(--text);
}
.search-wrap input::placeholder{color:var(--muted2)}

.topbar-right{display:flex;align-items:center;gap:12px}
.user-chip{display:flex;align-items:center;gap:10px;padding:6px 14px 6px 6px;background:var(--surface);border:1px solid var(--border);border-radius:999px;cursor:pointer;transition:border-color .15s}
.user-chip:hover{border-color:var(--border2)}
.user-chip-text{text-align:left;line-height:1.25}
.user-chevron{width:14px;height:14px;color:var(--muted);margin-left:4px}

.user-menu-wrap{position:relative}
.user-dropdown{
    position:absolute;top:calc(100% + 8px);right:0;z-index:200;
    width:280px;background:#141419;border:1px solid var(--border);
    border-radius:12px;box-shadow:0 16px 48px rgba(0,0,0,.55);
    padding:8px 0;animation:fadeUp .2s ease;
}
.ud-head{display:flex;align-items:center;gap:12px;padding:14px 16px}
.ud-head strong{display:block;font-size:14px;word-break:break-all}
.ud-head span{font-size:12px;color:var(--muted)}
.ud-expire{padding:0 16px 12px;font-size:13px;font-weight:600;color:var(--text)}
.ud-divider{height:1px;background:var(--border);margin:4px 0}
.ud-item{
    display:flex;align-items:center;gap:10px;width:100%;
    padding:10px 16px;font-size:13px;color:var(--text);
    transition:background .12s;text-decoration:none;
}
.ud-item svg{width:16px;height:16px;color:var(--muted)}
.ud-item:hover{background:var(--surface2)}
.ud-item.ud-danger{color:var(--red)}
.ud-item.ud-danger svg{color:var(--red)}
.avatar.lg{width:40px;height:40px;font-size:16px}

.account-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:20px}
.account-card{padding:24px}
.account-card h3{display:flex;align-items:center;gap:8px;font-size:15px;margin-bottom:20px}
.account-card h3 svg{width:18px;height:18px;color:var(--blue)}
.acc-sub-box{background:var(--bg2);border:1px solid var(--border);border-radius:10px;padding:20px;text-align:center}
.acc-sub-label{display:block;font-size:12px;color:var(--muted);margin-bottom:8px}
.acc-sub-days{display:block;font-size:28px;font-weight:700;color:var(--green)}
.acc-sub-days.expired{color:var(--red)}

.user-sub-line{font-size:12px;color:var(--muted);margin-top:4px}
.user-sub-line.expired{color:var(--red);font-weight:600}
.user-sub-line .discord-link{color:#5865F2;font-weight:600}
.avatar{
    width:30px;height:30px;border-radius:50%;
    background:linear-gradient(135deg,var(--blue),#6366f1);
    display:grid;place-items:center;
    font-size:12px;font-weight:700;color:#fff;
}
.user-name{font-size:13px;font-weight:500}
.icon-btn{
    width:36px;height:36px;border-radius:var(--radius);
    display:grid;place-items:center;
    color:var(--muted);transition:all .15s;
}
.icon-btn:hover{background:var(--surface);color:var(--text)}
.icon-btn svg{width:18px;height:18px}

.content{padding:24px 28px 40px;flex:1}

.breadcrumb{
    display:flex;align-items:center;gap:8px;
    font-size:13px;color:var(--muted);
    margin-bottom:20px;
}
.breadcrumb svg{width:14px;height:14px}
.bc-app::before{content:none}
.bc-app{color:var(--muted);font-weight:400}
.hidden{display:none!important}

.page{display:none}
.page.active{display:block}

.page-head{margin-bottom:24px}
.page-head.flex-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.page-head h1{font-size:26px;font-weight:700;letter-spacing:-.02em;margin-bottom:6px}
.page-sub{color:var(--muted);font-size:14px;line-height:1.5;max-width:640px}

.stat-row{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:24px}
.stat-card{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:var(--radius-lg);
    padding:20px 22px;
}
.stat-num{display:block;font-size:32px;font-weight:700;line-height:1;margin-bottom:6px;letter-spacing:-.03em}
.stat-num.green{color:var(--green)}
.stat-num.orange{color:var(--orange)}
.stat-num.blue{color:var(--blue)}
.stat-lbl{font-size:13px;color:var(--muted);font-weight:500}

.panel-card{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:var(--radius-lg);
    overflow:hidden;
}
.panel-head{
    display:flex;align-items:center;justify-content:space-between;
    padding:20px 22px;
    border-bottom:1px solid var(--border);
}
.panel-head h2{font-size:16px;font-weight:600}
.panel-tools{display:flex;gap:12px}

.search-mini{
    display:flex;align-items:center;gap:8px;
    background:var(--bg2);
    border:1px solid var(--border);
    border-radius:var(--radius);
    padding:0 12px;
}
.search-mini svg{width:14px;height:14px;color:var(--muted2)}
.search-mini input{background:none;border:none;outline:none;padding:8px 0;width:200px;color:var(--text)}
.search-mini input::placeholder{color:var(--muted2)}

.btn-create{
    display:flex;align-items:center;justify-content:center;gap:8px;
    width:calc(100% - 44px);
    margin:16px 22px 0;
    padding:13px;
    background:var(--blue);
    color:#fff;
    font-weight:600;font-size:14px;
    border-radius:var(--radius);
    transition:background .15s,transform .1s;
}
.btn-create:hover{background:var(--blue2)}
.btn-create svg{width:18px;height:18px}

.btn-primary{
    display:inline-flex;align-items:center;gap:8px;
    padding:10px 18px;
    background:var(--blue);
    color:#fff;font-weight:600;font-size:13px;
    border-radius:var(--radius);
    transition:background .15s;
    white-space:nowrap;
}
.btn-primary:hover{background:var(--blue2)}
.btn-primary svg{width:16px;height:16px}

.btn-ghost{
    padding:10px 18px;
    background:var(--surface2);
    border:1px solid var(--border);
    border-radius:var(--radius);
    font-weight:500;font-size:13px;
    color:var(--muted);
    transition:all .15s;
}
.btn-ghost:hover{color:var(--text);border-color:var(--border2)}

.app-list{padding:16px 22px 22px;display:flex;flex-direction:column;gap:12px}

.app-row{
    background:var(--bg2);
    border:1px solid var(--border);
    border-radius:var(--radius-lg);
    padding:20px 22px;
    transition:border .15s,box-shadow .15s;
}
.app-row:hover{border-color:var(--border2)}
.app-row.selected{border-color:var(--blue);box-shadow:0 0 0 1px rgba(59,130,246,.25)}

.app-row-top{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}
.app-row-top h3{font-size:18px;font-weight:700;letter-spacing:-.01em;margin-bottom:4px}
.app-desc{font-size:13px;color:var(--muted)}
.app-owner{font-size:12px;color:var(--muted2);font-family:monospace;margin-top:4px}

.badge{
    display:inline-flex;align-items:center;
    padding:4px 10px;
    border-radius:999px;
    font-size:11px;font-weight:700;
    letter-spacing:.04em;
    text-transform:uppercase;
    flex-shrink:0;
}
.badge-active{background:rgba(34,197,94,.12);color:var(--green)}
.badge-paused{background:rgba(249,115,22,.12);color:var(--orange)}
.badge-off{background:rgba(239,68,68,.12);color:var(--red)}

.app-meta{display:flex;gap:28px;margin-bottom:16px;flex-wrap:wrap}
.meta-item label{display:block;font-size:11px;color:var(--muted2);text-transform:uppercase;letter-spacing:.05em;margin-bottom:3px;font-weight:600}
.meta-item span{font-size:14px;font-weight:600;color:var(--text)}

.app-actions{display:flex;flex-wrap:wrap;gap:8px}
.act-btn{
    display:inline-flex;align-items:center;gap:6px;
    padding:8px 14px;
    border-radius:var(--radius);
    font-size:12px;font-weight:600;
    transition:opacity .15s,transform .1s;
}
.act-btn:hover{opacity:.88;transform:translateY(-1px)}
.act-btn svg{width:14px;height:14px}
.act-select{background:#27272a;color:#fff}
.act-rename{background:rgba(168,85,247,.15);color:var(--purple);border:1px solid rgba(168,85,247,.25)}
.act-pause{background:rgba(249,115,22,.12);color:var(--orange);border:1px solid rgba(249,115,22,.25)}
.act-delete{background:rgba(239,68,68,.12);color:var(--red);border:1px solid rgba(239,68,68,.25)}

.table-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse}
thead th{
    text-align:left;
    padding:12px 22px;
    font-size:11px;font-weight:600;
    color:var(--muted2);
    text-transform:uppercase;
    letter-spacing:.05em;
    background:var(--bg2);
    border-bottom:1px solid var(--border);
}
tbody td{
    padding:14px 22px;
    border-bottom:1px solid var(--border);
    font-size:13px;
    vertical-align:middle;
}
tbody tr:last-child td{border-bottom:none}
tbody tr:hover td{background:rgba(255,255,255,.015)}
td code{
    font-family:'Consolas','Fira Code',monospace;
    font-size:12px;
    background:var(--bg2);
    padding:3px 8px;
    border-radius:6px;
    color:#a5b4fc;
}

.tag{display:inline-flex;padding:3px 10px;border-radius:999px;font-size:11px;font-weight:600}
.tag-ok{background:rgba(34,197,94,.12);color:var(--green)}
.tag-no{background:rgba(239,68,68,.12);color:var(--red)}
.tag-warn{background:rgba(249,115,22,.12);color:var(--orange)}

.btn-sm{
    padding:5px 12px;
    border-radius:7px;
    font-size:12px;font-weight:600;
    margin-right:4px;
    transition:opacity .15s;
}
.btn-sm:hover{opacity:.85}
.btn-sm-red{background:rgba(239,68,68,.15);color:var(--red)}
.btn-sm.c-blue{background:rgba(59,130,246,.15);color:var(--blue)}
.btn-sm-ghost{background:var(--surface2);border:1px solid var(--border);color:var(--muted)}

.empty{padding:48px 22px;text-align:center;color:var(--muted);font-size:14px}

.settings-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px;
    padding:22px;
}
.field label{display:block;font-size:12px;font-weight:600;color:var(--muted);margin-bottom:8px}
.field input,.field select,.modal-body input,.modal-body select,.modal-body textarea{
    width:100%;
    padding:10px 14px;
    background:var(--bg2);
    border:1px solid var(--border);
    border-radius:var(--radius);
    outline:none;
    transition:border .15s;
}
.field input:focus,.field select:focus,.modal-body input:focus{border-color:var(--blue)}
.settings-foot{padding:0 22px 22px}

.modal{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;padding:20px}
.modal.hidden{display:none}
.modal-back{position:absolute;inset:0;background:rgba(0,0,0,.65);backdrop-filter:blur(4px)}
.modal-box{
    position:relative;
    width:440px;max-width:100%;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:var(--radius-lg);
    box-shadow:var(--shadow);
    animation:popIn .2s ease;
}
@keyframes popIn{from{opacity:0;transform:scale(.96) translateY(8px)}to{opacity:1;transform:none}}
.modal-head{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;border-bottom:1px solid var(--border)}
.modal-head h3{font-size:16px;font-weight:600}
.modal-x{width:32px;height:32px;border-radius:8px;display:grid;place-items:center;color:var(--muted)}
.modal-x:hover{background:var(--surface2);color:var(--text)}
.modal-x svg{width:18px;height:18px}
.modal-body{padding:22px;display:flex;flex-direction:column;gap:14px}
.modal-foot{display:flex;justify-content:flex-end;gap:10px;padding:16px 22px;border-top:1px solid var(--border)}

.key-output{
    background:var(--bg2);
    border:1px solid var(--border);
    border-radius:var(--radius);
    padding:14px;
    font-family:monospace;
    font-size:12px;
    max-height:220px;
    overflow-y:auto;
    white-space:pre-wrap;
    word-break:break-all;
    color:#a5b4fc;
    line-height:1.6;
}

.toast{
    position:fixed;bottom:24px;right:24px;z-index:300;
    padding:12px 20px;
    background:var(--surface2);
    border:1px solid var(--border);
    border-radius:var(--radius);
    font-size:13px;font-weight:500;
    box-shadow:var(--shadow);
    animation:slideUp .25s ease;
}
@keyframes slideUp{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
.toast.ok{border-color:rgba(34,197,94,.3);color:var(--green)}

.login-page{
    min-height:100vh;
    display:grid;
    place-items:center;
    background:var(--bg);
    background-image:radial-gradient(ellipse 80% 60% at 50% -10%,rgba(59,130,246,.18),transparent);
}
.login-wrap{width:400px;max-width:calc(100% - 32px)}
.login-brand{text-align:center;margin-bottom:32px}
.login-brand .logo{justify-content:center;padding-bottom:12px}
.login-brand p{color:var(--muted);font-size:14px;margin-top:8px}
.login-card{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:var(--radius-lg);
    padding:32px;
    box-shadow:var(--shadow);
}
.login-card h2{font-size:20px;font-weight:700;margin-bottom:4px}
.login-card .sub{color:var(--muted);font-size:13px;margin-bottom:24px}
.login-card input{
    width:100%;
    padding:12px 14px;
    background:var(--bg2);
    border:1px solid var(--border);
    border-radius:var(--radius);
    margin-bottom:14px;
    outline:none;
    transition:border .15s;
}
.login-card input:focus{border-color:var(--blue)}
.login-card button{
    width:100%;
    padding:13px;
    background:var(--blue);
    color:#fff;
    font-weight:600;
    font-size:14px;
    border-radius:var(--radius);
    margin-top:6px;
    transition:background .15s;
}
.login-card button:hover{background:var(--blue2)}
.err{color:var(--red);font-size:13px;margin-top:12px;text-align:center}

@media(max-width:900px){
    .sidebar{transform:translateX(-100%)}
    .main-wrap{margin-left:0}
    .stat-row{grid-template-columns:repeat(2,1fr)}
    .settings-grid{grid-template-columns:1fr}
    .search-wrap{width:200px}
}

@media(max-width:600px){
    .stat-row{grid-template-columns:1fr}
    .app-meta{gap:16px}
    .topbar{padding:0 16px}
    .content{padding:16px}
}

.bg-glow{
    position:fixed;inset:0;pointer-events:none;z-index:0;
    background:
        radial-gradient(ellipse 60% 40% at 10% 0%,rgba(59,130,246,.08),transparent),
        radial-gradient(ellipse 50% 30% at 90% 80%,rgba(168,85,247,.06),transparent);
}
.shell{position:relative;z-index:1}

.glass{
    background:var(--surface);
    border-color:var(--border);
}

.stat-card.anim{animation:fadeUp .45s ease both}
.stat-card.d1{animation-delay:.06s}
.stat-card.d2{animation-delay:.12s}
.stat-card.d3{animation-delay:.18s}
@keyframes fadeUp{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}

.page.active{animation:pageIn .3s ease}
@keyframes pageIn{from{opacity:0}to{opacity:1}}

.user-role{display:block;font-size:11px;color:var(--muted2)}

.toolbar{
    display:flex;align-items:center;justify-content:space-between;gap:16px;
    padding:16px 22px;border-bottom:1px solid var(--border);
}
.search-mini.wide{flex:1;max-width:420px}
.search-mini.wide input{width:100%}

.tool-group{display:flex;gap:8px}
.tool-btn{
    width:38px;height:38px;border-radius:var(--radius);
    display:grid;place-items:center;
    background:var(--bg2);border:1px solid var(--border);
    color:var(--muted);transition:all .18s;
}
.tool-btn svg{width:16px;height:16px}
.tool-btn:hover{color:var(--text);border-color:var(--border2);transform:translateY(-1px)}
.tool-btn.green:hover{background:rgba(34,197,94,.12);color:var(--green);border-color:rgba(34,197,94,.25)}
.tool-btn.red:hover{background:rgba(239,68,68,.12);color:var(--red);border-color:rgba(239,68,68,.25)}

.fab{
    position:fixed;bottom:32px;right:32px;z-index:100;
    width:56px;height:56px;border-radius:50%;
    background:linear-gradient(135deg,var(--blue),#6366f1);
    color:#fff;display:grid;place-items:center;
    box-shadow:0 8px 32px rgba(59,130,246,.4);
    transition:transform .2s,box-shadow .2s,opacity .2s;
    border:none;cursor:pointer;
}
.fab.hidden{display:none}
.fab:hover{transform:scale(1.08);box-shadow:0 12px 40px rgba(59,130,246,.5)}
.fab svg{width:24px;height:24px}

.empty-state{
    padding:64px 32px;text-align:center;
}
.empty-icon{
    width:72px;height:72px;margin:0 auto 20px;
    background:rgba(59,130,246,.1);border-radius:50%;
    display:grid;place-items:center;
    animation:pulse 2.5s ease infinite;
}
.empty-icon svg{width:32px;height:32px;color:var(--blue)}
@keyframes pulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(1.05);opacity:.85}}
.empty-state h3{font-size:18px;font-weight:600;margin-bottom:8px}
.empty-state p{color:var(--muted);font-size:14px;margin-bottom:20px}

.key-bar{
    display:flex;align-items:center;justify-content:space-between;
    padding:14px 22px 0;
}
.lic-list{display:flex;flex-direction:column;gap:12px;padding:12px 18px 18px}
.lic-card{
    background:var(--bg2);
    border:1px solid var(--border);
    border-radius:var(--radius-lg);
    padding:18px 20px;
    transition:border-color .15s,box-shadow .15s;
}
.lic-card:hover{border-color:var(--border2);box-shadow:0 4px 20px rgba(0,0,0,.15)}
.lic-card-top{
    display:flex;align-items:center;gap:12px;
    margin-bottom:16px;
}
.lic-card-top h4{
    flex:1;min-width:0;
    font-size:16px;font-weight:700;
    letter-spacing:-.01em;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.lic-chk{margin:0}
.lic-card-meta{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:6px 28px;
}
.lic-row{font-size:13px;color:var(--text);line-height:1.75}
.lic-lbl{color:var(--muted);margin-right:4px}

.bc-app strong{color:var(--text);font-weight:600}
.bc-sep{color:var(--muted2);margin:0 8px}

@media(max-width:720px){
    .lic-card-meta{grid-template-columns:1fr}
    .lic-card-top{flex-wrap:wrap}
    .lic-card-top h4{flex-basis:calc(100% - 40px);order:1}
    .lic-chk{order:0}
    .lic-card-top .status-pill{order:2}
    .lic-card-top .row-menu{margin-left:auto;order:3}
}
.chk-wrap{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);cursor:pointer}
.chk-wrap input{width:16px;height:16px;accent-color:var(--blue)}

.pager{
    display:flex;justify-content:space-between;
    padding:14px 22px;border-top:1px solid var(--border);
}
.btn-ghost.sm{padding:8px 16px;font-size:12px}

.sub-tabs{
    display:flex;gap:4px;margin-bottom:20px;
    background:var(--surface);border:1px solid var(--border);
    border-radius:var(--radius-lg);padding:4px;width:fit-content;
}
.sub-tab{
    padding:10px 20px;border-radius:var(--radius);
    font-size:13px;font-weight:500;color:var(--muted);
    transition:all .18s;
}
.sub-tab:hover{color:var(--text)}
.sub-tab.active{background:var(--blue);color:#fff;box-shadow:0 2px 12px rgba(59,130,246,.3)}

.settings-layout{
    display:grid;grid-template-columns:1fr 1fr;gap:20px;
}
.set-card{
    background:var(--surface);border:1px solid var(--border);
    border-radius:var(--radius-lg);overflow:hidden;
    animation:fadeUp .35s ease both;
}
.set-card h3{
    padding:18px 22px;font-size:14px;font-weight:600;
    border-bottom:1px solid var(--border);
    background:var(--bg2);
}
.set-card-body{padding:8px 0}

.toggle-row{
    display:flex;align-items:center;justify-content:space-between;gap:16px;
    padding:14px 22px;border-bottom:1px solid var(--border);
    transition:background .15s;
}
.toggle-row:last-child{border-bottom:none}
.toggle-row:hover{background:rgba(255,255,255,.02)}
.toggle-info strong{display:block;font-size:13px;font-weight:500;margin-bottom:3px}
.toggle-info span{font-size:12px;color:var(--muted);line-height:1.4}

.toggle{
    position:relative;width:44px;height:24px;flex-shrink:0;
    background:var(--border2);border-radius:999px;
    transition:background .2s;cursor:pointer;
}
.toggle.on{background:var(--blue)}
.toggle::after{
    content:'';position:absolute;top:3px;left:3px;
    width:18px;height:18px;border-radius:50%;background:#fff;
    transition:transform .2s cubic-bezier(.4,0,.2,1);
    box-shadow:0 1px 4px rgba(0,0,0,.3);
}
.toggle.on::after{transform:translateX(20px)}

.set-fields{padding:18px 22px;display:flex;flex-direction:column;gap:14px}
.set-fields .field{margin:0}

.hash-btns{display:flex;flex-direction:column;gap:10px;padding:18px 22px}
.hash-list{display:flex;flex-direction:column;gap:6px;margin-bottom:4px}
.hash-item{padding:8px 10px;background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius)}
.hash-item code{font-size:11px;word-break:break-all;color:#a5b4fc}
.hash-drop{
    border:2px dashed var(--border2);
    border-radius:var(--radius-lg);
    padding:36px 20px;
    text-align:center;
    cursor:pointer;
    transition:border-color .15s,background .15s;
}
.hash-drop:hover,.hash-drop.over{background:rgba(59,130,246,.06);border-color:rgba(59,130,246,.4)}
.hash-drop.busy{opacity:.6;pointer-events:none}
.hash-drop svg{width:28px;height:28px;color:var(--muted);margin-bottom:10px}
.hash-drop-title{font-size:14px;font-weight:500;color:var(--text);margin-bottom:6px}
.hash-drop-sub{font-size:12px;color:var(--muted)}
.btn-block{
    width:100%;padding:12px;border-radius:var(--radius);
    font-weight:600;font-size:13px;transition:all .15s;
}
.btn-block.blue{background:var(--blue);color:#fff}
.btn-block.blue:hover{background:var(--blue2)}
.btn-block.red{background:rgba(239,68,68,.15);color:var(--red);border:1px solid rgba(239,68,68,.25)}
.btn-block.red:hover{background:rgba(239,68,68,.25)}

.dash-foot{
    display:flex;align-items:center;justify-content:space-between;
    padding:16px 28px;border-top:1px solid var(--border);
    font-size:12px;color:var(--muted2);
}
.foot-links{display:flex;gap:16px}
.foot-links a{color:var(--muted);transition:color .15s}
.foot-links a:hover{color:var(--blue)}

.modal-box.lg{width:520px}
.modal-body .form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.modal-body .req::after{content:' *';color:var(--red)}
.modal-body .hint{font-size:11px;color:var(--muted2);margin-top:4px}
.modal-body .chk-row{display:flex;gap:20px;align-items:center}
.modal-body .chk-row label{display:flex;align-items:center;gap:6px;font-size:13px;cursor:pointer}

.ripple{position:relative;overflow:hidden}
.key-copy{cursor:pointer;transition:color .15s}
.key-copy:hover{color:var(--blue)}

.copy-toast{
    position:fixed;bottom:80px;right:24px;z-index:301;
    padding:8px 14px;background:var(--surface2);
    border:1px solid rgba(59,130,246,.3);border-radius:var(--radius);
    font-size:12px;color:var(--blue);animation:slideUp .2s ease;
}

@media(max-width:900px){
    .settings-layout{grid-template-columns:1fr}
    .fab{bottom:20px;right:20px}
    .apps-split{grid-template-columns:1fr!important}
    .cred-panel{position:static!important}
}

.apps-page{width:100%;display:block;clear:both}
.apps-page > .stat-row{
    width:100%;
    margin-bottom:20px;
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
}

.apps-split{
    display:grid;
    grid-template-columns:minmax(260px,340px) minmax(0,1fr);
    gap:20px;
    align-items:start;
    width:100%;
}
.apps-split > *{min-width:0}
.apps-main{width:100%;overflow:visible}
.panel-card.apps-main{overflow:visible}

.apps-head{
    display:flex;flex-direction:column;gap:14px;
    padding:20px 22px;border-bottom:1px solid var(--border);
}
.apps-head h2{font-size:16px;font-weight:600;white-space:nowrap}
.apps-head-tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap;width:100%}
.apps-head-tools .search-mini{flex:1;min-width:160px;max-width:320px}
.apps-head-tools .search-mini input{width:100%}
.apps-head-tools .btn-primary{margin-left:auto;flex-shrink:0}
.app-list.kauth{padding:14px 18px 18px;display:flex;flex-direction:column;gap:10px}

.stat-card{position:relative;overflow:hidden;transition:border-color .2s,transform .2s}
.stat-card:hover{border-color:rgba(59,130,246,.25);transform:translateY(-2px)}
.stat-icon{
    width:36px;height:36px;border-radius:10px;
    display:grid;place-items:center;margin-bottom:12px;
}
.stat-icon svg{width:18px;height:18px}
.si-blue{background:rgba(59,130,246,.12);color:var(--blue)}
.si-green{background:rgba(34,197,94,.12);color:var(--green)}
.si-orange{background:rgba(249,115,22,.12);color:var(--orange)}
.si-purple{background:rgba(168,85,247,.12);color:var(--purple)}

.kapp{
    background:var(--bg2);
    border:1px solid var(--border);
    border-radius:var(--radius-lg);
    padding:18px 20px;
    transition:all .2s;
}
.kapp:hover{border-color:var(--border2);box-shadow:0 4px 20px rgba(0,0,0,.2)}
.kapp.selected{border-color:rgba(34,197,94,.4);box-shadow:0 0 0 1px rgba(34,197,94,.15),0 4px 24px rgba(34,197,94,.08)}
.kapp-top{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}
.kapp-info h3{font-size:17px;font-weight:700;margin-bottom:8px;letter-spacing:-.01em}
.kapp-stats{display:flex;flex-wrap:wrap;gap:8px 24px;font-size:12px;color:var(--muted)}
.kapp-stats b{color:var(--text);font-weight:600;margin-left:4px}
.kapp-stats .stand-good{color:var(--green)}
.kapp-stats .stand-warn{color:var(--orange)}
.kapp-stats .stand-bad{color:var(--red)}

.kapp-actions{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(108px,1fr));
    gap:8px;
}
.kbtn{
    display:inline-flex;align-items:center;justify-content:center;gap:6px;
    padding:8px 10px;border-radius:var(--radius);
    font-size:11px;font-weight:600;transition:all .15s;
    white-space:nowrap;
}
.kbtn svg{width:14px;height:14px}
.kbtn-select{background:#27272a;color:#fff;border:1px solid var(--border)}
.kbtn-select.on{background:rgba(34,197,94,.18);color:var(--green);border-color:rgba(34,197,94,.35)}
.kbtn-purple{background:rgba(168,85,247,.12);color:var(--purple);border:1px solid rgba(168,85,247,.25)}
.kbtn-cyan{background:rgba(6,182,212,.12);color:#22d3ee;border:1px solid rgba(6,182,212,.25)}
.kbtn-orange{background:rgba(249,115,22,.12);color:var(--orange);border:1px solid rgba(249,115,22,.25)}
.kbtn-red{background:rgba(239,68,68,.12);color:var(--red);border:1px solid rgba(239,68,68,.25)}
.kbtn:hover{opacity:.88;transform:translateY(-1px)}

.cred-empty{
    padding:32px 16px;text-align:center;color:var(--muted);
    border:1px dashed var(--border);border-radius:var(--radius-lg);margin-bottom:16px;
}
.cred-empty-icon{
    width:48px;height:48px;margin:0 auto 12px;
    background:rgba(59,130,246,.1);border-radius:50%;
    display:grid;place-items:center;
}
.cred-empty-icon svg{width:22px;height:22px;color:var(--blue)}
.cred-snippet{
    background:var(--bg2);border:1px solid var(--border);
    border-radius:var(--radius);padding:12px;margin:8px 0 14px;
    font-family:monospace;font-size:11px;line-height:1.5;
    color:#a5b4fc;overflow-x:auto;white-space:pre-wrap;word-break:break-all;
}

.cred-panel{
    position:sticky;top:calc(var(--topbar) + 24px);
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:var(--radius-lg);
    padding:22px;
    animation:fadeUp .4s ease;
}
.cred-panel h3{font-size:15px;font-weight:600;margin-bottom:18px;display:flex;align-items:center;gap:8px}
.cred-field{margin-bottom:14px}
.cred-field label{display:block;font-size:11px;font-weight:600;color:var(--muted2);text-transform:uppercase;letter-spacing:.05em;margin-bottom:6px}
.cred-val{
    display:flex;align-items:center;gap:8px;
    background:var(--bg2);border:1px solid var(--border);
    border-radius:var(--radius);padding:10px 12px;
}
.cred-val input,.cred-val span{
    flex:1;min-width:0;
    background:none;border:none;outline:none;
    font-size:12px;font-family:monospace;color:var(--text);
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.cred-val.blur span{filter:blur(4px);user-select:none;white-space:nowrap}
.cred-copy{
    width:32px;height:32px;border-radius:8px;
    display:grid;place-items:center;color:var(--muted);
    transition:all .15s;flex-shrink:0;
}
.cred-copy:hover{background:var(--surface2);color:var(--blue)}
.cred-copy svg{width:15px;height:15px}
.cred-toggle{font-size:12px;color:var(--blue);cursor:pointer;margin-bottom:14px;display:inline-block}
.cred-toggle:hover{text-decoration:underline}
.btn-warn{
    width:100%;padding:11px;margin-top:8px;
    background:rgba(249,115,22,.12);color:var(--orange);
    border:1px solid rgba(249,115,22,.25);border-radius:var(--radius);
    font-weight:600;font-size:13px;transition:all .15s;
}
.btn-warn:hover{background:rgba(249,115,22,.2)}
.cred-note{
    margin-top:16px;padding:12px 14px;
    background:rgba(59,130,246,.08);border:1px solid rgba(59,130,246,.2);
    border-radius:var(--radius);font-size:12px;color:var(--muted);line-height:1.5;
}

.app-list.compact .app-row{padding:16px 20px}
.app-list.compact .app-meta{display:none}
.app-list.compact .app-row-top{margin-bottom:10px}
.app-list.compact .app-row-top h3{font-size:15px}

.row-list{padding:8px 0}
.row-card{
    display:flex;align-items:center;gap:16px;
    padding:16px 22px;border-bottom:1px solid var(--border);
    transition:background .15s,transform .15s;
    position:relative;
}
.row-card:hover{background:rgba(255,255,255,.02)}
.row-card:last-child{border-bottom:none}
.row-card-check{flex-shrink:0}
.row-card-body{flex:1;min-width:0}
.row-card-body h4{font-size:15px;font-weight:600;margin-bottom:8px}
.row-key{
    display:flex;align-items:center;gap:8px;margin-bottom:8px;
    font-family:'Consolas','Fira Code',monospace;font-size:13px;color:#a5b4fc;
}
.row-key code{
    background:var(--bg2);padding:6px 10px;border-radius:8px;
    font-size:12px;word-break:break-all;flex:1;
}
.key-copy-btn{
    width:32px;height:32px;border-radius:8px;flex-shrink:0;
    display:grid;place-items:center;color:var(--muted);
    background:var(--bg2);border:1px solid var(--border);
    transition:all .15s;cursor:pointer;
}
.key-copy-btn:hover{color:var(--blue);border-color:rgba(59,130,246,.3)}
.key-copy-btn svg{width:14px;height:14px}
.row-meta{font-size:12px;color:var(--muted);display:flex;flex-wrap:wrap;gap:6px 20px}

.status-pill{
    padding:6px 14px;border-radius:999px;
    font-size:11px;font-weight:700;white-space:nowrap;flex-shrink:0;
}
.status-pill.ok{background:rgba(34,197,94,.12);color:var(--green)}
.status-pill.used{background:rgba(34,197,94,.12);color:var(--green)}
.status-pill.free{background:rgba(59,130,246,.12);color:var(--blue)}
.status-pill.bad{background:rgba(239,68,68,.12);color:var(--red)}
.status-pill.warn{background:rgba(249,115,22,.12);color:var(--orange)}

.row-menu{position:relative;flex-shrink:0}
.menu-trigger{
    width:36px;height:36px;border-radius:var(--radius);
    display:grid;place-items:center;color:var(--muted);
    transition:all .15s;
}
.menu-trigger:hover{background:var(--surface2);color:var(--text)}
.menu-trigger svg{width:18px;height:18px}
.menu-drop{
    position:absolute;right:0;top:calc(100% + 4px);z-index:30;
    min-width:160px;background:var(--surface2);
    border:1px solid var(--border);border-radius:var(--radius);
    box-shadow:var(--shadow);padding:6px;
    opacity:0;visibility:hidden;transform:translateY(-6px);
    transition:all .18s;
}
.menu-drop.open{opacity:1;visibility:visible;transform:none}
.menu-drop button{
    display:flex;align-items:center;gap:8px;width:100%;
    padding:10px 12px;border-radius:8px;font-size:13px;
    text-align:left;color:var(--muted);transition:all .12s;
}
.menu-drop button:hover{background:var(--surface);color:var(--text)}
.menu-drop button.danger:hover{color:var(--red);background:rgba(239,68,68,.08)}
.menu-drop button svg{width:14px;height:14px}

.tool-group.colors .tool-btn.c-blue{background:rgba(59,130,246,.15);color:var(--blue);border-color:rgba(59,130,246,.25)}
.tool-group .tool-btn.c-blue{background:rgba(59,130,246,.15);color:var(--blue);border-color:rgba(59,130,246,.25)}
.tool-group.colors .tool-btn.c-green{background:rgba(34,197,94,.12);color:var(--green);border-color:rgba(34,197,94,.25)}
.tool-group.colors .tool-btn.c-purple{background:rgba(168,85,247,.12);color:var(--purple);border-color:rgba(168,85,247,.25)}
.tool-group.colors .tool-btn.c-orange{background:rgba(249,115,22,.12);color:var(--orange);border-color:rgba(249,115,22,.25)}
.tool-group.colors .tool-btn.c-red{background:rgba(239,68,68,.12);color:var(--red);border-color:rgba(239,68,68,.25)}

.pager-info{font-size:12px;color:var(--muted2);padding:0 22px}

.scroll-tabs{overflow-x:auto;max-width:100%;flex-wrap:nowrap}
.scroll-tabs .sub-tab{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.scroll-tabs .sub-tab svg{width:14px;height:14px}

.func-grid{
    display:grid;grid-template-columns:repeat(3,1fr);gap:16px;
}
.func-card{
    background:var(--surface);border:1px solid var(--border);
    border-radius:var(--radius-lg);overflow:hidden;
    animation:fadeUp .35s ease both;
}
.func-card h3{
    padding:16px 20px;font-size:13px;font-weight:600;
    border-bottom:1px solid var(--border);background:var(--bg2);
    display:flex;align-items:center;gap:8px;
}
.func-card h3 svg{width:16px;height:16px;color:var(--blue)}
.func-card .toggle-row{padding:12px 20px}

.msg-grid{
    display:grid;grid-template-columns:1fr 1fr;gap:16px;
}
.msg-card{
    background:var(--surface);border:1px solid var(--border);
    border-radius:var(--radius-lg);padding:20px 22px;
}
.msg-card .field{margin-bottom:12px}
.msg-card .field:last-child{margin-bottom:0}
.msg-card .field label{font-size:11px;color:var(--muted2)}

.save-float{
    position:fixed;bottom:28px;right:28px;z-index:55;
    display:inline-flex;align-items:center;gap:8px;
    padding:14px 22px;background:var(--blue);color:#fff;
    font-weight:600;font-size:14px;border-radius:var(--radius-lg);
    box-shadow:0 8px 32px rgba(59,130,246,.45);
    transition:transform .2s,box-shadow .2s;
}
.save-float:hover{transform:translateY(-2px);box-shadow:0 12px 40px rgba(59,130,246,.55)}
.save-float svg{width:18px;height:18px}

.sub-tabs-wrap{margin-bottom:20px}
.settings-top-tabs{
    display:flex;gap:4px;margin-bottom:16px;
    border-bottom:1px solid var(--border);padding-bottom:0;
}
.settings-top-tab{
    padding:10px 20px;font-size:13px;font-weight:500;color:var(--muted);
    border-bottom:2px solid transparent;margin-bottom:-1px;
    transition:all .15s;
}
.settings-top-tab.active{color:var(--text);border-bottom-color:var(--blue)}

@media(max-width:1100px){
    .func-grid{grid-template-columns:1fr 1fr}
    .msg-grid{grid-template-columns:1fr}
}
@media(max-width:700px){
    .func-grid{grid-template-columns:1fr}
}

.plat-stats{margin-bottom:20px}
.plat-filter{
    background:var(--surface2);border:1px solid var(--border);border-radius:8px;
    color:var(--text);padding:8px 12px;font-size:13px;outline:none;cursor:pointer
}
.plat-list{display:flex;flex-direction:column;gap:12px;padding:4px 0}
.plat-row{
    display:flex;align-items:flex-start;gap:16px;padding:16px 18px;
    border-radius:12px;border:1px solid var(--border);background:var(--surface2);
    transition:border-color .15s,opacity .15s
}
.plat-row:hover{border-color:rgba(99,102,241,.35)}
.plat-row.disabled{opacity:.55}
.plat-row.is-admin{border-color:rgba(168,85,247,.3);background:rgba(168,85,247,.04)}
.plat-avatar.admin{background:linear-gradient(135deg,#a855f7,#6366f1)}
.tag-purple{background:rgba(168,85,247,.15);color:#c084fc}
.tag-admin{background:rgba(168,85,247,.18);color:#d8b4fe}
.tag-seller{background:rgba(59,130,246,.12);color:var(--blue)}
.plat-you{font-size:11px;color:var(--muted);padding:6px 8px}
.plat-avatar{
    width:44px;height:44px;border-radius:50%;flex-shrink:0;
    background:linear-gradient(135deg,var(--blue),var(--purple));
    display:flex;align-items:center;justify-content:center;
    font-weight:700;font-size:16px;color:#fff
}
.plat-body{flex:1;min-width:0}
.plat-top{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:8px}
.plat-top strong{font-size:15px}
.plat-meta{
    display:flex;flex-wrap:wrap;gap:12px 18px;font-size:12px;color:var(--muted)
}
.plat-meta span{display:inline-flex;align-items:center;gap:5px}
.plat-meta svg{width:13px;height:13px;opacity:.7}
.plat-note{
    margin-top:8px;font-size:12px;color:var(--muted2);font-style:italic;
    padding:6px 10px;background:rgba(255,255,255,.03);border-radius:6px
}
.plat-expire{margin-top:6px;font-size:12px;color:var(--orange)}
.plat-actions{display:flex;flex-wrap:wrap;gap:6px;flex-shrink:0;align-items:flex-start}
.tag-blue{background:rgba(59,130,246,.12);color:var(--blue)}
@media(max-width:900px){
    .plat-row{flex-direction:column}
    .plat-actions{width:100%;justify-content:flex-end}
}

.dlog-webhook{padding:22px}
.dlog-label{display:block;font-size:12px;font-weight:600;color:var(--muted);margin-bottom:8px}
.dlog-input{width:100%;padding:12px 14px;background:var(--bg2);border:1px solid var(--border);border-radius:10px;color:var(--text);font-size:14px}
.dlog-hint{margin-top:8px;font-size:12px;color:var(--muted2)}
.dlog-head{display:flex;align-items:center;justify-content:space-between;padding:18px 22px 0}
.dlog-head h2{font-size:16px;font-weight:600}
.dlog-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px;padding:18px 22px 22px}
.dlog-card{background:var(--surface2);border:1px solid var(--border);border-radius:12px;padding:16px;transition:border-color .15s,box-shadow .15s}
.dlog-card.on{border-color:rgba(88,101,242,.45);box-shadow:0 0 0 1px rgba(88,101,242,.12)}
.dlog-card-top{display:flex;align-items:center;gap:10px;cursor:pointer;margin-bottom:8px}
.dlog-card-top input{width:16px;height:16px;accent-color:var(--blue)}
.dlog-icon{font-size:20px;line-height:1}
.dlog-title{font-size:14px;font-weight:700}
.dlog-desc{font-size:12px;color:var(--muted);margin-bottom:10px;line-height:1.5}
.dlog-events{margin:0;padding:0 0 0 16px;font-size:11px;color:var(--muted2);line-height:1.6;max-height:120px;overflow:auto}
.dlog-events code{font-size:10px;color:#a5b4fc;background:rgba(99,102,241,.1);padding:1px 5px;border-radius:4px}
.head-actions{display:flex;gap:8px;flex-wrap:wrap}
