body {
  background: linear-gradient(180deg, #fff7ed 0%, #e0ecff 100%);
  background-attachment: fixed;
}

.main {
  max-width: 1200px;
  margin: 0 auto;
}

/* subnav */
.dashboard-subnav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 34px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.08);
}

.dashboard-tab {
  background: none;
  border: none;
  color: var(--text-main);
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 6px 0;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.dashboard-tab::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.dashboard-tab:hover {
  color: var(--primary);
}

.dashboard-tab:hover::after,
.dashboard-tab.active::after {
  width: 100%;
}

.dashboard-tab.active {
  color: var(--accent);
}

/* titles */
.page-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.page-title h1 {
  font-size: 2.3rem;
  line-height: 1.05;
  letter-spacing: -1px;
  color: var(--text-main);
}

.page-title h1 span {
  color: var(--accent);
}

.subtitle {
  font-size: 1rem;
  color: #4b5563;
  margin-top: 8px;
  font-family: Arial, sans-serif;
}

.timestamp {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #6b7280;
  margin-top: 10px;
  white-space: nowrap;
}

/* shared card look */
.stat-card,
.chart-card,
.table-wrap,
.tool-tile {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 24px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.stat-card:hover,
.chart-card:hover,
.tool-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.07);
  border-color: #dbe3ee;
}

/* stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

.stat-card {
  padding: 24px 22px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 4px;
  border-radius: 999px;
}

.stat-card.orange::before { background: var(--accent); }
.stat-card.green::before { background: #166534; }
.stat-card.amber::before { background: #b45309; }
.stat-card.blue::before { background: #1e3a8a; }

.stat-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-sub {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: #6b7280;
}

.stat-card.orange .stat-value { color: var(--accent); }
.stat-card.green .stat-value { color: #166534; }
.stat-card.amber .stat-value { color: #b45309; }
.stat-card.blue .stat-value { color: #1e3a8a; }

/* content cards */
.charts-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  margin-bottom: 38px;
}

.chart-card {
  padding: 22px;
}

.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin-bottom: 16px;
}

/* bar chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 190px;
  padding-top: 12px;
}

.bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  height: 100%;
}

.bar {
  width: 100%;
  max-width: 36px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-radius: 12px 12px 0 0;
  min-height: 8px;
  box-shadow: 0 8px 20px rgba(194, 65, 12, 0.18);
}

.bar-label,
.bar-val {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: #6b7280;
}

/* donut */
.donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.donut-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-name {
  flex: 1;
  color: var(--text-main);
}

.legend-count {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #6b7280;
}

/* tables */
.table-section {
  margin-bottom: 40px;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.table-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

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

.search-input,
.filter-select {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 10px 12px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-main);
  outline: none;
}

.search-input {
  min-width: 220px;
}

.search-input::placeholder {
  color: #9ca3af;
}

.search-input:focus,
.filter-select:focus,
.gm-form-group input:focus,
.gm-form-group textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.08);
}

.table-wrap {
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: transparent;
}

th {
  padding: 18px 16px 12px;
  text-align: left;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  white-space: nowrap;
}

td {
  padding: 18px 16px;
  font-size: 13px;
  border-top: 1px solid #f3f4f6;
  vertical-align: middle;
}

tbody tr:hover td {
  background: #fffdfa;
}

.loading-row td {
  text-align: center;
  padding: 26px;
  color: #6b7280;
  font-family: 'DM Mono', monospace;
}

.tool-name {
  font-weight: 700;
  color: var(--text-main);
}

.tool-name small {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: #6b7280;
  margin-top: 2px;
}

.mono {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
}

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

.borrower-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f3f4f6;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

/* badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge.beschikbaar {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}
.badge.beschikbaar .badge-dot { background: #166534; }

.badge.uitgeleend {
  background: #fff1e8;
  color: var(--accent);
  border-color: #fdba74;
}
.badge.uitgeleend .badge-dot { background: var(--accent); }

.badge.te-laat {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}
.badge.te-laat .badge-dot { background: #b91c1c; }

.badge.pending,
.badge.ingeleverd-vraag {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}
.badge.pending .badge-dot,
.badge.ingeleverd-vraag .badge-dot { background: #b45309; }

.badge.teruggegeven {
  background: #e0ecff;
  color: #1e3a8a;
  border-color: #bfdbfe;
}
.badge.teruggegeven .badge-dot { background: #1e3a8a; }

/* tool tiles */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}

.tool-tile {
  padding: 18px;
  background: rgba(255, 255, 255, 0.96);
}

.tool-tile.beschikbaar {
  box-shadow: inset 0 4px 0 #166534, 0 8px 18px rgba(0,0,0,0.04);
}
.tool-tile.uitgeleend {
  box-shadow: inset 0 4px 0 var(--accent), 0 8px 18px rgba(0,0,0,0.04);
}
.tool-tile.te-laat {
  background: #fffafa;
  box-shadow: inset 0 4px 0 #b91c1c, 0 8px 18px rgba(0,0,0,0.04);
}
.tool-tile.ingeleverd-vraag {
  background: #fffbeb;
  box-shadow: inset 0 4px 0 #b45309, 0 8px 18px rgba(0,0,0,0.04);
}

.tile-img,
.tile-img-placeholder {
  width: 100%;
  height: 120px;
  border-radius: 14px;
  margin-bottom: 12px;
}

.tile-img {
  object-fit: cover;
}

.tile-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  color: #6b7280;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
}

.tile-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.tile-meta {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* tab buttons */
.tab-bar {
  display: flex;
  gap: 4px;
}

.tab {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  border-radius: 10px;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  transition: 0.2s ease;
}

.tab.active {
  background: #e0ecff;
  color: #1e3a8a;
  border-color: #bfdbfe;
}

/* pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #6b7280;
}

.pagination-btns {
  display: flex;
  gap: 6px;
}

.page-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: var(--text-main);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  cursor: pointer;
}

.page-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* modal */
.gm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 41, 55, 0.35);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}

.gm-overlay[hidden] {
  display: none;
}

.gm-modal {
  background: #ffffff;
  border-radius: 22px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.18);
  border: 1px solid #e5e7eb;
}

.gm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 2;
}

.gm-header h2 {
  font-size: 1rem;
  color: var(--text-main);
}

.gm-sluit {
  background: none;
  border: none;
  font-size: 22px;
  color: #6b7280;
  cursor: pointer;
}

.gm-img-wrap {
  width: 100%;
  height: 180px;
  background: #f3f4f6;
  overflow: hidden;
}

.gm-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gm-no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
}

.gm-body {
  padding: 20px 22px;
}

.gm-form-group {
  margin-bottom: 14px;
}

.gm-form-group label {
  display: block;
  margin-bottom: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.gm-form-group input,
.gm-form-group textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  background: #ffffff;
  border-radius: 12px;
  padding: 10px 12px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--text-main);
}

.gm-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gm-cat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gm-cat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  cursor: pointer;
}

.gm-cat-label input {
  display: none;
}

.gm-cat-label.checked {
  background: var(--accent-soft);
  border-color: #fdba74;
  color: var(--accent);
}

.gm-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 22px;
  border-top: 1px solid #e5e7eb;
}

.gm-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  transition: 0.2s ease;
}

.gm-btn:hover {
  transform: translateY(-1px);
}

.gm-btn.opslaan {
  background: var(--accent);
  color: white;
}

.gm-btn.annuleer {
  background: #f3f4f6;
  color: var(--text-main);
  border-color: #e5e7eb;
}

.gm-btn.verwijder {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

/* inlever actions */
.inlever-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.btn-inlever {
  flex: 1;
  min-width: 80px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-inlever:hover {
  transform: translateY(-1px);
}

.btn-inlever.op-tijd {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.btn-inlever.te-laat {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

#tbody-tools-table td:last-child .inlever-actions {
  flex-direction: row;
}

/* toast */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: var(--text-main);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  z-index: 9999;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.dashboard-add-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s ease;
}

.dashboard-add-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(194, 65, 12, 0.18);
}

.geen-items {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 24px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.04);
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 22px;
}

.geen-items p {
  margin-bottom: 14px;
  color: var(--text-muted);
}

.tool-tile .inlever-actions {
  margin-top: 14px;
}

.tool-tile .btn-inlever {
  flex: 1;
}

@media (max-width: 700px) {
  .dashboard-add-btn {
    width: 100%;
  }
}

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

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

  .gm-two-col {
    grid-template-columns: 1fr;
  }

  .search-input {
    min-width: 100%;
  }
}

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

  .dashboard-subnav {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-tab {
    width: 100%;
    text-align: center;
  }
}