/* ==========================================================================
   SnelHerstel — Garage Dashboard
   Los, zelfstandig stylesheet (bedoeld voor subdomein, bv. garage.snelherstel.nl)
   Herhaalt de design tokens van de hoofdsite zodat dit bestand op zichzelf kan
   draaien zonder afhankelijk te zijn van style.css.
   ========================================================================== */
:root {
  --brand-50: #E5F2FC;
  --brand-100: #CFE7FA;
  --brand-500: #3E93E6;
  --brand-600: #2783DE;
  --brand-700: #1E68B3;

  --stone-50: #F9F8F7;
  --stone-100: #F0EFED;
  --stone-200: #E6E5E3;
  --stone-300: #D6D3CE;
  --stone-400: #AFAAA2;
  --stone-500: #7D7A75;
  --stone-600: #5E5C57;
  --stone-700: #44423F;
  --stone-800: #2C2C2B;
  --stone-900: #1C1B1A;

  --green-50: #E8F1EC;
  --green-600: #46A171;
  --green-700: #357D57;
  --orange-50: #FBEBDE;
  --orange-600: #D5803B;
  --orange-700: #B0632A;
  --red-50: #FCE9E7;
  --red-600: #E56458;
  --red-700: #C14539;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(28, 27, 26, .05), 0 4px 12px rgba(28, 27, 26, .04);
  --shadow-md: 0 2px 4px rgba(28, 27, 26, .06), 0 8px 24px rgba(28, 27, 26, .06);
  --sidebar-w: 248px;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--stone-800);
  background: var(--stone-50);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

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

.small {
  font-size: 13px;
}

.tiny {
  font-size: 12px;
}

/* ---------- App shell ---------- */
.g-app {
  display: flex;
  min-height: 100vh;
}

.g-sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: #fff;
  color: var(--stone-600);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--stone-200);
}

.g-brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 17px;
  color: var(--stone-900);
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand-600);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex: none;
  font-family: monospace;
}

.text-brand-600 {
  color: var(--brand-600);
}

.g-brand-sub {
  font-size: 11.5px;
  color: var(--stone-500);
  padding-left: 2px;
}

.g-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--stone-600);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease;
}

.g-nav-item .ic {
  width: 18px;
  text-align: center;
  flex: none;
  font-size: 15px;
}

.g-nav-item .label {
  flex: 1;
}

.g-nav-item:hover {
  background: var(--stone-100);
  color: var(--stone-900);
}

.g-nav-item.active {
  color: var(--brand-700);
}

.g-nav-item .pill,
.g-sub-item .pill {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--orange-600);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.g-nav-item .pill.show,
.g-sub-item .pill.show {
  display: flex;
}

.g-sidebar-footer {
  margin-top: auto;
  padding: 10px;
  font-size: 11.5px;
  color: var(--stone-400);
}

.g-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.g-topbar {
  height: 66px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid var(--stone-200);
  position: sticky;
  top: 0;
  z-index: 5;
}

.g-search {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--stone-100);
  border: 1px solid var(--stone-200);
  border-radius: 999px;
  padding: 9px 16px;
  width: 360px;
  max-width: 45vw;
}

.g-search svg {
  flex: none;
  color: var(--stone-400);
}

.g-search input {
  border: none;
  background: none;
  outline: none;
  font-size: 13.5px;
  color: var(--stone-800);
  width: 100%;
  font-family: inherit;
}

.g-search input::placeholder {
  color: var(--stone-400);
}

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

.g-topbar .who .av {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: var(--brand-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex: none;
}

.g-topbar .who .name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--stone-800);
}

.g-topbar .who .role {
  display: block;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--stone-500);
}

.g-content {
  padding: 28px;
  max-width: 1180px;
}

.page-head {
  margin-bottom: 22px;
}

.page-head b {
  font-size: 21px;
  display: block;
  color: var(--stone-900);
}

.page-head span {
  font-size: 13.5px;
  color: var(--stone-500);
}

/* ---------- Sidebar submenu (Reparaties) ---------- */
.g-subnav {
  display: flex;
  flex-direction: column;
  margin: 2px 0 6px 23px;
  padding-left: 15px;
  border-left: 1px solid var(--stone-200);
}

.g-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: var(--stone-500);
  font-size: 13px;
  font-weight: 500;
}

.g-sub-item:hover {
  background: var(--stone-100);
  color: var(--stone-900);
}

.g-sub-item.active {
  color: var(--brand-700);
}

.g-sub-item .pill {
  margin-left: auto;
}

/* ---------- Generic card / kv ---------- */
.card {
  background: #fff;
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-lg);
}

.card-pad {
  padding: 18px;
}

.section-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--stone-500);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 22px 0 10px;
}

.kv {
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
}

.kv .row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 16px;
  font-size: 13.5px;
  border-top: 1px solid var(--stone-100);
}

.kv .row:first-child {
  border-top: none;
}

.kv .k {
  color: var(--stone-500);
}

.kv .v {
  color: var(--stone-800);
  font-weight: 500;
  text-align: right;
}

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

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--stone-300);
  color: var(--stone-600);
  background: #fff;
}

.tag.on {
  border-color: var(--brand-500);
  color: var(--brand-700);
}

/* ---------- Buttons ---------- */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
}

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

.btn-primary:hover {
  background: var(--brand-700);
}

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

.btn-secondary:hover {
  border-color: var(--stone-500);
}

/* ---------- Openstaande aanvragen: overzicht (cards) + detail ---------- */
.view {
  display: none;
}

.view.active {
  display: block;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--stone-600);
  margin-bottom: 18px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

.back-link:hover {
  color: var(--brand-700);
}

.req-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.repair-card {
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-xl);
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .2s ease, transform .2s ease;
}

.repair-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.repair-card.locked {
  cursor: default;
}

.repair-card.locked:hover {
  box-shadow: none;
  transform: none;
}

.repair-photos {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2px;
  height: 168px;
}

.repair-photos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.optie-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--orange-50);
  color: var(--orange-700);
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--stone-100);
}

.optie-banner svg {
  flex: none;
}

.repair-body {
  padding: 18px 20px 20px;
}

.repair-body h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--stone-900);
}

.repair-meta {
  font-size: 12px;
  color: var(--stone-500);
  margin-top: 4px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--stone-500);
  padding: 7px 0;
  border-top: 1px solid var(--stone-100);
}

.spec-row span:last-child {
  color: var(--stone-800);
  font-weight: 500;
}

.damage-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.damage-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13.5px;
  color: var(--stone-700);
}

.damage-list li svg {
  flex: none;
  margin-top: 3px;
  color: var(--orange-700);
}

.btn-block {
  width: 100%;
}

.eyebrow-orange {
  color: var(--orange-700);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  font-size: 11.5px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.photo-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--stone-200);
  aspect-ratio: 4/3;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(28, 27, 26, .65);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13.5px;
  color: var(--stone-700);
  padding: 6px 0;
  cursor: pointer;
}

.check-row input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--brand-600);
  flex: none;
}

.locked-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 30px;
  color: var(--stone-500);
  gap: 10px;
}

.locked-panel .ic {
  font-size: 28px;
}

/* ---------- Tables (actief / historie / facturatie) ---------- */
.g-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.g-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--stone-500);
  background: var(--stone-50);
  padding: 11px 16px;
  border-bottom: 1px solid var(--stone-200);
}

.g-table td {
  padding: 13px 16px;
  font-size: 13.5px;
  border-top: 1px solid var(--stone-100);
  vertical-align: middle;
}

.g-table tr:first-child td {
  border-top: none;
}

.g-table td.amount {
  font-weight: 700;
  color: var(--stone-900);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.status-pill.info {
  color: var(--brand-700);
}

.status-pill.warning {
  background: var(--orange-50);
  color: var(--orange-700);
}

.status-pill.good {
  background: var(--green-50);
  color: var(--green-700);
}

.status-pill.critical {
  background: var(--red-50);
  color: var(--red-700);
}

/* ---------- Status overzicht ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width:900px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-tile {
  background: #fff;
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.stat-tile .lbl {
  font-size: 12.5px;
  color: var(--stone-500);
  font-weight: 600;
}

.stat-tile .num {
  font-size: 26px;
  font-weight: 700;
  color: var(--stone-900);
  margin-top: 6px;
  letter-spacing: -.01em;
}

.stat-tile .delta {
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stat-tile .delta.up {
  color: var(--green-700);
}

.stat-tile .delta.flat {
  color: var(--stone-500);
}

.g-grid-2 {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 20px;
}

@media (max-width:900px) {
  .g-grid-2 {
    grid-template-columns: 1fr;
  }
}

.status-bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--stone-100);
}

.status-bar span {
  height: 100%;
}

.status-legend {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 14px;
}

.status-legend .item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
}

.status-legend .dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex: none;
}

.status-legend .item b {
  margin-left: auto;
  color: var(--stone-900);
}

.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  gap: 11px;
  padding: 12px 0;
  border-top: 1px solid var(--stone-100);
}

.activity-item:first-child {
  border-top: none;
}

.activity-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-top: 6px;
  flex: none;
}

.activity-item .txt {
  font-size: 13.5px;
  color: var(--stone-800);
}

.activity-item .when {
  font-size: 12px;
  color: var(--stone-500);
  margin-top: 2px;
}

/* ---------- Instellingen ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

.field-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 0;
  border-top: 1px solid var(--stone-100);
}

.field-row:first-child {
  border-top: none;
}

.field-row label {
  font-size: 12px;
  font-weight: 600;
  color: var(--stone-500);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.field-row .val {
  font-size: 14px;
  color: var(--stone-900);
  font-weight: 500;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-top: 1px solid var(--stone-100);
}

.toggle-row:first-child {
  border-top: none;
}

.toggle-row .t {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--stone-800);
}

.toggle-row .d {
  font-size: 12px;
  color: var(--stone-500);
  margin-top: 2px;
}

.switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: none;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .track {
  position: absolute;
  inset: 0;
  background: var(--stone-300);
  border-radius: 999px;
  transition: background .15s ease;
}

.switch .track::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 999px;
  transition: transform .15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}

.switch input:checked+.track {
  background: var(--brand-600);
}

.switch input:checked+.track::before {
  transform: translateX(16px);
}

.save-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

.saved-note {
  font-size: 12.5px;
  color: var(--green-700);
  font-weight: 600;
  display: none;
}

.saved-note.show {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}