:root {
  --bg: #060906;
  --panel: #0f1510;
  --panel-2: #141c15;
  --line: #26352a;
  --line-2: #1d271f;
  --text: #d7e3d5;
  --muted: #94a798;
  --green: #39e576;
  --green-dim: #1ca750;
  --danger: #f67272;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% -10%, rgba(57, 229, 118, 0.08), transparent 35%),
    linear-gradient(180deg, #070b08 0%, #050706 70%, #040504 100%);
}

a {
  color: var(--green);
}

code {
  padding: 0.12rem 0.3rem;
  border-radius: 4px;
  background: #0a120b;
  border: 1px solid var(--line);
}

.app-shell {
  width: min(1600px, 96vw);
  margin: 0 auto;
  padding: 1.2rem 0 2rem;
}

.topbar {
  margin: 0 0 1rem;
}

.topbar h1 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.03em;
  color: #f0fff1;
}

.topbar p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 0.65rem;
}

.input-row {
  display: flex;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

label {
  display: inline-block;
  margin-top: 0.35rem;
  color: var(--muted);
}

input {
  width: 100%;
  border: 1px solid var(--line);
  background: #080d09;
  color: var(--text);
  border-radius: 8px;
  padding: 0.72rem 0.75rem;
  outline: none;
}

input:focus {
  border-color: var(--green-dim);
  box-shadow: 0 0 0 2px rgba(57, 229, 118, 0.15);
}

button {
  border: 1px solid #1f6d38;
  background: #0f3620;
  color: #dff7e4;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  background: #134929;
}

.ghost {
  border: 1px solid var(--line);
  background: #0a0f0b;
}

.status {
  margin: 0.9rem 0 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0.6rem 0.75rem;
}

.status.neutral {
  color: var(--muted);
}

.status.ok {
  color: #b9f5c9;
  border-color: #246f41;
  background: rgba(42, 124, 74, 0.24);
}

.status.error {
  color: #ffd2d2;
  border-color: #5d2525;
  background: rgba(117, 38, 38, 0.32);
}

.hidden {
  display: none;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  color: #04170a;
  background: linear-gradient(180deg, #52f08a 0%, #35c068 100%);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.meta {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.tabs {
  margin-bottom: 0.7rem;
}

.tab {
  background: #0a130d;
  border-color: #20412a;
}

.tab.active {
  background: #123120;
  border-color: #2e8b4e;
}

.card-table {
  padding: 0.8rem 0.8rem 0.9rem;
}

.table-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0 0 0.6rem;
}

.table-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #e9f6ea;
}

#organized-crime-table {
  border: 1px solid var(--line-2);
  border-radius: 10px;
  overflow: hidden;
}

/* Tabulator overrides */
.tabulator {
  background: #0a0f0b;
  border: none;
  color: var(--text);
  font-size: 0.86rem;
}

.tabulator .tabulator-header {
  background: #121a14;
  border-bottom: 1px solid var(--line);
}

.tabulator .tabulator-header .tabulator-col {
  background: #121a14;
  border-right: 1px solid #1b251d;
}

.tabulator .tabulator-col-title {
  color: #d5e5d8;
}

.tabulator .tabulator-header .tabulator-col input {
  background: #090e0a;
  color: #c5d8c8;
  border: 1px solid #273829;
  border-radius: 4px;
  padding: 0.2rem 0.35rem;
}

.tabulator-row {
  background: #0a0f0b;
}

.tabulator-row.tabulator-row-even {
  background: #0c120d;
}

.tabulator-row.tabulator-selectable:hover {
  background: #131d15;
}

.tabulator .tabulator-cell {
  border-right: 1px solid #152017;
  border-bottom: 1px solid #162118;
  padding: 0.42rem 0.44rem;
}

.tabulator-row.row-failure,
.tabulator-row.row-failure.tabulator-row-even {
  background: rgba(122, 40, 40, 0.25);
}

.tabulator .tabulator-cell.cell-failure-text {
  color: #ff9898;
  font-weight: 600;
}

@media (max-width: 900px) {
  .app-shell {
    width: min(1600px, 97.5vw);
  }

  .input-row {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
