/* ═══════════════════════════════════════════
   Wed Terminal – Premium Dark Terminal UI
   ═══════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Share+Tech+Mono&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg: #000000;
    --bg-overlay: #050505;
    --bg-overlay-rgb: 5,5,5;
    --bg-overlay-alpha: .22;
    --bg-card: rgba(255,255,255,.04);
    --bg-card-solid: #050505;
    --bg-hover: rgba(249,115,22,.05);
    --bg-input: rgba(0,0,0,.4);
    --border: rgba(255,255,255,.3);
    --border-hover: rgba(249,115,22,.35);
    --border-focus: rgba(249,115,22,.4);
    --text: #ffffff;
    --text-dim: #e8e0e0;
    --text-muted: #c2bdbd;
    --primary: #f97316;
    --primary-rgb: 249,115,22;
    --primary-hover: #ea580c;
    --primary-faint: rgba(249,115,22,.06);
    --danger: #ff0000;
    --danger-rgb: 255,0,0;
    --success: #00ff5e;
    --success-rgb: 0,255,94;
    --warning: #ffaa00;
    --purple: #fd6d06;
    --purple-rgb: 253,109,6;
    --cyan: #f97316;
    --sidebar-w: 250px;
    --topbar-h: 80px;
    --radius: 8px;
    --radius-sm: 8px;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --mono: 'Fira Code', 'Share Tech Mono', 'Consolas', monospace;
    --glow-sm: 0 0 8px rgba(249,115,22,.18);
    --glow-md: 0 0 18px rgba(249,115,22,.22);
    --glow-lg: 0 0 36px rgba(249,115,22,.14), 0 0 72px rgba(249,115,22,.05);
    --shadow-card: 0 2px 16px rgba(0,0,0,.5), 0 0 1px rgba(249,115,22,.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    height: 100%; background: var(--bg); color: var(--text);
    font-family: var(--font); font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

#theme-bg-video {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    pointer-events: none;
    display: none;
    opacity: .72;
    filter: saturate(1.08) contrast(1.02);
    background: #000;
}

#particles-js {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}
#particles-js canvas {
    filter: drop-shadow(0 0 6px rgba(var(--primary-rgb),.25)) drop-shadow(0 0 14px rgba(var(--primary-rgb),.12));
}

#app { position: relative; z-index: 1; }
a { color: var(--primary); text-decoration: none; transition: all .2s; }
a:hover { color: var(--primary-hover); text-shadow: 0 0 8px rgba(var(--primary-rgb),.4); }
input, textarea, select, button { font-family: inherit; font-size: inherit; }
::selection { background: rgba(var(--primary-rgb),.25); color: #fff; }

/* ── Background effects ── */
body::before {
    content: ''; position: fixed; inset: 0; z-index: -1;
    background:
        radial-gradient(at 20% 10%, rgba(var(--bg-overlay-rgb),var(--bg-overlay-alpha)) 0%, transparent 50%),
        radial-gradient(at 80% 90%, rgba(var(--bg-overlay-rgb),calc(var(--bg-overlay-alpha) * .7)) 0%, transparent 50%),
        radial-gradient(rgba(60,60,80,.06) 0%, transparent 60%),
        linear-gradient(135deg, rgba(var(--bg-overlay-rgb),calc(var(--bg-overlay-alpha) * .85)) 0%, rgba(255,255,255,.03) 50%, rgba(var(--bg-overlay-rgb),calc(var(--bg-overlay-alpha) * .85)) 100%);
    pointer-events: none;
}
body::after {
    content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background-image: linear-gradient(rgba(var(--bg-overlay-rgb),calc(var(--bg-overlay-alpha) * .08)) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--bg-overlay-rgb),calc(var(--bg-overlay-alpha) * .08)) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* ── Layout ── */
#app { display: flex; height: 100vh; }

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-w); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; overflow: hidden; flex-shrink: 0;
    transition: width .3s cubic-bezier(.4,0,.2,1);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    position: relative;
}
.sidebar::after {
    content: ''; position: absolute; top: 0; right: 0; width: 1px; height: 100%;
    background: linear-gradient(to bottom, rgba(var(--primary-rgb),.25), transparent 30%, transparent 70%, rgba(var(--primary-rgb),.15));
    pointer-events: none;
}
.sidebar.collapsed { width: 0; border-right: none; }
.sidebar-header {
    height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px; border-bottom: 1px solid var(--border);
    background: linear-gradient(to right, rgba(var(--primary-rgb),.03), transparent);
}
.logo {
    font-size: 20px; font-weight: 700; color: #ffffff;
    font-family: var(--mono); text-shadow: 0 0 12px rgba(255,255,255,.2);
    letter-spacing: -0.5px;
}
.sidebar nav { flex: 1; overflow-y: auto; padding: 6px 0; }
.sidebar-footer {
    padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px;
    background: linear-gradient(to right, rgba(var(--primary-rgb),.02), transparent);
}

/* ── Sidebar live widget ── */
#sidebar-live {
    border-top: 1px solid var(--border);
    padding: 8px 12px;
    font-size: 11px;
    display: none;
}
#sidebar-live.slw-ready { display: block; }
.sidebar.collapsed #sidebar-live { display: none !important; }
.slw-online {
    display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
}
.slw-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #22c55e; box-shadow: 0 0 6px #22c55e;
    flex-shrink: 0; animation: slwPulse 2s infinite;
}
@keyframes slwPulse {
    0%,100% { box-shadow: 0 0 4px #22c55e; }
    50% { box-shadow: 0 0 10px #22c55e, 0 0 20px rgba(34,197,94,.3); }
}
.slw-cnt {
    font-size: 16px; font-weight: 800; color: #22c55e;
    font-family: var(--mono); line-height: 1;
}
.slw-lbl {
    color: var(--text-dim); font-size: 10px;
    text-transform: uppercase; letter-spacing: .5px;
}
.slw-top {
    display: flex; align-items: center; gap: 5px;
    padding: 3px 0;
}
.slw-medal { font-size: 12px; flex-shrink: 0; }
.slw-name {
    flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--text); font-weight: 600; font-size: 11px;
}
.slw-score {
    color: #f59e0b; font-weight: 700; font-size: 11px;
    font-family: var(--mono);
}

/* ── Nav items ── */
.nav-section { margin-bottom: 2px; }
.nav-section-title {
    display: flex; align-items: center; gap: 11px; padding: 6px 14px 6px 12px;
    cursor: pointer; margin: 2px 6px; border-radius: 8px; border-left: 2px solid transparent;
    color: var(--text-dim); transition: all .2s; -webkit-user-select: none; user-select: none;
}
.nav-section-title:hover {
    background: rgba(var(--ni-rgb, var(--primary-rgb)),.04); color: var(--text);
    border-left-color: rgba(var(--ni-rgb, var(--primary-rgb)),.3);
}
.nav-section-title .nav-icon { flex-shrink: 0; }
.nav-section-title .nav-label { flex: 1; font-size: 13px; font-weight: 500; }
.nav-section-title .arrow { font-size: 10px; color: rgba(var(--ni-rgb, var(--primary-rgb)),.5); transition: transform .25s cubic-bezier(.4,0,.2,1); }
.nav-section-title .arrow.open { transform: rotate(180deg); }
.nav-children { padding-left: 12px; }
.nav-child { padding-left: 14px !important; }
.nav-child-dot {
    width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
    margin-left: 7px; margin-right: 4px; transition: all .2s;
}
.nav-child.active .nav-child-dot {
    background: var(--ni-color, var(--primary)) !important;
    box-shadow: 0 0 6px var(--ni-color, var(--primary));
}

.nav-item {
    display: flex; align-items: center; gap: 11px; padding: 6px 16px 6px 12px;
    color: var(--text-dim); cursor: pointer; transition: all .2s; font-size: 13px;
    white-space: nowrap; border-left: 2px solid transparent; margin: 2px 6px;
    border-radius: 8px; position: relative;
}
.nav-item:hover {
    background: rgba(255,255,255,.04); color: #fff;
    border-left-color: rgba(var(--ni-rgb, var(--primary-rgb)),.4);
}
.nav-item:hover .nav-icon {
    background: rgba(var(--ni-rgb, var(--primary-rgb)),.18);
    box-shadow: 0 0 10px rgba(var(--ni-rgb, var(--primary-rgb)),.35);
}
.nav-item.active {
    color: #fff;
    background: rgba(var(--ni-rgb, var(--primary-rgb)),.1);
    border-left-color: var(--ni-color, var(--primary));
}
.nav-item.active .nav-icon {
    background: rgba(var(--ni-rgb, var(--primary-rgb)),.2);
    border-color: rgba(var(--ni-rgb, var(--primary-rgb)),.45);
    box-shadow: 0 0 12px rgba(var(--ni-rgb, var(--primary-rgb)),.5);
}
.nav-item.active::after {
    content: ''; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 55%; border-radius: 3px 0 0 3px;
    background: var(--ni-color, var(--primary));
    box-shadow: 0 0 8px var(--ni-color, var(--primary));
}
.nav-icon {
    width: 28px; height: 28px; flex-shrink: 0;
    border-radius: 7px; display: flex; align-items: center; justify-content: center;
    background: rgba(var(--ni-rgb, var(--primary-rgb)),.1);
    border: 1px solid rgba(var(--ni-rgb, var(--primary-rgb)),.22);
    transition: all .2s;
}
.nav-icon svg { width: 14px; height: 14px; }
.nav-label { font-size: 13px; font-weight: 500; }

/* ── Main ── */
#main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
#topbar {
    height: var(--topbar-h); display: flex; align-items: center; gap: 12px;
    padding: 0 28px; border-bottom: 1px solid var(--border);
    background: transparent; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    flex-shrink: 0;
}
#breadcrumb { flex: 1; font-size: 13px; color: var(--text-muted); font-family: var(--mono); letter-spacing: .5px; }
#page-content {
    flex: 1; overflow-y: auto;
    padding: 6px 8px;
    scroll-behavior: smooth;
    display: flex; flex-direction: column;
}
@media(max-width:900px){ #page-content{ padding: 12px 14px; } }
@media(max-width:600px){ #page-content{ padding: 8px; } }

/* ── Glass Card ── */
.card {
    width: 100%;
    min-height: 140px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    color: var(--text);
    font-family: var(--mono);
    font-size: 13px;
    transition: border-color .3s;
}
.card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(to right, transparent, rgba(var(--primary-rgb),.2), transparent);
    pointer-events: none;
}
.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card), var(--glow-sm);
}
.card-header {
    font-size: 15px; font-weight: 600; margin-bottom: 6px;
    display: flex; align-items: center; gap: 10px;
    font-family: var(--mono); letter-spacing: .3px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px;
    border-radius: 10px var(--radius-sm); border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.5); color: var(--text); cursor: pointer;
    font-size: 13px; font-weight: 500; transition: all .25s; white-space: nowrap;
    position: relative; overflow: hidden;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.btn::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.03), transparent);
    pointer-events: none;
}
.btn:hover {
    border-color: var(--border-hover); background: rgba(255,255,255,.06);
    box-shadow: var(--glow-sm);
    transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn-primary {
    font-weight: 600;
    box-shadow: 0 0 10px rgba(249,115,22,.15);
}
.btn-primary:hover {
    border-color: rgba(249,115,22,.7);
    box-shadow: 0 0 18px rgba(249,115,22,.3), 0 0 40px rgba(249,115,22,.1);
    transform: translateY(-2px);
    color: #fb923c;
}
.btn-danger {
    background: linear-gradient(135deg, var(--danger), #ff0000);
    color: #fff; border-color: var(--danger);
    box-shadow: 0 2px 12px rgba(var(--danger-rgb),.2);
}
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 5px; }
.btn-icon {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    font-size: 18px; padding: 6px 8px; transition: all .2s; border-radius: 6px;
}
.btn-icon:hover { color: var(--primary); background: var(--primary-faint); }

/* ── Tool Icon Badge ── */
.tool-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 10px; font-size: 17px; flex-shrink: 0;
    background: linear-gradient(135deg, rgba(var(--primary-rgb),.12), rgba(var(--primary-rgb),.04));
    border: 1px solid rgba(var(--primary-rgb),.2);
    box-shadow: 0 0 12px rgba(var(--primary-rgb),.1);
}

/* ── Inputs ── */
.input, input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], input[type="datetime-local"],
textarea, select {
    width: 100%; padding: 6px 8px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--bg-input);
    color: var(--text); outline: none; transition: all .25s;
    font-family: var(--font);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.input:focus, input:focus, textarea:focus, select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.08), var(--glow-sm);
    background: rgba(0,0,0,.6);
}
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23f97316' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    padding-right: 32px;
}
select option { background: #0a0a0a; color: var(--text); }

.form-group { margin-bottom: 16px; }
.form-label {
    display: block; margin-bottom: 6px; font-size: 12px;
    color: var(--text-dim); font-weight: 500; text-transform: uppercase;
    letter-spacing: .8px; font-family: var(--mono);
}

/* ── Grid ── */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ── Flex ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mono { font-family: var(--mono); }
.w-full { width: 100%; }
.hidden { display: none !important; }
.glow-text { color: #ffffff; text-shadow: 0 0 10px rgba(255,255,255,.4); }

/* ── Tool Cards ── */
.tool-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; cursor: pointer;
    transition: all .3s cubic-bezier(.4,0,.2,1);
    display: flex; flex-direction: column; gap: 8px;
    position: relative; overflow: hidden;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.tool-card::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(var(--primary-rgb),.03), transparent 60%);
    opacity: 0; transition: opacity .3s; pointer-events: none;
}
.tool-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(to right, transparent, rgba(var(--primary-rgb),.15), transparent);
    pointer-events: none;
}

/* ── Gate Report Button ── */
#gate-report-chat {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 9999;
}
.grw-report-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    height: 40px;
    border: 1px solid rgba(var(--primary-rgb), .42);
    background: rgba(8,8,8,.92);
    color: var(--text);
    border-radius: 8px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--mono);
    box-shadow: 0 8px 24px rgba(0,0,0,.45), 0 0 16px rgba(var(--primary-rgb),.18);
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
}
.grw-report-button:hover { border-color: rgba(var(--primary-rgb),.75); box-shadow: 0 10px 28px rgba(0,0,0,.5), 0 0 22px rgba(var(--primary-rgb),.28); }
.grw-report-button:active { cursor: grabbing; transform: translateY(1px); }
.grw-report-button:disabled { opacity: .6; cursor: wait; }

.grw-overlay {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(0,0,0,.85);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    animation: grw-fadeIn .2s ease;
}
@keyframes grw-fadeIn { from { opacity: 0; } to { opacity: 1; } }

.grw-dialog {
    background: #1a1a2e; border: 1px solid #2d2d44;
    border-radius: 12px; width: 90%; max-width: 520px;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    animation: grw-slideUp .25s ease;
}
@keyframes grw-slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.grw-dialog-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid #2d2d44;
}
.grw-dialog-header h3 { margin: 0; font-size: 16px; color: #fff; }
.grw-close-btn {
    background: none; border: none; color: #888; font-size: 28px;
    cursor: pointer; padding: 0; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px; transition: all .2s;
}
.grw-close-btn:hover { background: #2d2d44; color: #fff; }

.grw-dialog-body { padding: 20px; }
.grw-field { margin-bottom: 16px; }
.grw-field label { display: block; font-size: 13px; color: #aaa; margin-bottom: 6px; font-weight: 600; }
.grw-input, .grw-textarea {
    width: 100%; padding: 10px 12px; background: #0f0f1a; border: 1px solid #2d2d44;
    border-radius: 6px; color: #fff; font-size: 13px; font-family: var(--mono);
    transition: border-color .2s;
}
.grw-input:focus, .grw-textarea:focus { outline: none; border-color: rgba(var(--primary-rgb),.6); }
.grw-textarea { resize: vertical; line-height: 1.5; }

.grw-report-types {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px;
}
.grw-type-card {
    background: #0f0f1a; border: 2px solid #2d2d44; border-radius: 8px;
    padding: 14px; cursor: pointer; text-align: center;
    transition: all .2s;
}
.grw-type-card:hover { border-color: #404060; }
.grw-type-card.active { border-color: rgba(var(--primary-rgb),.8); background: rgba(var(--primary-rgb),.08); }
.grw-type-icon { font-size: 32px; margin-bottom: 8px; }
.grw-type-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.grw-type-desc { font-size: 11px; color: #888; line-height: 1.3; }

.grw-examples { margin-top: 12px; }
.grw-examples small { display: block; margin-bottom: 8px; }
.grw-ex-btn {
    display: inline-block; padding: 6px 12px; margin: 4px 4px 4px 0;
    background: #2d2d44; border-radius: 6px; font-size: 12px; color: #bbb;
    cursor: pointer; transition: all .2s;
}
.grw-ex-btn:hover { background: rgba(var(--primary-rgb),.3); color: #fff; }

.grw-dialog-footer {
    display: flex; gap: 10px; justify-content: flex-end;
    padding: 16px 20px; border-top: 1px solid #2d2d44;
}
.grw-btn {
    padding: 10px 20px; border-radius: 6px; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all .2s; border: none;
}
.grw-btn-cancel { background: #2d2d44; color: #aaa; }
.grw-btn-cancel:hover { background: #3a3a54; color: #fff; }
.grw-btn-submit { background: rgba(var(--primary-rgb),1); color: #fff; }
.grw-btn-submit:hover { background: rgba(var(--primary-rgb),.85); }
.grw-btn-submit:disabled { opacity: .6; cursor: wait; }

@media (max-width: 700px) {
    #gate-report-chat {
        right: 12px;
        bottom: 12px;
    }
    .grw-dialog { width: 95%; max-width: none; }
    .grw-report-types { grid-template-columns: 1fr; }
}
.tool-card:hover {
    border-color: rgba(var(--primary-rgb),.35);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,.3), 0 0 20px rgba(var(--primary-rgb),.1);
}
.tool-card:hover::before { opacity: 1; }
.tool-card .tool-icon {
    width: 36px; height: 36px; border-radius: 8px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb),.15), rgba(var(--primary-rgb),.05));
    display: flex; align-items: center; justify-content: center; font-size: 16px;
    border: 1px solid rgba(var(--primary-rgb),.15);
}
.tool-card .title { font-weight: 600; font-size: 14px; }
.tool-card .desc { font-size: 12px; color: var(--text-dim); line-height: 1.5; }

/* ── Table ── */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
th {
    color: var(--text-muted); font-weight: 600; font-size: 11px; text-transform: uppercase;
    letter-spacing: 1px; font-family: var(--mono);
    background: rgba(var(--primary-rgb),.02);
}
tr { transition: background .15s; }
tr:hover td { background: var(--bg-hover); }

/* ── Stat Cards ── */
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px; text-align: center; position: relative; overflow: hidden;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px); transition: all .3s;
}
.stat-card::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at center, rgba(var(--primary-rgb),.04), transparent 40%);
    pointer-events: none;
}
.stat-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--glow-sm);
    transform: translateY(-2px);
}
.stat-card .value {
    font-size: 32px; font-weight: 700; color: var(--primary);
    font-family: var(--mono); text-shadow: 0 0 20px rgba(var(--primary-rgb),.3);
}
.stat-card .label { font-size: 11px; color: var(--text-muted); margin-top: 6px; text-transform: uppercase; letter-spacing: 1px; }

/* ── Toast ── */
#toast-container {
    position: fixed; top: 24px; right: 24px; z-index: 9999;
    display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px 16px; border-radius: 12px;
    min-width: 270px; max-width: 360px;
    background: rgba(12, 12, 22, .85);
    border: 1px solid rgba(255,255,255,.1);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    backdrop-filter: blur(24px) saturate(1.6);
    box-shadow: 0 12px 40px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.06);
    position: relative; overflow: hidden;
    animation: toastSlideIn .35s cubic-bezier(.21,1.02,.73,1) forwards;
    pointer-events: all;
}
.toast::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 12px 0 0 12px;
}
.toast.success::before { background: linear-gradient(180deg,#22c55e,#16a34a); }
.toast.error::before   { background: linear-gradient(180deg,#ef4444,#dc2626); }
.toast.info::before    { background: linear-gradient(180deg,#3b82f6,#2563eb); }
.toast.warning::before { background: linear-gradient(180deg,#f59e0b,#d97706); }
.toast-icon {
    width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800;
}
.toast.success .toast-icon { background: rgba(34,197,94,.15); color: #22c55e50; }
.toast.error   .toast-icon { background: rgba(239,68,68,.15);  color: #ef444450; }
.toast.info    .toast-icon { background: rgba(59,130,246,.15); color: #3b82f650; }
.toast.warning .toast-icon { background: rgba(245,158,11,.15); color: #f59f0b50; }
.toast-body { flex: 1; min-width: 0; }
.toast-msg { font-size: 13px; font-weight: 500; color: #e8e8f0; line-height: 1.4; }
.toast-close {
    background: none; border: none; color: rgba(255,255,255,.25);
    cursor: pointer; font-size: 18px; padding: 0; line-height: 1;
    transition: color .2s; flex-shrink: 0; align-self: flex-start;
}
.toast-close:hover { color: #fff; }
/* progress bar */
.toast-bar {
    position: absolute; bottom: 0; left: 3px; right: 0; height: 2px;
    border-radius: 0 0 12px 0; transform-origin: left;
    animation: toastBar 3.4s linear forwards;
}
.toast.success .toast-bar { background: rgba(34,197,94,.6); }
.toast.error   .toast-bar { background: rgba(239,68,68,.6); }
.toast.info    .toast-bar { background: rgba(59,130,246,.6); }
.toast.warning .toast-bar { background: rgba(245,158,11,.6); }
@keyframes toastSlideIn {
    from { transform: translateX(110%) scale(.92); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
@keyframes toastBar {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}
.toast-out {
    animation: toastSlideOut .3s ease-in forwards !important;
}
@keyframes toastSlideOut {
    to { transform: translateX(112%); opacity: 0; }
}

/* ── Badge ── */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
    letter-spacing: .3px;
}
.badge-primary { background: rgba(255,255,255,.08); color: #ffffff; border: 1px solid rgba(255,255,255,.25); }
.badge-danger { background: rgba(var(--danger-rgb),.12); color: var(--danger); border: 1px solid rgba(var(--danger-rgb),.2); }
.badge-success { background: rgba(var(--success-rgb),.12); color: var(--success); border: 1px solid rgba(var(--success-rgb),.2); }

/* ── Tabs ── */
.tabs {
    display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px;
    gap: 4px; padding: 0 4px;
}
.tab {
    padding: 11px 22px; cursor: pointer; font-size: 13px; color: var(--text-muted);
    border-bottom: 2px solid transparent; transition: all .25s;
    font-weight: 500; border-radius: 6px 6px 0 0;
}
.tab:hover { color: var(--text); background: var(--primary-faint); }
.tab.active {
    color: var(--primary); border-bottom-color: var(--primary);
    background: rgba(var(--primary-rgb),.05);
    text-shadow: 0 0 8px rgba(var(--primary-rgb),.3);
}

/* ── Auth Page ── */
.auth-page {
    display: flex; align-items: center; justify-content: center; min-height: 100vh;
    background: url('/Raven_Bot/baby.jpg') center/cover no-repeat fixed !important; position: relative;
}
.auth-page::before {
    display: none;
}
.auth-box {
    width: 420px; max-width: 95vw; position: relative; z-index: 1;
}
.auth-box .card {
    box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 40px rgba(var(--primary-rgb),.05);
    border-color: rgba(var(--primary-rgb),.15);
}

/* ── Terminal Cursor ── */
.terminal-cursor::after {
    content: '▋'; margin-left: 2px; color: var(--primary);
    animation: cursor-blink 1s step-end infinite;
}
@keyframes cursor-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(var(--primary-rgb),.15); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--primary-rgb),.3); }

/* ── Code Block ── */
.code-block {
    background: rgba(0,0,0,.5); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 16px; font-family: var(--mono); font-size: 12px; overflow-x: auto;
    white-space: pre-wrap; word-break: break-all; max-height: 300px; overflow-y: auto;
    line-height: 1.7; color: rgba(var(--primary-rgb),.8);
}

/* ── Mobile ── */
.mobile-only { display: none; }
@media (max-width: 768px) {
    .sidebar {
        position: fixed; z-index: 100; height: 100vh; left: 0; top: 0;
        transform: translateX(-100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
    }
    .sidebar.open { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.5); }
    .sidebar.collapsed { transform: translateX(-100%); }
    .mobile-only { display: inline-flex; }
    #page-content { padding: 12px; overflow-x: hidden; }
    body { overflow-x: hidden; }
    #topbar { padding: 0 12px; }
    .card { padding: 14px; margin-bottom: 14px; }
    .card-header { font-size: 13px; margin-bottom: 10px; }
    .stat-card { padding: 14px 10px; }
    .stat-card .value { font-size: 22px; }
    .stat-card .label { font-size: 10px; }
    .tabs { gap: 2px; padding: 0; overflow-x: auto; }
    .tab { padding: 6px 8px; font-size: 12px; white-space: nowrap; }
    .t-out { padding: 6px 8px; font-size: 12px; }
    .t-row { flex-direction: column; gap: 2px; }
    .t-row .t-key { min-width: 0; text-align: left; }
    .t-row .t-key::after { content: ':'; }
    #toast-container { top: 10px; right: 10px; left: 10px; }
    .toast { min-width: auto; max-width: 100%; }
    table th, table td { padding: 6px 8px; font-size: 12px; }
    .code-block { padding: 10px; font-size: 11px; }
}

/* ── Encrypt Form ── */
.encrypt-form { max-width: 640px; }
.result-box {
    background: rgba(0,0,0,.5); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 20px; margin-top: 16px; font-family: var(--mono); font-size: 12px;
    word-break: break-all; white-space: pre-wrap; max-height: 400px; overflow-y: auto;
    position: relative; color: rgba(var(--primary-rgb),.8); line-height: 1.7;
}
.copy-btn {
    position: absolute; top: 10px; right: 10px; padding: 5px 12px; font-size: 11px;
    background: rgba(var(--primary-rgb),.1); border: 1px solid rgba(var(--primary-rgb),.2);
    border-radius: 5px; color: var(--primary); cursor: pointer; transition: all .2s;
    font-weight: 500; font-family: var(--mono);
}
.copy-btn:hover {
    background: rgba(var(--primary-rgb),.2); box-shadow: var(--glow-sm);
}

/* ── Glow Line Separator ── */
.glow-line {
    height: 1px; border: none; margin: 24px 0;
    background: linear-gradient(to right, transparent, rgba(var(--primary-rgb),.3), transparent);
}

/* ── Loading Animation ── */
.loading-spinner {
    width: 24px; height: 24px; border: 2px solid var(--border);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin .8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Pulse Dot ── */
.pulse-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--primary);
    box-shadow: 0 0 8px rgba(var(--primary-rgb),.5);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(.8); } }

/* ── Page Enter Animation ── */
#page-content > * {
    animation: pageIn .35s cubic-bezier(.21,1.02,.73,1);
}
@keyframes pageIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

/* ══════════════════════════════════════════
   Tool Page Layout  (.tp-*)
   ══════════════════════════════════════════ */

/* Header row */
.tp-hdr { display:flex; align-items:center; gap:10px; margin-bottom:10px; flex-wrap:wrap; }
.tp-icon {
    width:34px; height:34px; border-radius:8px; flex-shrink:0;
    display:flex; align-items:center; justify-content:center; font-size:16px;
    border:1px solid rgba(255,255,255,.1); background:rgba(255,255,255,.04);
}
.tp-titles { flex:1; min-width:0; }

.sidebar-show-btn {
    display: none;
    position: fixed;
    top: 14px;
    left: 12px;
    z-index: 200;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(0, 0, 0, .5);
    border: 1px solid rgba(0, 0, 0, .35);
    cursor: pointer;
    color: #8be4fa;
    font-size: 17px;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.tp-title { font-size:14px; font-weight:700; font-family:var(--mono); line-height:1.3; }
.tp-sub   { font-size:11px; color:var(--text-dim); margin-top:1px; line-height:1.35; }
.tp-badge {
    padding:2px 8px; border-radius:20px; font-size:9px; font-weight:700;
    font-family:var(--mono); letter-spacing:1px; text-transform:uppercase;
    background:rgba(249,115,22,.08); border:1px solid rgba(249,115,22,.25);
    color:var(--primary); white-space:nowrap; flex-shrink:0;
}

/* Divider */
.tp-line { height:1px; border:none; margin:0 0 10px; background:linear-gradient(to right,transparent,rgba(249,115,22,.3),transparent); }

/* Notice */
.tp-notice {
    padding:7px 12px; border-radius:5px; margin-bottom:10px;
    background:rgba(251,191,36,.06); border:1px solid rgba(251,191,36,.2);
    color:rgba(251,191,36,.85); font-size:11px; line-height:1.5;
}

/* Two-column split */
.tp-split { display:grid; grid-template-columns:1fr 1fr; gap:14px; align-items:stretch; }
@media(max-width:720px){ .tp-split{ grid-template-columns:1fr; } }

/* Panel */
.tp-panel {
    display:flex; flex-direction:column; gap:8px;
    background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.06);
    border-radius:7px; padding:12px;
}
.tp-panel-hdr { padding-bottom:8px; border-bottom:1px solid rgba(255,255,255,.07); margin-bottom:2px; }
.tp-panel-title { font-size:10px; font-weight:700; font-family:var(--mono); text-transform:uppercase; letter-spacing:1px; color:rgba(255,255,255,.6); }
.tp-panel-desc  { font-size:10px; color:var(--text-dim); margin-top:1px; }

/* Output box */
.tp-out {
    background:rgba(0,0,0,.4); border:1px solid rgba(255,255,255,.09);
    border-radius:6px; padding:10px 12px; overflow:auto;
    font-family:var(--mono); font-size:11px; line-height:1.8;
    min-height:180px; max-height:480px; flex:1;
    color:var(--text-dim); word-break:break-all;
}

/* Chip buttons */
.tp-chips { display:flex; flex-wrap:wrap; gap:5px; }
.tp-chip {
    padding:3px 9px; border-radius:20px; font-size:10px; font-family:var(--mono);
    background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.1);
    color:var(--text-dim); cursor:pointer; transition:all .18s;
}
.tp-chip:hover {
    background:rgba(249,115,22,.1); border-color:rgba(249,115,22,.35);
    color:var(--primary);
}

/* ── T output helpers ── */
.t-wrap { display:flex; flex-direction:column; gap:2px; }

/* ── Right Column ── */
#right-col {
    width: 210px; flex-shrink: 0;
    border-left: 1px solid var(--border);
    display: flex; flex-direction: column;
    height: 100vh; overflow: hidden;
}
body.route-dashboard #right-col { display: none; }
.rc-panel {
    flex: 1; display: flex; flex-direction: column;
    padding: 10px 8px; overflow: hidden;
    border-bottom: 1px solid var(--border);
}
.rc-panel:last-child { border-bottom: none; }
.rc-header {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 10px; font-weight: 700; color: var(--text);
    text-transform: uppercase; letter-spacing: .5px;
    margin-bottom: 8px; flex-shrink: 0;
}
.rc-badge {
    font-size: 10px; padding: 1px 6px; border-radius: 10px;
    background: rgba(34,197,94,.15); color: #22c55e; font-weight: 600;
}
.rc-list { flex: 1; overflow-y: auto; overflow-x: hidden; }
.rc-row { display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.rc-rank { font-size: 11px; width: 18px; flex-shrink: 0; text-align: center; }
.rc-row-info { min-width: 0; flex: 1; }
.rc-name {
    font-size: 12px; font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rc-sub {
    font-size: 10px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rc-hits { font-size: 10px; font-weight: 700; color: #f97316; white-space: nowrap; }
.rc-empty { font-size: 12px; color: var(--text-muted); padding: 6px 0; }
.rc-online-dot {
    position: absolute; bottom: -2px; right: -2px;
    width: 8px; height: 8px; border-radius: 50%;
    background: #22c55e; border: 2px solid var(--bg);
}
@media (max-width: 1280px) { #right-col { display: none; } }

.t-head { display:flex; align-items:center; gap:7px; font-size:12px; font-weight:700; font-family:var(--mono); color:#fff; margin-bottom:3px; }
.t-sep  { height:1px; background:rgba(255,255,255,.07); margin:3px 0; }
.t-row  { display:flex; gap:6px; align-items:baseline; font-size:11px; line-height:1.7; }
.t-key  { font-family:var(--mono); color:var(--text-dim); min-width:120px; flex-shrink:0; }
.t-key::after { content:':'; }
.t-val  { color:#fff; word-break:break-all; flex:1; }
.t-line { font-size:11px; font-family:var(--mono); line-height:1.7; }
.t-ok   { color:#4ade80; }
.t-err  { color:#f87171; }
.t-warn { color:#fbbf24; }
.t-dim  { color:var(--text-dim); }

/* ── Gradient Text ── */
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Hover Glow Effects ── */
.glow-hover { transition: all .3s; }
.glow-hover:hover { box-shadow: var(--glow-md); }

hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── Terminal Tool Output ── */
.t-out {
    background: rgba(0,0,0,.45); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 18px 20px; font-family: var(--mono); font-size: 13px; line-height: 2;
    color: var(--text); max-height: 500px; overflow-y: auto;
}
.t-out .t-head {
    font-weight: 700; font-size: 15px; color: var(--primary);
    text-shadow: 0 0 8px rgba(var(--primary-rgb),.3);
}
.t-out .t-sep { color: rgba(var(--primary-rgb),.25); -webkit-user-select: none; user-select: none; }
.t-out .t-key { color: var(--text-muted); font-weight: 600; }
.t-out .t-val { color: var(--primary); }
.t-out .t-dim { color: var(--text-dim); font-style: italic; }
.t-out .t-ok { color: var(--success); font-weight: 600; }
.t-out .t-err { color: var(--danger); }
.t-out .t-warn { color: #f0ad4e; }
.t-out .t-section { color: var(--text-muted); font-weight: 700; margin-top: 4px; }
.t-out a { color: var(--primary); text-decoration: underline; }
.t-out a:hover { color: #fff; }
.t-row { display: flex; gap: 8px; align-items: baseline; }
.t-row .t-key { min-width: 120px; text-align: right; flex-shrink: 0; }
.t-row .t-key::after { content: ' :'; }
