:root {
  --bg: #0f1412;
  --panel: #18201c;
  --ink: #eef4ef;
  --muted: #9aada3;
  --line: rgba(238, 244, 239, 0.1);
  --accent: #d4a017;
  --good: #7dcca0;
  --warn: #e0a35a;
  --bad: #e07a6a;
  font-family: "Segoe UI", "IBM Plex Sans", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

button, input, select { font: inherit; color: inherit; }

.app {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 20px 72px;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: 40px;
  letter-spacing: -0.04em;
}

.lede, .sync-line, .empty, small, .hint {
  color: var(--muted);
}

.lede { max-width: 560px; line-height: 1.45; margin: 8px 0 0; }

.top-actions, .pager { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

button, .linkbtn {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}

button.primary {
  background: var(--accent);
  color: #1a1404;
  border-color: transparent;
  font-weight: 650;
}

button:disabled { opacity: 0.5; cursor: not-allowed; }

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0 10px;
}

.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}

.kpi span { display: block; color: var(--muted); font-size: 12px; }
.kpi strong { font-size: 28px; letter-spacing: -0.03em; }
.kpi.hot strong { color: var(--bad); }

.watch {
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 12px;
  margin: 0 0 18px;
  overflow: hidden;
}

.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.check-col { width: 36px; }
tr.picked { background: rgba(212, 160, 23, 0.08); }
tr.watching td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

.watch-remove { padding: 6px 10px; font-size: 12px; }

.sync-line { margin: 0 0 18px; font-size: 13px; }
.sync-line.err { color: var(--bad); }

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 18px;
}

label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
label.grow { grid-column: span 1; }
label.check { flex-direction: row; align-items: center; gap: 8px; padding-bottom: 10px; }

input, select {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

h2 { margin: 0; font-size: 16px; }

.table-scroll { overflow: auto; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: rgba(212, 160, 23, 0.06); }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.money { text-align: right; font-variant-numeric: tabular-nums; }
td.empty { text-align: center; padding: 40px 16px; cursor: default; }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.badge.critica { color: var(--bad); border-color: var(--bad); }
.badge.pronta { color: var(--warn); border-color: var(--warn); }
.badge.ok { color: var(--good); border-color: var(--good); }

.drawer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: flex-end;
}

.drawer[hidden] { display: none; }

.drawer-card {
  width: min(460px, 100%);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--line);
  padding: 20px;
  overflow: auto;
}

.drawer-card h3 { margin: 12px 0 8px; }
.drawer-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.drawer-card dt { color: var(--muted); font-size: 12px; }
.drawer-card dd { margin: 4px 0 0; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-card h1 { font-size: 36px; }
.login-card button.primary { margin-top: 8px; }

.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}

.shell-side {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: #121916;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand { text-decoration: none; color: inherit; }
.brand strong { display: block; font-size: 22px; letter-spacing: -0.03em; }

.shell-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.shell-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 8px;
}
.shell-nav a:hover, .shell-nav a.active {
  color: var(--ink);
  background: rgba(238, 244, 239, 0.06);
}
.shell-nav a.active { color: var(--accent); }
.shell-side .ghost { width: 100%; }
  margin-left: 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.home {
  max-width: 920px;
  padding: 36px 28px 72px;
}

.modules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.module-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 16px;
  text-decoration: none;
  color: inherit;
  min-height: 180px;
}
.module-card h2 { font-size: 22px; }
.module-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.module-go {
  margin-top: auto;
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
}
.module-card.soon { opacity: 0.85; }
.ghost-card { border-style: dashed; color: var(--muted); }

@media (max-width: 1100px) {
  .kpis, .filters { grid-template-columns: 1fr 1fr; }
  .top { flex-direction: column; align-items: flex-start; }
  .shell { grid-template-columns: 1fr; }
  .shell-side {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .shell-nav { flex-direction: row; flex-wrap: wrap; }
}
