* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f5f7;
  margin: 0;
  color: #1a1a1a;
}

.screen { min-height: 100vh; }
.hidden { display: none !important; }

/* Login/register scherm */
#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
}
.card {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  width: 320px;
  text-align: center;
}
.card h1 { margin: 0 0 4px; }
.subtitle { color: #666; margin: 0 0 24px; }
.card input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}
.button-row { display: flex; gap: 8px; margin-top: 8px; }
.error { color: #c0392b; font-size: 13px; min-height: 18px; }

/* Algemene knoppen */
button {
  background: #2563eb;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  flex: 1;
}
button:hover { background: #1d4ed8; }
button.secondary { background: #e5e7eb; color: #1a1a1a; }
button.secondary:hover { background: #d1d5db; }
button.small { flex: none; padding: 6px 12px; }
button.danger { background: #dc2626; }
button.danger:hover { background: #b91c1c; }

/* Hoofdscherm */
header {
  background: white;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
}
header h1 { margin: 0; font-size: 20px; }

.toolbar {
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#breadcrumbs { font-size: 14px; color: #555; }
#breadcrumbs span { cursor: pointer; color: #2563eb; }
.toolbar-actions { display: flex; gap: 8px; }
.upload-dropdown { position: relative; }
.upload-dropdown > button {
  background: #2563eb;
  padding: 10px 16px;
  border-radius: 8px;
}
.upload-dropdown > button:hover { background: #1d4ed8; }
.upload-dropdown.disabled { pointer-events: none; opacity: 0.6; }
.upload-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  z-index: 10;
  min-width: 170px;
}
.upload-menu-item {
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  color: #1a1a1a;
  cursor: pointer;
  white-space: nowrap;
}
.upload-menu-item:hover { background: #f4f5f7; }

.upload-progress {
  margin: 0 32px 12px;
  padding: 8px 16px;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 8px;
  font-size: 13px;
}

table {
  width: calc(100% - 64px);
  margin: 0 32px;
  background: white;
  border-collapse: collapse;
  border-radius: 8px;
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}
th { color: #888; font-weight: 500; }
tr.row:hover { background: #f9fafb; }
.name-cell { cursor: pointer; }
.name-cell:hover { text-decoration: underline; }
.empty { text-align: center; color: #999; margin-top: 24px; }

/* Bestand-viewer / editor */
.viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.viewer-box {
  background: white;
  border-radius: 12px;
  width: min(700px, 90vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
}
.viewer-header button { flex: none; }
.viewer-body {
  padding: 16px 20px;
  overflow: auto;
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
}
.viewer-body img {
  max-width: 100%;
  max-height: 60vh;
  margin: 0 auto;
  border-radius: 6px;
}
.viewer-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  background: rgba(0, 0, 0, 0.45);
}
.viewer-nav-btn:hover { background: rgba(0, 0, 0, 0.65); }
#viewer-prev { left: 8px; }
#viewer-next { right: 8px; }
.viewer-body textarea {
  width: 100%;
  min-height: 400px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  line-height: 1.5;
}
.viewer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid #e5e7eb;
}
.viewer-footer #viewer-status { font-size: 13px; color: #16a34a; }
.viewer-footer button { flex: none; }
.viewer-footer-actions { display: flex; gap: 8px; }
#viewer-unsupported { color: #999; margin: auto; }

/* Uploadresultaat-schermpje */
.upload-result-box { width: min(480px, 90vw); }
.upload-result-body {
  flex-direction: column;
  align-items: stretch;
  text-align: left;
}
#upload-result-summary { margin: 0 0 8px; font-size: 14px; }
.upload-result-list {
  max-height: 260px;
  overflow-y: auto;
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: #dc2626;
}
.upload-result-list li { padding: 2px 0; word-break: break-all; }
