/* === Base + theme tokens === */
:root{
  --bg: #f9f9f9;
  --text: #333;
  --brand: #004080;
  --link: #0066cc;
  --panel-bg: #fff;
  --panel-border: #e5e5e5;
  --panel-radius: 10px;
  --panel-shadow: 0 1px 4px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* === Layout containers === */
.container {
  max-width: 800px;              /* ↑ wider so tables & panels align */
  margin: 0 auto;
  text-align: center;
  padding: 40px 16px 56px;
}

header, footer {
  padding: 1rem;
  text-align: center;
}

header {
  background: var(--brand);
  color: #fff;
  padding: 0.5rem 1rem;   /* was 1rem, reduced */
}

footer { margin-top: 40px; }

/* === Type & links === */
h1 {
  background: var(--brand);
  color: #fff;
  margin: 0;
  padding: 0.25rem 0.5rem; /* was .75rem 1rem, reduced */
  font-size: 1.5rem;       /* keeps it compact */
}

nav a {
  padding: 0.5rem 0.75rem;
  display: inline-block;
}

h2 { color: var(--brand); margin-top: 0; }
h3 { margin: 0 0 .75rem; }

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

.logo {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* === Reusable panel style (used by all sections) === */
.section {
  margin: 1.25rem auto;
  padding: 1rem;
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
  max-width: 800px;              /* align with .container */
  text-align: left;              /* forms/tables look better left-aligned */
}

/* Label & helper text */
.label {
  display: block;
  font-weight: 600;
  margin-bottom: .5rem;
}

.help-text {
  font-size: .9rem;
  margin: .25rem 0 .75rem;
}

.muted-link { text-decoration: underline; opacity: .9; }

/* Error text */
.error-msg {
  color: #e04666;
  margin-top: .25rem;
  font-size: .9rem;
}

/* === Form controls === */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="file"] {
  width: 100%;
}

input[type="email"],
input[type="number"] {
  padding: .45rem .6rem;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #fff;
}

/* Checkbox row */
.checkbox-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: .5rem;
}
.checkbox-row label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

/* === Omics layout (two columns) === */
#omicsSection .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

/* === Scrollable Exchanges table === */
#exTable {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
}
#exTable table { margin-bottom: 0; }
#exTable thead th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  box-shadow: 0 1px 0 rgba(0,0,0,.05);
}
#exTable thead th { cursor: default; }
#exTable thead th.sortable { cursor: pointer; }
#exTable thead th.sortable::after { content: ' ⇅'; font-size: .8em; color: #999; }
#exTable thead th.sorted-asc::after { content: ' ▲'; color: #666; }
#exTable thead th.sorted-desc::after { content: ' ▼'; color: #666; }

/* === Scrollable keff edit basket === */
#keffBasket {
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
  padding: 6px;
}
.keff-row {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 6px;
  padding: 6px 4px;
  border-bottom: 1px solid #f0f0f0;
}
.keff-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.2;
  word-break: break-all;
  white-space: normal;
}
.keff-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}
.keff-input { flex: 1; min-width: 0; }

/* --- Fix squished keff results rows --- */
#keffResults { 
  display: block;                 /* ensure it's not inheriting flex */
  max-height: 250px; 
  overflow-y: auto;
}

#keffResults .list-group-item {
  display: flex;                  /* stable vertical sizing */
  align-items: center;            /* vertically center text */
  min-height: 32px;               /* <- key: guarantees a tall enough row */
  line-height: 1.2;               /* readable line-height */
  padding-top: .25rem;            /* keep compact but not crushed */
  padding-bottom: .25rem;
  white-space: nowrap;            /* keep your ellipsis behavior */
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Compact result lists */
#geneResults, #keffResults, #exResults {
  max-height: 220px;
  overflow-y: auto;
}
#keffResults .list-group-item {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Misc */
.file-info { font-size: .9rem; opacity: .8; margin-top: .25rem; }
.hidden { display: none !important; }

/* ultra-thin navbar */
.navbar.slim-nav { padding: 0 !important; }
.navbar.slim-nav .container {
  height: 40px;                 /* ← controls the blue bar thickness */
  display: flex;
  align-items: center;          /* vertical centering */
  justify-content: center;      /* center links horizontally */
  gap: 28px;
}
.navbar.slim-nav .nav-link {
  padding: 0 !important;        /* kill extra vertical padding */
  line-height: 40px;            /* match the bar height */
  font-size: 1rem;
  color: #fff !important;
}

/* Scroll container to mirror exchange bounds feel */
.scroll-y {
  max-height: 320px;   /* tweak to your taste */
  overflow-y: auto;
}

/* Keep table header visible while scrolling */
.scroll-y thead th {
  position: sticky;
  top: 0;
  background: #fff;    /* or var(--bs-body-bg) if using Bootstrap vars */
  z-index: 1;
}

/* Slightly tighter inputs inside tables */
.table td input.form-control-sm {
  padding-top: .15rem;
  padding-bottom: .15rem;
}

.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sort-caret {
  font-size: 0.9em;
  color: #adb5bd;           /* muted gray (Bootstrap-ish) */
  margin-left: .25rem;
}

.sort-caret.active {
  color: #495057;           /* darker when active (like your Exchanges) */
  font-weight: 600;
}