/* ============================================================
 * RMM Mini — design system
 * ============================================================ */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef0f3;
  --border: #e3e6eb;
  --border-strong: #d2d7de;
  --text: #111827;
  --text-2: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;
  --accent: #2b59c3;
  --accent-hover: #234aa6;
  --accent-soft: #e8eefb;
  --accent-text: #1e429f;
  --ok: #15803d;      --ok-soft: #e7f6ec;
  --warn: #b45309;    --warn-soft: #fdf3e2;
  --danger: #c0262d;  --danger-soft: #fdeaea;
  --nav-bg: #0f172a;
  --nav-text: #a3adbf;
  --nav-text-hi: #f1f5f9;
  --nav-active: #1e293b;
  --nav-label: #5b6578;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 6px 24px rgba(16, 24, 40, .12);
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  --sidebar-w: 232px;
  --topbar-h: 52px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f17; --surface: #121823; --surface-2: #161d2a; --surface-3: #1c2433; --border: #232c3b; --border-strong: #2f394b;
    --text: #e6e9ef; --text-2: #c9cfda; --muted: #8b94a6; --faint: #667085;
    --accent: #5b86e5; --accent-hover: #7398ea; --accent-soft: #1b2a4a; --accent-text: #9db8f2;
    --ok: #4ade80; --ok-soft: #13291c; --warn: #fbbf24; --warn-soft: #2e2410; --danger: #f87171; --danger-soft: #331617;
    --nav-bg: #080b12; --nav-active: #151c2a; --shadow-sm: none; --shadow-md: 0 8px 30px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f17; --surface: #121823; --surface-2: #161d2a; --surface-3: #1c2433; --border: #232c3b; --border-strong: #2f394b;
  --text: #e6e9ef; --text-2: #c9cfda; --muted: #8b94a6; --faint: #667085;
  --accent: #5b86e5; --accent-hover: #7398ea; --accent-soft: #1b2a4a; --accent-text: #9db8f2;
  --ok: #4ade80; --ok-soft: #13291c; --warn: #fbbf24; --warn-soft: #2e2410; --danger: #f87171; --danger-soft: #331617;
  --nav-bg: #080b12; --nav-active: #151c2a; --shadow-sm: none; --shadow-md: 0 8px 30px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 13.5px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12px; }
h1 { font-size: 19px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 11.5px; font-weight: 600; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
svg { flex: none; }

/* ---------- estrutura ---------- */
.layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--nav-bg); color: var(--nav-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--nav-text-hi); font-weight: 650; font-size: 15px; height: var(--topbar-h); padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.06); }
.logo { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, #3a6fe0, #2347a8); display: grid; place-items: center; color: #fff; }
.logo svg { width: 15px; height: 15px; }
.nav { padding: 6px 10px 16px; }
.nav-section { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .09em; color: var(--nav-label); padding: 16px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--nav-text); padding: 7px 10px; border-radius: 6px; margin-bottom: 1px; text-decoration: none; font-size: 13px; font-weight: 500; position: relative; }
.nav a:hover { background: rgba(255,255,255,.04); color: var(--nav-text-hi); }
.nav a.active { background: var(--nav-active); color: var(--nav-text-hi); }
.nav a.active::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: #4f7ce8; }
.nav svg { width: 16px; height: 16px; opacity: .9; }
.nav-badge { margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 700; background: #334155; color: #fff; border-radius: 999px; padding: 0 7px; line-height: 18px; }
.nav-badge.hot { background: var(--danger); }
.sidebar-foot { margin-top: auto; padding: 12px 18px; border-top: 1px solid rgba(255,255,255,.06); font-size: 11.5px; color: var(--nav-label); }

.shell { display: flex; flex-direction: column; min-width: 0; }
.topbar { height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; padding: 0 24px; position: sticky; top: 0; z-index: 20; }
.crumbs-top { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; }
.crumbs-top a { color: var(--muted); }
.crumbs-top strong { color: var(--text); font-weight: 600; }
.crumbs-top .sep { color: var(--faint); }
.topsearch { position: relative; margin-left: auto; width: 300px; }
.topsearch input { width: 100%; padding-left: 32px; background: var(--surface-2); }
.topsearch > svg { position: absolute; left: 10px; top: 9px; width: 14px; height: 14px; color: var(--faint); }
.topsearch .results { position: absolute; top: 38px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); overflow: hidden; z-index: 30; }
.topsearch .results a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: var(--text); text-decoration: none; }
.topsearch .results a:hover { background: var(--surface-2); }
.usermenu-btn { display: flex; align-items: center; gap: 8px; background: none; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 4px 8px; cursor: pointer; color: var(--text); font: inherit; }
.usermenu-btn:hover { background: var(--surface-2); border-color: var(--border); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-weight: 650; font-size: 12px; text-transform: uppercase; }
.usermenu-btn .who { text-align: left; line-height: 1.2; font-size: 12.5px; font-weight: 600; }
.usermenu-btn .who small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }

.main { padding: 22px 24px 40px; min-width: 0; max-width: 1680px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; min-height: 34px; }
.page-head .spacer { flex: 1; }
.page-head .sub { color: var(--muted); font-size: 12.5px; }

/* ---------- cartões ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px 18px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-header { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-bottom: 1px solid var(--border); min-height: 48px; flex-wrap: wrap; }
.card-header h3 { margin: 0; }
.card-body { padding: 16px 18px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* ---------- botões e campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); padding: 0 12px; border-radius: var(--radius-sm); cursor: pointer; font: inherit; font-weight: 550; font-size: 13px; white-space: nowrap; text-decoration: none !important; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); border-color: var(--faint); color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn.icon { width: 32px; padding: 0; }
.btn.sm.icon { width: 28px; }
.btn svg { width: 15px; height: 15px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group .btn.on { background: var(--accent-soft); color: var(--accent-text); position: relative; z-index: 1; }

input, select, textarea { font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 10px; height: 32px; outline: none; transition: border-color .12s, box-shadow .12s; }
textarea { padding: 8px 10px; height: auto; resize: vertical; min-height: 72px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox], input[type=radio] { height: auto; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-2); font-weight: 550; }
label.field > input, label.field > select, label.field > textarea { font-weight: 400; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form-row > * { flex: 1; min-width: 150px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 3px 0; color: var(--text-2); }
.check input { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; }

/* ---------- tabelas ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tbody tr.click { cursor: pointer; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td strong { color: var(--text); font-weight: 600; }
.card.flush .tbl th:first-child, .card.flush .tbl td:first-child { padding-left: 18px; }
.card.flush .tbl th:last-child, .card.flush .tbl td:last-child { padding-right: 18px; }

/* ---------- badges, status ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 1px 8px; line-height: 19px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge svg { width: 11px; height: 11px; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--accent-soft); color: var(--accent-text); }
.badge.outline { background: transparent; border: 1px solid var(--border-strong); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--faint); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.error { color: var(--danger); font-size: 12.5px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.bar { height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bar.warn > i { background: var(--warn); }
.bar.danger > i { background: var(--danger); }
.metric { display: flex; flex-direction: column; gap: 4px; min-width: 90px; }
.metric .lbl { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.stat { padding: 14px 16px; display: flex; align-items: center; gap: 14px; }
.stat .ico { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.stat .ico svg { width: 18px; height: 18px; }
.stat .ico.ok { background: var(--ok-soft); color: var(--ok); }
.stat .ico.warn { background: var(--warn-soft); color: var(--warn); }
.stat .ico.danger { background: var(--danger-soft); color: var(--danger); }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat .v { font-size: 21px; font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums; }

dl.kv { display: grid; grid-template-columns: minmax(130px, max-content) 1fr; gap: 7px 18px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 12.5px; }
dl.kv dd { margin: 0; word-break: break-word; color: var(--text); }

/* ---------- abas, toolbar ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 550; white-space: nowrap; text-decoration: none; cursor: pointer; font-size: 13px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input[type=search] { min-width: 260px; }

/* ---------- cabeçalho da máquina ---------- */
.agent-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.agent-head .ico { width: 44px; height: 44px; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); position: relative; }
.agent-head .ico svg { width: 22px; height: 22px; }
.agent-head .ico .dot { position: absolute; right: -2px; bottom: -2px; border: 2px solid var(--bg); }
.agent-head .meta { display: flex; flex-wrap: wrap; gap: 3px 16px; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.agent-head .meta span { display: inline-flex; align-items: center; gap: 5px; }
.agent-head .meta svg { width: 13px; height: 13px; }

/* ---------- menus ---------- */
.menu-wrap { position: relative; display: inline-flex; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); min-width: 230px; padding: 5px; z-index: 40; }
.menu button, .menu a { display: flex; align-items: center; gap: 9px; width: 100%; background: none; border: 0; padding: 7px 10px; border-radius: 5px; font: inherit; font-size: 13px; color: var(--text-2); cursor: pointer; text-align: left; text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.menu button.danger { color: var(--danger); }
.menu button svg, .menu a svg { width: 15px; height: 15px; color: var(--muted); }
.menu button.danger svg { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }

/* ---------- grade de máquinas com prévia ---------- */
.machine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.mcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: border-color .12s, box-shadow .12s; display: flex; flex-direction: column; }
.mcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.mcard .thumb { aspect-ratio: 16 / 9; background: #0b0f17; position: relative; display: grid; place-items: center; color: #5b6578; font-size: 12px; overflow: hidden; }
.mcard .thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mcard .thumb .tag { position: absolute; top: 8px; left: 8px; }
.mcard .thumb .live { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.6); color: #e5e7eb; font-size: 10.5px; padding: 1px 7px; border-radius: 999px; display: flex; align-items: center; gap: 5px; }
.mcard .thumb .live i { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; }
.mcard .info { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.mcard .info .name { display: flex; align-items: center; gap: 7px; font-weight: 600; color: var(--text); }
.mcard .info .sub { color: var(--muted); font-size: 12px; }
.mcard .bars { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

/* ---------- configurações ---------- */
.settings-grid { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar-h) + 22px); display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { padding: 7px 10px; border-radius: 6px; color: var(--text-2); text-decoration: none; font-weight: 500; }
.settings-nav a:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
.section-desc { color: var(--muted); margin: -4px 0 14px; font-size: 12.5px; max-width: 760px; }
.copy-field { display: flex; gap: 6px; align-items: center; }
.copy-field code { flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; overflow-x: auto; white-space: nowrap; }
.callout { border: 1px solid var(--border); border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 12.5px; color: var(--text-2); }
.callout.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.callout.ok { border-left-color: var(--ok); }
.step { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.step:first-child { border-top: 0; padding-top: 2px; }
.step .n { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 12px; display: grid; place-items: center; }

.crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; font-family: var(--mono); font-size: 12.5px; }
.crumbs a { padding: 2px 6px; border-radius: 4px; cursor: pointer; }
.crumbs a:hover { background: var(--accent-soft); text-decoration: none; }
.crumbs span { color: var(--faint); }

.term-wrap { background: #0c0c0c; border-radius: var(--radius); padding: 8px; height: calc(100vh - 300px); min-height: 360px; border: 1px solid var(--border); }
.term-wrap .xterm { height: 100%; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login .side { background: var(--nav-bg); color: #cbd5e1; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login .side h2 { color: #fff; font-size: 26px; font-weight: 650; margin: 0 0 12px; letter-spacing: -.02em; }
.login .side p { color: #94a3b8; max-width: 440px; line-height: 1.6; margin: 0; }
.login .side ul { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 11px; color: #cbd5e1; }
.login .side li { display: flex; gap: 10px; align-items: center; }
.login .side li svg { color: #5b86e5; width: 16px; height: 16px; }
.login .form { display: grid; place-items: center; padding: 24px; background: var(--surface); }
.login .form form { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 14px; }
.login .form h1 { font-size: 22px; }
.login .form input, .login .form .btn { height: 38px; }
.brand-dark { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 650; font-size: 16px; }

/* ---------- modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(9, 13, 22, .55); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .12s ease-out; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-md); animation: pop .15s ease-out; }
.modal header { padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 14.5px; }
.modal .body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.modal footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(6px) scale(.99); opacity: 0; } }
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow-md); max-width: 400px; animation: slide .2s ease-out; font-size: 13px; }
.toast.err { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }
@keyframes slide { from { transform: translateY(8px); opacity: 0; } }

.progress-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.progress-item { display: flex; gap: 10px; align-items: center; font-size: 12.5px; }
.progress-item .bar { flex: 1; }
pre.code { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 0; font-family: var(--mono); font-size: 12px; }

/* ---------- tela remota ---------- */
.desk-stage { position: relative; background: #07090d; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; min-height: 420px; padding: 6px; border: 1px solid var(--border); }
.desk-canvas { display: block; max-width: 100%; max-height: calc(100vh - 300px); outline: none; cursor: default; }
.desk-canvas:focus { box-shadow: 0 0 0 2px var(--accent); }
.desk-overlay { position: absolute; inset: 0; display: grid; place-items: center; color: #cbd5e1; font-size: 14px; background: rgba(0,0,0,.6); border-radius: var(--radius); text-align: center; padding: 20px; }
.desk-stage:fullscreen { border-radius: 0; padding: 0; border: 0; }
.desk-stage:fullscreen .desk-canvas { max-height: 100vh; max-width: 100vw; }
.desk-stage:fullscreen .desk-canvas:focus { box-shadow: none; }
.desk-stage.drop { outline: 3px dashed var(--accent); outline-offset: -6px; }
.player-canvas { max-width: 100%; max-height: 62vh; display: block; margin: 0 auto; background: #000; }
.player-term { height: 60vh; background: #0c0c0c; padding: 6px; border-radius: 8px; overflow: auto; }
.player-bar { height: 6px; background: var(--surface-3); border-radius: 3px; cursor: pointer; position: relative; flex: 1; }
.player-bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 3px; }

.day-bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: 6px; }
.day-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 14px; }
.day-bar i { display: block; width: 100%; max-width: 36px; background: var(--accent); border-radius: 3px 3px 0 0; opacity: .85; }
.day-bar span { font-size: 10.5px; color: var(--muted); margin-top: 4px; }

.ticket-layout { display: grid; grid-template-columns: 360px 1fr; gap: 16px; align-items: start; }
.ticket-list { max-height: calc(100vh - 170px); overflow: auto; }
.ticket-item { display: flex; flex-direction: column; gap: 3px; padding: 11px 16px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.ticket-item:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.ticket-item.active { background: var(--accent-soft); }
.ticket-detail { min-height: 420px; display: flex; flex-direction: column; }
.ticket-shot { max-width: 100%; max-height: 260px; border: 1px solid var(--border); border-radius: 6px; margin: 4px 0 10px; display: block; }
.chat-thread { flex: 1; overflow: auto; max-height: 50vh; min-height: 200px; display: flex; flex-direction: column; gap: 10px; padding: 8px 2px; }
.chat-msg { max-width: 78%; display: flex; flex-direction: column; gap: 2px; }
.chat-msg.tech { align-self: flex-end; text-align: right; }
.chat-bubble { padding: 9px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); white-space: pre-wrap; text-align: left; }
.chat-msg.tech .chat-bubble { background: var(--accent); color: #fff; border-color: var(--accent); }
.report-card { color: var(--text); text-decoration: none; display: flex; flex-direction: column; gap: 6px; }
.report-card:hover { border-color: var(--accent); text-decoration: none; color: var(--text); }

@media (max-width: 1000px) {
  .settings-grid { grid-template-columns: 1fr; }
  .settings-nav { display: none; }
  .login { grid-template-columns: 1fr; }
  .login .side { display: none; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .nav-section, .sidebar-foot { display: none; }
  .topsearch { display: none; }
  .main { padding: 16px; }
  .ticket-layout { grid-template-columns: 1fr; }
  .toolbar input[type=search] { min-width: 0; flex: 1; }
}
@media print {
  .sidebar, .topbar, .no-print, #toasts, .toolbar button, .btn { display: none !important; }
  .layout { display: block; }
  .main { padding: 0; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #ccc; }
  .report-table .tbl td, .report-table .tbl th { font-size: 10.5px; padding: 4px 6px; }
}

/* ---------- monitoramento, automação, sistema, painel ---------- */
.chart { min-width: 0; }
.chart-tip { position: absolute; top: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); padding: 6px 9px; font-size: 12px; pointer-events: none; min-width: 150px; z-index: 5; }
select.sm { padding: 3px 6px; font-size: 12px; height: auto; }
.reg-item { display: flex; align-items: center; gap: 8px; padding: 5px 14px; color: var(--text); font-size: 12.5px; font-family: var(--mono); border-bottom: 1px solid var(--surface-3); }
.reg-item:hover { background: var(--surface-2); text-decoration: none; color: var(--accent); }
.reg-item svg { width: 14px; height: 14px; color: var(--warn); flex: none; }
.checks { display: flex; flex-direction: column; gap: 6px; }
.check-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.check-item summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; font-weight: 500; }
.check-item summary::-webkit-details-marker { display: none; }
.check-item summary svg { width: 14px; height: 14px; margin-left: auto; color: var(--muted); transition: transform .15s; }
.check-item[open] summary svg { transform: rotate(180deg); }
.check-item .cnt { min-width: 28px; text-align: center; font-weight: 700; border-radius: 999px; padding: 0 8px; font-variant-numeric: tabular-nums; background: var(--surface-3); }
.check-item.danger .cnt { background: var(--danger-soft); color: var(--danger); }
.check-item.warn .cnt { background: var(--warn-soft); color: var(--warn); }
.check-item.info .cnt { background: var(--accent-soft); color: var(--accent-text); }
.check-item.clear { opacity: .6; }
.check-item.clear summary { cursor: default; }
.check-item.clear .cnt { background: var(--ok-soft); color: var(--ok); }
.check-list { padding: 4px 12px 10px 50px; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; max-height: 260px; overflow: auto; }
.notes { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; }
.expanded { -webkit-line-clamp: unset !important; }
.badge svg { width: 11px; height: 11px; }
.sla-bar { padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
th.sortable:hover { color: var(--text); }

.chart-y { position: absolute; left: 0; width: 30px; text-align: right; font-size: 10px; color: var(--faint); transform: translateY(-50%); pointer-events: none; }
.chart-x { position: absolute; bottom: 2px; font-size: 10px; color: var(--faint); white-space: nowrap; pointer-events: none; }
