:root {
    --bg: #060b18;
    --bg2: #0c1325;
    --bg3: #111b30;
    --bg4: #162240;
    --border: #1e2d52;
    --border-light: #2a3d6a;
    --text: #e0e6f0;
    --text2: #8899bb;
    --text3: #5a6f8f;
    --accent: #3b82f6;
    --accent2: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.3);
    --green: #00e676;
    --red: #ff5252;
    --orange: #ffab40;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg);
    font-family: 'Inter', sans-serif;
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}
.hidden { display: none !important; }

.noise {
    position: fixed; inset: 0; pointer-events: none; opacity: 0.025; z-index: -1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.orb {
    position: fixed; border-radius: 50%; pointer-events: none; z-index: -1;
    filter: blur(120px); opacity: 0.12;
}
.orb-1 { width: 600px; height: 600px; top: -200px; right: -200px; background: radial-gradient(circle, var(--accent), transparent); }
.orb-2 { width: 500px; height: 500px; bottom: -150px; left: -150px; background: radial-gradient(circle, var(--accent2), transparent); }
.orb-3 { width: 400px; height: 400px; top: 50%; left: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(59,130,246,0.08), transparent); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 28px; border-radius: 50px; font-weight: 600;
    font-size: 0.9rem; text-decoration: none; transition: all 0.3s ease; cursor: pointer;
    font-family: inherit; border: none; white-space: nowrap;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.btn.primary {
    background: linear-gradient(135deg, var(--accent), #2563eb);
    color: #fff; box-shadow: 0 4px 20px var(--accent-glow);
}
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(59,130,246,0.5); }
.btn.small { padding: 8px 18px; font-size: 0.8rem; }
.btn.ghost {
    background: var(--bg3); border: 1px solid var(--border); color: var(--text2);
}
.btn.ghost:hover { border-color: var(--accent); color: var(--text); background: var(--bg4); }
.btn.danger {
    background: linear-gradient(135deg, var(--red), #cc3333);
    color: #fff; box-shadow: 0 4px 20px rgba(255,82,82,0.3);
}
.btn.danger:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(255,82,82,0.4); }
.btn:disabled, .btn[disabled] {
    opacity: 0.4; cursor: not-allowed; pointer-events: none;
    transform: none !important; box-shadow: none !important;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ===== LOGIN ===== */
.login-wrap {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; padding: 24px; position: relative;
}
.login-card {
    background: linear-gradient(145deg, rgba(12,19,37,0.95), rgba(17,27,48,0.9));
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 48px 40px 40px; width: 100%; max-width: 420px; text-align: center;
    position: relative; backdrop-filter: blur(20px);
    box-shadow: 0 0 60px rgba(59,130,246,0.06), 0 20px 60px rgba(0,0,0,0.3);
}
.login-card::before {
    content: ''; position: absolute; inset: -1px; border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(59,130,246,0.15), transparent 40%, transparent 60%, rgba(59,130,246,0.05));
    z-index: -1;
}
.login-logo { height: 52px; margin-bottom: 8px; transition: transform 0.3s; }
.login-logo:hover { transform: scale(1.05); }
.login-title {
    font-size: 1.5rem; font-weight: 900; letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 30%, var(--accent2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 4px;
}
.login-sub { color: var(--text2); font-size: 0.9rem; margin-bottom: 36px; }
.login-form { text-align: left; }
.login-field { margin-bottom: 20px; }
.login-field label {
    display: block; font-size: 0.72rem; font-weight: 600; color: var(--text2);
    margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.8px;
}
.login-input-wrap {
    position: relative; display: flex; align-items: center;
    background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm);
    transition: border-color 0.25s, box-shadow 0.25s;
}
.login-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.login-input-wrap .icon {
    flex-shrink: 0; width: 18px; height: 18px; margin-left: 14px; color: var(--text2); opacity: 0.5;
}
.login-input-wrap input {
    width: 100%; padding: 13px 14px 13px 10px; background: none; border: none;
    color: var(--text); font-family: inherit; font-size: 0.95rem; outline: none;
}
.login-input-wrap input::placeholder { color: var(--text2); opacity: 0.4; }
.login-form .btn.primary { width: 100%; padding: 14px 24px; font-size: 1rem; position: relative; }
.login-spinner {
    display: none; width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
    border-radius: 50%; animation: lspin 0.6s linear infinite; margin: 0 auto;
}
@keyframes lspin { to { transform: rotate(360deg); } }
.login-form .btn.primary.loading .btn-text { display: none; }
.login-form .btn.primary.loading .login-spinner { display: block; }
.login-error {
    display: none; margin-top: 12px; padding: 10px 14px;
    background: rgba(255,82,82,0.1); border: 1px solid rgba(255,82,82,0.2);
    border-radius: var(--radius-sm); color: var(--red); font-size: 0.82rem; text-align: center;
    animation: shake 0.4s ease;
}
@keyframes shake {
    0%,100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
.login-footer-text { margin-top: 24px; color: var(--text2); font-size: 0.85rem; }
.login-footer-text strong { color: var(--text); }

/* ===== LAYOUT ===== */
.dash-wrap { display: flex; min-height: 100vh; }

/* ===== TOPBAR ===== */
.topbar {
    position: fixed; top: 0; left: 240px; right: 0; height: 60px; z-index: 20;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 32px; background: rgba(6,11,24,0.85); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.topbar-title {
    display: flex; align-items: center; gap: 8px;
}
.topbar-title .badge {
    font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    padding: 2px 8px; border-radius: 20px;
    background: rgba(59,130,246,0.15); color: var(--accent2);
    border: 1px solid rgba(59,130,246,0.2);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-title {
    font-size: 1.05rem; font-weight: 700;
    color: var(--text);
}
.bot-status {
    display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 500;
    padding: 6px 14px; border-radius: 20px; background: var(--bg3); border: 1px solid var(--border);
}
.bot-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.bot-status-dot.online { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse-dot 2s infinite; }
.bot-status-dot.offline { background: var(--red); box-shadow: 0 0 8px var(--red); }
.bot-status-dot.starting { background: var(--orange); box-shadow: 0 0 8px var(--orange); animation: pulse-dot 1s infinite; }
@keyframes pulse-dot {
    0%,100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.topbar-user {
    display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 10px;
    border-radius: 20px; background: var(--bg3); border: 1px solid var(--border);
    cursor: default;
}
.topbar-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 800; color: #fff; flex-shrink: 0;
}
.topbar-user-name { font-size: 0.8rem; font-weight: 600; }

/* ===== SIDEBAR ===== */
.sidebar {
    width: 240px; flex-shrink: 0; position: fixed; top: 0; left: 0;
    height: 100vh; z-index: 30; display: flex; flex-direction: column;
    background: linear-gradient(180deg, var(--bg2) 0%, var(--bg3) 100%);
    border-right: 1px solid var(--border);
}
.sidebar-brand {
    display: flex; align-items: center; gap: 12px; padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.sidebar-brand img { height: 34px; }
.sidebar-brand-text { display: flex; flex-direction: column; }
.sidebar-brand-name {
    font-size: 1.1rem; font-weight: 800;
    background: linear-gradient(135deg, #fff 30%, var(--accent2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; line-height: 1.2;
}
.sidebar-brand-sub {
    font-size: 0.6rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--text3); line-height: 1;
}
.sidebar-user {
    display: flex; align-items: center; gap: 10px; padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}
.sidebar-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 800; color: #fff; flex-shrink: 0;
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-info .name { font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-info .role {
    font-size: 0.65rem; color: var(--text2); text-transform: uppercase; letter-spacing: 1px; font-weight: 600;
}

.sidebar-nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.sidebar-nav-item {
    display: flex; align-items: center; gap: 12px; padding: 11px 14px;
    border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 500;
    color: var(--text2); cursor: pointer; transition: all 0.2s; user-select: none;
    border: none; background: none; width: 100%; text-align: left; font-family: inherit;
}
.sidebar-nav-item:hover { background: var(--bg4); color: var(--text); }
.sidebar-nav-item.active {
    background: rgba(59,130,246,0.1);
    color: var(--accent2); border: 1px solid rgba(59,130,246,0.15);
}
.sidebar-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item-content { display: flex; flex-direction: column; min-width: 0; }
.nav-item-title { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.nav-item-desc { font-size: 0.62rem; color: var(--text3); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-nav-item.active .nav-item-desc { color: var(--accent2); opacity: 0.7; }
.plan-badge {
    display: inline-block; font-size: 0.6rem; font-weight: 600; padding: 1px 8px;
    background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.2);
    border-radius: 10px; color: var(--accent2); text-transform: uppercase; letter-spacing: 0.5px;
}
.category-badge {
    display: inline-block; font-size: 0.58rem; font-weight: 700; padding: 1px 6px;
    background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.2);
    border-radius: 10px; color: var(--green); text-transform: uppercase; letter-spacing: 0.5px;
    margin-right: 4px;
}
.sidebar-footer { padding: 12px 10px; border-top: 1px solid var(--border); }
.sidebar-footer .sidebar-nav-item { color: var(--red); font-size: 0.82rem; }
.sidebar-footer .sidebar-nav-item:hover { background: rgba(255,82,82,0.08); color: var(--red); }

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 240px; margin-top: 60px; flex: 1; min-height: calc(100vh - 60px);
    padding: 32px 48px;
    max-width: 1400px;
}

/* ===== SPINNERS OFF ===== */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

.cfg-label-inline {
    font-size: 0.72rem; color: var(--text3); font-weight: 600; white-space: nowrap;
}

.dyn-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border);
    cursor: pointer; transition: all 0.2s; flex-shrink: 0;
    background: var(--bg3); color: var(--text3); padding: 0;
}
.dyn-btn.remove:hover {
    background: rgba(255,82,82,0.1); border-color: rgba(255,82,82,0.25); color: var(--red);
}

/* ===== TIER CARDS ===== */
.tier-group {
    margin-bottom: 20px;
}
.tier-group:last-child {
    margin-bottom: 0;
}
.tier-group-header {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.75rem; font-weight: 700; color: var(--accent2);
    text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 12px;
}
.tier-group-header svg {
    opacity: 0.7; flex-shrink: 0;
}
.tier-list {
    display: flex; flex-direction: column; gap: 10px;
}

.tier-card {
    background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; transition: border-color 0.25s, box-shadow 0.25s;
}
.tier-card:hover {
    border-color: var(--border-light);
    box-shadow: 0 0 30px rgba(59,130,246,0.03);
}
.tier-card-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; background: var(--bg3);
    border-bottom: 1px solid var(--border);
}
.tier-card-name {
    flex: 1; min-width: 0;
}
.tier-card-name input.tier-name {
    width: 100%; max-width: 160px; background: var(--bg4);
    border: 1px solid var(--border); border-radius: 6px;
    padding: 5px 10px; color: var(--text); font-family: inherit;
    font-size: 0.82rem; font-weight: 600; outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-transform: uppercase; letter-spacing: 0.3px;
}
.tier-card-name input.tier-name:focus {
    border-color: var(--accent); box-shadow: 0 0 0 2px rgba(59,130,246,0.1);
}
.tier-card-name input.tier-name::placeholder {
    color: var(--text3); font-weight: 400;
}
.tier-remove {
    flex-shrink: 0; width: 26px; height: 26px; border-radius: 6px;
    border: none; background: none; color: var(--text3); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; margin-left: 8px;
}
.tier-remove:hover {
    background: rgba(255,82,82,0.1); color: var(--red);
}
.tier-card-body {
    padding: 12px 14px 14px;
}
.tier-steps-label {
    font-size: 0.65rem; font-weight: 600; color: var(--text3);
    text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px;
}
.tier-steps-row {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.tier-step-item {
    display: flex; align-items: center; gap: 0;
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: 8px; overflow: hidden;
    transition: border-color 0.2s;
}
.tier-step-item:focus-within {
    border-color: var(--accent); box-shadow: 0 0 0 2px rgba(59,130,246,0.08);
}
.tier-step-index {
    display: flex; align-items: center; justify-content: center;
    width: 20px; height: 28px; font-size: 0.6rem; font-weight: 700;
    color: var(--text3); background: var(--bg4); flex-shrink: 0;
    border-right: 1px solid var(--border);
    font-family: 'Inter', monospace;
}
.tier-step-item input.tier-step {
    width: 52px; text-align: center; background: none; border: none;
    padding: 0 2px; color: var(--text); font-family: 'Inter', monospace;
    font-size: 0.8rem; outline: none; -moz-appearance: textfield;
}
.tier-step-item input.tier-step::-webkit-inner-spin-button,
.tier-step-item input.tier-step::-webkit-outer-spin-button {
    -webkit-appearance: none; margin: 0;
}
.step-remove {
    width: 22px; height: 28px; border: none; background: none;
    color: var(--text3); cursor: pointer; display: flex;
    align-items: center; justify-content: center; flex-shrink: 0;
    transition: all 0.2s; border-left: 1px solid transparent; padding: 0;
}
.step-remove:hover {
    color: var(--red); background: rgba(255,82,82,0.08);
    border-left-color: rgba(255,82,82,0.15);
}
.step-add {
    width: 28px; height: 28px; border-radius: 8px;
    border: 1px dashed var(--border); background: none;
    color: var(--accent2); cursor: pointer; display: inline-flex;
    align-items: center; justify-content: center; flex-shrink: 0;
    transition: all 0.25s; padding: 0;
}
.step-add:hover {
    border-color: var(--accent); background: rgba(59,130,246,0.06);
    box-shadow: 0 0 12px rgba(59,130,246,0.06);
}

.btn-add-row, .tier-add-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; margin-top: 8px; border-radius: 8px;
    font-size: 0.72rem; font-weight: 700; color: var(--accent2);
    cursor: pointer; transition: all 0.25s;
    border: 1px dashed var(--border); background: none; font-family: inherit;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.btn-add-row:hover, .tier-add-btn:hover {
    border-color: var(--accent); background: rgba(59,130,246,0.04);
    box-shadow: 0 0 14px rgba(59,130,246,0.05);
}
.btn-add-row svg, .tier-add-btn svg {
    flex-shrink: 0;
}

/* ===== CONFIG EDITOR ===== */
.cfg-section {
    background: linear-gradient(145deg, var(--bg2), var(--bg3));
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 28px; margin-bottom: 24px;
    position: relative;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.cfg-section::before {
    content: ''; position: absolute; inset: -1px; border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(59,130,246,0.06), transparent 50%, transparent 50%, rgba(59,130,246,0.02));
    z-index: 0; pointer-events: none;
}
.cfg-section:hover { border-color: var(--border-light); box-shadow: 0 0 40px rgba(59,130,246,0.03); }
.cfg-section > * { position: relative; z-index: 1; }
.cfg-section h3 {
    font-size: 0.82rem; font-weight: 700; margin-bottom: 20px; padding-bottom: 12px;
    border-bottom: 1px solid var(--border); color: var(--accent2);
    display: flex; align-items: center; gap: 10px;
    text-transform: uppercase; letter-spacing: 1px;
}
.cfg-section h3 svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.8; }
.cfg-row {
    display: flex; align-items: center; gap: 14px; margin-bottom: 14px;
    flex-wrap: wrap;
}
.cfg-row label {
    font-size: 0.72rem; font-weight: 600; color: var(--text2); min-width: 130px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.cfg-row .hint { font-size: 0.7rem; color: var(--text3); }
.cfg-row select, .cfg-row input[type="number"], .cfg-row input[type="text"] {
    background: var(--bg3); border: 1px solid var(--border); border-radius: 8px;
    padding: 9px 14px; color: var(--text); font-family: inherit; font-size: 0.85rem;
    outline: none; transition: all 0.25s; min-width: 200px;
    -webkit-appearance: none; appearance: none;
    text-transform: uppercase; letter-spacing: 0.3px;
}
.cfg-row select {
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238899bb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
    cursor: pointer;
}
.cfg-row select:focus, .cfg-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
.cfg-row select option { background: var(--bg2); color: var(--text); text-transform: uppercase; }
#cfg_token { text-transform: none !important; font-family: monospace; letter-spacing: 0; }
.cfg-toggle {
    position: relative; width: 46px; min-width: 46px; max-width: 46px; height: 26px; display: inline-block;
}
.cfg-row label.cfg-toggle {
    min-width: 46px; text-transform: none; letter-spacing: 0; font-size: 0;
}
.cfg-toggle input {
    position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%;
    z-index: 1; cursor: pointer; margin: 0;
}
.cfg-toggle .slider {
    position: absolute; inset: 0; background: var(--bg4); border-radius: 26px;
    border: 1px solid var(--border); transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
    cursor: pointer;
}
.cfg-toggle .slider::before {
    content: ''; position: absolute; left: 3px; bottom: 3px; width: 18px; height: 18px;
    background: var(--text3); border-radius: 50%; transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.cfg-toggle input:checked + .slider { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 14px var(--accent-glow), inset 0 1px 3px rgba(0,0,0,0.15); }
.cfg-toggle input:checked + .slider::before { transform: translateX(21px); background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.cfg-toggle input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }
.cfg-toggle:hover .slider { border-color: var(--border-light); }
.cfg-toggle input:checked:hover + .slider { box-shadow: 0 0 20px var(--accent-glow); }


.cfg-actions {
    display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap;
}
.cfg-reset-btn {
    background: none; border: 1px solid var(--border); color: var(--red);
    padding: 10px 20px; border-radius: 50px; font-weight: 600; font-size: 0.82rem;
    cursor: pointer; font-family: inherit; transition: all 0.2s;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.cfg-reset-btn:hover { border-color: var(--red); background: rgba(255,82,82,0.05); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .topbar { left: 0; padding: 0 16px; }
    .sidebar { transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.visible { display: block; animation: overlay-in 0.3s ease; }
    @keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
    .main-content { margin-left: 0; margin-top: 60px; padding: 20px 16px; }
    .topbar-title { font-size: 0.88rem; }
    .topbar-title .badge { display: none; }
    .cfg-row { flex-direction: column; align-items: flex-start; }
    .cfg-row label { min-width: auto; }
    .bot-status span:not(.bot-status-dot) { display: none; }
    .bot-status { padding: 6px 8px; }
    .cfg-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .cfg-stat { padding: 14px 16px; }
    .cfg-stat-value { font-size: 1.15rem; }
    .cfg-section { padding: 20px 16px; }
    .cfg-actions { flex-direction: column; }
    .cfg-actions .btn { width: 100%; justify-content: center; }
    .toast-container { right: 12px; left: 12px; top: 68px; }
    .toast { max-width: 100%; }
    .tier-card-head { padding: 8px 12px; }
    .tier-card-body { padding: 10px 12px 12px; }
    .tier-card-name input.tier-name { max-width: 120px; font-size: 0.78rem; }
    .tier-step-item input.tier-step { width: 44px; }
    .tier-step-index { width: 18px; font-size: 0.55rem; }
}
@media (max-width: 480px) {
    .login-card { padding: 36px 24px 32px; }
}

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
    display: none; position: fixed; inset: 0; z-index: 25;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
}
@media (max-width: 768px) {
    .sidebar-overlay.visible { display: block; }
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed; top: 72px; right: 24px; z-index: 999;
    display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
    pointer-events: auto; display: flex; align-items: center; gap: 10px;
    padding: 12px 18px; border-radius: var(--radius-sm);
    background: var(--bg3); border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(59,130,246,0.05);
    font-size: 0.85rem; color: var(--text);
    animation: toast-in 0.3s ease; max-width: 380px;
    backdrop-filter: blur(12px);
}
.toast.removing { animation: toast-out 0.25s ease forwards; }
@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}
.toast-icon { width: 18px; height: 18px; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--green); }
.toast-error .toast-icon { color: var(--red); }
.toast-info .toast-icon { color: var(--accent2); }

/* ===== CONFIG STATS ===== */
.cfg-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px; margin-bottom: 24px;
}
.cfg-stat {
    background: linear-gradient(145deg, var(--bg2), var(--bg3));
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px 20px; transition: all 0.3s; cursor: default;
}
.cfg-stat:hover {
    border-color: var(--border-light); transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(59,130,246,0.04);
}
.cfg-stat-value {
    font-size: 1.4rem; font-weight: 800; line-height: 1.2;
    background: linear-gradient(135deg, #fff 30%, var(--accent2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.cfg-stat-label {
    font-size: 0.7rem; color: var(--text3); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px;
}

/* ===== PAGE TRANSITIONS ===== */
.main-content {
    animation: fade-up 0.35s ease;
}
@keyframes fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== BOT CONTROLS ===== */
.bot-controls {
    display: flex; flex-direction: column; gap: 20px;
}
.expiry-banner {
    display: flex; align-items: center; gap: 8px; padding: 10px 14px;
    border-radius: var(--radius-sm); font-size: 0.8rem; line-height: 1.5;
    flex-wrap: wrap;
}
.expiry-banner.expired {
    background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); color: var(--red);
}
.expiry-banner.expired svg { flex-shrink: 0; }
.expiry-banner .renew-btn {
    margin-left: auto; white-space: nowrap; padding: 5px 14px; font-size: 0.72rem;
}
.bot-status-bar {
    display: flex; align-items: center; gap: 12px;
}
.bot-status {
    display: flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 600;
}
.bot-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); }
.bot-status-dot.online { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse-dot 2s infinite; }
.bot-actions {
    display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.bot-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
@keyframes pulse-dot {
    0%,100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== TERMINAL ===== */
.terminal-wrap {
    border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
    background: #0a0e1a;
}
.terminal-header {
    display: flex; align-items: center; gap: 8px; padding: 10px 14px;
    background: var(--bg3); border-bottom: 1px solid var(--border);
    font-size: 0.78rem; font-weight: 600; color: var(--text2);
}
.terminal-header svg { color: var(--accent2); flex-shrink: 0; }
.terminal-time { margin-left: auto; font-size: 0.7rem; color: var(--text3); font-family: 'JetBrains Mono', monospace; }
.terminal-body {
    height: 220px; overflow-y: auto; padding: 12px 14px;
    font-family: 'JetBrains Mono', monospace; font-size: 0.78rem;
    color: var(--text2); line-height: 1.7;
}
.terminal-line { display: flex; align-items: flex-start; gap: 8px; white-space: nowrap; }
.terminal-prompt { color: var(--green); font-weight: 700; flex-shrink: 0; }
.terminal-time-inline { color: var(--text3); font-size: 0.72rem; flex-shrink: 0; }

/* ===== EMPTY STATE ===== */
.empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: calc(100vh - 60px); text-align: center; padding: 40px 20px;
    position: relative;
}
.empty-icon {
    width: 110px; height: 110px; border-radius: 50%;
    background: linear-gradient(145deg, var(--bg2), var(--bg3));
    border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
    margin-bottom: 28px; color: var(--accent2); position: relative;
}
.empty-icon::after {
    content: ''; position: absolute; inset: -4px; border-radius: 50%;
    background: linear-gradient(135deg, rgba(59,130,246,0.15), transparent 60%);
    z-index: -1;
}
.empty-icon svg { opacity: 0.7; }
.empty-state h2 {
    font-size: 1.5rem; font-weight: 800; margin-bottom: 10px;
    background: linear-gradient(135deg, #fff 30%, var(--accent2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.empty-state p {
    color: var(--text2); font-size: 0.9rem; max-width: 380px; margin-bottom: 32px; line-height: 1.7;
}
.empty-state .btn { min-width: 180px; }

/* ===== MENU TOGGLE ===== */
.menu-toggle {
    display: none; background: none; border: none; color: var(--text2); cursor: pointer; padding: 4px;
    transition: color 0.2s;
}
.menu-toggle:hover { color: var(--text); }
@media (max-width: 768px) {
    .menu-toggle { display: block; }
}
