:root {
  --nbs-blue: #0272a7;        /* the one blue - same shade as the "NPSW6 Data Validation" title text - used everywhere blue appears */
  --nbs-blue-light: #eaf3fa;  /* very light tint of --nbs-blue, for subtle backgrounds/hover only so text stays readable - not a second blue */
  --nbs-gold: #edc91e;        /* confirmed: --secondary-color in nbs.go.tz's master.min.css - available for accents (e.g. underlines) if wanted later */
  --text-grey: #444;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  font-family: "Segoe UI", Arial, sans-serif;
  margin: 0;
  background: #ffffff;
  color: #222;
  overflow-x: hidden;
  /* Sticky footer: stack header/nav/content/footer vertically, and let
     .container (below) grow to fill any leftover space, so the footer
     sits at the bottom of the viewport on a short page instead of right
     under the content - while still flowing normally below long content. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.nbs-header {
  background: #ffffff;
  border-bottom: 3px solid var(--nbs-blue);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nbs-header img { height: 140px; flex-shrink: 0; }

.nbs-header .titles { flex: 1; text-align: center; }

.nbs-header .titles .country {
  color: var(--nbs-blue);
  font-weight: 600;
  font-size: 18px;
  margin: 0;
}

.nbs-header .titles .bureau {
  color: var(--nbs-blue);
  font-weight: 800;
  font-size: 34px;
  margin: 4px 0 0 0;
}

.nbs-header .titles .dashboard-title {
  color: var(--nbs-blue);
  font-weight: 700;
  font-size: 20px;
  margin: 10px 0 0 0;
}

.nav {
  background: var(--nbs-blue);
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.nav-links { grid-column: 2; display: flex; gap: 4px; justify-self: center; }
.nav-right { grid-column: 3; justify-self: end; }

.nav a {
  color: var(--nbs-blue-light);
  text-decoration: none;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
}

.nav a:hover { background: rgba(255,255,255,0.15); }

/* Log Out is a POST form (Django 5+ LogoutView rejects GET), styled to look
   like the other nav links. */
.logout-form { margin: 0; }
.nav button {
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  color: var(--nbs-blue-light);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
}
.nav button:hover { background: rgba(255,255,255,0.15); }

.container { max-width: 96vw; margin: 0 auto; padding: 28px 24px; flex: 1 0 auto; width: 100%; }

.tiles { display: flex; flex-wrap: wrap; gap: 18px; }

.tile {
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  padding: 26px;
  min-width: 220px;
  flex: 1 1 220px;
  text-decoration: none;
  color: var(--nbs-blue);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: box-shadow 0.15s;
}

.tile:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.12); }

.tile .name { font-size: 18px; font-weight: 700; }

.empty-tiles {
  color: var(--text-grey);
  background: #fff;
  border: 1px dashed #ccc;
  border-radius: 8px;
  padding: 24px;
}

.page-title { color: var(--nbs-blue); margin: 0 0 4px 0; }
.page-subtitle { color: var(--text-grey); font-size: 14px; margin: 0 0 18px 0; }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  background: var(--nbs-blue);
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.btn:hover { filter: brightness(0.88); }

select.filter {
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  font-size: 12.5px;
}

table.data-table th,
table.data-table td {
  border: 1px solid #dde3e8;
  padding: 5px 8px;
  text-align: left;
  vertical-align: top;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 320px;
}

table.data-table th {
  background: var(--nbs-blue-light);
  color: var(--nbs-blue);
  border-bottom: 2px solid var(--nbs-blue);
  position: sticky;
  top: 0;
}

table.data-table tbody tr:nth-child(even) td { background: #f8fafb; }
table.data-table tr:hover td { background: var(--nbs-blue-light); }

.table-wrap { overflow-x: auto; max-height: 78vh; overflow-y: auto; border: 1px solid #e2e2e2; border-radius: 8px; }

.row-count { color: var(--text-grey); font-size: 13px; margin-bottom: 10px; }

.login-wrap {
  max-width: 380px;
  margin: 60px auto;
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 10px;
  padding: 32px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.login-wrap input[type=text], .login-wrap input[type=password] {
  width: 100%;
  padding: 10px;
  margin: 6px 0 16px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.login-wrap label { font-size: 13px; color: var(--text-grey); font-weight: 600; }

.error-msg { color: #b00020; font-size: 13px; margin-bottom: 12px; }

.site-footer {
  flex-shrink: 0;
  border-top: 3px solid var(--nbs-blue);
  padding: 14px 24px;
  margin-top: 32px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-grey);
}

/* --- Django messages (upload/run-pipeline feedback) --- */
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 13.5px;
}
.messages .success { background: #e6f6ea; color: #1e7d34; border: 1px solid #b7e4c2; }
.messages .error   { background: #fdecea; color: #b3261e; border: 1px solid #f6c6c2; }
.messages .warning { background: #fff8e1; color: #8a6d00; border: 1px solid #f2df9c; }
.messages .info    { background: var(--nbs-blue-light); color: var(--nbs-blue); border: 1px solid #bfe0ef; }

/* --- Upload Data page --- */
.dropzone {
  border: 2px dashed #b9c4cc;
  border-radius: 10px;
  padding: 36px 20px;
  text-align: center;
  color: var(--text-grey);
  background: #fafcfd;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone.dragover { border-color: var(--nbs-blue); background: var(--nbs-blue-light); }
.dropzone input[type=file] { display: none; }
.file-list { list-style: none; padding: 0; margin: 12px 0 0; font-size: 13px; }
.file-list li { padding: 4px 0; border-bottom: 1px solid #eee; }
