:root {
  --bg: #0b1220;
  --card-bg: #0f1a30;  /* Alias for modal/card backgrounds */
  --panel: #0f1a30;
  --text: #e6eefc;
  --muted: #a8b6d6;
  --border: #223152;
  --primary: #66a3ff;
  --danger: #ff6b6b;
  --success: #3ddc97;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(1000px 500px at 20% 0%, #14264a 0%, var(--bg) 60%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { color: #d7e7ff; }

.container { max-width: 1050px; margin: 0 auto; padding: 20px; }
.topbar { border-bottom: 1px solid var(--border); background: rgba(11, 18, 32, 0.7); backdrop-filter: blur(10px); position: sticky; top: 0; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand a { font-weight: 700; color: var(--text); }
.topbar__nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.muted { color: var(--muted); }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.card--link { display: block; }
.card--link:hover { transform: translateY(-1px); transition: transform 120ms ease; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.grid--cards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--primary);
  color: #061126;
  font-weight: 700;
  border: 0;
}
.button--secondary { background: rgba(255,255,255,0.08); color: var(--text); border: 1px solid var(--border); }
.button--danger { background: var(--danger); color: #fff; border: 0; }
.button--danger:hover { opacity: 0.85; }

.form { display: grid; gap: 12px; max-width: 420px; }
.label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  font-family: inherit;
  font-size: inherit;
}
select { cursor: pointer; }
textarea { resize: vertical; min-height: 60px; }

.flash-stack { display: grid; gap: 10px; margin: 16px 0; }
.flash { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,0.05); }
.flash--danger { border-color: rgba(255,107,107,0.5); }
.flash--success { border-color: rgba(61,220,151,0.5); }

.dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }

/* ===== View Details - Shared Readability System ===== */
.detail-panel {
  padding: 24px;
}
.detail-panel__section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.detail-panel__section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.detail-panel__header {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.detail-panel__label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.detail-panel__value {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
}
.detail-panel__value:last-child {
  margin-bottom: 0;
}
.detail-panel__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}
.detail-panel__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Modal dialog overrides for readability */
dialog.detail-modal {
  max-width: 700px;
  max-height: 80vh;
  width: 90vw;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}
dialog.detail-modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
}
dialog.detail-modal .modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
dialog.detail-modal .modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
dialog.detail-modal .modal-body {
  max-height: calc(80vh - 120px);
  overflow-y: auto;
  overflow-x: hidden;
}
dialog.detail-modal .modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
dialog.detail-modal .close-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
dialog.detail-modal .close-btn:hover {
  color: var(--text);
}

/* Warning icon for unmatched items */
.unmatched-warning {
  color: #f59e0b;
  cursor: help;
}
.unmatched-warning::before {
  content: "⚠";
  margin-right: 4px;
}

/* Badge styles */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.badge--warning {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge--success {
  background: rgba(61, 220, 151, 0.2);
  color: var(--success);
  border: 1px solid rgba(61, 220, 151, 0.3);
}
.badge--info {
  background: rgba(102, 163, 255, 0.2);
  color: var(--primary);
  border: 1px solid rgba(102, 163, 255, 0.3);
}
.badge--muted {
  background: rgba(168, 182, 214, 0.15);
  color: var(--muted);
  border: 1px solid rgba(168, 182, 214, 0.2);
}

/* Table */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }
.table tbody tr:hover { background: rgba(255,255,255,0.03); }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 12px; margin-top: 16px; justify-content: center; }

