@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
    --bg: #000000;
    --bg-elevated: #0a0a0a;
    --glass: rgba(255, 255, 255, 0.045);
    --glass-hover: rgba(255, 255, 255, 0.075);
    --glass-strong: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.09);
    --border-hover: rgba(255, 255, 255, 0.18);
    --text: #ededed;
    --text-muted: #888888;
    --text-faint: #555555;
    --white: #ffffff;
    --success: #4ade80;
    --warning: #eab308;
    --danger: #f87171;
    --accent: #b9d9ff;
    --glow-soft: rgba(185, 217, 255, 0.12);
    --glow-focus: rgba(185, 217, 255, 0.22);
    --radius: 14px;
    --radius-sm: 10px;
    --sidebar-w: 216px;
}
:root[data-theme="graphite"] { --bg:#111316; --bg-elevated:#1a1d21; --glass:rgba(255,255,255,.055); --glass-hover:rgba(255,255,255,.09); --border:rgba(255,255,255,.13); --border-hover:rgba(255,255,255,.24); --text:#f0f1f3; --text-muted:#a3a8b0; --text-faint:#707680; --accent:#d1d5db; }
:root[data-theme="frost"] { --bg:#dfe7ef; --bg-elevated:#f4f7fa; --glass:rgba(255,255,255,.48); --glass-hover:rgba(255,255,255,.7); --border:rgba(38,52,68,.16); --border-hover:rgba(38,52,68,.3); --text:#172333; --text-muted:#4e6072; --text-faint:#718293; --white:#172333; --accent:#315f91; --glow-soft:rgba(49,95,145,.16); --glow-focus:rgba(49,95,145,.24); }
:root[data-theme="ocean"] { --bg:#081824; --bg-elevated:#10283a; --glass:rgba(70,148,190,.11); --glass-hover:rgba(70,148,190,.18); --border:rgba(150,220,248,.16); --border-hover:rgba(150,220,248,.3); --text:#e7f7ff; --text-muted:#91b7c8; --text-faint:#628597; --accent:#8ed8f5; --glow-soft:rgba(142,216,245,.16); --glow-focus:rgba(142,216,245,.26); }
:root[data-theme="ember"] { --bg:#1d1110; --bg-elevated:#2a1715; --glass:rgba(226,139,105,.09); --glass-hover:rgba(226,139,105,.16); --border:rgba(255,205,180,.15); --border-hover:rgba(255,205,180,.3); --text:#fff0e9; --text-muted:#c9a69a; --text-faint:#96766d; --accent:#f0b394; --glow-soft:rgba(240,179,148,.15); --glow-focus:rgba(240,179,148,.25); }
:root[data-theme="ruby"] { --bg:#260c14; --bg-elevated:#3a121c; --glass:rgba(255,112,139,.09); --glass-hover:rgba(255,112,139,.16); --border:rgba(255,183,198,.16); --border-hover:rgba(255,183,198,.32); --text:#fff0f3; --text-muted:#d4a2ad; --text-faint:#a66e7a; --accent:#ff9db1; --glow-soft:rgba(255,94,124,.18); --glow-focus:rgba(255,94,124,.28); }
:root[data-theme="violet"] { --bg:#180e25; --bg-elevated:#27153a; --glass:rgba(187,133,255,.1); --glass-hover:rgba(187,133,255,.17); --border:rgba(220,190,255,.16); --border-hover:rgba(220,190,255,.32); --text:#f8f0ff; --text-muted:#c3a9d7; --text-faint:#9276a8; --accent:#d4adff; --glow-soft:rgba(180,120,255,.18); --glow-focus:rgba(180,120,255,.28); }
:root[data-theme="forest"] { --bg:#0b1c15; --bg-elevated:#123326; --glass:rgba(101,211,157,.09); --glass-hover:rgba(101,211,157,.16); --border:rgba(167,240,205,.15); --border-hover:rgba(167,240,205,.3); --text:#eafff3; --text-muted:#9cc8b1; --text-faint:#668f7b; --accent:#8ee7b8; --glow-soft:rgba(83,214,145,.16); --glow-focus:rgba(83,214,145,.25); }
:root[data-theme="amber"] { --bg:#211605; --bg-elevated:#34240b; --glass:rgba(245,184,72,.1); --glass-hover:rgba(245,184,72,.17); --border:rgba(255,221,145,.16); --border-hover:rgba(255,221,145,.32); --text:#fff8e8; --text-muted:#d2b878; --text-faint:#9e8449; --accent:#ffd477; --glow-soft:rgba(245,184,72,.17); --glow-focus:rgba(245,184,72,.27); }
:root[data-theme="daylight"] { --bg:#f3f5f7; --bg-elevated:#ffffff; --glass:rgba(255,255,255,.68); --glass-hover:rgba(255,255,255,.9); --border:rgba(35,48,62,.14); --border-hover:rgba(35,48,62,.28); --text:#172333; --text-muted:#536476; --text-faint:#788897; --white:#172333; --accent:#365f8c; --glow-soft:rgba(54,95,140,.14); --glow-focus:rgba(54,95,140,.24); }

* { box-sizing: border-box; }

html, body {
    margin: 0;
    width: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: "Manrope", "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; }

/* subtle radial glow behind everything, very Vercel-ish */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(600px circle at 15% -10%, rgba(255,255,255,0.05), transparent 60%),
        radial-gradient(500px circle at 90% 0%, rgba(255,255,255,0.03), transparent 55%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(420px circle at 50% 105%, rgba(185, 217, 255, 0.035), transparent 68%);
    pointer-events: none;
    z-index: 0;
}

/* ---------- PAGE TRANSITIONS ---------- */

.app-shell { animation: page-enter .32s cubic-bezier(.22,.8,.26,1) both; }
.page-exiting .app-shell { animation: page-exit .17s ease both; pointer-events: none; }
@keyframes page-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes page-exit { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-5px); } }
.page-intro { animation: content-rise .38s cubic-bezier(.22,.8,.26,1) .04s both; }
.card { animation: content-rise .38s cubic-bezier(.22,.8,.26,1) .1s both; }
.nav-box { animation: content-rise .34s cubic-bezier(.22,.8,.26,1) both; }
.nav-box:nth-child(2) { animation-delay: .04s; }
.nav-box:nth-child(3) { animation-delay: .08s; }
.nav-box:nth-child(4) { animation-delay: .12s; }
.nav-box:nth-child(5) { animation-delay: .16s; }
.nav-box:nth-child(6) { animation-delay: .2s; }
@keyframes content-rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
    .app-shell, .page-exiting .app-shell, .page-intro, .card, .nav-box { animation: none; }
}

/* ---------- LOGIN INTRO ---------- */

.login-splash {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 9px;
    background: #050608;
    color: var(--text);
    animation: splash-exit .42s ease .58s forwards;
}
.login-splash[hidden] { display: none; }
.splash-mark { width: 40px; height: 40px; opacity: 0; animation: splash-rise .5s ease .08s forwards; filter: drop-shadow(0 0 16px rgba(185,217,255,.24)); }
.splash-photo { width: 40px; height: 40px; border-radius: 12px; }
.splash-mark { display: grid; place-items: center; }
.splash-mark svg { width: 100%; height: 100%; }
.login-splash strong { opacity: 0; font-size: 18px; letter-spacing: .13em; animation: splash-rise .5s ease .18s forwards; }
.login-splash > span { opacity: 0; color: var(--text-muted); font-size: 11px; letter-spacing: .08em; animation: splash-rise .5s ease .25s forwards; }
.splash-line { width: 100px; height: 1px; margin-top: 10px; overflow: hidden; background: rgba(255,255,255,.1); }
.splash-line i { display: block; width: 42%; height: 100%; background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: splash-progress .66s ease forwards; }
@keyframes splash-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes splash-progress { from { transform: translateX(-110%); } to { transform: translateX(250%); } }
@keyframes splash-exit { to { opacity: 0; visibility: hidden; } }
.auth-wrap { transition: opacity .42s ease, transform .42s ease; }
.auth-boot .auth-wrap { opacity: 0; transform: translateY(8px); }

@media (prefers-reduced-motion: reduce) {
    .login-splash { animation: none; }
    .splash-mark, .login-splash strong, .login-splash > span, .splash-line i { animation: none; opacity: 1; transform: none; }
    .auth-wrap { transition: none; }
}

/* ---------- TEXT ---------- */

.text-gradient {
    background: linear-gradient(180deg, #ffffff 0%, #9a9a9a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- GLASS UTILITY ---------- */

.glass {
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--border);
}

/* ---------- LAYOUT ---------- */

.app-shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.app-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(185,217,255,.055), transparent 42%, rgba(255,255,255,.018));
    transition: background .35s ease;
}
.app-shell.page-dashboard::before { background: linear-gradient(135deg, rgba(185,217,255,.11), transparent 43%, rgba(255,255,255,.025)); }
.app-shell.page-whatsapp::before { background: linear-gradient(135deg, rgba(74,222,128,.09), transparent 42%, rgba(185,217,255,.025)); }
.app-shell.page-xmessage::before { background: linear-gradient(135deg, rgba(185,217,255,.11), transparent 42%, rgba(160,130,255,.035)); }
.app-shell.page-sessions::before { background: linear-gradient(135deg, rgba(100,190,220,.095), transparent 42%, rgba(255,255,255,.025)); }
.app-shell.page-logs::before { background: linear-gradient(135deg, rgba(234,179,8,.075), transparent 42%, rgba(255,255,255,.025)); }
.app-shell.page-system::before { background: linear-gradient(135deg, rgba(185,217,255,.09), transparent 42%, rgba(74,222,128,.035)); }
.app-shell.page-profile::before { background: linear-gradient(135deg, rgba(210,175,255,.095), transparent 42%, rgba(185,217,255,.035)); }

.sidebar {
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    padding: 22px 16px 42px;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    border-right: 1px solid var(--border);
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform .25s ease, width .25s ease, padding .25s ease;
    z-index: 40;
}

.sidebar-brand { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 4px 6px 26px; border-radius: 12px; }
.brand-photo { display: block; width: 38px; height: 38px; object-fit: cover; border: 1px solid rgba(185,217,255,.32); border-radius: 11px; box-shadow: 0 0 18px rgba(185,217,255,.16); transition: transform .18s ease, box-shadow .18s ease; }
.sidebar-brand:hover .brand-photo { transform: translateY(-1px); box-shadow: 0 0 24px rgba(185,217,255,.28); }
.sidebar-brand .icon svg { width: 22px; height: 22px; }
.sidebar-brand span { font-weight: 600; font-size: 16px; letter-spacing: -0.02em; }

.sidebar-spacer { flex: 1; }

.sidebar-navigation { display: flex; flex-direction: column; gap: 3px; }
.sidebar-nav-link { min-height: 42px; }
.sidebar-link-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sidebar-link-copy strong { color: inherit; font-size: 12.5px; font-weight: 500; }
.sidebar-link-copy small { color: var(--text-faint); font-size: 10.5px; }
.sidebar-nav-link.active { color: var(--text); background: rgba(185,217,255,.08); border: 1px solid rgba(185,217,255,.18); box-shadow: inset 2px 0 0 var(--accent), 0 0 18px rgba(185,217,255,.06); }
.sidebar-nav-link.active .sidebar-link-copy small { color: rgba(185,217,255,.7); }

.sidebar-links { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; }
.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: var(--radius-sm);
    color: var(--text-muted); font-size: 13px;
    transition: background .15s ease, color .15s ease;
}
.sidebar-link .icon svg { width: 16px; height: 16px; }
.sidebar-link:hover { background: var(--glass-hover); color: var(--text); }
.sidebar-link:focus-visible,
.logout-btn:focus-visible,
.back-btn:focus-visible,
.menu-toggle:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 18px var(--glow-soft);
}

.sidebar-user {
    font-size: 12px; color: var(--text-faint);
    padding: 12px 10px 6px; border-top: 1px solid var(--border); margin-top: 8px;
}
.sidebar-user strong { color: var(--text-muted); font-weight: 500; }

.logout-btn {
    display: flex; align-items: center; gap: 10px; width: 100%;
    margin-top: 10px; padding: 10px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: transparent; color: var(--text-muted);
    font-size: 13px; cursor: pointer; transition: all .15s ease;
}
.logout-btn .icon svg { width: 16px; height: 16px; }
.logout-btn:hover { color: var(--danger); border-color: rgba(248,113,113,.35); background: rgba(248,113,113,.06); }

.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    padding: 26px 32px 60px;
    max-width: 1180px;
    position: relative; z-index: 1;
    transition: margin-left .25s ease, padding .25s ease;
}

.sidebar-collapsed .sidebar { width: 68px; padding-left: 10px; padding-right: 10px; }
.sidebar-collapsed .main { margin-left: 68px; }
.sidebar-collapsed .sidebar-brand { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar-collapsed .sidebar-brand .text-gradient,
.sidebar-collapsed .sidebar-link-copy,
.sidebar-collapsed .sidebar-user,
.sidebar-collapsed .sidebar-links,
.sidebar-collapsed .logout-btn span { display: none; }
.sidebar-collapsed .sidebar-nav-link,
.sidebar-collapsed .logout-btn { justify-content: center; padding-left: 8px; padding-right: 8px; }

.topbar { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 24px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.theme-menu-wrap { position: relative; }
.theme-toggle { min-height: 30px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--glass); color: var(--text-muted); font-size: 11px; cursor: pointer; }
.theme-toggle:hover { color: var(--text); border-color: var(--border-hover); box-shadow: 0 0 16px var(--glow-soft); }
.theme-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 70; display: grid; gap: 4px; min-width: 145px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: rgba(12,14,18,.94); box-shadow: 0 14px 35px rgba(0,0,0,.35), 0 0 18px var(--glow-soft); backdrop-filter: blur(16px); }
.theme-menu[hidden] { display: none; }
.theme-option { display: flex; align-items: center; gap: 8px; padding: 8px; border: 0; border-radius: 7px; background: transparent; color: var(--text-muted); font-size: 11px; cursor: pointer; }
.theme-option:hover { background: var(--glass-hover); color: var(--text); }
.theme-option i { width: 14px; height: 14px; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; background: var(--swatch); }
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-identity { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.topbar-brand { color: var(--text); font-size: 17px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; text-shadow: 0 0 18px rgba(185,217,255,.12); }
.topbar-divider { color: var(--text-faint); font: 13px "JetBrains Mono", monospace; }
.back-btn {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 9px;
    border: 1px solid var(--border); background: var(--glass); color: var(--text-muted); cursor: pointer;
}
.back-btn .icon svg { width: 16px; height: 16px; }
.back-btn:hover { color: var(--text); border-color: var(--border-hover); }
.back-btn:hover { box-shadow: 0 0 18px var(--glow-soft); }
.topbar h1 { font-size: 19px; margin: 0; font-weight: 600; letter-spacing: 0; color: var(--text-muted); }
.topbar .role-badge {
    font-size: 11px; padding: 4px 10px; border-radius: 999px;
    background: var(--glass); color: var(--text-muted); border: 1px solid var(--border);
    letter-spacing: .02em; text-transform: uppercase;
}

.menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; padding: 4px; border-radius: 11px; border: 1px solid var(--border);
    background: var(--glass); color: var(--text-muted); cursor: pointer;
}
.menu-toggle .menu-logo { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 8px; box-shadow: 0 0 14px rgba(185,217,255,.16); }
.menu-toggle:has(.menu-logo) { padding: 3px; overflow: hidden; }
.menu-toggle:hover { color: var(--text); border-color: rgba(185,217,255,.35); box-shadow: 0 0 18px var(--glow-soft); }

@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main, .sidebar-collapsed .main { margin-left: 0; padding: 18px; }
    .sidebar-collapsed .sidebar { width: var(--sidebar-w); padding: 22px 16px 42px; transform: translateX(-100%); }
    .sidebar-collapsed .sidebar.open { transform: translateX(0); }
    .sidebar-collapsed .sidebar-brand { justify-content: center; padding-left: 0; padding-right: 0; }
    .sidebar-collapsed .sidebar-brand .text-gradient,
    .sidebar-collapsed .sidebar-link-copy,
    .sidebar-collapsed .sidebar-user,
    .sidebar-collapsed .sidebar-links,
    .sidebar-collapsed .logout-btn span { display: initial; }
    .sidebar-collapsed .sidebar-nav-link,
    .sidebar-collapsed .logout-btn { justify-content: flex-start; padding-left: 10px; padding-right: 10px; }
}

/* ---------- ACCOUNT BANNER (glass) ---------- */

.account-banner {
    border-radius: 18px;
    padding: 26px 28px;
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255,255,255,0.035);
}
.account-banner::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.06), transparent 60%);
    pointer-events: none;
    z-index: 1;
}
.account-banner::before {
    content: "";
    position: absolute;
    z-index: 1;
    top: -35%;
    bottom: -35%;
    left: -45%;
    width: 32%;
    pointer-events: none;
    background: linear-gradient(105deg, transparent 0%, rgba(220,225,232,.025) 35%, rgba(245,247,250,.13) 50%, rgba(170,178,190,.035) 66%, transparent 100%);
    filter: blur(12px);
    transform: skewX(-18deg);
    animation: banner-glass-sweep 8s ease-in-out infinite;
}
@keyframes banner-glass-sweep {
    0%, 12% { left: -45%; opacity: 0; }
    24% { opacity: .8; }
    52% { opacity: .35; }
    78%, 100% { left: 118%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .account-banner::before { animation: none; }
}

/* Kalau ada gambar banner, panel jadi "hero" - gambar background + rasio
   proporsional (lebar banget, gak kependekan/gepeng) + scrim biar teks
   tetap kebaca di atas gambar apapun. */
.account-banner.has-image {
    aspect-ratio: 3 / 1;
    display: flex;
    align-items: flex-end;
    padding: 28px 30px;
}
@media (max-width: 700px) {
    .account-banner.has-image { aspect-ratio: 4 / 3; }
}
.account-banner .bg-slide {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .6s ease;
    filter: grayscale(10%) brightness(.7);
}
.account-banner .bg-slide.active { opacity: 1; }
.account-banner .scrim {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,.45) 55%, rgba(0,0,0,.82) 100%);
}
.account-banner .banner-content { position: relative; z-index: 2; width: 100%; }
.account-banner .banner-brand { background: linear-gradient(110deg, #ffffff 0%, #e0e4ea 48%, #aeb8c7 100%); -webkit-background-clip: text; background-clip: text; color: transparent; font-family: "JetBrains Mono", monospace; font-size: clamp(25px, 3.2vw, 38px); font-weight: 800; line-height: 1.05; letter-spacing: .08em; text-shadow: 0 0 26px rgba(220,225,232,.22); }
.account-banner .banner-subtitle { margin: 8px 0 24px; color: rgba(255,255,255,.8); font-size: 12px; font-weight: 600; letter-spacing: .1em; line-height: 1.5; text-transform: uppercase; text-shadow: 0 0 14px rgba(185,217,255,.12); }

.account-banner .label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 4px; }
.account-banner .username { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.account-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 22px; position: relative; }
@media (max-width: 700px) { .account-grid { grid-template-columns: repeat(2, 1fr); row-gap: 18px; } }
.account-grid .stat .label { margin-bottom: 7px; }
.account-grid .stat .val { font-size: 13px; font-weight: 550; letter-spacing: -0.005em; }

/* ---------- STATUS STRIP (ala status page Vercel) ---------- */

.status-strip {
    display: flex;
    flex-wrap: wrap;
    margin-top: 10px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}
.status-item {
    flex: 1 1 150px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 14px 18px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.015);
}
.status-item:last-child { border-right: none; }
@media (max-width: 700px) {
    .status-item { flex: 1 1 45%; }
    .status-item:nth-child(2n) { border-right: none; }
}
.status-item .status-row { display: flex; align-items: center; gap: 8px; }
.status-item .status-name { font-size: 12.5px; font-weight: 500; color: var(--text); }
.status-item .status-text { font-size: 11.5px; color: var(--text-faint); padding-left: 16px; }

.status-dot {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
    background: var(--text-faint);
}
.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(74,222,128,.5);
    animation: status-pulse 2s ease-out infinite;
}
.status-dot.offline { background: var(--danger); }
@keyframes status-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(74,222,128,.45); }
    70%  { box-shadow: 0 0 0 6px rgba(74,222,128,0); }
    100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

/* ---------- NAV BOXES (slim, dashboard) ---------- */

.nav-box-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}
.bottom-navigation {
    position: relative;
    z-index: 3;
    display: flex;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    gap: 14px;
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
    justify-content: center;
    scrollbar-width: none;
    margin: 0;
    margin-top: -8px;
    margin-bottom: 22px;
    padding: 10px;
    border: 1px solid rgba(185,217,255,.16);
    border-radius: 14px;
    background: rgba(8,10,14,.78);
    box-shadow: 0 18px 42px rgba(0,0,0,.42), 0 0 28px rgba(185,217,255,.08);
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
}
.bottom-navigation::-webkit-scrollbar { display: none; }
.bottom-navigation .nav-box { flex: 1 1 160px; min-width: 150px; min-height: 78px; background: rgba(255,255,255,.035); border-color: rgba(255,255,255,.07); }
.bottom-navigation .nav-box:hover { background: rgba(185,217,255,.08); }
.bottom-navigation .nav-box > span:nth-child(2) { min-width: 0; overflow: hidden; }
.bottom-navigation .nav-box .label { line-height: 1.35; white-space: normal; }
.bottom-navigation .nav-box .sub { display: -webkit-box; overflow: hidden; line-height: 1.35; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
@media (min-width: 1100px) { .bottom-navigation { justify-content: center; } }
@media (max-width: 700px) { .nav-box-grid { grid-template-columns: repeat(2, 1fr); } }

.nav-box {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--glass);
    border: 1px solid var(--border);
    transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.nav-box:hover { background: var(--glass-hover); border-color: rgba(185,217,255,.3); transform: translateY(-1px); box-shadow: 0 8px 26px rgba(0,0,0,.24), 0 0 22px var(--glow-soft); }
.nav-box:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 22px var(--glow-focus); }
.nav-box .icon {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 9px;
    background: rgba(255,255,255,0.06); flex-shrink: 0;
}
.nav-box .icon svg { width: 17px; height: 17px; }
.nav-box .label { font-size: 13.5px; font-weight: 500; }
.nav-box .sub { font-size: 11.5px; color: var(--text-faint); margin-top: 1px; }
.nav-box .chevron { margin-left: auto; color: var(--text-faint); }
.nav-box .chevron svg { width: 14px; height: 14px; }

/* ---------- CARDS ---------- */

.grid { display: grid; gap: 14px; }
.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: 860px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 16px 42px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.025);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.card:hover { border-color: rgba(185,217,255,.18); box-shadow: 0 18px 46px rgba(0,0,0,.24), 0 0 24px rgba(185,217,255,.06), inset 0 1px 0 rgba(255,255,255,.035); }
.card h3 { margin: 0 0 8px; font-size: 12.5px; color: var(--text-muted); font-weight: 500; letter-spacing: .01em; }
.card .value { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.card .sub { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.card .sub a { color: var(--text-muted); border-bottom: 1px solid var(--border); }

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 0 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255,255,255,.028);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 0 24px rgba(185,217,255,.035);
}
.metric-item { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 13px 16px; border-right: 1px solid var(--border); }
.metric-item:last-child { border-right: 0; }
.metric-item > div { display: grid; min-width: 0; grid-template-columns: auto auto; column-gap: 8px; align-items: baseline; }
.metric-label { grid-column: 1 / -1; overflow: hidden; color: var(--text-muted); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.metric-item strong { color: var(--text); font: 700 21px "JetBrains Mono", monospace; line-height: 1.2; }
.metric-item small { overflow: hidden; color: var(--text-faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.metric-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; box-shadow: 0 0 11px currentColor; }
.metric-dot.online { color: var(--success); background: var(--success); }
.metric-dot.blue { color: var(--accent); background: var(--accent); }
.metric-dot.warning { color: var(--warning); background: var(--warning); }
.metric-item { animation: content-rise .34s cubic-bezier(.22,.8,.26,1) both; }
.metric-item:nth-child(2) { animation-delay: .05s; }
.metric-item:nth-child(3) { animation-delay: .1s; }
.compact-stats { margin-bottom: 14px; }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-kicker { display: block; margin-bottom: 6px; color: var(--accent); font: 10px "JetBrains Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.page-intro h2 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.page-intro p { margin: 6px 0 0; color: var(--text-muted); font-size: 13px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section-heading h3 { margin-bottom: 3px; }
.section-heading p { margin: 0; color: var(--text-faint); font-size: 11.5px; }
.profile-layout { display: grid; grid-template-columns: minmax(190px, .65fr) minmax(0, 1.35fr); gap: 14px; }
.profile-identity { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.profile-avatar { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 6px; border: 1px solid rgba(185,217,255,.28); border-radius: 15px; color: var(--accent); background: rgba(185,217,255,.08); font-size: 22px; box-shadow: 0 0 22px rgba(185,217,255,.08); }
.profile-identity h3 { margin: 0; color: var(--text); font-size: 18px; }
.profile-identity p { margin: 0 0 7px; color: var(--text-faint); font-size: 12px; }

@media (max-width: 700px) {
    .dashboard-metrics { display: flex; overflow-x: auto; scrollbar-width: none; }
    .dashboard-metrics::-webkit-scrollbar { display: none; }
    .metric-item { flex: 0 0 178px; border-right: 1px solid var(--border); }
    .metric-item:last-child { border-right: 0; }
    .page-intro { align-items: flex-start; flex-direction: column; }
    .page-intro .btn { width: 100%; }
    .profile-layout { grid-template-columns: 1fr; }
    .sender-picker { grid-template-columns: 1fr; gap: 8px; }
    .message-options { grid-template-columns: 1fr; }
    .console-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
    .console-log { grid-column: 1 / -1; padding-left: 16px; }
    .xmessage-activity-card { max-width: none; }
}

/* ---------- PAIRING STEPPER ---------- */

.pair-steps { display: flex; align-items: flex-start; margin: 4px 0 22px; }
.pair-step { display: flex; flex: 0 0 auto; flex-direction: column; align-items: center; gap: 6px; color: var(--text-faint); }
.pair-step span { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid var(--border); border-radius: 50%; background: var(--bg-elevated); font: 11px "JetBrains Mono", monospace; transition: color .18s ease, border-color .18s ease, box-shadow .18s ease; }
.pair-step small { font-size: 10px; white-space: nowrap; }
.pair-step.active { color: var(--accent); }
.pair-step.active span { border-color: var(--accent); box-shadow: 0 0 15px var(--glow-soft); }
.pair-step.complete { color: var(--success); }
.pair-step.complete span { border-color: rgba(74,222,128,.55); color: var(--success); }
.pair-steps i { flex: 1; height: 1px; margin: 12px 7px 0; background: var(--border); }

/* ---------- FORMS ---------- */

.field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--text-muted); }
.sender-picker { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 10px; width: 100%; }
.sender-field { display: flex; min-width: 0; flex-direction: column; gap: 6px; color: var(--text-muted); font-size: 11px; }
.sender-field span { color: var(--text-faint); font: 10px "JetBrains Mono", monospace; letter-spacing: .06em; text-transform: uppercase; }
.sender-field select { width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.form-note { margin: -2px 0 14px; color: var(--text-faint); font-size: 11.5px; line-height: 1.5; }
.xmessage-activity-card { max-width: 520px; margin-top: 14px; }
.xmessage-console { display: grid; gap: 8px; max-height: 360px; overflow-y: auto; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(0,0,0,.22); font: 11px/1.5 "JetBrains Mono", monospace; }
.console-row { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(0, 1.3fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.console-row:last-child { border-bottom: 0; }
.console-main { display: flex; min-width: 0; align-items: center; gap: 9px; }
.console-main strong, .console-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.console-main strong { color: var(--text); font-size: 11px; }
.console-main small { margin-top: 3px; color: var(--text-faint); font: 10px "Manrope", sans-serif; }
.console-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--text-faint); box-shadow: 0 0 9px currentColor; }
.console-dot.running, .console-dot.queued { color: var(--accent); background: var(--accent); }
.console-dot.completed { color: var(--success); background: var(--success); }
.console-dot.failed, .console-dot.stopped { color: var(--danger); background: var(--danger); }
.console-log { display: grid; min-width: 0; gap: 2px; color: var(--text-muted); }
.console-log span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.console-stop { min-height: 28px; padding: 5px 9px; font-size: 10px; }
.console-row { animation: content-rise .28s ease both; }
.console-row:nth-child(2) { animation-delay: .04s; }
.console-row:nth-child(3) { animation-delay: .08s; }
.console-row:nth-child(4) { animation-delay: .12s; }
.message-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.message-option { display: flex; align-items: center; min-width: 0; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(255,255,255,.025); color: var(--text-muted); text-align: left; cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease; }
.message-option { animation: content-rise .3s ease both; }
.message-option:nth-child(2) { animation-delay: .05s; }
.message-option:nth-child(3) { animation-delay: .1s; }
.message-option:nth-child(4) { animation-delay: .15s; }
.message-option:hover { border-color: rgba(185,217,255,.35); background: rgba(185,217,255,.055); transform: translateY(-1px); }
.message-option.selected { border-color: rgba(185,217,255,.55); background: rgba(185,217,255,.1); color: var(--text); box-shadow: 0 0 18px rgba(185,217,255,.1), inset 2px 0 0 var(--accent); }
.message-option-check { width: 16px; height: 16px; flex: 0 0 16px; border: 1px solid var(--border-hover); border-radius: 5px; background: rgba(0,0,0,.2); }
.message-option.selected .message-option-check { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 10px rgba(185,217,255,.35); }
.message-option.selected .message-option-check::after { display: block; width: 5px; height: 9px; margin: 1px 0 0 5px; border: solid #071018; border-width: 0 2px 2px 0; transform: rotate(45deg); content: ""; }
.message-option-copy { display: grid; min-width: 0; gap: 3px; }
.message-option-copy strong { overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.message-option-copy small { color: var(--text-faint); font-size: 10px; text-transform: capitalize; }
input, select, textarea {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(185,217,255,.48); background: rgba(255,255,255,0.05); box-shadow: 0 0 0 3px rgba(185,217,255,.07), 0 0 22px rgba(185,217,255,.08); }
input::placeholder, textarea::placeholder { color: var(--text-faint); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: var(--radius-sm); border: none;
    background: var(--white); color: #000; font-size: 13.5px; font-weight: 600;
    cursor: pointer; transition: opacity .15s ease, box-shadow .15s ease, transform .15s ease;
}
.btn:hover { opacity: .9; box-shadow: 0 7px 24px rgba(255,255,255,.1); transform: translateY(-1px); }
.btn:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 20px var(--glow-focus); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--glass); border: 1px solid var(--border); color: var(--text); }
.btn.secondary:hover { background: var(--glass-hover); opacity: 1; }
.btn.danger { background: rgba(248,113,113,.12); color: var(--danger); border: 1px solid rgba(248,113,113,.3); }
.btn.danger:hover { background: rgba(248,113,113,.2); opacity: 1; }
.btn.block { width: 100%; }

/* ---------- XMESSAGE CONFIRMATION ---------- */

.xmessage-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0,0,0,.62);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.xmessage-console-panel { position: static; inset: auto; display: block; z-index: auto; padding: 14px 0 0; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.xmessage-console-panel[hidden] { display: none; }
.xmessage-console-panel .xmessage-modal { width: min(100%, 520px); max-height: none; overflow: visible; padding: 16px; border-radius: var(--radius-sm); background: rgba(0,0,0,.18); box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 0 20px rgba(185,217,255,.035); }
.xmessage-overlay[hidden] { display: none; }
.xmessage-modal {
    width: min(100%, 520px);
    max-height: min(720px, calc(100vh - 40px));
    overflow: auto;
    padding: 22px;
    border: 1px solid rgba(185,217,255,.22);
    border-radius: 16px;
    background: rgba(12,14,18,.94);
    box-shadow: 0 24px 80px rgba(0,0,0,.5), 0 0 34px rgba(185,217,255,.09);
}
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-kicker { color: var(--accent); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.modal-header h2 { margin: 5px 0 0; font-size: 18px; font-weight: 600; }
.icon-button { width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--text-muted); font-size: 20px; cursor: pointer; }
.icon-button:hover { color: var(--text); border-color: var(--border-hover); }
.confirm-summary { display: grid; gap: 8px; margin: 20px 0; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(255,255,255,.025); }
.confirm-summary div { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; }
.confirm-summary span { color: var(--text-faint); }
.confirm-summary strong { color: var(--text); font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.job-panel { margin-top: 18px; }
.job-panel[hidden] { display: none; }
.job-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; color: var(--text-muted); font-size: 12px; }
.job-header strong { color: var(--text); font: 12px "JetBrains Mono", monospace; }
.job-status-running { color: var(--accent); }
.job-status-completed { color: var(--success); }
.job-status-stopped, .job-status-failed { color: var(--danger); }
.job-log { min-height: 88px; max-height: 190px; overflow: auto; margin-bottom: 12px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(0,0,0,.3); font: 11px/1.7 "JetBrains Mono", monospace; }
.job-log-entry { display: flex; gap: 10px; color: var(--text-muted); }
.job-log-entry time { color: var(--text-faint); flex: 0 0 auto; }

/* ---------- STATUS PILLS ---------- */

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; padding: 3px 10px; border-radius: 999px; font-weight: 500; }
.pill.connected, .pill.open { background: rgba(74,222,128,.12); color: var(--success); box-shadow: 0 0 14px rgba(74,222,128,.1); }
.pill.pairing, .pill.connecting { background: rgba(234,179,8,.12); color: var(--warning); }
.pill.disconnected, .pill.closed, .pill.error { background: rgba(248,113,113,.12); color: var(--danger); }

/* ---------- TABLE ---------- */

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--text-faint); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }

/* ---------- ACTIVITY LOG ---------- */

.activity-log {
    position: relative;
    overflow: hidden;
    margin-top: 12px;
    padding: 5px 0;
    border: 1px solid rgba(255,255,255,.075);
    border-radius: var(--radius-sm);
    background: rgba(0,0,0,.2);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 0 24px rgba(185,217,255,.025);
}
.activity-log::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 19px;
    width: 1px;
    background: linear-gradient(180deg, rgba(185,217,255,.28), rgba(255,255,255,.05));
}
.activity-entry {
    position: relative;
    display: grid;
    grid-template-columns: 14px 56px 52px 74px minmax(100px, .7fr) minmax(120px, 1.3fr);
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(255,255,255,.045);
    color: var(--text-muted);
    font-size: 12px;
    transition: background .16s ease, box-shadow .16s ease;
}
.activity-entry:last-child { border-bottom: none; }
.activity-entry:hover { background: rgba(185,217,255,.045); box-shadow: inset 2px 0 0 rgba(185,217,255,.4); }
.activity-entry.latest { background: rgba(185,217,255,.025); }
.activity-entry { animation: content-rise .3s ease both; }
.activity-entry:nth-child(2) { animation-delay: .04s; }
.activity-entry:nth-child(3) { animation-delay: .08s; }
.activity-entry:nth-child(4) { animation-delay: .12s; }
.activity-entry.error { box-shadow: inset 2px 0 0 rgba(248,113,113,.55); }
.activity-entry.auth { box-shadow: inset 2px 0 0 rgba(234,179,8,.45); }
.activity-marker {
    z-index: 1;
    width: 7px;
    height: 7px;
    margin-left: 1px;
    border: 2px solid var(--bg-elevated);
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(185,217,255,.55);
}
.activity-entry.error .activity-marker { background: var(--danger); box-shadow: 0 0 10px rgba(248,113,113,.45); }
.activity-entry.auth .activity-marker { background: var(--warning); box-shadow: 0 0 10px rgba(234,179,8,.4); }
.activity-time, .activity-level, .activity-action { font-family: "JetBrains Mono", monospace; }
.activity-time { color: var(--text-faint); }
.activity-level { color: var(--accent); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.activity-entry.error .activity-level { color: var(--danger); }
.activity-entry.auth .activity-level { color: var(--warning); }
.activity-type { color: var(--text-muted); }
.activity-action { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-detail { color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 700px) {
    .activity-entry { grid-template-columns: 14px 48px 1fr; gap: 8px; }
    .activity-level, .activity-type { display: none; }
    .activity-action { grid-column: 3; grid-row: 1; }
    .activity-detail { grid-column: 3; grid-row: 2; font-size: 11px; }
    .activity-entry { min-height: 52px; }
}

/* ---------- EMPTY / ERROR STATE ---------- */

.empty-state, .error-state {
    text-align: center; padding: 44px 20px; color: var(--text-faint); font-size: 13.5px;
}
.empty-state .icon, .error-state .icon { margin: 0 auto 12px; width: 34px; height: 34px; opacity: .5; }
.empty-state .icon svg, .error-state .icon svg { width: 100%; height: 100%; }

/* ---------- LOADING ---------- */

.spinner {
    width: 15px; height: 15px; border-radius: 50%;
    border: 2px solid rgba(0,0,0,.25); border-top-color: #000;
    animation: spin .7s linear infinite;
}
.btn.secondary .spinner, .btn.danger .spinner { border-color: rgba(255,255,255,.25); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, rgba(255,255,255,.03) 25%, rgba(255,255,255,.08) 37%, rgba(255,255,255,.03) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- TOAST ---------- */

#toast-container {
    position: fixed; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100;
}
.toast {
    background: rgba(10,10,10,0.85);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-left: 2px solid var(--text-muted);
    padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; min-width: 220px;
    animation: slidein .2s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
@keyframes slidein { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }

/* ---------- AUTH PAGE ---------- */

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; z-index: 1; }
.auth-card { width: 100%; max-width: 360px; padding: 34px 30px; border-radius: 18px; }
.auth-card .brand { text-align: center; margin-bottom: 26px; }
.auth-card .brand .icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-bottom: 10px; }
.auth-card .brand .icon .brand-photo { width: 30px; height: 30px; }
.auth-card .brand .icon svg { width: 30px; height: 30px; }
.auth-card .brand h1 { margin: 5px 0 6px; background: linear-gradient(110deg, #ffffff 0%, #cfe2ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 25px; font-weight: 800; line-height: 1.05; letter-spacing: .06em; text-shadow: 0 0 22px rgba(185,217,255,.14); }
.auth-card .brand p { max-width: 240px; margin: 0 auto; color: rgba(237,237,237,.68); font-size: 12px; font-weight: 600; letter-spacing: .06em; line-height: 1.5; }
.auth-error { color: var(--danger); font-size: 12.5px; margin-top: 4px; min-height: 16px; }

/* ---------- BANNER SLIDER ---------- */

/* (banner-slider lama sudah digantikan .account-banner.has-image di atas) */

/* ---------- MISC ICON UTIL ---------- */

.icon { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.icon svg { display: block; }

/* ---------- MOBILE / IOS RESPONSIVE POLISH ---------- */

html { overflow-x: hidden; }
body { overflow-x: hidden; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, .btn, .sidebar-link, .nav-box, .back-btn, .menu-toggle { touch-action: manipulation; }

@media (max-width: 860px) {
    .sidebar {
        padding-top: calc(18px + env(safe-area-inset-top));
        padding-bottom: calc(42px + env(safe-area-inset-bottom));
        box-shadow: 18px 0 50px rgba(0,0,0,.42);
    }
    .main {
        width: 100%;
        max-width: none;
        padding-top: calc(16px + env(safe-area-inset-top));
        padding-bottom: calc(32px + env(safe-area-inset-bottom));
    }
    .topbar { min-height: 38px; margin-bottom: 18px; }
    .topbar-left { min-width: 0; }
    .topbar-identity { min-width: 0; gap: 6px; overflow: hidden; }
    .topbar-brand { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
    .topbar h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
    .topbar .role-badge { flex: 0 0 auto; padding: 4px 8px; font-size: 10px; }
    .menu-toggle, .back-btn { flex: 0 0 38px; width: 38px; height: 38px; }
    .account-banner.has-image { min-height: 360px; aspect-ratio: auto; padding: 24px 20px; }
    .account-banner .banner-brand { font-size: clamp(24px, 8vw, 34px); overflow-wrap: anywhere; }
    .account-banner .banner-subtitle { max-width: 270px; margin-bottom: 20px; font-size: 10px; }
    .account-grid { gap: 14px 12px; margin-top: 18px; }
    .nav-box { min-height: 72px; padding: 12px; }
    .card { min-width: 0; padding: 16px; }
    .page-intro h2 { font-size: 21px; }
    .page-intro p { max-width: 600px; font-size: 12px; }
    .dashboard-stats .stat-card, .compact-stats .stat-card { min-height: 96px; }
    .xmessage-modal { max-height: calc(100dvh - 24px); padding: 18px; border-radius: 14px; }
    .xmessage-overlay { padding: 12px; padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}

@media (max-width: 600px) {
    .bottom-navigation { width: calc(100% + 8px); max-width: none; margin-left: -4px; justify-content: center; border-radius: 12px; gap: 9px; padding: 9px; }
    .bottom-navigation .nav-box { flex: 1 1 calc(50% - 9px); min-width: 0; min-height: 70px; }
    .main { padding-left: 14px; padding-right: 14px; }
    .topbar { gap: 8px; }
    .topbar-divider { display: none; }
    .topbar-brand { max-width: 36vw; }
    .topbar h1 { font-size: 15px; }
    .account-banner { border-radius: 14px; }
    .account-banner.has-image { min-height: 390px; }
    .account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .account-grid .stat .val { overflow-wrap: anywhere; }
    .nav-box-grid { grid-template-columns: 1fr; gap: 8px; }
    .nav-box { min-height: 62px; }
    .status-item { min-width: 50%; padding: 12px 13px; }
    .page-intro { margin-bottom: 15px; }
    .page-intro .btn, .page-intro a.btn { width: 100%; min-height: 42px; }
    .section-heading { flex-direction: column; }
    .pair-steps { margin-bottom: 18px; }
    .pair-step small { font-size: 9px; }
    .pair-steps i { margin-left: 4px; margin-right: 4px; }
    .modal-actions { grid-template-columns: 1fr; }
    .confirm-summary div { align-items: flex-start; flex-direction: column; gap: 3px; }
    .confirm-summary strong { text-align: left; }
    .job-log-entry { gap: 7px; }
    .job-log-entry time { font-size: 10px; }
    table { min-width: 560px; }
    .card:has(table) { overflow-x: auto; }
    .profile-layout { gap: 10px; }
    .profile-identity { align-items: center; text-align: center; }
    .auth-wrap { min-height: 100dvh; padding: 16px; padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
    .auth-card { max-width: 400px; padding: 28px 20px; }
    .auth-card .brand h1 { font-size: 23px; }
    input, select, textarea { min-height: 44px; font-size: 16px; }
    textarea { min-height: 92px; }
    .btn { min-height: 44px; }
}

@media (max-width: 380px) {
    .main { padding-left: 11px; padding-right: 11px; }
    .topbar-brand { max-width: 31vw; font-size: 13px; }
    .topbar h1 { font-size: 14px; }
    .role-badge { max-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .account-banner.has-image { min-height: 420px; padding: 20px 16px; }
    .account-grid { gap: 13px 8px; }
    .account-grid .stat .label { font-size: 9px; }
    .account-grid .stat .val { font-size: 12px; }
}