:root {
  /* Merkkleuren */
  --green: #4a7362;
  --green-dark: #2f463c;
  --green-light: #8fb5a3;
  --green-soft: rgba(120, 178, 154, 0.16);

  --bg: #0b0d0c;
  --surface: rgba(30, 33, 31, 0.22);
  --surface-strong: rgba(255, 255, 255, 0.1);
  --surface-solid: #16181a;
  --border: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.2);
  --text: #f3f5f4;
  --text-muted: rgba(243, 245, 244, 0.58);
  --text-faint: rgba(243, 245, 244, 0.36);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);

  --blur: blur(28px) saturate(150%);

  --danger: #ff6b6b;
  --danger-dark: #e2483f;
  --danger-soft: rgba(255, 107, 107, 0.14);

  --ease: 200ms cubic-bezier(.4, 0, .2, 1);
}

/* =========================
   RESET & BASIS
   ========================= */
* {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  position: relative;
}

/* Ambient glow behind the whole app (shows through empty photo areas) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(720px 420px at 18% -8%, rgba(120, 178, 154, 0.16), transparent 60%),
    radial-gradient(600px 500px at 85% 0%, rgba(90, 130, 200, 0.1), transparent 55%);
}

::selection {
  background: var(--green-light);
  color: #0b0d0c;
}

/* Modern scrollbar (webkit) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.14);
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.24);
  background-clip: content-box;
}

/* =========================
   APP LAYOUT
   ========================= */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  gap: 16px;
  padding: 16px;
}

/* =========================
   SIDEBAR
   ========================= */
.sidebar {
  width: 84px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  padding: 18px 12px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.logo {
  margin-bottom: 22px;
}

.logo img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  flex: 1;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 4px;
  border-radius: 13px;
  border: 1px solid transparent;
  transition: background var(--ease), color var(--ease), border-color var(--ease), transform var(--ease);
}

.sidebar nav a svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.sidebar nav a:hover {
  background: var(--surface-strong);
  color: var(--text);
}

.sidebar nav a:active {
  transform: scale(0.94);
}

.sidebar nav a.active {
  background: var(--surface-strong);
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.sidebar nav hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 6px;
  width: 32px;
}

.sidebar nav .nav-spacer {
  flex: 1;
}

/* =========================
   CONTENT
   ========================= */
.content {
  flex: 1;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 4px 18px;
}

.topbar-eyebrow {
  font-size: 13px;
  color: var(--text-muted);
  text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

.topbar-eyebrow strong {
  color: var(--text);
  font-weight: 600;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 16px 6px 6px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--text);
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.user-meta strong {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.user-meta small {
  font-size: 11.5px;
  color: var(--text-muted);
}

.page {
  padding: 4px;
}

/* =========================
   TYPOGRAFIE
   ========================= */
h1 {
  margin-top: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  text-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

p {
  color: var(--text-muted);
}

a {
  color: var(--green-light);
}

/* =========================
   CARDS
   ========================= */
.card {
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  border: 1px solid var(--border);
  transition: box-shadow var(--ease), border-color var(--ease);
}

/* =========================
   KPI BLOKKEN (DASHBOARD)
   ========================= */
.kpis {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}

.kpi {
  min-width: 160px;
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}

.kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.kpi span {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}

.kpi strong {
  display: block;
  font-size: 32px;
  font-weight: 700;
  margin-top: 8px;
  letter-spacing: -.02em;
  color: var(--text);
}

/* =========================
   FORMULIEREN
   ========================= */
form label {
  display: block;
  margin-top: 16px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  margin-top: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  /* Geen backdrop-filter hier: te veel gelijktijdige blur-lagen (elke card +
     elk veld) laat de browser zijn GPU-budget overschrijden, waardoor de
     blur op willekeurige elementen niet meer rendert. Velden krijgen daarom
     een iets dekkendere vlakke tint i.p.v. hun eigen glaslaag. */
  background: rgba(22, 24, 23, 0.55);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

select {
  color-scheme: dark;
}

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

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: var(--green-light);
  background: var(--surface-strong);
  box-shadow: 0 0 0 3px var(--green-soft);
}

/* =========================
   RANGE SLIDERS
   ========================= */
input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  padding: 0;
  margin-top: 6px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(to right, var(--green-light) var(--range-fill, 0%), rgba(255, 255, 255, 0.12) var(--range-fill, 0%));
  cursor: pointer;
}

input[type="range"]:focus {
  outline: none;
  box-shadow: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: linear-gradient(to right, var(--green-light) var(--range-fill, 0%), rgba(255, 255, 255, 0.12) var(--range-fill, 0%));
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--green-light);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform var(--ease), box-shadow var(--ease);
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px var(--green-soft);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.12);
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.12);
}

input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--green-light);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green-light);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease);
}

input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px var(--green-soft);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 120px auto;
  gap: 12px;
  align-items: end;
}

/* Toggle switch (checkboxes) */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 42px !important;
  height: 25px;
  margin: 0 10px 0 0 !important;
  padding: 0;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--border-strong);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--ease), border-color var(--ease);
}

input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  transition: transform var(--ease);
}

input[type="checkbox"]:checked {
  background: var(--green);
  border-color: var(--green);
}

input[type="checkbox"]:checked::before {
  transform: translateX(17px);
}

input[type="checkbox"]:focus-visible {
  box-shadow: 0 0 0 3px var(--green-soft);
}

/* =========================
   BUTTONS (ALGEMEEN)
   ========================= */
.btn,
a.btn {
  margin-top: 20px;
  background: linear-gradient(180deg, #ffffff, #e7e9e8);
  color: #14171a;
  border: 1px solid rgba(255,255,255,0.6);
  padding: 12px 18px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-block;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: filter var(--ease), box-shadow var(--ease), transform var(--ease);
}

/* Hover effect voor alle buttons */
.btn:hover,
a.btn:hover {
  filter: brightness(0.96);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.btn:active,
a.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Disabled button state */
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn:disabled:hover {
  filter: none;
  transform: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* =========================
   SECONDARY BUTTON
   Gebruik voor: filters, minder belangrijke acties
   ========================= */
.btn.secondary,
a.btn.secondary {
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: none;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

/* Hover secondary */
.btn.secondary:hover,
a.btn.secondary:hover {
  background: rgba(255,255,255,0.12);
  box-shadow: var(--shadow-sm);
}

/* =========================
   DANGER BUTTON
   Gebruik voor: verwijderen / destructieve acties
   ========================= */
.btn.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(255, 107, 107, 0.35);
  box-shadow: none;
}

/* Hover danger */
.btn.danger:hover {
  background: rgba(255, 107, 107, 0.22);
  color: #fff;
  box-shadow: 0 6px 16px rgba(226, 72, 63, 0.3);
}

/* =========================
   BUTTON GROUPS
   ========================= */
.button-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.button-row .btn {
  flex: 1;
}

/* =========================
   TABELLEN
   ========================= */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--border);
}

th {
  text-transform: uppercase;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--text-faint);
}

tbody tr {
  transition: background var(--ease);
}

tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

.actions {
  text-align: right;
  white-space: nowrap;
}

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

/* =========================
   ALERTS (FEEDBACK)
   ========================= */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
}

.alert.success {
  border-left: 3px solid #4caf62;
  background: rgba(76, 175, 98, 0.08);
}

.alert.error {
  border-left: 3px solid var(--danger);
  background: rgba(255, 107, 107, 0.08);
}

/* =========================
   LOGIN PAGINA
   ========================= */
body.login {
  display: flex;
  align-items: center;
  justify-content: center;
}

body.login .container {
  max-width: 360px;
}

body.login h1 {
  font-size: 26px;
}

/* =========================
   QR CODE WEERGAVE
   ========================= */
#qrBlock {
  text-align: center;
  margin-top: 20px;
}

#qrBlock img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

/* =========================
   STATUS INDICATORS
   ========================= */
.status-indicator {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: help;
  line-height: 1.3;
  border: 1px solid transparent;
}

.status-active {
  color: #6fd684;
  background: rgba(76, 175, 98, 0.14);
  border-color: rgba(76, 175, 98, 0.25);
}

.status-broken {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(255, 107, 107, 0.25);
}

.status-unknown {
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  border-color: var(--border);
}

.status-checking {
  color: #ffc266;
  background: rgba(255, 194, 102, 0.14);
  border-color: rgba(255, 194, 102, 0.25);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* =========================
   KPI WARNING
   ========================= */
.kpi-warning {
  border-color: rgba(255, 152, 0, 0.4) !important;
}

.kpi-warning strong {
  color: #ff9800;
}

/* =========================
   KLEINE BUTTONS
   ========================= */
.btn-small,
a.btn-small {
  padding: 7px 12px;
  font-size: 12.5px;
  margin-top: 0;
  margin-left: 4px;
}

.actions .btn-small:first-child {
  margin-left: 0;
}
/* =========================
   TEXT TOOLS
   ========================= */
.tool-container {
  display: flex;
  gap: 30px;
  margin-top: 20px;
  align-items: stretch;
}

.tool-column {
  flex: 1;
  min-width: 0;
}

.tool-section {
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.tool-section h3 {
  margin: 0 0 15px 0;
  color: var(--green-light);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tool-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.text-channel-control {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.text-channel-field {
  display: grid;
  gap: 5px;
  width: min(220px, 100%);
}

.text-channel-field label {
  color: #455468;
  font-size: 13px;
  font-weight: 600;
}

.text-channel-field select {
  min-height: 40px;
}

.text-character-count {
  padding-bottom: 10px;
  color: #637187;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.text-character-count.is-over-limit {
  color: #b42318;
}

.keyword-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.keyword-results[hidden] {
  display: none;
}

.keyword-result {
  min-width: 0;
  margin-bottom: 0;
}

.keyword-result h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.keyword-result textarea {
  min-height: 180px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.keyword-result .btn {
  width: 100%;
}

.calculator-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 16px;
}

.calculator-tab {
  padding: 10px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}

.calculator-tab:hover {
  background: var(--surface-strong);
  color: var(--text);
}

.calculator-tab[aria-selected="true"] {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.calculator-panel[hidden] {
  display: none;
}

.calculator-panel h2 {
  margin-top: 0;
  font-size: 20px;
}

.calculator-panel label {
  display: block;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
  color: #455468;
}

.calculator-fields,
.calculator-conversions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.budget-amount,
.budget-period {
  grid-column: 1 / -1;
}

.budget-period-label {
  display: block;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
  color: #455468;
}

.budget-period-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.budget-period-option {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #d4dce8;
  border-radius: var(--radius-pill);
  background: #fff;
  color: #34445a;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}

.budget-period-option:hover {
  border-color: #b6c4bd;
  background: #f5f8f6;
  color: #395448;
}

.budget-period-option[aria-pressed="true"] {
  border-color: #395448;
  background: #395448;
  color: #fff;
}

.budget-period > label {
  margin-top: 12px;
}

.calculator-result {
  display: block;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #d6deeb;
  border-radius: var(--radius-sm);
  background: #f7f9fc;
  color: #1d1d1b;
  font-size: 16px;
  font-weight: 600;
}

.calculator-result.is-error {
  border-color: #f0caca;
  background: #fff2f1;
  color: #912018;
}

.app .tool-actions .btn,
.app .keyword-result .btn,
.app .calculator-panel > .btn {
  min-height: 42px;
  padding: 10px 16px;
  font-weight: 600;
  transition: background var(--ease), border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}

.app .tool-actions .btn {
  margin-top: 0;
}

.app .calculator-panel > .btn {
  margin-top: 16px;
}

.app .btn:focus-visible,
.app .calculator-tab:focus-visible,
.app .budget-period-option:focus-visible {
  outline: 3px solid rgba(57, 84, 72, .35);
  outline-offset: 2px;
}

/* =========================
   TOAST NOTIFICATIONS
   ========================= */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  font-size: 14px;
  font-weight: 500;
  animation: slideIn 0.3s cubic-bezier(.4,0,.2,1);
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.toast.hide {
  animation: slideOut 0.3s ease-out forwards;
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 768px) {
  .app {
    flex-direction: column;
    padding: 10px;
    gap: 10px;
  }

  .sidebar {
    width: 100%;
    height: auto;
    max-height: none;
    position: static;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    padding: 12px;
  }

  .logo {
    margin-bottom: 0;
    margin-right: 10px;
  }

  .sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: auto;
    flex: 0;
  }

  .sidebar nav a {
    margin-bottom: 0;
    margin-right: 4px;
  }

  .sidebar nav hr {
    display: none;
  }

  .sidebar nav .nav-spacer {
    display: none;
  }

  .topbar {
    flex-direction: column;
  }

  .tool-container {
    flex-direction: column;
    gap: 20px;
  }

  .keyword-results {
    grid-template-columns: minmax(0, 1fr);
  }

  .calculator-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .qr-container {
    flex-direction: column;
    gap: 20px;
  }

  .qr-column {
    max-width: 100%;
  }

  .link-container {
    flex-direction: column;
    gap: 20px;
  }

  .link-column {
    max-width: 100%;
  }

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

  .reset-password-input {
    min-width: 0;
  }

  .inline {
    flex-wrap: wrap;
    min-width: 0;
    margin-left: 0;
  }

  .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .table-responsive table {
    min-width: 560px;
  }

  #qrBlock > div {
    max-width: 100%;
  }

  #qrBlock img {
    height: auto;
  }
}

@media (max-width: 600px) {
  .app {
    padding: 8px;
  }

  .page {
    padding: 2px;
  }

  .page > h1 {
    font-size: clamp(24px, 7vw, 30px);
    overflow-wrap: anywhere;
  }

  .card {
    padding: 16px;
    margin-bottom: 16px;
  }

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

  .button-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .button-row .btn {
    flex: 1 1 140px;
    min-width: 0;
  }

  .tool-actions .btn {
    flex: 1 1 120px;
    min-width: 0;
  }

  .table-responsive table {
    min-width: 520px;
  }

  td.actions {
    align-items: flex-start;
    flex-direction: column;
    white-space: normal;
  }

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

  td.actions .inline .btn {
    margin-left: 0;
  }
}

/* =========================
   QR GENERATOR STYLES
   ========================= */
.qr-container {
  display: flex;
  gap: 30px;
  margin-top: 20px;
  align-items: stretch;
}

.qr-column {
  flex: 0 1 50%;
  max-width: 50%;
  min-width: 0;
}

/* =========================
   SHORTLINK GENERATOR STYLES
   ========================= */
.link-container {
  display: flex;
  gap: 30px;
  margin-top: 20px;
  align-items: stretch;
}

.link-column {
  flex: 0 1 50%;
  max-width: 50%;
  min-width: 0;
}

/* =========================
   ACTIES IN USERS TABLE NETJES OP 1 LIJN
   ========================= */

td.actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

td.actions form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

td.actions .btn {
  margin-top: 0; /* override standaard 20px margin */
}

/* =========================
   BUTTON UITLIJNING IN FORM-GRID
   ========================= */

.form-grid .btn {
  margin-top: 0;
  align-self: end;
}

.reset-password-input {
  flex: 1;
  min-width: 420px;
}
/* =========================
   TABLE TEXT LEFT ALIGN
   ========================= */

th,
td {
  text-align: left;
}

td.actions,
th.actions {
  text-align: right;
}

@media (max-width: 768px) {
  .reset-password-input {
    min-width: 0;
  }
}

@media (max-width: 600px) {
  td.actions {
    align-items: flex-start;
    flex-direction: column;
    white-space: normal;
  }
}

/* =========================
   LOGIN V2: centered + dynamic bg + slideshow
   ========================= */

body.login.login-v2 {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

body.login.login-v2::before {
  content: none;
}

/* Centered card */
.login-center {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.login-card h1 {
  color: #fff;
}

.subtitle {
  margin-top: -6px;
  margin-bottom: 18px;
  color: var(--text-muted);
}

/* Background base layer */
.login-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Slideshow background (subtiel!) */
.login-bg-slideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.3s ease-in-out;
  filter: grayscale(0%) contrast(100%) brightness(0.85);
}

.login-bg-slideshow img.visible {
  opacity: 0.55;
}

/* Donkere overlay zodat het glas-effect leesbaar blijft */
.login-bg-slideshow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 8, 7, 0.034), rgba(6, 8, 7, 0.144) 15%, rgba(6, 8, 7, 0.178));
}

/* Mobiel: card blijft mooi */
@media (max-width: 600px) {
  .login-card { max-width: 100%; }
}

/* =========================
   ENTRANCE ANIMATIE (premium fade bij openen)
   ========================= */
/* Puur opacity-only: een transform hier zou (via animation-fill-mode) een
   nieuwe stacking/backdrop-context op de voorouder achterlaten, waardoor
   geneste .card-elementen met backdrop-filter niet meer door de echte
   achtergrondfoto heen kunnen blurren en veel "leger"/doorzichtiger ogen. */
@keyframes fadeSlideUp {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeSlideDown {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeSlideRight {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.sidebar {
  animation: fadeSlideRight 560ms cubic-bezier(.22, 1, .36, 1) both;
}

/* Animatie zit bewust NIET op .topbar/wrapper-containers: een geanimeerd
   voorouder-element (zelfs opacity-only, fill-mode:both) kan de browser
   ertoe zetten dat op zijn eigen compositing-laag te zetten, wat
   backdrop-filter van geneste cards/chips blokkeert. Daarom animeren we
   alleen de glaselementen zelf, nooit hun wrappers. */
.topbar-eyebrow {
  animation: fadeSlideDown 520ms cubic-bezier(.22, 1, .36, 1) both;
  animation-delay: 60ms;
}

.user-chip {
  animation: fadeSlideDown 520ms cubic-bezier(.22, 1, .36, 1) both;
  animation-delay: 60ms;
}

.page > h1 {
  animation: fadeSlideUp 560ms cubic-bezier(.22, 1, .36, 1) both;
  animation-delay: 80ms;
}

.page > p {
  animation: fadeSlideUp 560ms cubic-bezier(.22, 1, .36, 1) both;
  animation-delay: 130ms;
}

.card,
.kpi,
.alert {
  animation: fadeSlideUp 560ms cubic-bezier(.22, 1, .36, 1) both;
  animation-delay: 200ms;
}

.kpis > .kpi:nth-child(2) { animation-delay: 250ms; }
.kpis > .kpi:nth-child(3) { animation-delay: 300ms; }

.login-card {
  animation: fadeSlideUp 620ms cubic-bezier(.22, 1, .36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .topbar-eyebrow,
  .user-chip,
  .page > h1,
  .page > p,
  .card,
  .kpi,
  .alert,
  .login-card {
    animation: none;
  }
}

/* =========================
   NHLink dashboard styling
   ========================= */
body:not(.login) {
  min-height: 100vh;
  background: #f3f5f9;
  color: #1d2939;
}

body:not(.login)::before {
  display: none;
}

.app {
  --green: #395448;
  --green-dark: #2f463c;
  --green-light: #879e94;
  --green-soft: rgba(135, 158, 148, .2);
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-strong: #eef2ef;
  --surface-solid: #ffffff;
  --border: #e5e9f0;
  --border-strong: #d6deeb;
  --text: #1d2939;
  --text-muted: #637187;
  --text-faint: #8290a4;
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 0;
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .06);
  --shadow: 0 4px 14px rgba(16, 24, 40, .08);
  --shadow-lg: 0 10px 28px rgba(16, 24, 40, .12);
  --blur: none;
  --danger: #c93737;
  --danger-dark: #ae2929;
  --danger-soft: #fff0f0;
  display: block;
  min-height: 100vh;
  padding: 0;
  background: var(--bg);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  max-height: 100vh;
  max-height: 100dvh;
  align-items: stretch;
  padding: 22px 14px 16px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  overflow: hidden auto;
  overscroll-behavior: contain;
  animation: none;
}

.logo {
  margin: 0 8px 26px;
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.nav-toggle {
  display: none;
}

.logo img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  box-shadow: none;
}

.sidebar nav {
  align-items: stretch;
  gap: 4px;
  min-height: 0;
}

.nav-section-label {
  display: block;
  margin: 8px 10px 7px;
  color: #8793a5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.sidebar nav a {
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  height: auto;
  margin: 0;
  padding: 0 10px;
  border-radius: 8px;
  color: #526176;
}

.sidebar nav a svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.nav-label {
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar nav a:hover {
  background: #f3f6f4;
  color: #395448;
}

.sidebar nav a.active {
  border-color: transparent;
  background: #eef2ef;
  color: #395448;
  box-shadow: none;
}

.sidebar nav a.active .nav-label {
  font-weight: 650;
}

.sidebar nav a.logout-nav-link {
  color: #395448;
}

.sidebar nav a.logout-nav-link:hover {
  background: #eef2ef;
}

.sidebar nav hr {
  width: auto;
  margin: 14px 8px 8px;
  border-top-color: var(--border);
}

.sidebar nav .nav-spacer {
  min-height: 24px;
}

.content {
  width: calc(100% - 238px);
  margin-left: 238px;
  min-width: 0;
  background: var(--bg);
}

.topbar {
  min-height: 68px;
  align-items: center;
  padding: 12px 28px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.topbar-eyebrow {
  color: var(--text-muted);
  text-shadow: none;
  animation: none;
}

.topbar-eyebrow strong {
  color: var(--text);
}

.user-chip {
  display: flex;
  align-items: center;
  padding: 5px 13px 5px 5px;
  border-color: var(--border);
  background: #fff;
  box-shadow: none;
  animation: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.week-number {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: #f3f6f4;
  color: #395448;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.logout-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #395448;
  border-radius: 8px;
  background: #395448;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--ease), border-color var(--ease);
}

.logout-action:hover {
  border-color: #2f463c;
  background: #2f463c;
}

.logout-action svg {
  width: 17px;
  height: 17px;
}

.user-avatar {
  border: 0;
  background: #eef2ef;
  color: #395448;
}

.user-avatar.has-photo {
  overflow: hidden;
  padding: 0;
  border-radius: 50%;
}

.user-avatar-photo {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.user-avatar-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border-radius: inherit;
}

.user-avatar-fallback[hidden] {
  display: none;
}

.user-meta strong {
  color: var(--text);
}

.user-meta small {
  color: var(--text-muted);
}

.page {
  padding: 28px 32px;
}

.app h1,
.app h2,
.app h3,
.app h4,
.app .brand-hub-heading h2,
.app .link-overview-title,
.app .brand-details-heading h3,
.app .brand-section h4 {
  color: #879e94;
  text-shadow: none;
}

.page > h1,
.page > p {
  animation: none;
}

.app p {
  color: var(--text-muted);
}

.app a {
  color: #395448;
}

.app .card,
.app .tool-section {
  border-color: var(--border);
  background: #fff;
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.app .card,
.app .kpi,
.app .alert {
  animation: none;
}

.app .kpi:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.app .kpi span {
  color: var(--text-muted);
}

.app .kpi strong {
  color: var(--text);
}

.app form label {
  color: #455468;
}

.app input:not([type="checkbox"]):not([type="range"]),
.app select,
.app textarea {
  border-color: #d6deeb;
  background: #fff;
  color: var(--text);
}

.app input::placeholder,
.app textarea::placeholder {
  color: #8793a5;
}

.app select {
  color-scheme: light;
}

.app input:focus,
.app select:focus,
.app textarea:focus {
  border-color: #879e94;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(135, 158, 148, .2);
}

.app input[type="range"],
.app input[type="range"]::-webkit-slider-runnable-track {
  background: linear-gradient(to right, #879e94 var(--range-fill, 0%), #e3e8f0 var(--range-fill, 0%));
}

.app input[type="range"]::-moz-range-track {
  background: #e3e8f0;
}

.app input[type="range"]::-moz-range-progress {
  background: #879e94;
}

.app input[type="range"]::-webkit-slider-thumb,
.app input[type="range"]::-moz-range-thumb {
  background: #879e94;
}

.app input[type="checkbox"] {
  border-color: #cbd4e1;
  background: #e6eaf0;
}

.app input[type="checkbox"]:checked {
  border-color: #395448;
  background: #395448;
}

.app input[type="checkbox"]::before {
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .2);
}

.app .btn,
.app a.btn {
  border: 1px solid #395448;
  background: #395448;
  color: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
}

.app .btn:hover,
.app a.btn:hover {
  border-color: #2f463c;
  background: #2f463c;
  color: #fff;
  box-shadow: 0 3px 8px rgba(57, 84, 72, .18);
}

.app .btn:active,
.app a.btn:active {
  background: #263b31;
}

.app .btn.secondary,
.app a.btn.secondary {
  border-color: #d4dce8;
  background: #fff;
  color: #34445a;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.app .btn.secondary:hover,
.app a.btn.secondary:hover {
  border-color: #b6c4bd;
  background: #f5f8f6;
  color: #395448;
  box-shadow: none;
}

.app .calculator-tab {
  border-color: #d4dce8;
  background: #fff;
  color: #34445a;
}

.app .calculator-tab:hover {
  border-color: #b6c4bd;
  background: #f5f8f6;
  color: #395448;
}

.app .calculator-tab[aria-selected="true"] {
  border-color: #395448;
  background: #395448;
  color: #fff;
}

.app .btn.danger {
  border-color: #f0caca;
  background: #fff5f5;
  color: #b42318;
}

.app .btn.danger:hover {
  border-color: #e4a6a6;
  background: #ffebeb;
  color: #912018;
  box-shadow: none;
}

.app .btn:disabled:hover {
  background: #395448;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
}

.app table {
  color: var(--text);
}

.app th,
.app td {
  border-bottom-color: var(--border);
}

.app th {
  color: #6f7d91;
}

.app tbody tr:hover {
  background: #f7f9fc;
}

.app .alert {
  border-color: var(--border);
  background: #fff;
  color: var(--text);
}

.app .alert.success {
  background: #effaf2;
}

.app .alert.error {
  background: #fff2f1;
}

.app .status-active {
  border-color: #c9ead2;
  background: #edf9f0;
  color: #237a3b;
}

.app .status-broken {
  border-color: #f0caca;
}

.app .status-unknown {
  border-color: var(--border);
  background: #f3f5f8;
}

.app .status-checking {
  border-color: #f2dfb5;
  background: #fff8e8;
  color: #986a12;
}

.app .kpi-warning {
  border-color: #f2d5a1 !important;
}

.app .kpi-warning strong {
  color: #a76508;
}

.app .tool-section h3 {
  color: #879e94;
}

.toast {
  border-color: var(--border);
  background: #fff;
  color: #1d1d1b;
  box-shadow: var(--shadow-lg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.app :focus-visible {
  outline: 3px solid rgba(135, 158, 148, .45);
  outline-offset: 2px;
}

.app .brand-gradient-card,
.app .brand-font-card,
.app .brand-logo-card {
  border-color: var(--border);
  background: #fff;
}

.app .brand-portal-link {
  border-color: var(--border);
  background: #fff;
  color: #455468;
}

.app .brand-portal-link:hover,
.app .brand-logo-link:hover {
  border-color: #b6c4bd;
  background: #f5f8f6;
  color: #395448;
}

.app .brand-portal-link::after,
.app .brand-logo-link span:last-child,
.app .brand-font-download {
  color: #395448;
}

@media (max-width: 900px) {
  .app {
    display: flex;
    flex-direction: column;
  }

  .sidebar {
    position: sticky;
    inset: auto;
    width: 100%;
    min-height: auto;
    max-height: none;
    height: auto;
    top: 0;
    z-index: 20;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .content {
    width: auto;
    margin-left: 0;
  }

  .sidebar-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .logo {
    margin: 0 4px;
  }

  .logo img {
    width: 40px;
    height: 40px;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: #34445a;
    cursor: pointer;
  }

  .nav-toggle:hover {
    border-color: #b6c4bd;
    background: #f5f8f6;
    color: #395448;
  }

  .nav-toggle svg {
    width: 22px;
    height: 22px;
  }

  .sidebar nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 100%;
    padding-top: 12px;
    overflow: visible;
  }

  .sidebar.is-open nav {
    display: flex;
  }

  .nav-section-label,
  .sidebar nav hr,
  .sidebar nav .nav-spacer {
    display: none;
  }

  .sidebar nav a {
    flex: 0 0 auto;
    width: 100%;
    min-height: 44px;
    padding: 0 10px;
  }

  .topbar {
    min-height: 60px;
    padding: 10px 20px;
  }

  .page {
    padding: 22px 20px;
  }
}

@media (max-width: 600px) {
  .topbar {
    gap: 10px;
    flex-direction: row;
    align-items: center;
    padding: 10px 14px;
  }

  .topbar-eyebrow {
    display: none;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .text-channel-control {
    align-items: stretch;
    flex-direction: column;
  }

  .text-channel-field {
    width: 100%;
  }

  .text-character-count {
    padding-bottom: 0;
  }

  .user-chip {
    min-width: 0;
    gap: 7px;
    padding-right: 9px;
  }

  .user-avatar {
    width: 32px;
    height: 32px;
  }

  .user-meta strong {
    max-width: 110px;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .user-meta small {
    max-width: 100px;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page {
    padding: 18px 14px;
  }
}

@view-transition {
  navigation: auto;
}

.app .page > h1,
.app .page > p,
.app .card,
.app .kpi,
.app .alert,
.app .tool-section,
.app .inspector-summary,
.app .inspector-tabs,
.app .inspector-panel:not([hidden]),
.app .brand-tile {
  animation: fadeSlideUp 440ms cubic-bezier(.22, 1, .36, 1) both;
}

.app .page > h1 { animation-delay: 50ms; }
.app .page > p { animation-delay: 90ms; }
.app .kpis > .kpi:nth-child(2) { animation-delay: 100ms; }
.app .kpis > .kpi:nth-child(3) { animation-delay: 150ms; }
.app .brand-grid > .brand-tile:nth-child(2) { animation-delay: 70ms; }
.app .brand-grid > .brand-tile:nth-child(3) { animation-delay: 100ms; }
.app .brand-grid > .brand-tile:nth-child(4) { animation-delay: 130ms; }
.app .brand-grid > .brand-tile:nth-child(5) { animation-delay: 160ms; }
.app .brand-grid > .brand-tile:nth-child(6) { animation-delay: 190ms; }
.app .brand-grid > .brand-tile:nth-child(n+7) { animation-delay: 220ms; }
.app .brand-details:not([hidden]) {
  animation: brandDetailsReveal 320ms cubic-bezier(.22, 1, .36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .app .page > h1,
  .app .page > p,
  .app .card,
  .app .kpi,
  .app .alert,
  .app .tool-section,
  .app .inspector-summary,
  .app .inspector-tabs,
  .app .inspector-panel,
  .app .brand-tile,
  .app .brand-details:not([hidden]) {
    animation: none;
    transition: none;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 1ms;
  }
}

.website-monitor-dashboard {
  margin: 28px 0 34px;
}

.website-monitor-dashboard-heading,
.website-monitor-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.website-monitor-dashboard-heading {
  margin-bottom: 14px;
}

.website-monitor-dashboard-heading h2 {
  margin: 0;
  font-size: 21px;
}

.website-monitor-dashboard-heading > a {
  color: var(--green-light);
  font-size: 13px;
  text-decoration: none;
}

.website-monitor-summary-grid,
.website-monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.website-monitor-summary-card {
  display: grid;
  grid-template-areas:
    "name indicator"
    "details indicator";
  grid-template-columns: minmax(0, 1fr) 12px;
  align-items: center;
  column-gap: 16px;
  row-gap: 5px;
  min-height: 82px;
  padding: 16px;
  color: var(--text);
  text-decoration: none;
}

.website-monitor-summary-name {
  grid-area: name;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
}

.website-monitor-summary-details {
  grid-area: details;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 7px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.website-monitor-summary-time,
.website-monitor-intro,
.website-monitor-empty {
  color: var(--text-muted);
  font-size: 13px;
}

.website-monitor-summary-time::before {
  content: "·";
  margin-right: 7px;
}

.website-monitor-status-dot {
  grid-area: indicator;
  align-self: center;
  justify-self: center;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #8b9490;
  box-shadow: 0 0 0 3px rgba(139, 148, 144, .12);
}

.website-monitor-status-dot.operational {
  background: #27ae60;
  box-shadow: 0 0 0 3px rgba(39, 174, 96, .14);
}

.website-monitor-status-dot.degraded {
  background: #f39c12;
  box-shadow: 0 0 0 3px rgba(243, 156, 18, .16);
}

.website-monitor-status-dot.offline {
  background: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, .14);
}

.website-monitor-status-dot.unknown {
  background: #8b9490;
  box-shadow: 0 0 0 3px rgba(139, 148, 144, .12);
}

.website-monitor-grid {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 20px;
}

.website-monitor-card {
  min-width: 0;
  padding: 20px;
}

.website-monitor-card-heading {
  align-items: center;
  margin-bottom: 18px;
}

.website-monitor-card-heading h2 {
  margin: 0 0 5px;
  font-size: 19px;
}

.website-monitor-card-heading a {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
}

.website-monitor-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}

.website-monitor-facts div {
  min-width: 0;
}

.website-monitor-facts dt {
  color: var(--text-muted);
  font-size: 11px;
}

.website-monitor-facts dd {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.website-monitor-check {
  margin-bottom: 4px;
}

.website-monitor-check:disabled {
  cursor: wait;
  opacity: .6;
}

.website-monitor-feedback {
  min-height: 18px;
  margin: 4px 0 14px;
  color: var(--text-muted);
  font-size: 12px;
}

.website-monitor-card h3 {
  margin: 18px 0 10px;
  font-size: 15px;
}

.website-monitor-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.website-monitor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.website-monitor-table th,
.website-monitor-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.website-monitor-table th {
  color: var(--text-muted);
  font-weight: 600;
}

.website-monitor-incidents {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 12px;
}

.website-monitor-notice,
.website-monitor-dashboard-empty,
.website-monitor-setup {
  padding: 18px;
}

.website-monitor-setup {
  max-width: 680px;
}

.website-monitor-setup > p,
.website-monitor-notice > p {
  color: var(--text-muted);
  line-height: 1.6;
}

.settings-monitor-panel {
  display: grid;
  gap: 12px;
}

.settings-monitor-panel > h2,
.settings-monitor-list > h3 {
  margin: 0;
  color: var(--text);
}

.settings-monitor-form {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.settings-monitor-form label {
  display: block;
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.settings-monitor-form input {
  display: block;
  width: 100%;
  margin-top: 6px;
}

.settings-monitor-form .settings-help {
  margin: 0;
}

.settings-monitor-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.settings-monitor-list > h3 {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 15px;
}

.settings-monitor-list > h3 small,
.settings-monitor-info small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
}

.settings-monitor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.settings-monitor-info {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.settings-monitor-info a {
  overflow-wrap: anywhere;
  color: var(--text-muted);
  font-size: 12px;
}

.settings-monitor-row form {
  flex: 0 0 auto;
  margin: 0;
}

.settings-monitor-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.settings-monitor-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}

.settings-monitor-empty p {
  margin: 0;
  color: var(--text-muted);
}

.shortlink-workspace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: -8px 0 20px;
  border-bottom: 1px solid var(--border);
}

.link-table-wrap {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

.shortlink-workspace-tab {
  margin-bottom: -1px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-bottom-color: var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.shortlink-workspace-tab:hover {
  color: var(--text);
  background: var(--surface);
}

.shortlink-workspace-tab.is-active {
  border-color: var(--border);
  border-bottom-color: var(--surface);
  background: var(--surface);
  color: var(--green-dark);
}

.shortlink-workspace-tab:focus-visible {
  outline: 2px solid var(--green-light);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .settings-monitor-row,
  .settings-monitor-empty {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-monitor-row form,
  .settings-monitor-row form .btn {
    width: 100%;
  }

  .settings-monitor-row .settings-monitor-actions form {
    flex: 1;
    width: auto;
  }

  .kpis {
    flex-wrap: wrap;
    gap: 12px;
  }

  .kpis > .kpi {
    flex: 1 1 140px;
    min-width: 0;
  }

  .website-monitor-dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .website-monitor-summary-card {
    min-height: 76px;
  }

  .website-monitor-card-heading {
    align-items: center;
    flex-direction: row;
  }

  .website-monitor-card {
    padding: 15px;
  }

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

.app .website-monitor-site-tabs,
.app .calculator-tabs,
.app .shortlink-workspace-tabs,
.app .if-mode-tabs,
.app .inspector-tabs,
.app .guide-choice-buttons,
.app .tasks-view-switch {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  margin: 16px 0;
  padding: 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-strong);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.app .tasks-view-switch {
  width: max-content;
  max-width: 100%;
}

.app .website-monitor-site-tab,
.app .calculator-tab,
.app .shortlink-workspace-tab,
.app .if-mode-tab,
.app .inspector-tab,
.app .guide-tab,
.app .tasks-view-switch button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}

.app .website-monitor-site-tab:hover,
.app .calculator-tab:hover,
.app .shortlink-workspace-tab:hover,
.app .if-mode-tab:hover,
.app .inspector-tab:hover,
.app .guide-tab:hover,
.app .tasks-view-switch button:hover {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.app .website-monitor-site-tab[aria-selected="true"],
.app .calculator-tab[aria-selected="true"],
.app .shortlink-workspace-tab.is-active,
.app .shortlink-workspace-tab[aria-current="page"],
.app .if-mode-tab.active,
.app .if-mode-tab[aria-selected="true"],
.app .inspector-tab.is-active,
.app .inspector-tab[aria-selected="true"],
.app .guide-tab.is-active,
.app .guide-tab[aria-selected="true"],
.app .tasks-view-switch button.is-active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  box-shadow: none;
}

.app .website-monitor-site-tab:focus-visible,
.app .calculator-tab:focus-visible,
.app .shortlink-workspace-tab:focus-visible,
.app .if-mode-tab:focus-visible,
.app .inspector-tab:focus-visible,
.app .guide-tab:focus-visible,
.app .tasks-view-switch button:focus-visible {
  outline: 2px solid var(--green-light);
  outline-offset: 2px;
}

.website-monitor-workspace {
  min-width: 0;
}

.app .website-monitor-site-tabs {
  margin-top: 12px;
}

.website-monitor-site-panel[hidden] {
  display: none !important;
}

.website-monitor-site-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.website-monitor-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.website-monitor-overview-card,
.website-monitor-period-card,
.website-monitor-chart-card,
.website-monitor-incidents-card,
.website-monitor-history {
  min-width: 0;
  margin: 0;
  padding: 16px;
}

.website-monitor-overview-card h2,
.website-monitor-period-card h2,
.website-monitor-chart-card h2,
.website-monitor-incidents-card h2 {
  margin: 0;
  font-size: 14px;
}

.website-monitor-overview-card > a {
  display: inline-block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: none;
}

.website-monitor-overview-card > p,
.website-monitor-period-card p,
.website-monitor-section-heading p {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.website-monitor-current-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.website-monitor-status-label {
  color: var(--text);
  font-size: 17px;
}

.website-monitor-overview-value {
  display: block;
  margin-top: 12px;
  color: var(--text);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.website-monitor-uptime-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.website-monitor-uptime-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.website-monitor-uptime-heading strong,
.website-monitor-period-card > strong {
  color: var(--green);
  font-size: 20px;
  white-space: nowrap;
}

.website-monitor-hour-strip {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 4px;
  margin-top: 12px;
}

.website-monitor-hour {
  display: block;
  min-width: 0;
  height: 20px;
  border-radius: 4px;
  background: #98a2b3;
}

.website-monitor-hour.operational {
  background: #27ae60;
}

.website-monitor-hour.degraded {
  background: #f39c12;
}

.website-monitor-hour.offline {
  background: #dc3545;
}

.website-monitor-hour.unknown {
  background: #98a2b3;
}

.website-monitor-hour-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 10px;
}

.website-monitor-hour-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.website-monitor-hour-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #98a2b3;
}

.website-monitor-hour-legend i.operational {
  background: #27ae60;
}

.website-monitor-hour-legend i.degraded {
  background: #f39c12;
}

.website-monitor-hour-legend i.offline {
  background: #dc3545;
}

.website-monitor-periods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.website-monitor-period-card h2 {
  margin-bottom: 10px;
}

.website-monitor-period-card > strong {
  display: block;
  margin-bottom: 8px;
}

.website-monitor-period-card small {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 11px;
}

.website-monitor-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.website-monitor-section-heading p {
  margin-top: 4px;
}

.website-monitor-section-heading .website-monitor-check {
  flex: 0 0 auto;
}

.website-monitor-response-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 150px;
  margin-top: 18px;
  padding: 0 4px;
  border-bottom: 1px solid var(--border);
}

.website-monitor-response-bar {
  flex: 1 1 0;
  min-width: 2px;
  min-height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--green-light);
  transition: height 180ms ease;
}

.website-monitor-response-bar.is-empty {
  background: var(--border-strong);
}

.website-monitor-chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 10px;
}

.website-monitor-response-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 11px;
}

.website-monitor-response-stats span {
  display: grid;
  gap: 3px;
}

.website-monitor-response-stats strong {
  color: var(--text);
  font-size: 15px;
}

.website-monitor-chart-card .website-monitor-feedback {
  min-height: 0;
  margin: 6px 0 0;
}

.website-monitor-incidents-card h2 {
  margin-bottom: 10px;
}

.website-monitor-history summary {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.website-monitor-history .website-monitor-table-wrap {
  margin-top: 10px;
}

@media (max-width: 900px) {
  .website-monitor-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .website-monitor-uptime-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .app .website-monitor-site-tab,
  .app .calculator-tab,
  .app .shortlink-workspace-tab,
  .app .if-mode-tab,
  .app .inspector-tab,
  .app .guide-tab,
  .app .tasks-view-switch button {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .website-monitor-overview,
  .website-monitor-periods {
    grid-template-columns: minmax(0, 1fr);
  }

  .website-monitor-uptime-card {
    grid-column: auto;
  }

  .website-monitor-response-chart {
    gap: 2px;
    height: 120px;
  }

  .website-monitor-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .website-monitor-response-stats {
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app .website-monitor-site-tab,
  .app .calculator-tab,
  .app .shortlink-workspace-tab,
  .app .if-mode-tab,
  .app .inspector-tab,
  .app .guide-tab,
  .app .tasks-view-switch button,
  .website-monitor-response-bar {
    transition: none;
  }
}
