/**
 * Kloek-huis Reparatieportaal — rustige, professionele stijl (zorg/woon).
 */

:root {
  --color-bg: #f4f6f8;
  --color-surface: #ffffff;
  --color-text: #1e2936;
  --color-muted: #5c6778;
  --color-border: #d8dee6;
  --color-primary: #1f5c78;
  --color-primary-soft: #e6f1f5;
  --color-accent: #2a8f6f;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(15, 35, 52, 0.07);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-primary);
}

.main-content {
  flex: 1;
  width: min(1180px, 100% - 2rem);
  margin: 0 auto;
  padding: 1.25rem 0 2.5rem;
}

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  width: min(1180px, 100% - 2rem);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 700;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #1f5c78, #2a8f6f);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.brand-text {
  letter-spacing: 0.01em;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: center;
}

.main-nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--color-muted);
  padding: 0.35rem 0.15rem;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.user-bar {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.user-name {
  font-weight: 600;
  color: var(--color-text);
}

.badge-role {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-weight: 700;
}

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  text-align: center;
  padding: 1rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.page-head,
.dashboard-intro,
.detail-head {
  margin-bottom: 1.25rem;
}

.page-head h1,
.dashboard-intro h1,
.detail-head h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
}

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

.small {
  font-size: 0.9rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-muted);
  margin: 0 0 0.25rem;
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.25rem;
}

.card-login {
  max-width: 420px;
}

.card-login h1 {
  margin-top: 0;
}

.card h2,
.card h3 {
  margin-top: 0;
}

.panel {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.panel-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.page-center {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 2rem;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tile {
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.tile-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.tile-link:hover,
.tile-link:focus-visible {
  transform: translateY(-2px);
  border-color: var(--color-primary);
}

.tile-label {
  font-size: 0.85rem;
  color: var(--color-muted);
  font-weight: 600;
}

.tile-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-primary);
}

.tile-danger .tile-value {
  color: #b42318;
}

.tile-success .tile-value {
  color: #1f7a4d;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: #f0f4f7;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
}

.data-table th a {
  color: inherit;
  text-decoration: none;
}

.data-table th a:hover {
  text-decoration: underline;
}

.data-table tbody tr:hover {
  background: #fafcfd;
}

.row-muted {
  opacity: 0.55;
}

.pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: capitalize;
  border: 1px solid transparent;
}

.urgency-spoed {
  background: #fde8e6;
  color: #b42318;
  border-color: #f5c3bc;
}

.urgency-hoog {
  background: #fff2e5;
  color: #b45309;
  border-color: #ffd6a8;
}

.urgency-normaal {
  background: #eef4f8;
  color: #1f5c78;
  border-color: #d8e4ec;
}

.urgency-laag {
  background: #f1f3f5;
  color: #5c6778;
  border-color: #e1e6eb;
}

.status-nieuw {
  background: #eef4f8;
  color: #1f5c78;
  border-color: #d8e4ec;
}

.status-in-behandeling {
  background: #e8f1fb;
  color: #174f96;
  border-color: #c7daf5;
}

.status-opdracht {
  background: #fff6e5;
  color: #8a5b00;
  border-color: #ffe0a3;
}

.status-afgerond {
  background: #e7f6ee;
  color: #1f7a4d;
  border-color: #c6ead4;
}

.status-geannuleerd {
  background: #eceff2;
  color: #5c6778;
  border-color: #d8dee6;
}

.status-default {
  background: #f1f3f5;
  color: #334155;
}

.pill-internal {
  background: #fff8e6;
  color: #946200;
  border-color: #ffe6ab;
  margin-left: 0.35rem;
}

.form .field {
  margin-bottom: 1rem;
}

.field-inline {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.field-inline input {
  margin-top: 0.2rem;
}

.field-span {
  grid-column: 1 / -1;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.filters {
  margin-bottom: 1.25rem;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.filters-grid--simple {
  grid-template-columns: 1fr;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  font: inherit;
  background: #fff;
}

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

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid #2a8f6f;
  outline-offset: 2px;
}

.hint {
  display: block;
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 0.25rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 9px;
  border: 1px solid transparent;
  padding: 0.55rem 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.95rem;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

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

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-secondary {
  background: #fff;
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn-ghost {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn-danger {
  background: #fde8e6;
  color: #9f2a22;
  border-color: #f5c3bc;
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.alert-success {
  background: #e7f6ee;
  border-color: #c6ead4;
  color: #14532d;
}

.alert-error {
  background: #fde8e6;
  border-color: #f5c3bc;
  color: #7f1d1d;
}

.alert ul {
  margin: 0;
  padding-left: 1.1rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 1.25rem;
  align-items: start;
}

.detail-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
}

.kv dt {
  font-weight: 700;
  color: var(--color-muted);
}

.kv dd {
  margin: 0;
}

.pre-wrap {
  white-space: pre-wrap;
}

.report-photo {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.comment {
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 0;
}

.comment:last-of-type {
  border-bottom: none;
}

.comment header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.comment time {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.simple-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.simple-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--color-border);
}

.back-row {
  margin-top: 1.5rem;
}

.two-pane {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.card-nested {
  margin: 1rem;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.form-inline .field {
  margin-bottom: 0;
}

.inline-form {
  display: inline;
}

.inline-form button {
  vertical-align: middle;
}

.nowrap {
  white-space: nowrap;
}

@media (max-width: 960px) {
  .detail-grid,
  .two-pane {
    grid-template-columns: 1fr;
  }

  .user-bar {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .main-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    padding: 0.5rem 0 0;
  }

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

  .header-inner {
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  .main-content {
    width: calc(100% - 1.25rem);
  }

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