/* ── Site header ─────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(212, 227, 243, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}

.site-header .page-nav {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 260px;
  border-bottom: none;
  margin-bottom: 0;
  justify-content: center;
}

.site-header .nav-home-link {
  position: absolute;
  top: 50%;
  right: 104px;
  transform: translateY(-50%);
  z-index: 10;
}

.site-header .nav-login-link {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  z-index: 10;
}

/* ── Session countdown timer ─────────────────────────────────────────────── */
.site-header .session-info {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 6px 9px;
  pointer-events: none;
  white-space: nowrap;
}

.site-header .session-top {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.site-header .session-info .logout-btn {
  pointer-events: auto;
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 4px;
  align-self: flex-start;
}

.site-header .session-user {
  font-size: 0.72rem;
  color: var(--muted);
}

.site-header .session-user strong {
  color: var(--ink);
  font-weight: 600;
}

.site-header .session-timer {
  font-size: 0.72rem;
  color: var(--muted);
}

.site-header .page-nav .nav-home-link:hover {
  transform: translateY(-50%);
}

.site-header .page-nav .nav-login-link:hover {
  transform: translateY(-50%);
}

/* ── Search stacked layout ───────────────────────────────────────────────── */
.app-shell.search-stack {
  grid-template-columns: 1fr;
  max-width: 860px;
}

.search-top {
  padding: 20px;
}

.list-filter {
  width: 100%;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
}

.preview-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.preview-title-row .button-link {
  flex: 0;
  padding: 8px 12px;
  font-size: 0.82rem;
  white-space: nowrap;
}

/* ── Section block ───────────────────────────────────────────────────────── */
.section-block {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

.section-block:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.page-nav .nav-btn {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 8px;
  color: var(--muted);
  background: #deebf8;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex: 0;
}

.page-nav .nav-btn:hover {
  background: #cddff2;
  color: var(--ink);
  transform: none;
  filter: none;
}



.mode,
.hint {
  margin: 6px 0 10px;
  color: var(--muted);
}

.results-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.results-grid.single-col {
  grid-template-columns: 1fr;
}

.results-grid.stack-top {
  margin-top: 16px;
}

.results-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #f1f7ff;
}

input[type="password"],
select,
#vesselOffice {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
  color: var(--ink);
  font: inherit;
}

.list {
  display: grid;
  gap: 8px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f1f7ff;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.item-body {
  min-width: 0;
}

.item-title {
  margin: 0;
  font-weight: 700;
}

.item-sub {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.item-inline {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink);
}

.item-inline strong {
  font-weight: 700;
  font-size: 1.1rem;
}

.item button {
  flex: 0;
  min-width: 90px;
}

.inline-actions {
  display: flex;
  gap: 8px;
}

.search-item .inline-actions {
  margin-left: auto;
  justify-content: flex-end;
}

.email-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.email-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  justify-content: initial;
  gap: 10px;
  cursor: pointer;
  font-weight: 400;
}

.email-item input[type="checkbox"] {
  margin-top: 4px;
}

.email-item .item-title,
.email-item .item-sub {
  text-align: left;
}

.email-output {
  width: 100%;
  margin-top: 8px;
  resize: vertical;
}

.inline-actions .danger {
  border: 1px solid #bfd4ea;
  color: #1f4f82;
  background: rgba(31, 79, 130, 0.1);
}

.inline-actions .danger:hover {
  background: rgba(31, 79, 130, 0.18);
}

.empty {
  margin: 0;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: #f1f7ff;
}

.site-notice {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 400;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #89b18d;
  background: rgba(233, 246, 235, 0.96);
  color: #214a28;
  box-shadow: 0 10px 28px rgba(8, 22, 37, 0.16);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.site-notice.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.site-notice.is-error {
  border-color: #c98e8e;
  background: rgba(255, 237, 237, 0.97);
  color: #6b2525;
}

/* ── Logboek ─────────────────────────────────────────────────────────────── */
.log-shell {
  grid-template-columns: 320px 1fr;
}

.log-panel {
  overflow-x: auto;
}

.log-table-wrap {
  overflow-x: auto;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.log-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.log-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.log-table tbody tr:last-child td {
  border-bottom: none;
}

.log-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.log-time {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.8rem;
}

.log-user {
  font-weight: 600;
  white-space: nowrap;
}

.log-details {
  color: var(--muted);
  font-size: 0.8rem;
}

.log-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 0.77rem;
  font-weight: 600;
  white-space: nowrap;
}

.log-badge--toegevoegd {
  background: rgba(56, 161, 105, 0.2);
  color: #68d391;
  border: 1px solid rgba(56, 161, 105, 0.3);
}

.log-badge--gewijzigd {
  background: rgba(66, 153, 225, 0.2);
  color: #90cdf4;
  border: 1px solid rgba(66, 153, 225, 0.3);
}

.log-badge--verwijderd {
  background: rgba(229, 62, 62, 0.2);
  color: #fc8181;
  border: 1px solid rgba(229, 62, 62, 0.3);
}

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

.error-message {
  margin: 0;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid #7d4444;
  color: #ffb6b6;
  background: rgba(125, 44, 44, 0.2);
}

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

  .inline-actions {
    width: 100%;
  }
}

/* ── Utility toggles ─────────────────────────────────────────────────────── */
.utility-toggles {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
}

.utility-toggle {
  padding: 0;
  flex: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: background 0.15s, border-color 0.15s, transform 0.14s, color 0.14s;
}

/* ── Theme toggle ────────────────────────────────────────────────────────── */
.theme-toggle {
  width: 34px;
  height: 34px;
  min-width: 34px;
  max-width: 34px;
  border-radius: 50%;
  font-size: 1rem;
  overflow: hidden;
  line-height: 1;
}

.language-toggle {
  width: 34px;
  height: 34px;
  min-width: 34px;
  max-width: 34px;
  border-radius: 50%;
  font-size: 1.2rem;
  overflow: hidden;
  line-height: 1;
}

.site-header .utility-toggles {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  box-shadow: none;
  z-index: 10;
}

.site-header .utility-toggle {
  box-shadow: none;
}

.utility-toggle:hover {
  transform: scale(1.08);
  filter: none;
}

.site-header .utility-toggle:hover {
  transform: scale(1.08);
}

/* ── Dark mode ───────────────────────────────────────────────────────────── */
[data-theme="dark"] .site-header {
  background: rgba(28, 28, 28, 0.92);
}

[data-theme="dark"] input[type="password"],
[data-theme="dark"] select,
[data-theme="dark"] #vesselOffice,
[data-theme="dark"] .list-filter {
  background: #252525;
  color: var(--ink);
  border-color: var(--line);
}

[data-theme="dark"] button {
  background: linear-gradient(120deg, var(--accent), #a4a4a4);
  color: #141414;
}

[data-theme="dark"] .button-link {
  background: linear-gradient(120deg, var(--accent), #a4a4a4);
  color: #141414;
}

[data-theme="dark"] button.secondary {
  background: linear-gradient(120deg, var(--accent-2), #8f8f8f);
  color: #141414;
}

[data-theme="dark"] .button-link.secondary {
  background: linear-gradient(120deg, var(--accent-2), #8f8f8f);
  color: #141414;
}

[data-theme="dark"] .page-nav a,
[data-theme="dark"] .page-nav span:not(.active) {
  background: #252525;
}

[data-theme="dark"] .page-nav .nav-btn {
  background: #252525;
  color: var(--muted);
}

[data-theme="dark"] .page-nav a:hover,
[data-theme="dark"] .page-nav .nav-btn:hover {
  background: #3d3d3d;
  color: var(--ink);
}

[data-theme="dark"] .results-block {
  background: #2a2a2a;
}

[data-theme="dark"] .item {
  background: #252525;
}

[data-theme="dark"] .empty {
  background: #252525;
}

[data-theme="dark"] .site-notice {
  border-color: #54735a;
  background: rgba(31, 55, 36, 0.96);
  color: #d8f0dc;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .site-notice.is-error {
  border-color: #7d4444;
  background: rgba(87, 32, 32, 0.96);
  color: #ffd0d0;
}

[data-theme="dark"] .inline-actions .danger {
  border-color: #7d4444;
  color: #ffb6b6;
  background: rgba(125, 44, 44, 0.26);
}

[data-theme="dark"] .inline-actions .danger:hover {
  background: rgba(125, 44, 44, 0.38);
}
