* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #111827;
  color: #e5e7eb;
}

.page {
  max-width: 1800px;
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.topbar h1 {
  margin: 0 0 6px 0;
  font-size: 28px;
}

.sub {
  margin: 0;
  color: #9ca3af;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.card {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 12px;
}

.stat {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 10px;
  padding: 12px;
}

.label {
  color: #9ca3af;
  font-size: 12px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.value {
  font-size: 18px;
  font-weight: bold;
}

.value.small {
  font-size: 13px;
  font-weight: normal;
  word-break: break-word;
}

.summary {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.tools {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.tools input[type="text"] {
  width: 100%;
  max-width: 760px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #4b5563;
  background: #111827;
  color: #e5e7eb;
}

.tool-buttons {
  display: flex;
  gap: 10px;
}

.bulk-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.bulk-left {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.group-head h2 {
  margin: 0 0 4px 0;
  font-size: 22px;
}

.meta {
  color: #9ca3af;
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  position: sticky;
  top: 0;
  background: #111827;
  color: #d1d5db;
  border-bottom: 1px solid #374151;
  text-align: left;
  padding: 10px;
  font-size: 13px;
}

tbody td {
  border-bottom: 1px solid #374151;
  padding: 10px;
  vertical-align: top;
  font-size: 13px;
}

.keep-row {
  background: rgba(16, 185, 129, 0.08);
}

.keep-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #065f46;
  color: #d1fae5;
  font-size: 12px;
  font-weight: bold;
}

.path, .hash {
  word-break: break-all;
  font-family: Consolas, monospace;
  font-size: 12px;
}

.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #4b5563;
  background: #374151;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.1);
}

.btn.primary {
  background: #2563eb;
  border-color: #2563eb;
}

.btn.danger {
  background: #b91c1c;
  border-color: #b91c1c;
}

.flash-wrap {
  margin-bottom: 16px;
}

.flash {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
}

.flash.success {
  background: #064e3b;
  border: 1px solid #065f46;
}

.flash.warning {
  background: #78350f;
  border: 1px solid #92400e;
}

.flash.danger {
  background: #7f1d1d;
  border: 1px solid #991b1b;
}

.empty {
  text-align: center;
  color: #9ca3af;
}

@media (max-width: 1200px) {
  .stats {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .topbar,
  .tools,
  .bulk-actions,
  .group-head {
    flex-direction: column;
    align-items: stretch;
  }
}