:root{
  --bg: #0b0d10;
  --card: #11151b;
  --text: #e9eef5;
  --muted: #a9b4c2;
  --line: #273040;
  --accent: #7aa2ff;
  --good: #5bd6a2;
  --warn: #ffd46b;
  --bad: #ff7a7a;
}

*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; background:var(--bg); color:var(--text); font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial; }
a{ color:inherit; }

.header{
  display:flex;
  gap:16px;
  align-items:flex-start;
  justify-content:space-between;
  padding:18px 16px;
  border-bottom:1px solid var(--line);
  background: linear-gradient(180deg, rgba(122,162,255,0.08), rgba(122,162,255,0.00));
}
.header__title h1{ margin:0; font-size:22px; letter-spacing:0.2px; }
.header__title p{ margin:6px 0 0; color:var(--muted); font-size:13px; }
.header__meta{ min-width: 280px; }
.meta__row{ display:flex; gap:8px; justify-content:flex-end; align-items:center; margin:4px 0; }
.meta__label{ color:var(--muted); font-size:12px; }
.meta__controls{ gap:10px; }

.main{ padding:16px; max-width: 1500px; margin: 0 auto; }

.controls{
  display:flex;
  gap:14px;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.tabs{ display:flex; gap:8px; }
.tab{
  border:1px solid var(--line);
  background: var(--card);
  color: var(--text);
  padding:10px 12px;
  border-radius: 10px;
  cursor:pointer;
  font-weight:600;
}
.tab--active{
  border-color: rgba(122,162,255,0.8);
  box-shadow: 0 0 0 3px rgba(122,162,255,0.12);
}

.search{
  display:flex;
  gap:10px;
  align-items:center;
  flex: 1;
  justify-content:flex-end;
  min-width: 260px;
}
.search__input{
  width: min(620px, 100%);
  padding:10px 12px;
  border-radius: 10px;
  border:1px solid var(--line);
  background: var(--card);
  color: var(--text);
  outline:none;
}
.search__input:focus{
  border-color: rgba(122,162,255,0.8);
  box-shadow: 0 0 0 3px rgba(122,162,255,0.12);
}
.counts{ color: var(--muted); font-size: 12px; }

.panel{ display:none; }
.panel--active{ display:block; }

.tableWrap{
  border:1px solid var(--line);
  border-radius: 14px;
  background: rgba(17,21,27,0.65);
  overflow:auto;
}
.table{
  width: 100%;
  border-collapse: collapse;
  min-width: 1200px;
  /* ✅ Stabilare kolumnbeteende (gör att kolumner inte "krossas" lika lätt) */
  table-layout: auto;
}
.table thead th{
  position: sticky;
  top: 0;
  background: #0f141b;
  border-bottom:1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  padding: 10px 10px;
  text-align:left;
  white-space: nowrap;
}
.table tbody td{
  border-bottom:1px solid rgba(39,48,64,0.6);
  padding: 9px 10px;
  font-size: 13px;
  vertical-align: top;
  /* ✅ Standard: håll de flesta celler på en rad */
  white-space: nowrap;
}
.table tbody tr:hover td{
  background: rgba(122,162,255,0.06);
}
.muted{ color: var(--muted); }

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 4px 8px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  white-space: nowrap;
}
.badge--good{ border-color: rgba(91,214,162,0.35); color: var(--good); }
.badge--warn{ border-color: rgba(255,212,107,0.40); color: var(--warn); }
.badge--bad{ border-color: rgba(255,122,122,0.40); color: var(--bad); }

.truncate{
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.truncate--wide{ max-width: 620px; }

.btn{
  border:1px solid var(--line);
  background: var(--card);
  color: var(--text);
  padding:10px 12px;
  border-radius: 10px;
  cursor:pointer;
  font-weight:600;
}
.btn:hover{ border-color: rgba(122,162,255,0.6); }

.switch{
  display:flex;
  align-items:center;
  gap:8px;
  color: var(--muted);
  font-size: 12px;
  user-select:none;
}
.switch input{ transform: scale(1.1); }

.sr-only{
  position:absolute;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);
  border:0;
}

.footnote{ margin-top: 12px; }

/* ✅ VIKTIGT: Från/Till-kolumnen (kolumn 4) ska få plats för "Stad [IATA]" och ev. "via ..." */
.table tbody td:nth-child(4),
.table thead th:nth-child(4){
  min-width: 240px;
  white-space: normal;     /* tillåt radbrytning här */
}
