/* RemoteDesk Console — tema compacto original */
:root {
    --bg: #f3f5fa;
    --card: #ffffff;
    --border: #e5e9f2;
    --ink: #0f172a;
    --mut: #64748b;
    --mut2: #94a3b8;
    --acc: #4f46e5;
    --acc-soft: #eef0ff;
    --ok: #16a34a;
    --ok-soft: #e8f7ee;
    --warn: #d97706;
    --warn-soft: #fef3e2;
    --bad: #dc2626;
    --bad-soft: #fdecec;
    --side: #151b31;
    --side2: #1e2542;
    --shadow: 0 1px 2px rgba(15, 23, 42, .05);
    --r: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 12.5px;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── layout ── */
.side {
    position: fixed; inset: 0 auto 0 0; width: 216px; z-index: 40;
    background: linear-gradient(180deg, #1a2140 0%, #12172e 100%);
    color: #c3cad9; display: flex; flex-direction: column;
    transition: width .18s ease;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 13px 15px 11px; color: #fff; }
.brand .bolt {
    width: 26px; height: 26px; border-radius: 7px; flex: none;
    background: linear-gradient(135deg, #6366f1, #4338ca);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800; color: #fff;
}
.brand b { font-size: 13.5px; letter-spacing: .2px; white-space: nowrap; }
.brand small { display: block; font-size: 9.5px; color: #8b93ad; font-weight: 400; }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.nav .sec { font-size: 9.5px; text-transform: uppercase; letter-spacing: .8px; color: #6b7490; padding: 12px 8px 5px; white-space: nowrap; }
.nav a.it {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 9px; border-radius: 7px; color: #c3cad9;
    font-size: 12px; margin-bottom: 1px; white-space: nowrap;
}
.nav a.it:hover { background: rgba(255, 255, 255, .06); text-decoration: none; color: #fff; }
.nav a.it.on { background: rgba(99, 102, 241, .22); color: #fff; }
.nav a.it .ic { width: 20px; text-align: center; font-size: 13px; flex: none; }
.nav a.it .n { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav a.it .c { font-size: 10px; background: rgba(255, 255, 255, .12); border-radius: 8px; padding: 0 6px; }
.side .foot { padding: 10px 12px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 10.5px; color: #8b93ad; white-space: nowrap; }
body.sb-min .side { width: 60px; }
body.sb-min .brand b, body.sb-min .brand small, body.sb-min .nav .sec,
body.sb-min .nav a.it .n, body.sb-min .nav a.it .c, body.sb-min .side .foot { display: none; }
body.sb-min .nav a.it { justify-content: center; padding: 8px 0; }
.main { margin-left: 216px; min-height: 100vh; transition: margin .18s ease; }
body.sb-min .main { margin-left: 60px; }
.top {
    position: sticky; top: 0; z-index: 30; height: 48px;
    background: #fff; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px; padding: 0 18px;
}
.top .burger { border: 0; background: none; font-size: 15px; cursor: pointer; color: var(--mut); padding: 6px; border-radius: 6px; }
.top .burger:hover { background: var(--bg); }
.top h1 { font-size: 13.5px; margin: 0; font-weight: 650; }
.top .sp { flex: 1; }
.top .me { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.avatar {
    width: 26px; height: 26px; border-radius: 50%; flex: none;
    background: linear-gradient(135deg, #6366f1, #4338ca); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700;
}
.wrap { padding: 16px 18px 30px; max-width: 1240px; }

/* ── cards / stats ── */
.grid { display: grid; gap: 12px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); }
.card .hd { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: 650; font-size: 12.5px; }
.card .hd .sp { flex: 1; }
.card .bd { padding: 12px 14px; }
.card .bd.flush { padding: 0; }
.stat { display: flex; align-items: center; gap: 11px; padding: 13px 14px; }
.stat .si {
    width: 34px; height: 34px; border-radius: 9px; flex: none;
    display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.stat b { font-size: 19px; display: block; line-height: 1.1; }
.stat span { font-size: 11px; color: var(--mut); }

/* ── tablas densas ── */
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th {
    text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .5px;
    color: var(--mut); font-weight: 650; padding: 8px 12px;
    border-bottom: 1px solid var(--border); background: #fafbfe; white-space: nowrap;
}
.tbl td { padding: 8px 12px; border-bottom: 1px solid #f0f2f7; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #f8faff; }
.tbl .r { text-align: right; }
.tbl .c { text-align: center; }
.mono { font-family: Consolas, "Cascadia Code", monospace; font-size: 11.5px; }

/* ── badges / dots / botones ── */
.badge { display: inline-block; font-size: 10.5px; font-weight: 600; border-radius: 20px; padding: 2px 9px; white-space: nowrap; }
.b-green { background: var(--ok-soft); color: var(--ok); }
.b-gray { background: #eef1f6; color: var(--mut); }
.b-indigo { background: var(--acc-soft); color: var(--acc); }
.b-amber { background: var(--warn-soft); color: var(--warn); }
.b-red { background: var(--bad-soft); color: var(--bad); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.d-green { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.d-gray { background: #cbd5e1; }
.d-amber { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.btn {
    display: inline-block; border: 1px solid transparent; border-radius: 7px;
    font-size: 12px; font-weight: 600; padding: 6px 13px; cursor: pointer;
    background: var(--acc); color: #fff; white-space: nowrap;
}
.btn:hover { filter: brightness(.95); text-decoration: none; }
.btn.sm { font-size: 11px; padding: 4px 10px; }
.btn.ghost { background: #eef1f6; color: var(--ink); }
.btn.danger { background: var(--bad); }
.btn.line { background: #fff; border-color: var(--border); color: var(--ink); }
.btn:disabled { opacity: .55; cursor: default; }

/* ── formularios ── */
.frm { display: grid; gap: 10px; }
.frm label { font-size: 11px; font-weight: 650; color: var(--mut); display: block; margin-bottom: 4px; }
.inp, .sel, textarea.inp {
    width: 100%; border: 1px solid var(--border); border-radius: 7px;
    font-size: 12.5px; padding: 7px 10px; font-family: inherit; background: #fff; color: var(--ink);
}
.inp:focus, .sel:focus, textarea.inp:focus { outline: 2px solid rgba(79, 70, 229, .25); border-color: var(--acc); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 11px; color: var(--mut2); }
.err { background: var(--bad-soft); color: var(--bad); border-radius: 7px; padding: 8px 12px; font-size: 12px; margin-bottom: 12px; }
.okmsg { background: var(--ok-soft); color: var(--ok); border-radius: 7px; padding: 8px 12px; font-size: 12px; margin-bottom: 12px; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .sp { flex: 1; }

/* ── auth ── */
.auth-bg { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
    background: radial-gradient(1000px 500px at 20% -10%, #2b3370 0%, transparent 60%),
                radial-gradient(900px 500px at 110% 110%, #312e81 0%, transparent 55%),
                linear-gradient(180deg, #141a30, #0d1226); }
.auth-card { width: 360px; background: #fff; border-radius: 14px; padding: 26px 26px 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.auth-card h2 { margin: 0 0 2px; font-size: 16px; }
.auth-card p.sub { margin: 0 0 16px; color: var(--mut); font-size: 12px; }
.auth-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.auth-brand .bolt { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #6366f1, #4338ca);
    display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; }

/* ── toast / modal ── */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: grid; gap: 8px; }
.toast { background: #0f172a; color: #fff; font-size: 12px; border-radius: 8px; padding: 9px 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.modal-veil { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-veil.open { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 440px; max-width: 100%; max-height: 90vh; overflow: auto; }
.modal .hd { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 650; }
.modal .hd .sp { flex: 1; }
.modal .bd { padding: 14px 16px; }
.modal .ft { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.x { border: 0; background: none; font-size: 14px; cursor: pointer; color: var(--mut); }

/* ── detalle hardware ── */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 5px 10px; font-size: 12px; }
.kv dt { color: var(--mut); }
.kv dd { margin: 0; word-break: break-word; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.tabs button { border: 0; background: none; font-size: 12px; font-weight: 600; color: var(--mut); padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--acc); border-bottom-color: var(--acc); }
.tpane { display: none; }
.tpane.on { display: block; }
.empty { padding: 22px; text-align: center; color: var(--mut2); font-size: 12px; }
code.chip { background: #eef1f6; border-radius: 5px; padding: 1px 6px; font-size: 11px; }

/* ── responsive ── */
@media (max-width: 960px) {
    .g4 { grid-template-columns: repeat(2, 1fr); }
    .g3, .g2, .row2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .side { transform: translateX(-100%); width: 216px !important; }
    body.sb-open .side { transform: none; }
    body.sb-min .side { width: 216px !important; }
    body.sb-min .brand b, body.sb-min .brand small, body.sb-min .nav .sec,
    body.sb-min .nav a.it .n, body.sb-min .nav a.it .c, body.sb-min .side .foot { display: block; }
    .main, body.sb-min .main { margin-left: 0; }
    .wrap { padding: 12px; }
}
