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

:root {
  --bg: #0f0f1a;
  --surface: #1a1a2e;
  --surface-2: #252540;
  --border: #333;
  --text: #e4e4e7;
  --text-muted: #9ca3af;
  --accent: #ffae00;
  --accent-dim: #b37a00;
  --danger: #ef4444;
  --success: #22c55e;
  --info: #3b82f6;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.logout-btn {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.logout-btn:hover { color: var(--text); border-color: var(--text-muted); text-decoration: none; }

/* Header */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}
.header .env-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-muted);
}

/* Filters */
.filters {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  flex-wrap: wrap;
  align-items: center;
}
.filters select, .filters input {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
}
.filters select:focus, .filters input:focus {
  outline: none;
  border-color: var(--accent);
}
.filters label {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Stats bar */
.stats {
  padding: 0 24px 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Table */
.table-wrap {
  padding: 0 24px;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tr:hover td { background: var(--surface); }
tr { cursor: pointer; }

/* Type badges */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}
.badge-report { background: #7c3aed22; color: #a78bfa; }
.badge-feedback { background: #3b82f622; color: #60a5fa; }
.badge-missed_message { background: #f59e0b22; color: #fbbf24; }

.env-staging { color: #f59e0b; }
.env-production { color: var(--success); }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px 24px;
}
.pagination button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
}
.pagination button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.pagination button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.pagination .page-info {
  font-size: 13px;
  color: var(--text-muted);
}

/* Detail modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 24px;
  overflow-y: auto;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  padding: 24px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}
.modal-close:hover { color: var(--text); }
.modal h2 {
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 16px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 16px;
  font-size: 13px;
}
.detail-grid dt {
  color: var(--text-muted);
  font-weight: 500;
}
.detail-grid dd {
  word-break: break-word;
}
.detail-grid dd pre {
  background: var(--bg);
  padding: 8px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 12px;
  white-space: pre-wrap;
}
.detail-images {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.detail-images h3 {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.detail-images img {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #000;
}

/* Loading */
.loading {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
}
.error-msg {
  text-align: center;
  padding: 24px;
  color: var(--danger);
}

/* Empty state */
.empty {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
}
