:root {
  --rws-blue: #154273;
  --rws-link: #0073bf;
  --rws-link-hover: #00548c;
  --rws-primary: #007bc7;
  --rws-primary-hover: #006eb3;
  --rws-yellow: #f9e11e;
  --rws-yellow-hover: #edd406;
  --rws-yellow-light: #fcf29a;
  --rws-focus: #e17000;
  --rws-text: #222;
  --rws-muted: #696969;
  --rws-border: #ddd;
  --rws-border-dark: #b4b4b4;
  --rws-panel: #f3f3f3;
  --rws-panel-dark: #e6e6e6;
  --rws-success: #39870c;
  --rws-error: #d52b1e;
}

@font-face {
  font-family: RijksoverheidSansText;
  font-style: normal;
  font-weight: 400;
  src: url("/static/font/ROsanswebtextregular.woff") format("woff");
}

@font-face {
  font-family: RijksoverheidSansText;
  font-style: normal;
  font-weight: 700;
  src: url("/static/font/ROsanswebtextbold.woff") format("woff");
}

* { box-sizing: border-box; }

html {
  font-size: 15px;
  line-height: 1.5;
  scroll-padding-top: 20px;
}

@media (min-width: 900px) {
  html {
    font-size: 16px;
    line-height: 1.6;
  }
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: #fff;
  color: var(--rws-text);
  font-family: RijksoverheidSansText, Arial, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover,
a:focus {
  color: var(--rws-link-hover);
}

.topbar {
  position: relative;
  background: #fff;
  min-height: 124px;
}

.topbar::before {
  content: "";
  display: block;
  height: 88px;
  background: #fff;
}

.topbar::after {
  content: "";
  display: block;
  height: 44px;
  background: var(--rws-yellow);
}

.brand {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  width: min(100%, 1240px);
  height: 88px;
  padding: 0 20px;
  transform: translateX(-50%);
}

.brand > a {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 270px;
  height: 88px;
  color: var(--rws-blue);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
}

.brand > a::before {
  content: "";
  width: 42px;
  height: 56px;
  margin-right: 10px;
  background:
    linear-gradient(90deg, var(--rws-blue) 0 32%, transparent 32% 37%, var(--rws-yellow) 37% 63%, transparent 63% 68%, var(--rws-blue) 68%),
    linear-gradient(var(--rws-blue), var(--rws-blue));
  background-repeat: no-repeat;
  background-position: center 6px, center 42px;
  background-size: 100% 28px, 100% 8px;
}

.role-badge {
  grid-column: 3;
  justify-self: end;
  max-width: 360px;
  color: var(--rws-muted);
  font-size: .9rem;
  line-height: 1.3;
}

.topbar nav {
  position: absolute;
  bottom: 0;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  width: min(100%, 1240px);
  height: 44px;
  padding: 0 20px;
  transform: translateX(-50%);
}

.topbar nav a,
.logout-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-left: 1px solid rgba(0, 0, 0, .1);
  background: transparent;
  color: var(--rws-text);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.topbar nav a:hover,
.topbar nav a:focus,
.logout-button:hover,
.logout-button:focus {
  background: var(--rws-yellow-light);
  color: var(--rws-text);
}

.logout-form {
  display: inline-flex;
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--rws-focus);
  outline-offset: 2px;
}

.topbar a:focus-visible,
.logout-button:focus-visible {
  outline-offset: -2px;
}

.container {
  max-width: 1180px;
  margin: 32px auto;
  padding: 0 16px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rws-border);
}

.page-header h1 {
  margin: 0 0 8px;
  color: var(--rws-blue);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.page-header p {
  margin: 0;
  max-width: 760px;
  color: var(--rws-muted);
}

h1,
h2,
h3 {
  color: var(--rws-blue);
  font-weight: 700;
  line-height: 1.3;
}

h1 { font-size: 2rem; margin: 0 0 20px; }
h2 { font-size: 1.5rem; margin: 28px 0 12px; }
h3 { font-size: 1.25rem; margin: 24px 0 10px; }
p { margin: 0 0 1.125rem; }
strong { font-weight: 700; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

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

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.info-panel,
.login-panel,
.auth-panel,
.form-panel,
.panel,
.searchform {
  background: var(--rws-panel);
  border: 0;
  border-radius: 0;
}

.info-panel,
.login-panel,
.auth-panel,
.form-panel,
.searchform {
  padding: 24px;
}

.info-panel h2,
.login-panel h2,
.auth-panel h1 {
  margin-top: 0;
}

.panel {
  display: block;
  min-height: 100%;
  padding: 20px;
  color: var(--rws-text);
  text-decoration: none;
  border-top: 4px solid var(--rws-yellow);
}

.panel strong {
  display: block;
  margin-bottom: 8px;
  color: var(--rws-link);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.panel span {
  color: var(--rws-muted);
}

.panel:hover,
.panel:focus {
  background: var(--rws-panel-dark);
}

.panel:hover strong,
.panel:focus strong {
  color: var(--rws-link-hover);
  text-decoration: underline;
}

.auth-panel { max-width: 720px; }
.auth-panel-narrow { max-width: 460px; margin: 0 auto; }
.auth-panel form p { margin: 0 0 16px; }
.auth-panel .float-right { float: right; }
.form-panel { max-width: 760px; }

.auth-panel label,
.form-panel label {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  color: var(--rws-text);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

input,
select,
textarea {
  box-sizing: border-box;
  width: 100%;
  max-width: 400px;
  min-height: 44px;
  margin: 2px 0;
  padding: 3px 16px;
  border: 1px solid var(--rws-muted);
  border-radius: 3px;
  background: #fff;
  box-shadow: inset 1px 1px 3px rgba(105, 105, 105, .1);
  color: var(--rws-text);
  font: 16px RijksoverheidSansText, Arial, sans-serif;
  line-height: 1.5;
  accent-color: var(--rws-link);
}

select {
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml;utf8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M5.13 8.77l.62-.62a.44.44 0 0 1 .63 0L12 13.78l5.62-5.61a.44.44 0 0 1 .63 0l.62.62a.44.44 0 0 1 0 .62l-6.54 6.55a.45.45 0 0 1-.64 0L5.13 9.4a.44.44 0 0 1 0-.63z' fill='%23222'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

textarea {
  max-width: 100%;
  min-height: 170px;
  padding: 10px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #999;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--rws-link);
  box-shadow: inset 1px 1px 3px rgba(105, 105, 105, .1), inset 0 0 0 1px var(--rws-link), 0 0 5px rgba(0, 115, 191, .5);
  outline: 0;
}

input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  min-height: 20px;
}

.helptext,
.form-guidance {
  display: block;
  margin-top: 6px;
  color: #535353;
  font-size: 15px;
}

.form-guidance {
  border-top: 1px solid var(--rws-panel-dark);
  padding-top: 16px;
}

.btn,
.button {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 20px;
  margin: 5px 0;
  padding: 12px 16px;
  border: 0;
  border-radius: 3px;
  background: var(--rws-yellow);
  color: var(--rws-text);
  font-family: RijksoverheidSansText, Arial, sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
}

.btn:hover,
.btn:focus,
.button:hover,
.button:focus {
  background: var(--rws-yellow-hover);
  color: var(--rws-text);
  text-decoration: underline;
}

.btn-primary,
.button.primary {
  background: var(--rws-primary);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.button.primary:hover,
.button.primary:focus {
  background: var(--rws-primary-hover);
  color: #fff;
}

.btn-secondary {
  background: var(--rws-muted);
  color: #fff;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: #5f5f5f;
  color: #fff;
}

.btn-link {
  border: 0;
  background: transparent;
  color: var(--rws-link);
  padding-left: 0;
  padding-right: 0;
}

.btn-block,
.button.full-width {
  display: flex;
  justify-content: center;
  width: 100%;
}

table {
  width: 100%;
  max-width: 100%;
  margin-bottom: 1.125rem;
  border: 0;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  border: 1px solid var(--rws-border);
  padding: 8px;
  text-align: left;
  vertical-align: top;
  font-size: .95rem;
  line-height: 1.5;
}

@media (min-width: 651px) {
  th,
  td {
    padding: 12px 16px;
    font-size: 1rem;
  }
}

th {
  background: var(--rws-panel);
  color: var(--rws-text);
  font-weight: 700;
}

table tr > :first-child { border-left: 0; }
table tr > :last-child { border-right: 0; }
table thead td,
table thead th { font-weight: 700; }
tbody th { background: #fff; }

.searchform {
  margin-bottom: 24px;
}

.location-map-panel {
  margin-bottom: 32px;
}

.location-map {
  width: 100%;
  height: 420px;
  border: 1px solid var(--rws-border);
  background: var(--rws-panel-dark);
}

.location-map .leaflet-popup-content {
  font-family: RijksoverheidSansText, Arial, sans-serif;
  line-height: 1.4;
}

.location-map-fallback {
  padding: 16px;
  border: 1px solid var(--rws-border);
  background: var(--rws-panel);
  color: var(--rws-muted);
}

.documentation-section {
  margin: 0 0 32px;
}

.documentation-section h2 {
  margin-bottom: 12px;
}

.model-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
}

.model-node {
  padding: 8px 12px;
  border: 1px solid var(--rws-border);
  border-radius: 3px;
  background: var(--rws-panel);
  font-weight: 700;
}

.model-org { background: #e5f2fb; border-color: #b6d7ec; }
.model-asset { background: #e4f1db; border-color: #bfd7b2; }
.model-arrow { color: var(--rws-muted); font-size: .9rem; }

pre {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--rws-border-dark);
  background: var(--rws-panel);
  color: var(--rws-text);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .95em;
}

.ci-depth-1 { padding-left: 1.5rem; }
.ci-depth-2 { padding-left: 3rem; }
.ci-depth-3 { padding-left: 4.5rem; }
.ci-depth-4 { padding-left: 6rem; }

.message {
  margin-bottom: 24px;
  padding: 16px;
  border-left: 4px solid var(--rws-success);
  background: #e4f1db;
}

.message.error,
.form-errors,
.errorlist {
  margin: 8px 0;
  padding: 16px;
  border-left: 4px solid var(--rws-error);
  background: #fbe8e6;
  color: var(--rws-error);
  font-weight: 700;
}

@media (max-width: 860px) {
  .topbar,
  .topbar::before,
  .topbar::after {
    min-height: 0;
    height: auto;
  }

  .topbar::before,
  .topbar::after {
    display: none;
  }

  .brand {
    position: static;
    display: flex;
    width: 100%;
    height: auto;
    min-height: 80px;
    padding: 12px 16px;
    transform: none;
  }

  .brand > a {
    justify-content: flex-start;
    width: auto;
    height: auto;
    min-height: 56px;
    text-align: left;
  }

  .role-badge {
    max-width: none;
  }

  .topbar nav {
    position: static;
    width: 100%;
    height: auto;
    padding: 0;
    transform: none;
    background: var(--rws-yellow);
  }

  .topbar nav a,
  .logout-button {
    border-top: 1px solid rgba(0, 0, 0, .1);
  }

  .page-header,
  .brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }
}
