:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-hover: #1c2330;
  --surface-2: #1c232c;
  --border: #30363d;
  --text: #c9c9c9;
  --text-dim: #8b949e;
  --accent: #58a6ff;
  --green: #3fb950;
  --red: #f85149;
  --orange: #f0883e;
  --gray-line: #8b949e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  min-height: 100vh;
}
a { color: var(--accent); }

/* site header */
header.site {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header.site .title {
  font-size: 16px;
  font-weight: 600;
  padding: 16px 0;
}
header.site .title span { color: var(--text-dim); font-weight: 400; }
nav.tabs { display: flex; gap: 4px; }
nav.tabs a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  padding: 18px 14px;
  border-bottom: 2px solid transparent;
}
nav.tabs a:hover { color: var(--text); }
nav.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }

main { max-width: 1280px; margin: 0 auto; padding: 28px 24px 64px; }

/* page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 6px;
}
.page-header h1 { font-size: 24px; margin: 0; }
.page-header .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.section-label {
  color: var(--text-dim);
  font-size: 13px;
  margin: 4px 0 16px;
}

/* buttons */
button, .btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
button:hover, .btn:hover { border-color: var(--accent); background: var(--surface-hover); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #0d1117; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-dark { background: #21262d; border-color: #21262d; color: var(--text); font-weight: 600; }
.btn-dark:hover { background: #2d333b; }
.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.icon-btn:hover { color: var(--text); background: var(--surface-hover); border-color: var(--border); }
.icon-btn svg { width: 16px; height: 16px; }

/* cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
}
.card + .card { margin-top: 20px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}
.card-head .card-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-head .card-title .info-icon {
  color: var(--text-dim);
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 15px; height: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: default;
}
.card-head .card-tools { display: flex; align-items: center; gap: 6px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* form controls */
select, input[type=text], input[type=date] {
  background: #010409;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--accent); }
label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
}
textarea {
  width: 100%;
  background: #010409;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  resize: vertical;
}
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }

/* filter link row (Last 7 days | Month to date | ...) */
.filter-links { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 13px; color: var(--text-dim); margin-bottom: 14px; }
.filter-links a { color: var(--text-dim); text-decoration: none; padding: 2px 4px; }
.filter-links a:hover { color: var(--accent); }
.filter-links a.active { color: var(--accent); font-weight: 600; }
.filter-links .sep { color: var(--border); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--text-dim); font-weight: 600; background: var(--surface-2); position: sticky; top: 0; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th .arrow { font-size: 10px; margin-left: 4px; color: var(--accent); }
tbody tr:hover td { background: var(--surface-hover); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.money { text-align: right; color: var(--accent); font-variant-numeric: tabular-nums; }
.table-foot { display: flex; justify-content: flex-end; margin-top: 8px; }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.status-dot.ok { background: var(--orange); }
.status-dot.warn { background: var(--red); }

.legend { display: flex; gap: 18px; justify-content: center; margin-top: 12px; font-size: 12px; color: var(--text-dim); flex-wrap: wrap; }
.legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }

footer.site { text-align: center; color: var(--text-dim); font-size: 12px; padding: 40px 24px; }

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
}
