/* =====================================================================
   JT ADMIN web panel — same "Midnight Grid" design as the in-game menu
   (black panels, blue accent, dot grid, stripes, HUD corners)
   No letter-spacing on Arabic text (breaks letter joining): tracking only on .en
   ===================================================================== */
:root {
    --bg: #050505;
    --panel: rgba(9, 9, 9, .94);
    --card: rgba(13, 13, 13, .82);
    --card-2: #131313;
    --card-3: #1a1a1a;
    --line: #1a1a1a;
    --line-2: #242424;
    --line-3: #333;
    --text: #ebebeb;
    --soft: #c9c9c9;
    --mute: #888;
    --mute-2: #666;
    --mute-3: #444;
    --mute-4: #2c2c2c;
    --accent: #507ccc;
    --accent-2: #3f66b0;
    --accent-3: #8fb0ea;
    --on-accent: #fff;
    --accent-dim: rgba(80, 124, 204, .14);
    --accent-line: rgba(80, 124, 204, .5);
    --accent-glow: rgba(80, 124, 204, .35);
    --ok: #5be49b;
    --ok-dim: rgba(91, 228, 155, .12);
    --warn: #ffc24b;
    --warn-dim: rgba(255, 194, 75, .12);
    --bad: #ff5a5f;
    --bad-dim: rgba(255, 90, 95, .12);
    --r-xl: .55rem;
    --r-lg: .4rem;
    --r-md: .32rem;
    --r-pill: .3rem;
    --dots: radial-gradient(rgba(255, 255, 255, .075) .09rem, transparent .1rem);
    --dots-size: 1rem 1rem;
    --stripes: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .022) 0 2px, transparent 2px 9px);
    --f-ar: "Segoe UI", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
    --f-disp: "Bahnschrift", "Segoe UI", Arial, sans-serif;
    --f-mono: "Cascadia Mono", Consolas, "Courier New", monospace;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --shadow: 0 1.6rem 4rem rgba(0, 0, 0, .65);
    --side-w: 16.5rem;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
@media (max-width: 1400px) { html { font-size: 14px; } }
html, body { margin: 0; min-height: 100%; }
body {
    background: radial-gradient(ellipse at 70% -10%, #0d1626 0%, #050505 55%) fixed, var(--bg);
    color: var(--text);
    font-family: var(--f-ar);
    -webkit-font-smoothing: antialiased;
}
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: var(--dots);
    background-size: 1.15rem 1.15rem;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 100%);
    mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 100%);
    pointer-events: none;
    animation: gridDrift 24s linear infinite;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; padding: 0; cursor: pointer; }
a { color: var(--accent-3); text-decoration: none; }
.hidden { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.en { font-family: var(--f-disp); letter-spacing: .02em; }
.mono { font-family: var(--f-mono); direction: ltr; unicode-bidi: isolate; }
.grow { flex: 1; min-width: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ico { width: 1.1rem; height: 1.1rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
::-webkit-scrollbar { width: .45rem; height: .45rem; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #232323; border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---------------------------------------------------------------- fx (shared with the menu) */
.fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; border-radius: inherit; }
.fx-grid {
    position: absolute;
    inset: -3rem;
    background-image: radial-gradient(rgba(255, 255, 255, .085) .08rem, transparent .095rem);
    background-size: 1.15rem 1.15rem;
    animation: gridDrift 18s linear infinite;
    -webkit-mask-image: radial-gradient(ellipse 85% 70% at 50% 40%, #000 30%, transparent 100%);
    mask-image: radial-gradient(ellipse 85% 70% at 50% 40%, #000 30%, transparent 100%);
}
.fx-glow { position: absolute; inset: 0; background: radial-gradient(30rem circle at 50% -10%, rgba(80, 124, 204, .14), transparent 60%); }
.fx-c { position: absolute; width: .9rem; height: .9rem; border: 2px solid var(--accent); opacity: .75; }
.fx-c.tl { top: .45rem; left: .45rem; border-right: none; border-bottom: none; }
.fx-c.tr { top: .45rem; right: .45rem; border-left: none; border-bottom: none; }
.fx-c.bl { bottom: .45rem; left: .45rem; border-right: none; border-top: none; }
.fx-c.br { bottom: .45rem; right: .45rem; border-left: none; border-top: none; }

/* ---------------------------------------------------------------- atoms */
.kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .4rem; border-radius: .25rem; border: 1px solid var(--line-3); border-bottom-width: 2px; background: #101010; color: #bdbdbd; font-family: var(--f-disp); font-size: .64rem; font-weight: 700; }
.kicker { display: flex; align-items: center; gap: .6rem; color: var(--mute); font-size: .64rem; font-weight: 700; }
.kicker .en { letter-spacing: .3em; text-transform: uppercase; direction: ltr; unicode-bidi: isolate; color: var(--accent-3); }
.dot { width: .45rem; height: .45rem; border-radius: 50%; background: var(--accent); flex: none; animation: ping 1.8s ease-out infinite; }
.live { width: .4rem; height: .4rem; border-radius: 50%; background: var(--ok); box-shadow: 0 0 .5rem var(--ok); animation: pulse 1.6s ease-in-out infinite; }
.tag { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: var(--r-pill); background: #151515; border: 1px solid var(--line-2); color: var(--mute); font-size: .7rem; font-weight: 700; white-space: nowrap; flex: none; }
.tag.ban { background: var(--bad-dim); border-color: rgba(255, 90, 95, .3); color: #ff9a9d; }
.tag.warn { background: var(--warn-dim); border-color: rgba(255, 194, 75, .3); color: #ffd98a; }
.tag.kick { background: rgba(124, 58, 237, .14); border-color: rgba(124, 58, 237, .35); color: #c4b5fd; }
.tag.ok { background: var(--ok-dim); border-color: rgba(91, 228, 155, .3); color: #9ff0c4; }
.tag.accent { background: var(--accent-dim); border-color: var(--accent-line); color: var(--accent-3); }
.sec-head { display: flex; align-items: center; gap: .65rem; margin: 1.6rem .1rem .8rem; color: var(--mute-3); font-size: .62rem; font-weight: 700; }
.sec-head:first-child { margin-top: .2rem; }
.sec-head .en { letter-spacing: .32em; text-transform: uppercase; }
.sec-head .ar { font-size: .82rem; color: var(--mute); font-weight: 600; }
.sec-head::after { content: ''; flex: 1; height: 1px; background: linear-gradient(to left, var(--line-2), transparent); order: 5; }
.sec-head .dot { border-radius: 1px; transform: rotate(45deg); animation: none; }
.sec-head > .btn { order: 6; }
.note { color: var(--mute); font-size: .82rem; line-height: 1.7; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 2.5rem; padding: 0 1.1rem; border-radius: var(--r-pill); border: 1px solid var(--line-3); background: #111; color: #ddd; font-weight: 700; font-size: .84rem; white-space: nowrap; transition: background .2s, color .2s, border-color .2s, box-shadow .2s, transform .2s var(--ease); }
.btn .ico { width: 1rem; height: 1rem; }
.btn.sm { height: 2rem; padding: 0 .8rem; font-size: .76rem; }
.btn.big { height: 3.1rem; padding: 0 1.8rem; font-size: 1rem; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 .4rem 1.2rem rgba(80, 124, 204, .25); }
.btn.danger { background: var(--bad-dim); border-color: rgba(255, 90, 95, .4); color: #ff9a9d; }
.btn.warn { background: var(--warn-dim); border-color: rgba(255, 194, 75, .4); color: #ffd98a; }
.btn.ghost { background: transparent; }
.btn:hover:not(:disabled) { border-color: var(--accent-line); transform: translateY(-1px); }
.btn.primary:hover:not(:disabled) { box-shadow: 0 .6rem 1.6rem var(--accent-glow); }
.btn.danger:hover:not(:disabled) { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: var(--r-pill); border: 1px solid var(--line-2); color: var(--mute); background: rgba(0, 0, 0, .25); transition: color .2s, border-color .2s, background .2s; }
.icon-btn:hover { color: #fff; border-color: var(--accent); background: var(--accent-dim); }

/* ---------------------------------------------------------------- inputs */
.input, select.input { width: 100%; min-width: 0; padding: .7rem .9rem; border-radius: var(--r-md); border: 1px solid var(--line-2); background: #0b0b0b; color: #fff; font-size: .9rem; transition: border-color .2s, box-shadow .2s; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 .22rem rgba(80, 124, 204, .14); }
.input::placeholder { color: var(--mute-3); }
textarea.input { resize: vertical; min-height: 6rem; line-height: 1.6; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%); background-position: left 1rem center, left .7rem center; background-size: .3rem .3rem; background-repeat: no-repeat; padding-left: 2rem; }
select.input option { background: #111; }
.search { flex: 1 1 16rem; min-width: 12rem; display: flex; align-items: center; gap: .6rem; height: 2.5rem; padding: 0 .9rem; border-radius: var(--r-pill); background: #0b0b0b; border: 1px solid var(--line-2); color: var(--mute-2); transition: border-color .2s, box-shadow .2s; }
.search:focus-within { border-color: var(--accent); color: var(--accent-3); box-shadow: 0 0 0 .22rem rgba(80, 124, 204, .14); }
.search input { flex: 1; min-width: 0; height: 100%; background: none; border: none; outline: none; color: #fff; font-size: .88rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.toolbar.flush { margin: 0; }
.toolbar.flush-top { margin: .8rem 0 0; }
.toolbar select.input { width: auto; }
.click-copy { cursor: pointer; }
.seg { display: inline-flex; padding: .2rem; gap: .2rem; border-radius: var(--r-pill); background: rgba(0, 0, 0, .3); border: 1px solid var(--line-2); }
.seg button { height: 2rem; padding: 0 .9rem; border-radius: .25rem; color: var(--mute); font-weight: 700; font-size: .8rem; border: 1px solid transparent; }
.seg button:hover { color: #fff; }
.seg button.on { background: var(--accent-dim); border-color: var(--accent); color: var(--accent-3); }

/* ---------------------------------------------------------------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card { position: relative; width: min(26rem, 100%); padding: 2.6rem 2rem 2.2rem; text-align: center; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--shadow); animation: pop .6s var(--ease) both; }
.login-card::before { content: ''; position: absolute; top: 0; left: 12%; right: 12%; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.login-card > * { position: relative; z-index: 1; }
.login-card .brand-name { font-size: 1.6rem; text-align: center; direction: ltr; margin-top: 1.2rem; }
.login-card .brand-sub { justify-content: center; }
.login-text { color: var(--mute); font-size: .88rem; line-height: 1.8; margin: 1.4rem 0 1.6rem; }
.login-card .btn { width: 100%; }
.login-error { margin-top: 1.2rem; padding: .8rem 1rem; border-radius: var(--r-lg); background: var(--bad-dim); border: 1px solid rgba(255, 90, 95, .35); color: #ffc9cb; font-size: .84rem; line-height: 1.7; }

/* ---------------------------------------------------------------- shell */
.shell { display: flex; min-height: 100vh; }
.side {
    position: sticky;
    top: 0;
    width: var(--side-w);
    height: 100vh;
    flex: none;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border-inline-end: 1px solid var(--line-2);
    z-index: 20;
}
.side::before { content: ''; position: absolute; top: 0; bottom: 0; inset-inline-end: -1px; width: 1px; background: linear-gradient(to bottom, transparent, var(--accent-line), transparent); }
.side > * { position: relative; z-index: 1; }
.side > .fx { position: absolute; }
.side-top { display: flex; align-items: center; gap: .75rem; padding: 1.2rem 1.1rem 1rem; background: var(--stripes); border-bottom: 1px solid var(--line); }
.mark { position: relative; width: 2.6rem; height: 2.6rem; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px var(--accent-line), 0 .5rem 1.6rem var(--accent-glow); }
.mark.big { width: 4.6rem; height: 4.6rem; margin: 0 auto; }
.mark img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.mark::after { content: ''; position: absolute; inset: -.25rem; border-radius: 50%; border: 1px solid rgba(80, 124, 204, .3); animation: ring 3s ease-out infinite; }
.brand { flex: 1; min-width: 0; }
.brand-name { font-family: var(--f-disp); font-weight: 800; font-size: 1.15rem; letter-spacing: .14em; text-transform: uppercase; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; text-align: right; text-shadow: 0 0 1.2rem rgba(80, 124, 204, .3); }
.brand-sub { display: flex; align-items: center; gap: .45rem; color: var(--mute); font-size: .55rem; font-weight: 700; margin-top: .25rem; }
.brand-sub .en { letter-spacing: .34em; }
.side-close { display: none; }
.nav { flex: 1; overflow-y: auto; padding: .9rem .7rem; display: flex; flex-direction: column; gap: .2rem; }
.nav-item { position: relative; display: flex; align-items: center; gap: .75rem; padding: .65rem .8rem; border-radius: var(--r-md); color: var(--mute); font-weight: 700; font-size: .9rem; border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s; }
.nav-item .ico { width: 1.1rem; height: 1.1rem; }
.nav-item:hover { color: #fff; background: rgba(80, 124, 204, .06); }
.nav-item.on { color: var(--accent-3); background: var(--accent-dim); border-color: var(--accent-line); box-shadow: inset 0 0 .8rem rgba(80, 124, 204, .12); }
.nav-item.on::before { content: ''; position: absolute; inset-inline-start: -.7rem; top: 22%; bottom: 22%; width: 3px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 .7rem var(--accent); }
.nav-sep { margin: .9rem .8rem .3rem; color: var(--mute-3); font-size: .58rem; font-weight: 800; letter-spacing: .3em; font-family: var(--f-disp); }
.side-user { display: flex; align-items: center; gap: .7rem; padding: .9rem 1rem; border-top: 1px solid var(--line); background: var(--stripes), rgba(0, 0, 0, .25); }
.avatar { width: 2.3rem; height: 2.3rem; border-radius: 50%; background: #151515; border: 1px solid var(--line-3); object-fit: cover; flex: none; }
.me-name { font-weight: 800; font-size: .88rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-role { font-size: .7rem; color: var(--mute); margin-top: .1rem; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem; padding: 1rem 1.6rem; background: rgba(5, 5, 5, .82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; }
.hero { position: relative; flex: 1; min-width: 0; padding: .55rem 1rem .6rem; border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--stripes), rgba(0, 0, 0, .22); overflow: hidden; }
.hero::after { content: ''; position: absolute; inset-inline-start: 0; top: 18%; bottom: 18%; width: 3px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 .8rem var(--accent); }
.hero-title { margin: .25rem 0 0; font-size: 1.55rem; line-height: 1.15; font-weight: 800; color: #fff; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 .75rem; }
.hero-dim { font-size: .5em; font-weight: 700; color: var(--mute); }
.hero.swap .hero-title, .hero.swap .kicker { animation: rise .5s var(--ease) both; }
.top-end { display: flex; align-items: center; gap: .6rem; }
.clock { color: var(--mute); font-size: .8rem; font-weight: 600; letter-spacing: .1em; padding: .3rem .55rem; border: 1px solid var(--line-2); border-radius: .25rem; background: rgba(0, 0, 0, .2); }
.page { flex: 1; padding: 1.4rem 1.6rem 3rem; }
.page.anim > * { animation: rise .45s var(--ease) both; }

/* ---------------------------------------------------------------- panels / rows */
.panel { position: relative; padding: 1.1rem 1.2rem; border-radius: var(--r-xl); background: var(--dots), var(--card); background-size: var(--dots-size), auto; border: 1px solid var(--line-2); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.stat { position: relative; padding: .9rem 1rem; border-radius: var(--r-lg); background: var(--dots), var(--card); background-size: var(--dots-size), auto; border: 1px solid var(--line); min-width: 0; overflow: hidden; }
.stat::before { content: ''; position: absolute; top: 0; inset-inline-start: 0; width: 1.6rem; height: 2px; background: var(--accent); }
.stat-k { display: flex; align-items: center; gap: .4rem; color: var(--mute); font-size: .76rem; font-weight: 600; }
.stat-k .ico { width: .9rem; height: .9rem; }
.stat-v { font-family: var(--f-disp); font-size: 1.8rem; font-weight: 800; color: #fff; letter-spacing: -.02em; line-height: 1.1; margin-top: .45rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; text-align: right; }
.stat.accent .stat-v { color: var(--accent-3); }
.stat.bad .stat-v { color: var(--bad); }
.stat.warn .stat-v { color: var(--warn); }
.stat.ok .stat-v { color: var(--ok); }

.rows { display: flex; flex-direction: column; gap: .5rem; }
.orow { position: relative; display: flex; flex-direction: column; gap: .4rem; padding: .85rem 1rem; border-radius: var(--r-lg); background: var(--dots), var(--card); background-size: var(--dots-size), auto; border: 1px solid var(--line); transition: border-color .2s, background .2s; }
.orow:hover { border-color: var(--line-3); }
.orow::before { content: ''; position: absolute; inset-inline-start: -1px; top: 50%; width: 3px; height: 0; border-radius: 3px; background: var(--accent); transform: translateY(-50%); transition: height .3s var(--ease); }
.orow:hover::before { height: 50%; }
.orow.slim { flex-direction: row; align-items: center; flex-wrap: wrap; }
.orow.click { cursor: pointer; }
.orow-head { display: flex; align-items: center; gap: .7rem; min-width: 0; flex: 1; }
.orow-num { font-family: var(--f-disp); font-size: 1.3rem; font-weight: 800; color: var(--mute-3); line-height: 1; direction: ltr; min-width: 2rem; text-align: center; }
.orow-title { min-width: 0; font-weight: 700; font-size: .95rem; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orow:hover .orow-title { color: #fff; }
.orow-id { font-family: var(--f-disp); font-size: .72rem; color: var(--mute-2); letter-spacing: .1em; direction: ltr; }
.orow-body { color: #c4c4c4; font-size: .86rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.orow-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; color: var(--mute); font-size: .74rem; }
.orow-meta > span { display: inline-flex; align-items: center; gap: .3rem; }
.orow-meta .ico { width: .8rem; height: .8rem; }
.acts { display: flex; flex-wrap: wrap; gap: .35rem; }
.orow.slim .acts { margin-inline-start: auto; }
.chip { display: inline-flex; align-items: center; gap: .35rem; height: 1.95rem; padding: 0 .75rem; border-radius: var(--r-pill); border: 1px solid var(--line-2); color: var(--mute); font-size: .74rem; font-weight: 700; white-space: nowrap; transition: background .2s, color .2s, border-color .2s; }
.chip .ico { width: .82rem; height: .82rem; }
.chip:hover { color: #fff; border-color: var(--accent); background: var(--accent-dim); }
.chip.primary { color: var(--accent-3); border-color: var(--accent-line); }
.chip.primary:hover { background: var(--accent); color: #fff; }
.chip.danger { color: #ff9a9d; border-color: rgba(255, 90, 95, .35); }
.chip.danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.hp { color: var(--ok); }
.hp.mid { color: var(--warn); }
.hp.low { color: var(--bad); }

.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .5rem; }
.kv { padding: .75rem 1rem; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); min-width: 0; }
.kv-k { font-size: .72rem; color: var(--mute); font-weight: 600; }
.kv-v { margin-top: .3rem; font-size: .95rem; font-weight: 700; color: #e6e6e6; word-break: break-word; }
.kv-v.mono { font-size: .8rem; font-weight: 500; text-align: left; }

.empty { padding: 3rem 1rem; text-align: center; color: var(--mute-2); }
.empty-mark { width: 3.4rem; height: 3.4rem; margin: 0 auto 1rem; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); color: var(--mute-3); animation: float 4s ease-in-out infinite; }
.empty-mark .ico { width: 1.4rem; height: 1.4rem; }
.empty-title { font-size: 1.2rem; font-weight: 800; color: var(--mute); }
.empty-sub { font-size: .82rem; margin-top: .35rem; }
.more { display: flex; justify-content: center; padding: 1rem 0 0; }
.pager { display: flex; align-items: center; gap: .6rem; justify-content: center; padding: 1rem 0 0; color: var(--mute); font-size: .8rem; }

/* ---------------------------------------------------------------- database editor */
.tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .55rem; }
.tcard { display: flex; align-items: center; gap: .8rem; padding: .8rem .95rem; border-radius: var(--r-lg); background: var(--dots), var(--card); background-size: var(--dots-size), auto; border: 1px solid var(--line); text-align: start; transition: border-color .2s, transform .2s var(--ease); }
.tcard:hover { border-color: var(--accent); transform: translateY(-2px); }
.tcard .ico { color: var(--accent-3); }
.tcard-name { font-family: var(--f-mono); font-size: .84rem; color: #fff; direction: ltr; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard-meta { font-size: .7rem; color: var(--mute); margin-top: .2rem; }
.grid-wrap { direction: ltr; overflow: auto; max-height: calc(100vh - 17rem); border: 1px solid var(--line-2); border-radius: var(--r-lg); background: rgba(5, 5, 5, .7); }
table.grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; direction: ltr; font-size: .8rem; }
table.grid th, table.grid td { padding: .45rem .7rem; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: left; max-width: 22rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.grid th { position: sticky; top: 0; z-index: 1; background: #101010; color: var(--soft); font-weight: 700; cursor: pointer; user-select: none; }
table.grid th:hover { color: #fff; background: #151515; }
table.grid th .ty { display: block; font-weight: 500; color: var(--mute-2); font-size: .66rem; font-family: var(--f-mono); }
table.grid th.pk { color: var(--warn); }
table.grid th.sorted { color: var(--accent-3); box-shadow: inset 0 -2px 0 var(--accent); }
table.grid td { font-family: var(--f-mono); color: #d0d0d0; }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .015); }
table.grid tbody tr:hover td { background: var(--accent-dim); color: #fff; }
td.null { color: var(--mute-3) !important; font-style: italic; }
td.bin { color: var(--mute-2) !important; }
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .9rem; min-width: 0; }
.field > label { display: flex; align-items: center; gap: .5rem; color: var(--mute); font-size: .76rem; font-weight: 700; }
.field > label .mono { color: var(--soft); font-size: .78rem; }
.field > label .ty { color: var(--mute-2); font-family: var(--f-mono); font-size: .68rem; font-weight: 500; }
.null-toggle { margin-inline-start: auto; display: inline-flex; align-items: center; gap: .3rem; color: var(--mute-2); font-size: .7rem; cursor: pointer; }
.null-toggle input { accent-color: var(--accent); }
.field .input.mono { text-align: left; }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }
.perm { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); font-size: .8rem; color: var(--soft); cursor: pointer; }
.perm:hover { border-color: var(--line-3); }
.perm input { accent-color: var(--accent); width: 1rem; height: 1rem; }
.perm.all { grid-column: 1 / -1; border-color: var(--accent-line); font-weight: 800; }

/* ---------------------------------------------------------------- logs */
.lrow { display: grid; grid-template-columns: 9rem 6rem minmax(0, 1fr); align-items: start; gap: .9rem; padding: .55rem .9rem; border-radius: .4rem; font-size: .82rem; }
.lrow:nth-child(odd) { background: rgba(255, 255, 255, .025); }
.lrow-time { color: var(--mute-2); font-family: var(--f-mono); font-size: .72rem; padding-top: .15rem; direction: ltr; text-align: right; }
.lrow-msg { color: #cfcfcf; word-break: break-word; line-height: 1.55; }
.lrow.denied .lrow-msg { color: #ff9a9d; }

/* ---------------------------------------------------------------- dialog / toasts */
.layer { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1rem; background: rgba(2, 2, 2, .7); backdrop-filter: blur(3px); animation: fade .25s ease-out; }
.dialog { position: relative; width: min(34rem, 100%); max-height: 92vh; overflow-y: auto; padding: 1.6rem 1.7rem 1.4rem; background: var(--dots), var(--panel); background-size: 1.15rem 1.15rem, auto; border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--shadow); animation: pop .4s var(--ease) both; }
.dialog.wide { width: min(52rem, 100%); }
.dialog::before { content: ''; position: absolute; top: 0; left: 12%; right: 12%; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.dialog.danger::before { background: linear-gradient(90deg, transparent, var(--bad), transparent); }
.dialog-title { margin: .6rem 0 .6rem; font-size: 1.4rem; font-weight: 800; color: #fff; line-height: 1.3; word-break: break-word; }
.dialog-text { color: var(--mute); font-size: .86rem; line-height: 1.7; margin-bottom: 1rem; white-space: pre-wrap; word-break: break-word; }
.dialog-text:empty { display: none; }
.dialog-actions { position: sticky; bottom: -1.4rem; display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; padding: .8rem 0 0; background: linear-gradient(to top, var(--panel) 70%, transparent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.toasts { position: fixed; bottom: 1.6rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .5rem; z-index: 80; pointer-events: none; }
.toast { display: flex; align-items: center; gap: .7rem; min-width: 16rem; max-width: min(36rem, 92vw); padding: .8rem 1.2rem; border-radius: var(--r-lg); background: var(--stripes), rgba(8, 8, 8, .97); border: 1px solid var(--line-2); color: #f0f0f0; font-size: .86rem; font-weight: 600; box-shadow: var(--shadow); word-break: break-word; animation: toastIn .45s var(--ease) both; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
.t-dot { width: .55rem; height: .55rem; border-radius: 50%; background: #fff; flex: none; }
.toast.success .t-dot { background: var(--ok); box-shadow: 0 0 0 .25rem var(--ok-dim); }
.toast.error .t-dot { background: var(--bad); box-shadow: 0 0 0 .25rem var(--bad-dim); }
.toast.info .t-dot { background: var(--accent); box-shadow: 0 0 0 .25rem var(--accent-dim); }
.spinner { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--line-3); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 3rem auto; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 960px) {
    .side { position: fixed; inset-block: 0; inset-inline-start: 0; transform: translateX(110%); transition: transform .35s var(--ease); box-shadow: var(--shadow); }
    .shell.nav-open .side { transform: none; }
    .side-close, .menu-btn { display: grid; }
    .topbar { padding: .8rem 1rem; }
    .page { padding: 1rem 1rem 3rem; }
    .grid2, .form-grid, .perm-grid { grid-template-columns: minmax(0, 1fr); }
    .lrow { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
    .clock { display: none; }
    .hero-title { font-size: 1.25rem; }
}

/* ---------------------------------------------------------------- motion */
@keyframes gridDrift { from { background-position: 0 0; } to { background-position: 1.15rem 2.3rem; } }
@keyframes ring { 0% { transform: scale(.92); opacity: .9; } 100% { transform: scale(1.18); opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(.7rem); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(1rem) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(80, 124, 204, .6); } 100% { box-shadow: 0 0 0 .5rem rgba(80, 124, 204, 0); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-.4rem); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(1rem) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(.6rem) scale(.96); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
