:root {
    --bg: #0a0e14;
    --bg-soft: #0e1219;
    --surface: #121820;
    --surface-2: #1a2030;
    --surface-3: #222a38;
    --line: #253040;
    --line-soft: #1a2230;
    --text: #f0f4f8;
    --text-dim: #94a3b8;
    --muted: #64748b;
    --accent: #5b8dff;
    --accent-2: #8b5cf6;
    --ok: #22c55e;
    --warn: #f59e0b;
    --err: #ef4444;
    --shadow: 0 20px 48px -20px rgba(0, 0, 0, .85);
    --glass: rgba(255, 255, 255, .04);
    --glass-border: rgba(255, 255, 255, .08);
    --glass-hover: rgba(255, 255, 255, .07);
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

body {
    background-image:
        radial-gradient(1000px 500px at 8% -12%, rgba(91, 141, 255, .12), transparent 55%),
        radial-gradient(800px 400px at 92% -8%, rgba(139, 92, 246, .10), transparent 50%),
        radial-gradient(600px 600px at 50% 110%, rgba(91, 141, 255, .06), transparent 60%);
}

.hidden { display: none !important; }
.spacer { flex: 1; }
.muted { color: var(--muted); font-size: 13px; }
code { font-family: "JetBrains Mono", Consolas, monospace; font-size: 13px; color: var(--accent); }

/* ------------------------------------------------------------- controls */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: .16s ease;
    white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover:not(:disabled) { border-color: #3a4358; background: var(--surface-3); transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary {
    background: linear-gradient(180deg, #759fff, #5c8dff);
    border-color: #5c8dff;
    color: #fff;
    box-shadow: 0 8px 24px -12px rgba(99, 102, 241, .9);
}
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #759fff, #5c8dff); }
.btn.danger { color: #ffd7d7; border-color: #4a2a30; background: #2a1a1e; }
.btn.danger:hover:not(:disabled) { border-color: #7a3a44; background: #351f25; }
.btn.ghost { background: transparent; }
.btn.icon { padding: 8px 10px; }
.btn.sm { padding: 7px 12px; font-size: 13px; gap: 6px; }
.btn.sm svg { width: 13px; height: 13px; }
.btn.red { color: #ffc9c9; border-color: #4a2a30; background: #241519; }
.btn.red:hover:not(:disabled) { color: #fff; border-color: #7a3a44; background: #351f25; }
.btn.block { width: 100%; justify-content: center; }

.mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: .15s;
}
.mini:hover { color: var(--text); border-color: #3e475c; background: var(--surface-3); }
.mini svg { width: 14px; height: 14px; }

input, select, textarea {
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 10px;
    padding: 8px 11px;
    font: inherit;
    outline: none;
    transition: .15s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(91, 141, 255, .16);
}
input::placeholder { color: var(--muted); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--surface-3);
    border: 1px solid var(--line);
    color: var(--text-dim);
    font-size: 11.5px;
    font-weight: 500;
}
.chip.accent { color: #e8eaf0; border-color: rgba(91, 141, 255, .4); background: rgba(91, 141, 255, .14); }

/* segmented filter (Tất cả / Có model) */
.seg {
    display: inline-flex;
    padding: 2px;
    gap: 2px;
    border-radius: 9px;
    background: var(--surface-2);
    border: 1px solid var(--line);
}
.seg button {
    padding: 5px 11px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    transition: .14s;
}
.seg button:hover { color: var(--text-dim); }
.seg button.on {
    background: var(--surface-3);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

/* ---------------------------------------------------------------- login */

.login {
    display: grid;
    place-items: center;
    height: 100%;
    background-image:
        radial-gradient(600px 400px at 50% 30%, rgba(91, 141, 255, .08), transparent 60%),
        radial-gradient(500px 350px at 40% 50%, rgba(139, 92, 246, .06), transparent 55%);
}
.login-card {
    width: 400px;
    padding: 40px 36px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06);
    text-align: center;
}
.login-logo {
    width: 76px;
    height: 76px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
}
.login-logo img {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 14px 26px rgba(0, 0, 0, .65)) drop-shadow(0 0 22px rgba(139, 92, 246, .22));
}
.login-card h1 { margin: 0 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -.4px; }
.login-card p { margin: 0 0 22px; }
.field {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 14px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .03);
    margin-bottom: 14px;
    transition: border-color .2s;
}
.field:focus-within { border-color: rgba(91, 141, 255, .5); }
.field svg { width: 15px; height: 15px; color: var(--muted); }
.field input { flex: 1; border: none; background: transparent; padding: 12px 0; box-shadow: none; }
.error { color: var(--err); min-height: 18px; margin: 10px 0 0; font-size: 12px; }

/* -------------------------------------------------------------- topbar */

#app { display: grid; grid-template-columns: 260px minmax(0, 1fr); height: 100%; }

/* ------------------------------------------------------------- sidebar */

.sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 14px 12px 12px;
    background: rgba(10, 14, 20, .85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--glass-border);
    overflow-y: auto;
}

.side-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 6px 10px;
    cursor: pointer;
    user-select: none;
}
.side-brand .logo { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 6px 14px rgba(99, 102, 241, .35)); }
.side-brand h1 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.2px;
}
.side-brand .bsub { font-size: 11.5px; color: var(--muted); }

/* current server chip — the sidebar only exists once a server is picked */
.side-server {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 2px 0 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: .14s ease;
}
.side-server:hover { border-color: rgba(91, 141, 255, .5); background: var(--surface-3); }
.side-server .ss-icon {
    display: grid;
    place-items: center;
    width: 22px; height: 22px;
    flex: none;
    border-radius: 6px;
    background: rgba(91, 141, 255, .16);
    color: #759fff;
}
.side-server .ss-icon svg { width: 13px; height: 13px; }
.side-server .ss-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}
.side-server .ss-swap { width: 13px; height: 13px; flex: none; color: var(--muted); }

/* no server selected → no sidebar, no toolbar */
#app.no-side { grid-template-columns: minmax(0, 1fr); }
#app.no-side .sidebar { display: none; }
.toolbar.hidden { display: none; }

.side-sec {
    padding: 14px 8px 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--muted);
}
#tabbar { display: flex; flex-direction: column; gap: 2px; }

.tabbtn {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--text-dim);
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: .14s ease;
}
.tabbtn .ico { width: 17px; height: 17px; flex: none; color: var(--muted); transition: .14s; }
.tabbtn:hover { background: var(--surface-2); color: var(--text); }
.tabbtn:hover .ico { color: var(--text-dim); }
.tabbtn.on {
    background: rgba(91, 141, 255, .14);
    border-color: rgba(91, 141, 255, .34);
    color: #eef0f4;
    box-shadow: inset 0 0 0 1px rgba(91, 141, 255, .05);
}
.tabbtn.on .ico { color: #759fff; }
.tabbtn:disabled { opacity: .45; cursor: not-allowed; }

.side-foot {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.side-foot .btn { justify-content: flex-start; }
.side-ver {
    font-size: 11.5px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    padding-left: 2px;
}

.main-col { display: grid; grid-template-rows: auto auto 1fr; min-width: 0; min-height: 0; }

@media (max-width: 860px) {
    #app { grid-template-columns: 68px minmax(0, 1fr); }
    .sidebar { padding: 12px 8px; }
    .side-brand { justify-content: center; padding: 2px 0 8px; }
    .side-brand > div { display: none; }
    .side-sec { display: none; }
    .tabbtn { justify-content: center; padding: 9px 0; }
    .tabbtn span { display: none; }
    .side-foot .btn span { display: none; }
    .side-server { justify-content: center; padding: 7px 0; }
    .side-server .ss-name, .side-server .ss-swap { display: none; }
}

.topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: rgba(10, 14, 20, .75);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 20;
}

/* toolbar: build + rescan, always reachable */
.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(10, 14, 20, .5);
}
.toolbar-stat {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.btn.build {
    color: #eafff0;
    border-color: #2a6b42;
    background: linear-gradient(180deg, #2f8f55, #237041);
    font-weight: 600;
    box-shadow: 0 6px 18px -10px #1f8a4c;
}
.btn.build:hover:not(:disabled) {
    background: linear-gradient(180deg, #37a563, #2a7f4b);
    border-color: #3f9a63;
}
.btn.build svg { fill: currentColor; }
@media (max-width: 860px) {
    .toolbar .btn span { display: none; }
    .toolbar-stat { display: none; }
}

.brand { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.brand-mark {
    width: 28px; height: 28px;
    display: grid; place-items: center;
    border-radius: 9px;
    background: linear-gradient(140deg, var(--accent), var(--accent-2));
    color: #fff;
}
.brand-mark svg { width: 16px; height: 16px; }
.brand-name { font-weight: 700; letter-spacing: -.2px; }

.crumbs { display: flex; align-items: center; gap: 2px; margin-left: 6px; min-width: 0; }
.crumb {
    color: var(--text-dim);
    padding: 4px 8px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid transparent;
    font-size: 14px;
}
.crumb:hover { background: var(--surface-2); color: var(--text); }
.crumb.current { color: var(--text); font-weight: 600; }
.crumb-sep { color: var(--muted); font-size: 12px; }

.search-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    height: 36px;
    width: 260px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}
.search-wrap svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.search-wrap input { flex: 1; border: none; background: transparent; padding: 0; height: 100%; box-shadow: none; }

/* ---------------------------------------------------------------- view */

.view { overflow: auto; padding: 24px 28px 48px; min-height: 0; }

.view-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.view-head h1 { margin: 0; font-size: 22px; letter-spacing: -.3px; }
.view-head p { margin: 0; color: var(--muted); font-size: 14px; }
.view-head .grow { flex: 1; }

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 26px 0 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--muted);
}
.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

/* ------------------------------------------------------------- servers */

.server-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 4px 2px 0;
    max-width: 1240px;
    margin: 0 auto;
}

.server-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 26px;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.server-head-main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.server-head-logo {
    flex: none;
    width: 60px; height: 60px;
    display: grid; place-items: center;
}
.server-head-logo img {
    width: 100%; height: 100%; display: block;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .55));
}
.server-head-text { min-width: 0; }
.server-head-text .eyebrow {
    font-size: 10.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
}
.server-head-text h1 { margin: 3px 0 4px; font-size: 24px; letter-spacing: -.4px; }
.server-head-text p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.55; max-width: 600px; }
.server-head-actions { flex: none; display: flex; gap: 8px; }

.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    align-content: start;
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.kpi {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color .2s, background .2s;
}
.kpi:hover { border-color: rgba(91, 141, 255, .25); background: var(--glass-hover); }
.kpi-ico {
    flex: none;
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: var(--radius-xs);
    background: rgba(91, 141, 255, .10);
    border: 1px solid rgba(91, 141, 255, .18);
    color: var(--accent);
}
.kpi-ico svg { width: 19px; height: 19px; }
.kpi > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.kpi b { font-size: 22px; font-weight: 650; letter-spacing: -.5px; line-height: 1.1; }
.kpi span:last-child { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }

.server-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
    align-items: start;
}

.server-aside { display: flex; flex-direction: column; gap: 14px; }
.aside-card {
    padding: 15px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.aside-card h3 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.aside-card h3 svg { width: 14px; height: 14px; color: var(--accent); }
.aside-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-top: 1px solid var(--line-soft);
    font-size: 13px;
}
.aside-row:first-of-type { border-top: 0; }
.aside-row > span { color: var(--muted); }
.aside-row code {
    padding: 2px 7px;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: 12px;
    color: var(--text-dim);
    max-width: 168px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.aside-val { font-size: 13px; font-weight: 600; }
.aside-val.ok { color: var(--ok); }
.aside-tips {
    margin: 0;
    padding-left: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}
.aside-tips b { color: var(--text-dim); font-weight: 600; }

.server-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 18px 18px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease, background .2s ease;
    overflow: hidden;
}
.server-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    opacity: 0;
    transition: opacity .2s ease;
}
.server-card:hover {
    border-color: rgba(91, 141, 255, .4);
    background: var(--glass-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow), 0 0 20px -8px rgba(91, 141, 255, .15);
}
.server-card:hover::before { opacity: 1; }

.server-card-top { display: flex; align-items: center; gap: 13px; }
.server-avatar {
    flex: none;
    width: 50px; height: 50px;
    display: grid; place-items: center;
    border-radius: var(--radius-sm);
    font-size: 21px;
    font-weight: 700;
    color: #eaf0ff;
    background: linear-gradient(150deg, rgba(91, 141, 255, .30), rgba(139, 92, 246, .25));
    border: 1px solid rgba(91, 141, 255, .25);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.server-ident { min-width: 0; flex: 1; }
.server-name {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.server-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.server-meta .chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    font-size: 11.5px;
    color: var(--text-dim);
}
.server-meta .chip svg { width: 12px; height: 12px; }
.server-meta .chip .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, .16);
}
.server-meta .chip.live { border-color: rgba(52, 211, 153, .35); color: #a7f3d0; }
.server-arrow {
    flex: none;
    width: 30px; height: 30px;
    display: grid; place-items: center;
    border-radius: var(--radius-xs);
    border: 1px solid var(--glass-border);
    background: var(--glass);
    color: var(--text-dim);
    transition: .2s ease;
}
.server-arrow svg { width: 15px; height: 15px; }
.server-card:hover .server-arrow { color: var(--text); border-color: rgba(91, 141, 255, .4); background: rgba(91, 141, 255, .12); }

.server-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    border-radius: var(--radius-sm);
    background: var(--glass-border);
    border: 1px solid var(--glass-border);
    overflow: hidden;
}
.server-stats > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    background: var(--bg);
}
.server-stats b { font-size: 18px; font-weight: 650; letter-spacing: -.3px; }
.server-stats span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }

.server-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 11px;
    border-top: 1px solid var(--line-soft);
    font-size: 12.5px;
    color: var(--muted);
}
.server-path {
    padding: 3px 8px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.server-scan { white-space: nowrap; }

/* --------------------------------------------------------------- items */

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.item-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 14px 10px 12px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: .2s ease;
    text-align: center;
}
.item-card:hover {
    border-color: rgba(91, 141, 255, .4);
    background: var(--glass-hover);
    transform: translateY(-2px);
}
.item-card.off { opacity: .45; }
.item-card.off:hover { opacity: .85; }

.item-icon {
    width: 56px; height: 56px;
    display: grid;
    place-items: center;
    image-rendering: pixelated;
}
.item-icon img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.item-name {
    font-size: 13px;
    line-height: 1.25;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: var(--text-dim);
}
.item-card:hover .item-name { color: var(--text); }
.item-count {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
    background: rgba(91, 141, 255, .18);
    border: 1px solid rgba(91, 141, 255, .45);
    color: #e8eaf0;
}
.item-card.off .item-count { background: var(--surface-3); border-color: var(--line); color: var(--muted); }

/* -------------------------------------------------------------- models */

.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.card {
    position: relative;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: .2s ease;
}
.card:hover { transform: translateY(-2px); border-color: rgba(91, 141, 255, .35); box-shadow: var(--shadow); }

.card-thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    background:
        linear-gradient(180deg, #161a22, #0f1117),
        repeating-conic-gradient(#1a1e26 0 25%, #14171d 0 50%) 0 0 / 18px 18px;
}
.grid-sentinel {
    grid-column: 1 / -1;
    height: 1px;
}
.card-thumb canvas.card-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.card-thumb canvas.card-canvas.off { display: none; }
.card-states {
    display: grid;
    place-items: center;
    font-size: 10.5px;
    font-weight: 700;
    color: #e8eaf0;
    background: rgba(91, 141, 255, .18);
    border-color: rgba(91, 141, 255, .45);
}
.card-thumb-error {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 22px;
    color: #a1546a;
}
.card-thumb .loader {
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 2px solid var(--surface-3);
    border-top-color: var(--accent);
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.card-body { padding: 9px 11px 11px; border-top: 1px solid var(--line-soft); }
.card-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.card-id {
    flex: none;
    padding: 1px 6px;
    border-radius: 999px;
    border: 1px solid rgba(91, 141, 255, .45);
    background: rgba(91, 141, 255, .16);
    color: #d9e6ff;
    font-size: 10px;
    font-weight: 600;
    font-family: "JetBrains Mono", monospace;
    cursor: copy;
}
.card-id:hover { border-color: rgba(91, 141, 255, .75); color: #fff; }

.card-check {
    position: absolute;
    top: 7px; left: 7px;
    width: 22px; height: 22px;
    display: grid; place-items: center;
    padding: 0;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(12, 8, 18, .7);
    color: transparent;
    cursor: pointer;
    opacity: 0;
    transition: .14s ease;
    backdrop-filter: blur(6px);
}
.card:hover .card-check { opacity: 1; }
.card-check svg { width: 12px; height: 12px; }
.card.selected .card-check {
    opacity: 1;
    color: #0a1018;
    background: var(--accent);
    border-color: var(--accent);
}
.card.selected { border-color: rgba(91, 141, 255, .7); box-shadow: 0 0 0 1px rgba(91, 141, 255, .5); }

.select-bar {
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-2) 94%, transparent);
    box-shadow: 0 22px 50px -24px #000;
    backdrop-filter: blur(12px);
}
.select-bar b { font-size: 12px; margin-right: 4px; white-space: nowrap; }

.card-actions {
    position: absolute;
    top: 7px; right: 7px;
    display: flex; gap: 4px;
    opacity: 0;
    transform: translateY(-4px);
    transition: .15s;
}
.card:hover .card-actions { opacity: 1; transform: none; }
.card-actions button {
    width: 26px; height: 26px;
    display: grid; place-items: center;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: rgba(12, 8, 18, .82);
    color: var(--text-dim);
    cursor: pointer;
    backdrop-filter: blur(6px);
}
.card-actions button:hover { color: #fff; border-color: #4a5265; }
.card-actions button.del:hover { color: #ffb4b4; border-color: #6b3038; background: #341c21; }
.card-actions svg { width: 13px; height: 13px; }

.card-item {
    position: absolute;
    left: 7px;
    bottom: 7px;
    width: 26px;
    height: 26px;
    padding: 3px;
    image-rendering: pixelated;
    object-fit: contain;
    border-radius: 7px;
    background: rgba(12, 8, 18, .82);
    border: 1px solid var(--line);
    backdrop-filter: blur(6px);
}

/* --------------------------------------------------------------- empty */

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 64px 20px;
    color: var(--text-dim);
    text-align: center;
}
.empty-icon {
    width: 62px; height: 62px;
    display: grid; place-items: center;
    border-radius: 18px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    margin-bottom: 6px;
}
.empty-icon svg { width: 26px; height: 26px; color: var(--muted); }
.empty h2 { margin: 0; font-size: 17px; color: var(--text); }
.empty p { margin: 0 0 8px; font-size: 14px; }

/* --------------------------------------------------------------- fonts */

.font-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.font-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: .2s;
}
.font-card:hover { border-color: rgba(91, 141, 255, .4); transform: translateY(-2px); }
.font-card b { font-size: 14.5px; }
.font-preview {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 34px;
    align-items: center;
    padding: 8px;
    background: #0c0e13;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
}
.font-preview img { width: 24px; height: 24px; image-rendering: pixelated; object-fit: contain; }

.font-body { flex: 1; display: grid; grid-template-columns: 300px 1fr; min-height: 0; }

.font-glyphs { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.font-caption {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--line-soft);
}
.font-caption code { text-transform: none; letter-spacing: 0; }

.font-grid {
    overflow: auto;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
    gap: 7px;
    align-content: start;
}

.font-editor { display: flex; flex-direction: column; min-height: 0; }
.font-rows { flex: 1; overflow: auto; padding: 10px 12px 16px; }
.font-rows.drop { background: rgba(91, 141, 255, .06); box-shadow: inset 0 0 0 2px rgba(91, 141, 255, .35); }

.font-hint {
    margin: 0;
    padding: 0 12px 12px;
    font-size: 10.5px;
    line-height: 1.5;
    color: var(--muted);
}
.font-empty {
    grid-column: 1 / -1;
    padding: 14px 4px;
    font-size: 11.5px;
    color: var(--muted);
}

.font-row {
    display: grid;
    grid-template-columns: 40px 1fr 28px;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 7px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.font-row-thumb {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 8px;
    background: #0b0d11;
    border: 1px solid var(--line-soft);
    font-size: 15px;
    color: var(--text-dim);
}
.font-row-thumb img { width: 32px; height: 32px; image-rendering: pixelated; object-fit: contain; }
.font-row-fields { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.font-row-key {
    font: 11.5px/1.2 "JetBrains Mono", Consolas, monospace;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.font-row-inputs { display: flex; gap: 6px; flex-wrap: wrap; }
.font-row-inputs input[type="text"],
.font-row-inputs input[type="number"] {
    width: 78px;
    padding: 4px 8px;
    font-size: 11.5px;
    font-family: "JetBrains Mono", monospace;
    border-radius: 7px;
}
.font-row-inputs input[type="text"] { width: 96px; }
.font-row-inputs select { padding: 4px 6px; font-size: 11.5px; border-radius: 7px; max-width: 150px; }
.font-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-dim);
    padding: 0 6px 0 2px;
}
.font-check input { width: 14px; height: 14px; accent-color: var(--accent); }

.font-raw {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid var(--line);
    background: #07080b;
}
.font-raw textarea {
    height: 200px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #080a0d;
    color: #759fff;
    padding: 10px 12px;
    resize: vertical;
    font: 12px/1.6 "JetBrains Mono", Consolas, monospace;
}
.font-raw .btn { align-self: flex-start; }
.font-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    transition: .14s ease;
}
.font-cell:hover { border-color: rgba(91, 141, 255, .5); background: var(--surface-2); }
.font-cell.dragging { opacity: .45; border-style: dashed; }
.font-cell img { width: 32px; height: 32px; image-rendering: pixelated; object-fit: contain; }
.font-cell span { font-size: 9.5px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-del {
    position: absolute;
    top: 2px; right: 2px;
    width: 18px; height: 18px;
    display: grid; place-items: center;
    padding: 0;
    border-radius: 6px;
    border: 1px solid #4a2a30;
    background: #241519;
    color: #ff9b9b;
    cursor: pointer;
    opacity: 0;
    transition: .14s ease;
}
.font-del svg { width: 10px; height: 10px; }
.font-cell:hover .font-del { opacity: 1; }
.font-del:hover { background: #3a1d24; color: #fff; }
.font-row.drop {
    border-color: rgba(91, 141, 255, .7);
    background: rgba(91, 141, 255, .1);
}
.font-row.drop .font-row-thumb { border-color: rgba(91, 141, 255, .6); }
#font-text {
    border: none;
    border-radius: 0;
    resize: none;
    background: #080a0d;
    padding: 14px 16px;
    font: 12px/1.6 "JetBrains Mono", Consolas, monospace;
    color: #759fff;
    box-shadow: none;
}

/* --------------------------------------------------------------- drop */

.drop-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    background: rgba(9, 6, 14, .8);
    backdrop-filter: blur(3px);
}
.drop-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 38px 54px;
    border: 2px dashed rgba(91, 141, 255, .65);
    border-radius: 20px;
    background: rgba(21, 15, 31, .92);
}
.drop-card svg { width: 34px; height: 34px; color: var(--accent); margin-bottom: 4px; }
.drop-card span { color: var(--muted); font-size: 12px; }

/* -------------------------------------------------------------- logbar */

.logbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    max-height: 42vh;
    display: flex;
    flex-direction: column;
    background: #090a0d;
    border-top: 1px solid var(--line);
    box-shadow: 0 -18px 40px -24px #000;
    z-index: 50;
}
.logbar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 12px;
    color: var(--text-dim);
}
.logbar-head span { display: flex; align-items: center; gap: 7px; }
.logbar-head svg { width: 14px; height: 14px; }
#log {
    margin: 0;
    padding: 10px 14px;
    overflow: auto;
    font: 11.5px/1.5 "JetBrains Mono", Consolas, monospace;
    color: #759fff;
    white-space: pre-wrap;
}

/* -------------------------------------------------------------- detail */

.overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    background: rgba(6, 8, 14, .78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 20px;
}
.detail-panel {
    width: min(1540px, 100%);
    height: min(960px, 100%);
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.detail-panel.narrow { width: min(1240px, 100%); height: min(860px, 100%); }

.detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}
.detail-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.detail-title > div { display: flex; flex-direction: column; min-width: 0; }
.detail-title b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-title svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.item-chip {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 9px;
    background: #0c0e13;
    border: 1px solid var(--line);
    flex: none;
}
.item-chip img { width: 24px; height: 24px; image-rendering: pixelated; }
.detail-actions { display: flex; gap: 7px; flex: none; }

/* state bar: bow / crossbow / trident … merged animation sets */
.state-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, .015);
}
.state-bar.hidden { display: none; }
.state-play {
    width: 26px; height: 26px;
    display: grid; place-items: center;
    border-radius: 7px;
    border: 1px solid rgba(91, 141, 255, .45);
    background: rgba(91, 141, 255, .16);
    color: #e8eaf0;
    font-size: 11px;
    cursor: pointer;
}
.state-play:hover { background: rgba(91, 141, 255, .3); color: #fff; }
.state-chip {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text-dim);
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: 11px;
    cursor: pointer;
    transition: .14s;
}
.state-chip:hover { border-color: #404a60; color: var(--text); }
.state-chip.on {
    border-color: rgba(91, 141, 255, .55);
    background: rgba(91, 141, 255, .18);
    color: #eef0f4;
}
.state-hint { margin-left: auto; font-size: 11px; color: var(--muted); }

.detail-body { flex: 1; display: flex; min-height: 0; }
.detail-stage { position: relative; flex: 1; min-height: 0; background: radial-gradient(circle at 50% 40%, #151820, #080a0d 70%); }
.detail-stage canvas { display: block; }
.stage-hints {
    position: absolute;
    left: 12px; bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: var(--muted);
    pointer-events: none;
}

/* animation dock (only for models that have bone animations) */
.dock {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 14px 10px;
    border-top: 1px solid var(--line);
    background: var(--bg-soft);
}
.dock.hidden { display: none; }
.dock-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dock-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dock-select {
    padding: 4px 8px;
    min-width: 150px;
    max-width: 260px;
    font-size: 12px;
    border-radius: 7px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text);
}
.dock-select:focus { outline: none; border-color: var(--accent); }
.dock-play {
    width: 34px; height: 28px;
    border-radius: 7px;
    border: 1px solid rgba(91, 141, 255, .45);
    background: rgba(91, 141, 255, .16);
    color: #e8eaf0;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}
.dock-play:hover { background: rgba(91, 141, 255, .28); color: #fff; }
.dock-inline { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.dock-num {
    width: 48px;
    padding: 3px 4px;
    text-align: center;
    font-size: 11px;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text);
}
.dock-loop { cursor: pointer; user-select: none; }
.dock-loop input { accent-color: var(--accent); cursor: pointer; }
.dock-right { font-size: 11px; color: var(--muted); white-space: nowrap; }
.dock-tick .cur { color: #759fff; font-weight: 600; }
.dock-track { position: relative; height: 14px; display: flex; align-items: center; }
.dock-track::before {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 50%;
    height: 4px;
    transform: translateY(-50%);
    border-radius: 2px;
    background: var(--surface-3);
    pointer-events: none;
}
.dock-fill {
    position: absolute;
    left: 0; top: 50%;
    height: 4px;
    transform: translateY(-50%);
    border-radius: 2px;
    background: var(--accent);
    pointer-events: none;
}
.dock-range {
    position: relative;
    width: 100%;
    height: 14px;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
.dock-range::-webkit-slider-runnable-track { background: transparent; height: 14px; }
.dock-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #e0e0e0;
    border: 2px solid var(--accent);
}
.dock-range::-moz-range-track { background: transparent; height: 14px; }
.dock-range::-moz-range-thumb {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #e0e0e0;
    border: 2px solid var(--accent);
}

/* ------------------------------------------------------ image preview */

.imgview {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 32px;
    background: rgba(8, 5, 13, .84);
    backdrop-filter: blur(6px);
    cursor: zoom-out;
}
.imgview-card { margin: 0; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.imgview-card img {
    max-width: min(720px, 82vw);
    max-height: min(620px, 74vh);
    object-fit: contain;
    image-rendering: pixelated;
    padding: 22px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background:
        repeating-conic-gradient(#171b23 0 25%, #0f1117 0 50%) 0 0 / 22px 22px;
    box-shadow: 0 40px 90px -40px #000;
}
.imgview-card figcaption {
    font-size: 12px;
    color: var(--text-dim);
    font-family: "JetBrains Mono", monospace;
}
.font-cell, .font-row-thumb { cursor: zoom-in; }
.font-cell[draggable="true"] { cursor: grab; }

/* ---------------------------------------------------------------- sounds */

.sound-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.sound-pick { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.sound-pick select {
    padding: 5px 8px;
    font-size: 11.5px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
}
.sound-ffmpeg { font-size: 11px; color: var(--muted); }
.sound-ffmpeg.ok { color: #34d399; }
.sound-ffmpeg.warn { color: #fbbf24; }

.sound-list { display: flex; flex-direction: column; gap: 6px; padding-bottom: 26px; }
.sound-folder {
    margin: 12px 0 2px;
    font: 10.5px "JetBrains Mono", Consolas, monospace;
    letter-spacing: .04em;
    color: var(--muted);
}
.sound-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xs);
    background: var(--glass);
    transition: .2s ease;
}
.sound-row:hover { border-color: rgba(91, 141, 255, .3); background: var(--glass-hover); }
.sound-row.playing { border-color: rgba(91, 141, 255, .55); background: rgba(91, 141, 255, .08); }
.sound-play {
    width: 30px; height: 30px;
    flex: none;
    display: grid; place-items: center;
    border-radius: 8px;
    border: 1px solid rgba(91, 141, 255, .45);
    background: rgba(91, 141, 255, .16);
    color: #d9e6ff;
    font-size: 11px;
    cursor: pointer;
}
.sound-play:hover { background: rgba(91, 141, 255, .3); color: #fff; }
.sound-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sound-info b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sound-meta { font-size: 10.5px; color: var(--muted); font-family: "JetBrains Mono", Consolas, monospace; }
.sound-actions { display: flex; gap: 4px; flex: none; }

.view.dropping { outline: 2px dashed rgba(91, 141, 255, .45); outline-offset: -10px; }

/* -------------------------------------------------------------- scroll */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #232834; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #2f3647; background-clip: padding-box; }

/* --------------------------------------------------------------- toast */

.toastify { border-radius: 10px; font-family: Inter, sans-serif; font-size: 12.5px; box-shadow: var(--shadow); padding: 10px 16px; }
.toastify.toast-ok { background: linear-gradient(180deg, #1d9f74, #158a63); }
.toastify.toast-err { background: linear-gradient(180deg, #d94a4a, #b93a3a); }
.toastify.toast-info { background: linear-gradient(180deg, #404a61, #303747); }

.swal2-popup {
    font-family: Inter, sans-serif;
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--line);
    border-radius: 16px !important;
}
.swal2-title, .swal2-html-container { color: var(--text) !important; }
.swal2-input {
    background: var(--surface-2) !important;
    border: 1px solid var(--line) !important;
    color: var(--text) !important;
    border-radius: 10px !important;
    font-family: Inter, sans-serif !important;
}

@media (max-width: 900px) {
    .font-body { grid-template-columns: 1fr; }
    .search-wrap { width: 140px; }
}

@media (max-width: 1180px) {
    .server-layout { grid-template-columns: 1fr; }
    .server-aside { flex-direction: row; flex-wrap: wrap; }
    .server-aside .aside-card { flex: 1 1 300px; }
}

@media (max-width: 720px) {
    .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}