
:root {
  --navy-950: #050814;
  --navy-900: #07111f;
  --navy-850: #0a1729;
  --navy-800: #0d2037;
  --navy-700: #102a48;
  --blue: #1d4f8f;
  --gold: #d7b15b;
  --gold-2: #f1d486;
  --paper: #f7f0df;
  --paper-2: #fff9eb;
  --ink: #152033;
  --muted: #657084;
  --line: rgba(215, 177, 91, .28);
  --line-dark: rgba(21, 32, 51, .14);
  --white: #f8fafc;
  --radius: 22px;
  --shadow: 0 26px 90px rgba(0,0,0,.35);
  --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(215,177,91,.22), transparent 30rem),
    radial-gradient(circle at bottom right, rgba(29,79,143,.24), transparent 34rem),
    linear-gradient(135deg, var(--navy-950), var(--navy-900) 45%, #101827);
  font-family: var(--font-ui);
}

a { color: inherit; }

.site-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 22px;
  color: var(--white);
  background:
    linear-gradient(180deg, rgba(7,17,31,.98), rgba(8,13,24,.98)),
    var(--navy-900);
  border-right: 1px solid var(--line);
  box-shadow: 12px 0 40px rgba(0,0,0,.22);
  z-index: 20;
}

.identity-card {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(215,177,91,.14), rgba(255,255,255,.04));
  box-shadow: 0 20px 55px rgba(0,0,0,.22);
}

.identity-logo {
  width: 82px;
  height: 82px;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.35));
}

.eyebrow {
  display: inline-block;
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.eyebrow.dark { color: #8a641e; }

.identity-card h1 {
  margin: 7px 0 4px;
  font-size: 1rem;
  line-height: 1.08;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.identity-card p {
  margin: 0;
  color: #cbd5e1;
  font-size: .85rem;
}

.search-box {
  display: block;
  margin: 18px 0;
}

.search-box span {
  display: block;
  margin: 0 0 8px;
  color: #cbd5e1;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 13px 16px;
  background: rgba(255,255,255,.06);
  color: var(--white);
  outline: none;
  font: inherit;
}

.search-box input::placeholder { color: #94a3b8; }
.search-box input:focus { border-color: var(--gold-2); box-shadow: 0 0 0 4px rgba(215,177,91,.13); }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 30px;
}

.nav-group {
  border: 1px solid rgba(215,177,91,.16);
  border-radius: 17px;
  overflow: hidden;
  background: rgba(255,255,255,.025);
}

.nav-group-title {
  width: 100%;
  border: 0;
  padding: 13px 14px;
  text-align: left;
  background: rgba(215,177,91,.08);
  color: var(--gold-2);
  font: 800 .78rem/1.2 var(--font-ui);
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-group-links {
  display: grid;
  gap: 2px;
  padding: 6px;
}

.nav-group.collapsed .nav-group-links { display: none; }

.sidebar-nav a {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px 9px;
  border-radius: 12px;
  text-decoration: none;
  color: #dbeafe;
  font-size: .9rem;
  line-height: 1.25;
}

.sidebar-nav a span {
  color: var(--gold-2);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .09em;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(215,177,91,.16);
  color: white;
}

.content {
  padding: 42px;
  min-width: 0;
}

.hero,
.result-status,
.no-results,
.manual-content,
.site-footer {
  max-width: 1160px;
  margin-left: auto;
  margin-right: auto;
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(7,17,31,.96), rgba(13,32,55,.92)),
    var(--navy-900);
  color: var(--white);
  box-shadow: var(--shadow);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(215,177,91,.28);
  border-radius: 24px;
  pointer-events: none;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
    radial-gradient(circle at 78% 18%, rgba(215,177,91,.26), transparent 19rem);
  background-size: 48px 48px, 48px 48px, auto;
  opacity: .72;
}

.hero-content {
  position: relative;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 34px;
  align-items: center;
  padding: 76px 74px 42px;
}

.hero-logo {
  width: 180px;
  height: 180px;
  object-fit: contain;
  filter: drop-shadow(0 28px 36px rgba(0,0,0,.46));
}

.hero-text h2 {
  margin: 12px 0 16px;
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 6vw, 5.2rem);
  line-height: .93;
  text-transform: uppercase;
  letter-spacing: .025em;
}

.hero-text p {
  max-width: 720px;
  margin: 0;
  color: #d7e2f1;
  font-size: 1.15rem;
  line-height: 1.7;
}

.hero-meta {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid rgba(215,177,91,.26);
  background: rgba(0,0,0,.18);
}

.hero-meta div {
  padding: 20px 28px;
  border-right: 1px solid rgba(215,177,91,.18);
}
.hero-meta div:last-child { border-right: 0; }
.hero-meta span {
  display: block;
  margin-bottom: 6px;
  color: #aebbd0;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 800;
}
.hero-meta strong {
  color: var(--gold-2);
  font-size: 1.02rem;
}

.result-status {
  display: none;
  margin-top: 18px;
  color: #d7e2f1;
  font-size: .94rem;
  font-family: var(--font-sans);
}
.no-results {
  display: none;
  margin-top: 18px;
  padding: 24px;
  border-radius: 20px;
  background: rgba(255,249,235,.94);
  color: var(--muted);
}
.no-results.show { display: block; }

.manual-content {
  margin-top: 28px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background:
    linear-gradient(90deg, rgba(0,0,0,.045), transparent 52px),
    linear-gradient(180deg, var(--paper-2), var(--paper));
  border: 1px solid rgba(255,255,255,.6);
}

.manual-section {
  padding: 56px 70px;
  border-bottom: 1px solid var(--line-dark);
  scroll-margin-top: 24px;
}
.manual-section.hidden { display: none; }
.manual-section:last-child { border-bottom: 0; }

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.section-kicker {
  color: #8a641e;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.manual-section h2 {
  margin: 8px 0 0;
  color: #101827;
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3vw, 3rem);
  line-height: 1.05;
}
.section-body {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.75;
}
.section-body p { margin: 0 0 16px; }
.section-body ul,
.section-body ol { margin: 0 0 22px 1.4rem; padding: 0; }
.section-body li { margin: 7px 0; padding-left: 4px; }
.section-body strong { color: #0f172a; }
.section-body h3 {
  margin: 28px 0 12px;
  color: #101827;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.code-table-wrap {
  overflow-x: auto;
  margin: 12px 0 22px;
  border: 1px solid rgba(15, 23, 42, .14);
  border-radius: 16px;
  background: rgba(255, 255, 255, .42);
}
.code-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: .96rem;
}
.code-table th,
.code-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(15, 23, 42, .1);
}
.code-table th {
  color: #8a641e;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: rgba(201, 162, 74, .12);
}
.code-table td:first-child {
  width: 130px;
  color: #0b1526;
  font-weight: 900;
}
.code-table tbody tr:last-child td { border-bottom: 0; }

.code-table .table-list {
  margin: 0;
  padding-left: 1.15rem;
}
.code-table .table-list li {
  margin: 4px 0;
  line-height: 1.45;
}
.vehicle-table td:first-child {
  width: 210px;
  vertical-align: top;
}


.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding: 22px 6px 34px;
  color: #cbd5e1;
}

.mobile-bar { display: none; }
mark {
  background: #fee28a;
  color: #111827;
  border-radius: 4px;
  padding: 0 .12em;
}

@media (max-width: 1180px) {
  .site-shell { grid-template-columns: 300px minmax(0, 1fr); }
  .content { padding: 28px; }
  .hero-content { grid-template-columns: 130px 1fr; padding: 58px 46px 34px; }
  .hero-logo { width: 130px; height: 130px; }
}

@media (max-width: 860px) {
  .site-shell { display: block; }
  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(7,17,31,.98);
    color: white;
    border-bottom: 1px solid var(--line);
  }
  .mobile-bar img { width: 38px; height: 38px; }
  .mobile-bar strong { margin-right: auto; }
  .mobile-bar button {
    border: 0;
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--gold);
    color: var(--navy-950);
    font-weight: 900;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(88vw, 340px);
    transform: translateX(-105%);
    transition: transform .22s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 18px; }
  .hero-content {
    display: block;
    padding: 44px 30px 28px;
  }
  .hero::before { inset: 14px; }
  .hero-logo { width: 112px; height: 112px; margin-bottom: 20px; }
  .hero-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-meta div { padding: 16px 18px; }
  .manual-section { padding: 42px 26px; }
  .section-head { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}



@media (max-width: 720px) {
  .vehicle-authorisation-section .vehicle-table {
    min-width: 680px;
  }
}


/* Table formatting pass v27 */
.code-table-wrap {
  width: 100%;
  margin: 16px 0 26px;
  overflow-x: auto;
  border: 1px solid rgba(15, 23, 42, .14);
  border-radius: 16px;
  background: rgba(255, 255, 255, .42);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
}

.code-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-family: var(--font-sans);
  font-size: .96rem;
  line-height: 1.45;
}

.code-table th,
.code-table td {
  padding: 13px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(15, 23, 42, .1);
}

.code-table th {
  color: #8a641e;
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: rgba(201, 162, 74, .12);
  white-space: nowrap;
}

.code-table tbody tr:nth-child(even) td {
  background: rgba(15, 23, 42, .025);
}

.code-table tbody tr:last-child td {
  border-bottom: 0;
}

.code-table td:first-child {
  color: #0b1526;
  font-weight: 900;
}

.code-table .table-list {
  margin: 0;
  padding-left: 1.15rem;
}

.code-table .table-list li {
  margin: 4px 0;
  line-height: 1.45;
  break-inside: avoid;
}

/* Two-column policy tables */
.unit-table,
.standards-table,
.tactics-table {
  table-layout: fixed;
  min-width: 680px;
}

.unit-table th:first-child,
.unit-table td:first-child,
.standards-table th:first-child,
.standards-table td:first-child,
.tactics-table th:first-child,
.tactics-table td:first-child {
  width: 30%;
  min-width: 220px;
}

.unit-table th:last-child,
.unit-table td:last-child,
.standards-table th:last-child,
.standards-table td:last-child,
.tactics-table th:last-child,
.tactics-table td:last-child {
  width: 70%;
}

/* Callsign table */
.callsign-table {
  table-layout: fixed;
  min-width: 660px;
}

.callsign-table th:nth-child(1),
.callsign-table td:nth-child(1) {
  width: 46%;
  min-width: 250px;
  white-space: nowrap;
}

.callsign-table th:nth-child(2),
.callsign-table td:nth-child(2) {
  width: 16%;
  min-width: 90px;
  text-align: center;
  white-space: nowrap;
}

.callsign-table th:nth-child(3),
.callsign-table td:nth-child(3) {
  width: 38%;
  min-width: 180px;
  white-space: nowrap;
}

/* Codes and signals tables */
.full-code-table {
  table-layout: fixed;
  min-width: 640px;
}

.full-code-table th:first-child,
.full-code-table td:first-child {
  width: 200px;
  white-space: nowrap;
}

.full-code-table th:last-child,
.full-code-table td:last-child {
  width: auto;
}

/* Vehicle authorisation tables */
.vehicle-authorisation-section .vehicle-table {
  table-layout: fixed;
  min-width: 760px;
}

.vehicle-authorisation-section .vehicle-table th:first-child,
.vehicle-authorisation-section .vehicle-table td:first-child {
  width: 32%;
  min-width: 240px;
  white-space: nowrap;
}

.vehicle-authorisation-section .vehicle-table th:last-child,
.vehicle-authorisation-section .vehicle-table td:last-child {
  width: 68%;
}

.vehicle-authorisation-section .vehicle-table .table-list {
  columns: 2;
  column-gap: 34px;
}

/* Use of force table */
.force-table {
  table-layout: fixed;
  min-width: 860px;
}

.force-table th:nth-child(1),
.force-table td:nth-child(1) {
  width: 120px;
  white-space: nowrap;
}

.force-table th:nth-child(2),
.force-table td:nth-child(2) {
  width: 245px;
  white-space: nowrap;
}

.force-table th:nth-child(3),
.force-table td:nth-child(3) {
  width: auto;
}

@media (max-width: 820px) {
  .vehicle-authorisation-section .vehicle-table .table-list {
    columns: 1;
  }
}


/* Department page link additions */
.manual-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  padding: 13px 18px;
  border-radius: 999px;
  background: rgba(215, 177, 91, .16);
  border: 1px solid rgba(215, 177, 91, .42);
  color: #f6e8bd;
  font-weight: 900;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.manual-page-link:hover {
  transform: translateY(-1px);
  background: rgba(215, 177, 91, .24);
  border-color: rgba(215, 177, 91, .72);
}


/* Employee roster additions */
.employee-table {
  min-width: 1180px;
}

.employee-table th:nth-child(1),
.employee-table td:nth-child(1) {
  width: 170px;
}

.employee-table th:nth-child(2),
.employee-table td:nth-child(2) {
  width: 170px;
}

.employee-table th:nth-child(3),
.employee-table td:nth-child(3) {
  width: 130px;
  text-align: center;
  white-space: nowrap;
}

.employee-table th:nth-child(4),
.employee-table td:nth-child(4) {
  width: 190px;
}

.employee-table th:nth-child(5),
.employee-table td:nth-child(5) {
  width: 190px;
}

.employee-table th:nth-child(6),
.employee-table td:nth-child(6) {
  width: 140px;
  white-space: nowrap;
}

.employee-notes-table {
  min-width: 760px;
}

.employee-notes-table th:first-child,
.employee-notes-table td:first-child {
  width: 220px;
  font-weight: 900;
}
