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

/* ── Tokens ── */
:root {
  --sb-bg:        #0f172a;
  --sb-bg-2:      #0b1220;
  --sb-line:      rgba(255,255,255,0.06);
  --sb-ink:       rgba(255,255,255,0.78);
  --sb-ink-dim:   rgba(255,255,255,0.50);
  --sb-ink-mute:  rgba(255,255,255,0.36);
  --sb-active-bg: rgba(255,255,255,0.07);

  --brand:        #3a52c4;
  --brand-2:      #2e41a8;
  --brand-soft:   #eef1fb;
  --seti-red:     #b91c1c;

  --st-ok:    #16a34a;
  --st-warn:  #d97706;
  --st-err:   #dc2626;
  --st-info:  #2563eb;
  --st-mute:  #9ca3af;

  --bg:        #f6f7f9;
  --surface:   #ffffff;
  --line:      #e7e9ee;
  --line-soft: #eef0f4;
  --hover:     #f8f9fb;

  --ink:       #0f172a;
  --ink-2:     #2c3344;
  --ink-3:     #5b6478;
  --ink-4:     #8a93a8;
  --ink-5:     #b6bcce;

  --font-sans: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --r-md: 8px; --r-lg: 10px; --r-xl: 12px;
  --shadow-pop: 0 16px 40px -12px rgba(15,23,42,.24), 0 2px 6px rgba(15,23,42,.06);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink-2);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 13.5px;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { text-decoration: none; color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d6dbe6; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.mono { font-family: var(--font-mono); letter-spacing: -0.01em; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-4); }
.right { margin-left: auto; }
.gap-2 { display: flex; gap: 8px; align-items: center; }
.gap-3 { display: flex; gap: 12px; align-items: center; }
.hr { height: 1px; background: var(--line-soft); margin: 14px 0; border: 0; }
.col-num { text-align: right; font-variant-numeric: tabular-nums; }
.col-mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-3); }
.col-strong { color: var(--ink); font-weight: 500; }
.text-right { text-align: right; }

/* ── App shell ── */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  min-height: 720px;
}

/* ── Sidebar ── */
.sb {
  background: var(--sb-bg);
  color: var(--sb-ink);
  display: flex; flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--sb-line);
}
.sb__logo {
  padding: 20px 22px 18px 22px;
  display: flex; align-items: center;
}
.sb__mark {
  width: 26px; height: 26px;
  background-image: url('/assets/seticom-mark.png');
  background-size: contain; background-repeat: no-repeat; background-position: center;
  flex: 0 0 26px;
}
.sb__brand {
  color: #fff; font-weight: 600; letter-spacing: 0.02em;
  font-size: 15.5px;
}
.sb__section {
  padding: 22px 22px 8px 22px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sb-ink-mute);
  font-weight: 500;
}
.sb__nav { padding: 0 12px; display: flex; flex-direction: column; gap: 1px; }
.sb__item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--sb-ink-dim);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 400;
  border: none; background: transparent;
  text-align: left; width: 100%;
  text-decoration: none;
  transition: background 100ms, color 100ms;
}
.sb__item:hover { background: var(--sb-active-bg); color: #fff; }
.sb__item.active {
  background: var(--sb-active-bg);
  color: #fff;
  font-weight: 500;
}
.sb__icon { width: 17px; height: 17px; flex: 0 0 17px; opacity: .9; }
.sb__item.active .sb__icon { opacity: 1; }
.sb__spacer { flex: 1; }
.sb__user {
  margin: 12px;
  padding: 12px;
  border-top: 1px solid var(--sb-line);
  display: flex; align-items: center; gap: 10px;
}
.sb__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #1e293b; color: rgba(255,255,255,.8);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 500;
  flex: 0 0 32px;
}
.sb__userinfo { flex: 1; min-width: 0; }
.sb__name { color: #fff; font-size: 13px; font-weight: 500; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb__role { color: var(--sb-ink-mute); font-size: 11.5px; margin-top: 1px; }
.sb__signout {
  background: transparent; border: 0; color: var(--sb-ink-dim);
  width: 28px; height: 28px; border-radius: 6px;
  cursor: pointer; display: grid; place-items: center; padding: 0;
}
.sb__signout:hover { background: var(--sb-active-bg); color: #fff; }

/* ── Main area ── */
.main { min-width: 0; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  height: 60px; padding: 0 28px;
  display: flex; align-items: center; gap: 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.pagetitle { font-size: 18px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.pagesub { color: var(--ink-4); font-size: 13px; margin-top: 1px; }
.topbar__spacer { flex: 1; }
.syncpill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--ink-3);
}
.syncpill__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--st-ok);
  box-shadow: 0 0 0 3px rgba(22,163,74,.15);
  flex: 0 0 7px;
}
.topbar__iconbtn {
  width: 34px; height: 34px; border-radius: 8px;
  background: transparent; border: 1px solid transparent;
  color: var(--ink-3); cursor: pointer;
  display: grid; place-items: center; position: relative;
}
.topbar__iconbtn:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.topbar__dot {
  position: absolute; top: 8px; right: 8px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--st-err);
}

.content { flex: 1; overflow: auto; padding: 24px 28px 60px 28px; }

/* ── Metrics container ── */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: 20px;
}
.metric {
  padding: 20px 20px 22px 20px;
  border-right: 1px solid var(--line-soft);
  min-width: 0;
}
.metric:last-child { border-right: 0; }
.metric__label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--ink-4);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.metric__value {
  font-size: 26px; font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.025em;
  margin-top: 8px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.metric__sub { font-size: 12px; color: var(--ink-4); margin-top: 8px; }

/* ── Panels ── */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
}
.panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px 22px;
}
.panel__title { font-size: 14.5px; font-weight: 600; color: var(--ink); letter-spacing: -0.005em; }
.panel__sub { font-size: 12.5px; color: var(--ink-4); margin-top: 2px; }
.panel__body { padding: 0 22px 18px 22px; }
.panel__body--flush { padding: 0; overflow-x: auto; }
.panel__tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel__foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px; color: var(--brand);
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer;
}
.panel__foot:hover { background: var(--hover); }

/* ── Grid layouts ── */
.grid-row { display: grid; gap: 16px; margin-bottom: 16px; }
.grid-3-1 { grid-template-columns: 1.1fr 1fr 1.15fr; }
.grid-2   { grid-template-columns: 1fr 1fr; }
.grid-7-3 { grid-template-columns: 7fr 3fr; }

/* ── Activity feed ── */
.activity { padding: 4px 22px 8px 22px; }
.activity__item {
  display: grid; grid-template-columns: 16px 1fr auto;
  gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.activity__item:last-child { border-bottom: 0; }
.activity__dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 6px;
}
.activity__dot--info { background: var(--st-info); }
.activity__dot--ok   { background: var(--st-ok); }
.activity__dot--warn { background: var(--st-warn); }
.activity__dot--err  { background: var(--st-err); }
.activity__msg  { font-size: 13px; color: var(--ink); line-height: 1.4; }
.activity__meta { font-size: 12px; color: var(--ink-4); margin-top: 2px; }
.activity__time { font-size: 12px; color: var(--ink-4); white-space: nowrap; }

/* ── Donut ── */
.donutwrap { display: flex; align-items: center; gap: 18px; padding: 10px 22px 22px 22px; }
.donut { width: 150px; height: 150px; flex: 0 0 150px; }
.donutlegend { flex: 1; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.donutlegend__row { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; }
.donutlegend__dot { width: 9px; height: 9px; border-radius: 50%; }
.donutlegend__name { color: var(--ink); font-weight: 500; }
.donutlegend__sub  { font-size: 12px; color: var(--ink-4); margin-top: 1px; }
.donutlegend__val  { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 500; }

/* ── Tables ── */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table thead th {
  text-align: left; font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.10em; text-transform: uppercase; color: var(--ink-4);
  padding: 12px 22px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
.table tbody td {
  padding: 14px 22px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
  color: var(--ink-2);
  vertical-align: middle;
}
.table tbody tr:hover td { background: var(--hover); }
.table tbody tr:last-child td { border-bottom: 0; }
.table--compact tbody td { padding: 11px 22px; }
/* Tabela wide — width:auto + padding compacto para 16 colunas caberem na viewport */
.table--wide { width: auto; min-width: 100%; }
.table--wide thead th,
.table--wide tbody td,
.table--wide tfoot td { padding-left: 9px; padding-right: 9px; font-size: 11.5px; white-space: nowrap; }
.table--wide thead th { padding-top: 10px; padding-bottom: 10px; }
.table--wide tbody td { padding-top: 11px; padding-bottom: 11px; }
.table tfoot td {
  padding: 14px 22px; background: var(--hover);
  font-weight: 600; color: var(--ink);
  border-top: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums;
}

/* ── Status dot ── */
.stat { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.stat__dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.stat--ok   .stat__dot { background: var(--st-ok); }
.stat--warn .stat__dot { background: var(--st-warn); }
.stat--err  .stat__dot { background: var(--st-err); }
.stat--info .stat__dot { background: var(--st-info); }
.stat--mute .stat__dot { background: var(--st-mute); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 7px;
  font-size: 13px; font-weight: 500;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background 100ms;
  white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn--primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn--primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-3); }
.btn--ghost:hover { background: var(--hover); color: var(--ink); }
.btn--sm { padding: 5px 10px; font-size: 12px; }
.btn--link { background: transparent; border: 0; color: var(--brand); padding: 0; font-weight: 500; }
.btn svg { flex: 0 0 auto; }

/* ── Inputs ── */
.input, .select {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 7px; padding: 7px 11px;
  font-size: 13px; color: var(--ink);
  outline: none;
  transition: border 100ms, box-shadow 100ms;
}
.input:focus, .select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(58,82,196,.12);
}
.input--search {
  background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a93a8' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5'/></svg>") no-repeat 11px center;
  padding-left: 32px;
  min-width: 220px;
}
.select {
  appearance: none;
  background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235b6478' stroke-width='2' stroke-linecap='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right 8px center;
  padding-right: 28px;
}
.field-group { display: flex; align-items: center; gap: 8px; }
.formfield { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.formfield label { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.formfield input, .formfield select {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 7px; padding: 10px 12px;
  font-size: 13.5px; color: var(--ink); outline: none;
  transition: border 100ms, box-shadow 100ms;
}
.formfield input:focus, .formfield select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(58,82,196,.12);
}

/* ── Login ── */
.login {
  min-height: 100vh; display: grid; place-items: center;
  background: var(--bg); padding: 24px;
}
.login__card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 36px 36px 28px 36px;
}
.login__brand { display: flex; align-items: center; margin-bottom: 30px; }
.login__mark {
  width: 30px; height: 30px;
  background-image: url('/assets/seticom-mark.png');
  background-size: contain; background-repeat: no-repeat; background-position: center;
  flex: 0 0 30px;
}
.login__name { font-weight: 600; color: var(--ink); font-size: 17px; letter-spacing: 0.01em; }
.login__name em { font-style: normal; font-weight: 400; color: var(--ink-4); }
.login__title { font-size: 17px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.login__sub { font-size: 13px; color: var(--ink-4); margin-top: 4px; margin-bottom: 24px; }
.login__row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 2px 0 22px 0; font-size: 12.5px;
}
.login__row a { color: var(--brand); font-weight: 500; }
.login__row label { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-3); }
.login__cta { width: 100%; justify-content: center; padding: 11px; }
.login__foot {
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  text-align: center; color: var(--ink-4); font-size: 11.5px;
}

/* ── Modal ── */
.modal__backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 24px;
}
.modal {
  /* Sobrescreve Bootstrap: display:none, position:fixed, height:100%, top:0, left:0 */
  display: block !important;
  position: relative !important;
  height: auto !important;
  top: auto !important; left: auto !important;
  overflow-x: unset !important; overflow-y: unset !important;
  z-index: 10000;
  width: 100%; max-width: 520px;
  background: var(--surface); border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.modal--wide { max-width: 720px; }
.modal__head {
  padding: 20px 24px 14px 24px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.modal__title { font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.modal__sub { color: var(--ink-4); font-size: 13px; margin-top: 4px; }
.modal__body { padding: 0 24px 6px 24px; }
.modal__foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 24px 18px 24px;
  border-top: 1px solid var(--line-soft);
  margin-top: 6px;
}

/* ── Tabs ── */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); padding: 0 22px; }
.tab {
  padding: 14px 0 13px 0; font-size: 13.5px; color: var(--ink-3);
  border-bottom: 2px solid transparent; cursor: pointer; font-weight: 500;
  margin-bottom: -1px;
}
.tab--active { color: var(--ink); border-bottom-color: var(--ink); }

/* ── Tree ── */
.tree { padding: 12px 8px 16px 12px; font-size: 13px; }
.tree__node {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; border-radius: 5px; cursor: pointer;
  color: var(--ink-2);
}
.tree__node:hover { background: var(--hover); }
.tree__node--active { background: var(--hover); color: var(--ink); font-weight: 500; }
.tree__caret { color: var(--ink-4); transition: transform 120ms; flex: 0 0 14px; }
.tree__caret--open { transform: rotate(90deg); }
.tree__count { margin-left: auto; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-4); }
.tree__indent-1 { padding-left: 24px; }
.tree__indent-2 { padding-left: 42px; }

/* ── Storage ── */
.storage__head { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 22px 4px 22px; }
.storage__label { font-size: 13px; color: var(--ink-3); }
.storage__pct { font-size: 22px; font-weight: 600; color: var(--ink); letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.storage__bar { margin: 14px 22px; height: 6px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.storage__bar > i { display: block; height: 100%; background: var(--ink); border-radius: 3px; }
.storage__meta { display: flex; justify-content: space-between; padding: 0 22px; font-size: 12.5px; color: var(--ink-4); }
.storage__avail { padding: 12px 22px 4px 22px; font-size: 13px; color: var(--ink-3); }

/* ── Path input ── */
.path {
  display: flex; align-items: center; gap: 8px;
  background: var(--hover); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 12px; font-family: var(--font-mono); font-size: 13px; color: var(--ink);
}
.path input { flex: 1; background: transparent; border: 0; outline: none; font-family: var(--font-mono); }

/* ── Pagination ── */
.pag {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px; border-top: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--ink-4);
}
.pag__ctrls { display: flex; gap: 4px; }
.pag__btn {
  min-width: 28px; height: 28px; padding: 0 8px;
  border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-3);
  display: grid; place-items: center; cursor: pointer; font-size: 12.5px;
}
.pag__btn:hover { background: var(--hover); color: var(--ink); }
.pag__btn--active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ── KV ── */
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 24px; font-size: 13.5px; }
.kv dt { color: var(--ink-4); }
.kv dd { margin: 0; color: var(--ink); font-weight: 500; font-family: var(--font-mono); font-size: 12.5px; }

/* ── Icon button ── */
.iconbtn {
  width: 28px; height: 28px; border-radius: 6px;
  background: transparent; border: 0; color: var(--ink-4);
  cursor: pointer; display: inline-grid; place-items: center; padding: 0;
}
.iconbtn:hover { background: var(--hover); color: var(--ink); }

/* ── Page header (compat) ── */
.page-header {
  padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.page-header h1 {
  font-size: 18px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.01em; margin: 0;
}
.page-body { padding: 0 28px 60px 28px; }

/* ── Blazor ── */
#blazor-error-ui {
  background: #fff3cd; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
  display: none; left: 0; padding: .6rem 1.25rem;
  position: fixed; width: 100%; z-index: 1000;
}
.blazor-error-boundary {
  background: #b32121; padding: 1rem; color: white; border-radius: 4px;
}

/* ── Sidebar toggle / collapse ── */
.sb__logo-full { display: block; }
.sb__logo-icon { display: none; }
.sb__toggle {
  background: transparent; border: 0; color: var(--sb-ink-dim);
  width: 24px; height: 24px; border-radius: 5px;
  cursor: pointer; display: grid; place-items: center; padding: 0;
  flex: 0 0 24px; transition: transform 220ms ease, background 100ms;
}
.sb__toggle:hover { background: var(--sb-active-bg); color: #fff; }
.sb__toggle--c { transform: rotate(180deg); }

.app--sb-collapsed { grid-template-columns: 52px 1fr; }
.app--sb-collapsed .sb__logo { padding: 18px 0 16px 0; justify-content: center; }
.app--sb-collapsed .sb__logo-full { display: none; }
.app--sb-collapsed .sb__logo-icon { display: flex; align-items: center; justify-content: center; }
.app--sb-collapsed .sb__section { display: none; }
.app--sb-collapsed .sb__nav { padding: 0 6px; }
.app--sb-collapsed .sb__item { justify-content: center; padding: 10px 0; }
.app--sb-collapsed .sb__item-text { display: none; }
.app--sb-collapsed .sb__user { padding: 10px 8px; justify-content: center; gap: 0; border-top: 0; }
.app--sb-collapsed .sb__userinfo,
.app--sb-collapsed .sb__signout { display: none; }

/* ── Live badge ── */
.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(220,38,38,.08); border: 1px solid rgba(220,38,38,.20);
  border-radius: 999px; padding: 3px 10px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em;
  color: #dc2626; text-transform: uppercase;
}
.live-badge__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #dc2626; flex: 0 0 6px;
  animation: livePulse 1.6s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .28; }
}

/* ── Live feed ── */
.live { display: flex; flex-direction: column; }
.live__item {
  position: relative; overflow: hidden;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line-soft);
}
.live__item:last-child { border-bottom: 0; }
.live__bar {
  position: absolute; bottom: 0; left: 0;
  height: 2px; width: 0; background: var(--brand);
  border-radius: 0 2px 2px 0;
}
.live__item--new { animation: liveSlide 0.35s ease-out; }
.live__item--new .live__bar { animation: liveFill 2s ease-out forwards; }
.live__row {
  display: grid; grid-template-columns: 10px 1fr auto;
  gap: 12px; align-items: start;
}
@keyframes liveFill {
  0%   { width: 0; opacity: 1; }
  70%  { width: 100%; opacity: 1; }
  100% { width: 100%; opacity: .4; }
}
@keyframes liveSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Chart stats footer ── */
.chart-stats {
  display: flex;
  border-top: 1px solid var(--line-soft);
  margin-top: 4px;
}
.chart-stat {
  flex: 1; padding: 12px 16px;
  border-right: 1px solid var(--line-soft);
}
.chart-stat:last-child { border-right: 0; }
.chart-stat__val {
  font-size: 18px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1;
}
.chart-stat__lbl {
  font-size: 10.5px; color: var(--ink-4); margin-top: 3px;
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500;
}

/* ── At-risk list ── */
.atrisk { margin-top: 10px; border-top: 1px solid var(--line-soft); }
.atrisk__lbl {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-4); font-weight: 500;
  padding: 10px 22px 6px 22px;
}
.atrisk__row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 22px; gap: 12px;
  border-top: 1px solid var(--line-soft);
}
.atrisk__name { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.atrisk__cnpj { font-size: 11px; color: var(--ink-4); font-family: var(--font-mono); margin-top: 1px; }
.atrisk__scroll { height: 220px; overflow-y: auto; }

/* ── TV / fullscreen button ── */
.tv-btn {
  width: 34px; height: 34px; border-radius: 8px;
  background: transparent; border: 1px solid transparent;
  color: var(--ink-4); cursor: pointer;
  display: grid; place-items: center;
  transition: background 100ms, border-color 100ms, color 100ms;
}
.tv-btn:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.tv-btn--active { background: var(--ink); border-color: var(--ink); color: #fff; }
.tv-btn--active:hover { background: var(--ink-2); }

/* ── Alertas de aviso (Ticket 3094 / 3095) ── */
.panel--warn {
    border-left: 3px solid var(--yellow, #f59e0b);
}
.metric--warn .metric__value {
    color: var(--red, #dc2626);
}

/* Elementos visíveis só no print */
.print-nota { display: none; }
#relatorio-print { display: none; }

/* ── Impressão ── */
@page {
  size: A4 landscape;
  margin: 12mm 14mm;
}

@media print {
  /* Oculta tudo exceto o bloco de impressão */
  .sb, .topbar, .topbar__spacer, .btn, button,
  .formfield, select, input[type="date"],
  .metrics, .screen-only,
  .print-hidden { display: none !important; }

  /* Layout limpo sem scroll/overflow */
  html, body { overflow: visible !important; height: auto !important; }
  .app { display: block !important; }
  .main { padding: 0 !important; margin: 0 !important; overflow: visible !important; }
  .content { padding: 0 !important; overflow: visible !important; }

  /* Nota rodapé — só aparece no print */
  .print-nota {
    display: block !important;
    font-size: 9px;
    color: #64748b;
    margin-top: 10px;
    font-style: italic;
  }

  /* Bloco de impressão */
  #relatorio-print {
    display: block !important;
    width: 100% !important;
  }

  /* Tabela de impressão — 9 colunas, layout fixo */
  .print-table {
    width: 100% !important;
    table-layout: fixed !important;
    font-size: 10px !important;
    border-collapse: collapse !important;
  }
  .print-table th,
  .print-table td {
    padding: 4px 6px !important;
    border: 1px solid #94a3b8 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    vertical-align: middle !important;
    font-size: 10px !important;
  }
  .print-table thead th {
    background: #1e293b !important;
    color: #fff !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    text-align: center !important;
  }
  .print-table tbody tr:nth-child(even) td { background: #f8fafc !important; }
  .print-table tfoot td {
    background: #e2e8f0 !important;
    font-weight: 700 !important;
  }

  /* thead repetida em cada página, tfoot no final */
  .print-table thead { display: table-header-group; }
  .print-table tfoot { display: table-footer-group; }

  /* Não quebra no meio de uma linha */
  .print-table tr { page-break-inside: avoid; }
}
