@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;600;700&family=Source+Serif+4:ital,wght@0,300;0,400;1,300&display=swap');

:root {
  --blue-dark:    #1a3a52;
  --blue-mid:     #387db6;
  --blue-light:   #c6ebef;
  --blue-pale:    #cfe0ee;
  --gray-light:   #f0f0f0;
  --text-dark:    #1a2a38;
  --text-mid:     #2c4a62;
  --white:        #ffffff;
  --header-height: 60px;
  --footer-height: 38px;
  --nav-width:    230px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Source Serif 4', Georgia, serif;
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.6;
}

/* ── HEADER ── */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--blue-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.2rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  z-index: 1000;
}

.logo {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--white);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}

.header-subtitle {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── HEADER NAV ── */
.header-nav {
  display: flex;
  gap: 0.2rem;
}

.header-nav-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.header-nav-link:hover {
  background: rgba(255,255,255,0.12);
  color: var(--white);
}

/* ── SIDEBAR NAV ── */
#nav {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--nav-width);
  bottom: var(--footer-height);
  background: var(--blue-dark);
  overflow-y: auto;
  z-index: 100;
}

#nav .innertube {
  padding: 1.2rem 0.8rem 1.5rem;
  margin: 0;
}

#nav h3 {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 1.2rem 0.4rem 0.4rem;
  margin-top: 0.8rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

#nav h3:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

#nav p.two,
#nav p.three {
  margin: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

#nav ul {
  list-style: none;
}

#nav ul li {
  padding: 0;
}

#nav ul a {
  display: block;
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.87rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.45rem 0.75rem;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

#nav ul a:hover {
  background: rgba(255,255,255,0.12);
  color: var(--white);
}

#nav .nav-home-link {
  display: block;
  color: var(--blue-light);
  text-decoration: none;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.87rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.5rem 0.75rem;
  margin-top: 1.2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1rem;
  transition: color 0.2s;
}

#nav .nav-home-link:hover {
  color: var(--white);
}

/* ── MAIN CONTENT ── */
main {
  position: fixed;
  top: var(--header-height);
  left: var(--nav-width);
  right: 0;
  bottom: var(--footer-height);
  overflow-y: auto;
  background: var(--white);
}

.container {
  /* wrapper div - no visual effect */
}

.innertube {
  padding: 2rem 2.5rem;
  max-width: 960px;
}

/* ── FOOTER ── */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-height);
  background: var(--blue-dark);
  color: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.2rem;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  z-index: 100;
}

footer a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
}

footer a:hover {
  color: var(--white);
  text-decoration: underline;
}

/* ── TYPOGRAPHY ── */
h1 {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  color: var(--blue-dark);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--blue-mid);
}

p.one {
  font-family: 'Source Serif 4', Georgia, serif;
  color: var(--text-mid);
  font-size: 0.97rem;
  line-height: 1.75;
  margin-bottom: 0.7rem;
  font-weight: 300;
}

p.two {
  font-family: 'Source Serif 4', Georgia, serif;
  color: var(--text-mid);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0.4rem;
}

p.three {
  font-family: 'Source Serif 4', Georgia, serif;
  color: var(--text-mid);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 0.8rem;
}

/* ── TABLES ── */
table {
  font-family: 'Source Serif 4', Georgia, serif;
  border-collapse: collapse;
  width: 100%;
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(26,58,82,0.08);
}

th {
  background: var(--blue-dark);
  color: var(--white);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}

td {
  border: 1px solid #ccdde8;
  padding: 6px 10px;
  color: var(--text-mid);
  text-align: center;
}

tr:nth-child(even) td {
  background-color: var(--blue-light);
}

tr:hover td {
  background-color: var(--blue-pale);
}

/* ── FORMS ── */
input[type="text"] {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 0.9rem;
  padding: 0.28rem 0.5rem;
  border: 1px solid #b0c4d8;
  border-radius: 4px;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 2px rgba(56,125,182,0.18);
}

input[type="submit"] {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.45rem 1.5rem;
  background: var(--blue-mid);
  color: var(--white);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

input[type="submit"]:hover {
  background: var(--blue-dark);
}

input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--blue-mid);
  margin: 0 0.3rem 0 0.15rem;
  vertical-align: middle;
}

select {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 0.9rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid #b0c4d8;
  border-radius: 4px;
  color: var(--text-dark);
  background: var(--white);
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 0.5rem 0;
}

/* ── Tooltip (kept from original) ── */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  min-width: 160px;
  background-color: var(--blue-dark);
  color: var(--white);
  text-align: left;
  border-radius: 4px;
  padding: 6px 10px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.82rem;
  position: absolute;
  z-index: 10;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.tooltip .tooltiptext::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--blue-dark) transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* ── Tab buttons (kept from original) ── */
.btn {
  border: none;
  outline: none;
  padding: 8px 16px;
  background-color: var(--gray-light);
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
  border-radius: 4px 4px 0 0;
  transition: background 0.2s, color 0.2s;
}

.active,
.btn:hover {
  background-color: var(--blue-mid);
  color: var(--white);
}

/* ── TAB 3.1 TABLE COLOURS ── */
.tab31 thead th {
  background: var(--blue-dark);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 2;
}

.tab31 tbody tr:nth-child(odd) th {
  background: #5b9cc4 !important;
  color: var(--white) !important;
}

.tab31 tbody tr:nth-child(even) th {
  background: #b8d8ec !important;
  color: var(--text-dark) !important;
}

/* ── STICKY TABLE HEADER ── */
thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--blue-dark);
}

/* ── CELL SELECTION ── */
td.cell-selected,
th.cell-selected {
  background-color: #e8a020 !important;
  color: #1a2a38 !important;
  outline: 2px solid #c07800;
  outline-offset: -2px;
  cursor: default;
}

/* ── ROW + COLUMN HIGHLIGHT ── */
td.row-col-highlight,
th.row-col-highlight {
  background-color: #b8d8f0 !important;
  color: var(--text-dark) !important;
}

td.row-col-highlight.row-col-clicked,
th.row-col-highlight.row-col-clicked {
  background-color: #e8a020 !important;
  color: #1a2a38 !important;
  outline: 2px solid #c07800;
  outline-offset: -2px;
}

/* ── EXPORT BUTTONS ── */
.export-btns {
  display: flex;
  gap: 0.4rem;
}

.export-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.65rem;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.export-btn:hover {
  background: var(--blue-mid);
  color: var(--white);
  border-color: var(--blue-mid);
}

/* ── PRINT ── */
@media print {
  html, body {
    height: auto !important;
    overflow: visible !important;
  }
  header, #nav, footer, .export-btns {
    display: none !important;
  }
  main {
    position: static !important;
    overflow: visible !important;
    left: 0 !important;
    top: 0 !important;
  }
  .innertube {
    padding: 1rem 0 !important;
    max-width: 100% !important;
  }
  input[type="submit"] {
    display: none !important;
  }
  table {
    page-break-inside: avoid;
  }
}

/* ── IE6 legacy fixes (kept from original) ── */
* html body {
  padding: 0 0 0 var(--nav-width);
}

* html main {
  height: 100%;
  width: 100%;
}
