:root {
  --bg: #f7fbfc;
  --bg-warm: #fef4e8;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --surface-soft: rgba(239, 248, 246, 0.88);
  --text: #17333b;
  --muted: #5f7379;
  --line: rgba(23, 51, 59, 0.12);
  --accent: #007f6d;
  --accent-deep: #0f5a66;
  --accent-soft: #d8f0eb;
  --nhs-blue: #005eb8;
  --berry: #c83c7a;
  --gold: #ffb81c;
  --coral: #df6155;
  --shadow-lg: 0 28px 70px rgba(27, 62, 73, 0.14);
  --shadow-md: 0 16px 34px rgba(27, 62, 73, 0.1);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(0, 127, 109, 0.18), transparent 24%),
    radial-gradient(circle at 85% 14%, rgba(200, 60, 122, 0.16), transparent 18%),
    radial-gradient(circle at bottom right, rgba(255, 184, 28, 0.18), transparent 22%),
    linear-gradient(180deg, #f8fcfd 0%, #fef7ef 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 220ms ease;
}

body.sidebar-collapsed .shell {
  grid-template-columns: 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  align-content: start;
  gap: 18px;
  height: 100vh;
  padding: 28px 22px;
  color: rgba(255, 255, 255, 0.92);
  background:
    linear-gradient(180deg, rgba(10, 70, 80, 0.96), rgba(20, 61, 81, 0.98)),
    radial-gradient(circle at top, rgba(255, 184, 28, 0.18), transparent 30%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
  overflow-x: hidden;
  transition: opacity 180ms ease, transform 220ms ease, padding 220ms ease;
}

body.sidebar-collapsed .sidebar {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.12rem;
  line-height: 1.1;
  font-weight: 700;
}

.brand small {
  margin-top: 4px;
  color: rgba(202, 233, 255, 0.84);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
}

.brand-mark,
.feature-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 16px 34px rgba(5, 27, 39, 0.26);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(219, 248, 241, 0.88));
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-toggle {
  display: none;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.nav {
  display: grid;
  gap: 8px;
  padding-bottom: 8px;
}

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

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 18px;
  color: rgba(229, 242, 247, 0.82);
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav a:hover,
.nav a.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(0, 127, 109, 0.2));
  color: white;
  transform: translateX(2px);
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  flex: 0 0 auto;
}

.subnav {
  display: grid;
  gap: 4px;
  margin: 0 0 4px 46px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.subnav-link {
  padding: 7px 10px;
  border-radius: 12px;
  color: rgba(229, 242, 247, 0.74);
  font-size: 0.9rem;
  line-height: 1.3;
}

.subnav-link:hover,
.subnav-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.main {
  padding: 34px 34px 40px;
}

.sidebar-toggle {
  margin-bottom: 16px;
  border: 1px solid rgba(23, 51, 59, 0.12);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.main > * {
  max-width: 1240px;
}

.breadcrumb-trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.94rem;
}

.breadcrumb-trail a {
  color: var(--nhs-blue);
  font-weight: 600;
}

.breadcrumb-divider {
  color: rgba(95, 115, 121, 0.5);
}

#identity-status {
  margin-bottom: 16px;
}

.identity-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(23, 51, 59, 0.12);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}

.hero,
.page-header {
  display: flex;
  gap: 26px;
  margin-bottom: 26px;
}

.hero {
  align-items: flex-start;
  padding: 28px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(234, 249, 245, 0.92)),
    var(--surface);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.78);
}

.hero h1,
.page-header h1,
.panel h2 {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.15;
  font-weight: 700;
}

.hero h1 {
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  max-width: 16ch;
}

.page-header h1 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.hero-intro,
.page-header-intro {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.section-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  color: white;
  box-shadow: 0 18px 34px rgba(7, 49, 65, 0.18);
  flex: 0 0 auto;
  position: relative;
}

.section-icon::before {
  content: "";
  width: 26px;
  height: 26px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.hero-icon,
.health-icon {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
}

.health-icon::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 2v10'/%3E%3Cpath d='M7 2v10a4 4 0 0 0 8 0V2'/%3E%3Cpath d='M19 10a2 2 0 0 0-2 2v2a4 4 0 0 1-4 4h-1'/%3E%3Cpath d='M18 20a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z'/%3E%3C/svg%3E");
}

.users-icon {
  background: linear-gradient(135deg, var(--nhs-blue), #2e8ce5);
}

.sops-icon {
  background: linear-gradient(135deg, var(--berry), var(--coral));
}

.sops-icon::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h7l5 5v13H7z'/%3E%3Cpath d='M14 3v5h5'/%3E%3Cpath d='M10 13h6'/%3E%3Cpath d='M10 17h6'/%3E%3C/svg%3E");
}

.news-icon {
  background: linear-gradient(135deg, #d54949, var(--gold));
}

.news-icon::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 1 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E");
}

.lead {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 62ch;
}

.panel,
.feature-card,
.article-shell,
.content-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-xl);
}

.panel,
.article-shell {
  padding: 24px;
}

.hero-stats,
.grid,
.stack,
.pill-group,
.list,
.download-stack,
.feedback-list {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.home-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  align-items: start;
}

.home-panel {
  min-height: 0;
}

.feature-card,
.content-card {
  padding: 22px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.feature-card:hover,
.content-card:hover,
.directory-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 46px rgba(26, 59, 69, 0.14);
}

.feature-card h3,
.content-card h3,
.article-main h1 {
  margin: 14px 0 10px;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  line-height: 1.3;
}

.feature-icon {
  color: white;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--accent-deep), var(--berry));
}

.feature-card p,
.content-card p {
  margin: 0;
}

.feature-card-static {
  cursor: default;
}

.home-feed {
  display: grid;
  gap: 14px;
}

.home-feed-card {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(23, 51, 59, 0.08);
}

.home-feed-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.home-feed-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.home-feed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.home-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.home-features .feature-card {
  min-height: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--berry);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.92rem;
}

.compact {
  padding: 18px;
}

.sidebar .panel {
  color: rgba(235, 246, 250, 0.92);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
  border-radius: var(--radius-lg);
}

.sidebar .eyebrow,
.sidebar .field-label,
.sidebar .muted {
  color: rgba(229, 242, 247, 0.82);
}

.sidebar input,
.sidebar select,
.sidebar textarea {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.panel-heading,
.toolbar,
.article-meta,
.article-actions,
.feedback-item,
.content-meta,
.stat-row,
.toolbar-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.toolbar {
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.toolbar-group {
  flex-wrap: wrap;
}

.search-field {
  flex: 1 1 320px;
}

input,
select,
textarea,
.rich-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus,
.rich-input:focus {
  outline: 3px solid rgba(0, 94, 184, 0.14);
  border-color: rgba(0, 94, 184, 0.34);
}

.rich-input {
  min-height: 220px;
  overflow: auto;
}

.rich-input:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.button,
.text-link,
.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
}

.button.primary {
  color: white;
  background: linear-gradient(135deg, var(--berry), var(--coral));
}

.button.secondary {
  color: var(--accent-deep);
  background: linear-gradient(135deg, var(--accent-soft), rgba(255, 184, 28, 0.24));
}

.button.subtle {
  color: var(--muted);
  border: 1px solid var(--line);
  background: transparent;
}

.pill-group {
  grid-auto-flow: column;
  justify-content: start;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 184, 28, 0.16));
  border: 1px solid rgba(23, 51, 59, 0.08);
  color: var(--muted);
}

.content-grid,
.section-directory {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}

.category-block {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.category-block:last-child {
  margin-bottom: 0;
}

.category-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(23, 51, 59, 0.08);
  background: linear-gradient(135deg, rgba(0, 127, 109, 0.1), rgba(255, 184, 28, 0.12));
}

.category-block-header h3 {
  margin: 4px 0 0;
  font-size: 1.22rem;
  line-height: 1.2;
}

.directory-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(23, 51, 59, 0.08);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 248, 246, 0.88));
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.directory-card.is-active {
  border-color: rgba(0, 94, 184, 0.22);
  background: linear-gradient(135deg, rgba(0, 127, 109, 0.14), rgba(255, 184, 28, 0.16));
}

.directory-name {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
}

.directory-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.content-card .summary {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 14px;
}

.tag-row,
.download-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag,
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.84rem;
}

.tag {
  background: rgba(0, 127, 109, 0.09);
  color: var(--accent-deep);
}

.badge {
  background: rgba(200, 60, 122, 0.12);
  color: #8d2051;
}

.text-link {
  color: var(--nhs-blue);
  font-weight: 700;
}

.empty-state,
.callout {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(23, 51, 59, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.callout {
  border-style: solid;
  background: rgba(255, 184, 28, 0.16);
  color: #724700;
}

.hidden,
.sr-only {
  display: none;
}

.article-shell {
  max-width: 1120px;
}

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(300px, 1fr);
  gap: 26px;
}

.article-main {
  padding-right: 6px;
}

.article-main h1 {
  font-size: clamp(1.9rem, 3.2vw, 2.8rem);
}

.article-body {
  line-height: 1.75;
}

.article-body details {
  margin: 16px 0;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(0, 127, 109, 0.08), rgba(0, 94, 184, 0.06));
}

.article-sidebar {
  display: grid;
  gap: 18px;
}

.stat-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(23, 51, 59, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 249, 247, 0.82));
}

.stat-value {
  font-size: 1.9rem;
  font-weight: 700;
}

.feedback-item {
  align-items: flex-start;
  padding: 15px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(23, 51, 59, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.download-link {
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 127, 109, 0.1), rgba(0, 94, 184, 0.08));
  color: var(--accent-deep);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(23, 51, 59, 0.08);
  text-align: left;
}

.table th {
  color: var(--muted);
  font-weight: 500;
}

.stack > * {
  margin: 0;
}

.list.tight {
  gap: 8px;
  padding-left: 18px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.admin-form,
.role-card {
  padding: 20px;
  border: 1px solid rgba(23, 51, 59, 0.08);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 251, 249, 0.86));
}

.file-editor-group {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  border: 0;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.checkbox-row input {
  width: auto;
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    padding-left: 22px;
    padding-right: 22px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
  }

  .menu-toggle {
    display: block;
  }

  .nav {
    display: none;
  }

  .sidebar.nav-open .nav {
    display: grid;
  }

  .subnav {
    margin-left: 18px;
  }

  body.sidebar-collapsed .sidebar {
    display: none;
  }
}

@media (max-width: 1080px) {
  .grid.two,
  .grid.three,
  .home-panels,
  .home-features,
  .article-grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .page-header,
  .panel-heading,
  .category-block-header,
  .toolbar,
  .article-meta,
  .article-actions,
  .toolbar-group {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-intro,
  .page-header-intro {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 18px;
  }

  .hero,
  .panel,
  .article-shell {
    padding: 20px;
    border-radius: 22px;
  }

  .section-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
  }
}
