:root {
  --bg: #f3f6fb;
  --card: #fff;
  --line: #e3e8f1;
  --text: #17213a;
  --text-2: #5b6782;
  --brand: #1167e8;
  --brand-dark: #0a3d91;
  --teal: #00c2b8;
  --good: #11a36b;
  --warn: #c98100;
  --bad: #d93545;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 14px; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }

.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 600; letter-spacing: .2px; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand b { color: var(--teal); font-weight: 700; }
.brand.big { font-size: 26px; justify-content: center; }
.brand.big img { width: 48px; height: 48px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand) 55%, var(--teal)); }
.login-card { width: min(380px, 92vw); background: #fff; border-radius: 16px; padding: 32px 30px;
  box-shadow: 0 24px 60px rgba(4, 22, 60, .35); display: flex; flex-direction: column; gap: 14px; }
.login-card .muted { text-align: center; margin: -6px 0 6px; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; }
input, select { font: inherit; color: var(--text); padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; outline: none; }
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(17, 103, 232, .15); }
.form-error { color: var(--bad); font-size: 13px; margin: 0; min-height: 1em; }
.form-error:empty { display: none; }

.btn { font: inherit; font-weight: 600; border: 1px solid transparent; border-radius: 8px; padding: 8px 14px;
  cursor: pointer; background: #eef2f9; color: var(--text); white-space: nowrap; }
.btn:hover { filter: brightness(.97); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: #0d5ad0; }
.btn.danger { background: #fdecee; color: var(--bad); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.wide { width: 100%; padding: 11px; }
.btn:disabled { opacity: .5; cursor: default; }

/* layout */
.app { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: #0b1830; color: #dfe7f7; padding: 20px 14px; display: flex; flex-direction: column; gap: 24px;
  position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 0 8px; color: #fff; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: #b9c5de; text-decoration: none; padding: 9px 10px; border-radius: 8px; display: flex; gap: 10px;
  align-items: center; font-weight: 500; }
.side nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side nav a.active { background: linear-gradient(90deg, rgba(17, 103, 232, .45), rgba(0, 194, 184, .18)); color: #fff; }
.ic { width: 18px; text-align: center; opacity: .85; }
.side-foot { margin-top: auto; padding: 12px 10px; border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.side-foot .muted { color: #8796b5; }
.side-foot .btn.ghost { color: #dfe7f7; border-color: rgba(255, 255, 255, .18); }
.me { font-weight: 600; }

.content { padding: 28px 34px; min-width: 0; }
.page { display: flex; flex-direction: column; gap: 18px; max-width: 1200px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(16, 34, 70, .04); overflow-x: auto; }
.card.narrow { max-width: 420px; display: flex; flex-direction: column; gap: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.stat-label { color: var(--text-2); font-size: 13px; }
.stat-value { font-size: 30px; font-weight: 700; margin-top: 6px; color: var(--brand-dark); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar input { flex: 1; min-width: 240px; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-2);
  font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.empty { text-align: center; color: var(--text-2); padding: 26px; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.mono { font-family: ui-monospace, Consolas, monospace; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px;
  border-radius: 999px; background: #eef2f9; color: var(--text-2); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.good { background: #e3f6ee; color: var(--good); }
.pill.warn { background: #fff3dc; color: var(--warn); }
.pill.bad { background: #fdecee; color: var(--bad); }
.pill.live { background: #e6f0fe; color: var(--brand); }

.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }

.modal { position: fixed; inset: 0; background: rgba(9, 20, 42, .45); display: grid; place-items: center; z-index: 10; }
.dialog { width: min(420px, 92vw); background: #fff; border-radius: 14px; padding: 22px 24px;
  box-shadow: 0 24px 60px rgba(4, 22, 60, .3); display: flex; flex-direction: column; gap: 14px; }
.dialog h2 { margin: 0; font-size: 17px; }
#modal-body { display: flex; flex-direction: column; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #0b1830; color: #fff;
  padding: 10px 18px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); z-index: 20; }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { margin: 0; border: 0; flex-direction: row; align-items: center; }
  .content { padding: 18px; }
}

/* manual de uso */
.manual section h2 { font-size: 18px; margin-bottom: 10px; }
.manual h3 { font-size: 15px; margin: 4px 0 8px; display: flex; align-items: center; gap: 8px; }
.manual p, .manual li { line-height: 1.55; }
.manual code { background: #eef2f9; padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.manual-toc { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.manual-toc a { color: var(--brand); text-decoration: none; font-weight: 500; }
.manual-toc a:hover { text-decoration: underline; }
.m-step { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 24px; align-items: start;
  padding: 14px 0; border-top: 1px solid var(--line); }
.m-step:first-of-type { border-top: 0; }
.m-step figure { margin: 0; }
.m-step img, .manual figure.wide img { width: 100%; border-radius: 10px; border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(16, 34, 70, .12); background: #0b1830; }
.manual figure.wide { margin: 6px 0 14px; max-width: 760px; }
.manual figcaption { font-size: 12px; color: var(--text-2); margin-top: 6px; text-align: center; }
.m-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand);
  color: #fff; font-size: 13px; font-weight: 700; flex: none; }
@media (max-width: 900px) { .m-step { grid-template-columns: 1fr; } }
