/* Reset & base */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f1419;
  color: #e6e6e6;
  font-size: 14px;
}

/* Header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: #161b22;
  border-bottom: 1px solid #30363d;
}
.site-header h1 {
  margin: 0;
  font-size: 1.4rem;
  color: #58a6ff;
}
.site-header nav a {
  color: #8b949e;
  text-decoration: none;
  margin-left: 1rem;
}
.site-header nav a:hover { color: #58a6ff; }

.container {
  padding: 1.5rem 2rem;
  max-width: 100%;
}

/* Filter bar */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.filters {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.filters input[type=text] {
  padding: 0.5rem 0.75rem;
  background: #21262d;
  border: 1px solid #30363d;
  color: #e6e6e6;
  border-radius: 6px;
  min-width: 280px;
}
.filters select {
  padding: 0.5rem;
  background: #21262d;
  border: 1px solid #30363d;
  color: #e6e6e6;
  border-radius: 6px;
}
.btn {
  padding: 0.5rem 1rem;
  background: #21262d;
  border: 1px solid #30363d;
  color: #e6e6e6;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
}
.btn:hover { background: #30363d; }
.btn-refresh { background: #1f6feb; border-color: #1f6feb; }
.btn-refresh:hover { background: #388bfd; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.stats { display: flex; gap: 1.5rem; color: #8b949e; }
.stat strong { color: #58a6ff; font-size: 1.1rem; }

/* Tables */
.table-wrap { overflow-x: auto; margin-bottom: 2rem; }
table {
  width: 100%;
  border-collapse: collapse;
  background: #161b22;
  border-radius: 6px;
  overflow: hidden;
}
table.main { font-size: 13px; }
th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #21262d;
  vertical-align: top;
}
th {
  background: #1c2128;
  color: #8b949e;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  position: sticky;
  top: 0;
}
tbody tr:hover { background: #1c2128; }

td.id { color: #8b949e; font-family: monospace; }
td.customer strong { color: #f0f6fc; }
td.numbers { font-family: monospace; font-size: 12px; }
td.notes { max-width: 250px; font-size: 12px; color: #8b949e; white-space: pre-wrap; }
td.checklist { font-size: 11px; white-space: nowrap; }
td.checklist span { display: block; }
td.phone-bill { min-width: 180px; }

/* Row highlights */
.row-delay { background: #3b1f1f !important; }
.row-delay:hover { background: #4a2828 !important; }
.row-mismatch { background: #3b2e1f !important; }
.row-mismatch:hover { background: #4a3a28 !important; }
.row-qb-ahead { background: #1f2f3b !important; }
.row-qb-ahead:hover { background: #283a4a !important; }

.foc-conflict { color: #f85149; font-weight: 600; }
.foc-new { color: #3fb950; font-weight: 600; }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-submitted { background: #1f6feb33; color: #58a6ff; }
.badge-pending-cx-response { background: #9e6a0333; color: #d29922; }
.badge-pending-internet-installation-reschedule { background: #8957e533; color: #bc8cff; }
.badge-completed { background: #23863633; color: #3fb950; }
.badge-source-questblue { background: #1f6feb33; color: #58a6ff; }
.badge-source-cognito { background: #9e6a0333; color: #d29922; }

/* Flags */
.flag {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}
.flag-delay { background: #3b1f1f; color: #f85149; }

/* Links & missing */
.bill-link {
  color: #58a6ff;
  text-decoration: none;
  font-size: 12px;
}
.bill-link:hover { text-decoration: underline; }
.missing { color: #f85149; font-size: 12px; }

.empty-state {
  padding: 2rem;
  text-align: center;
  color: #8b949e;
  background: #161b22;
  border-radius: 6px;
  border: 1px dashed #30363d;
}

h2 { color: #f0f6fc; margin-top: 2rem; }

table.history { font-size: 12px; }
table.history td { padding: 0.5rem 0.75rem; }
