:root {
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --text-color: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --primary: #3b82f6;
  --accent-open: #22c55e;
  --accent-closed: #ef4444;
  --warning: #f59e0b;
  --amber: #f97316;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  padding: 24px;
  line-height: 1.5;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Control Bar & Filters */
.controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

input[type="text"], select {
  background-color: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
}

input[type="text"]:focus, select:focus {
  border-color: var(--primary);
}

/* View Toggle Buttons */
.view-toggle {
  display: flex;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.view-toggle button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-toggle button.active {
  background-color: var(--primary);
  color: #ffffff;
}

/* Table Styling */
.table-container {
  width: 100%;
  overflow-x: auto;
  background-color: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  -webkit-overflow-scrolling: touch;
  display: block;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

th {
  background-color: #111827;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-color);
}

th:hover {
  color: var(--text-color);
}

/* Shrink all standard columns tightly to their content */
td, th {
  width: 1%; 
  white-space: nowrap; 
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Greedy Title column */
.title-cell {
  width: 100%; 
  max-width: none; 
  min-width: 250px; 
  white-space: normal !important; 
  word-wrap: break-word;
  line-height: 1.4; 
}

/* Links */
a.comp-link {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
}

a.comp-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background-color: #475569;
  color: #ffffff;
}

.badge-new {
  background-color: #3b82f6;
  color: #ffffff;
  margin-right: 8px;
  font-weight: 700;
}

/* Brand Overrides */
.badge-revcom { background-color: #8b5cf6; }
.badge-730 { background-color: #ec4899; }
.badge-botb { background-color: #06b6d4; color: #000; }
.badge-bounty { background-color: #eab308; color: #000; }
.badge-goodlife { background-color: #10b981; }

/* Text Colors */
.time-red, .yield-poor { color: var(--accent-closed); font-weight: 600; }
.time-amber, .yield-medium { color: var(--amber); font-weight: 600; }
.time-yellow { color: var(--warning); font-weight: 600; }
.time-green, .yield-high { color: var(--accent-open); font-weight: 600; }

/* Progress Bar */
.progress-wrapper {
  width: 140px;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background-color: #334155;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Urgency Colors */
.progress-low { background-color: var(--accent-open); }
.progress-medium { background-color: var(--warning); }
.progress-high { background-color: var(--accent-closed); }

.copy-btn {
  padding: 4px 8px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  border: 1px solid #333; 
  border-radius: 4px;
  background-color: black;
  color: white;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.copy-btn:hover {
  background-color: #333;
}

/* Auto-refresh Status */
.sync-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}