* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  color: #222;
  background: #fafafa;
}

a { color: #0366d6; text-decoration: none; }
a:hover { text-decoration: underline; }

header { display: flex; align-items: baseline; gap: 24px; margin-bottom: 24px; }
header h1 { margin: 0; font-size: 24px; }
header a { color: inherit; }
header a:hover { text-decoration: none; }
header .auth-box { margin-left: auto; font-size: 14px; color: #555; display: flex; align-items: center; gap: 12px; }
header .auth-user { color: #555; display: inline-flex; align-items: center; gap: 6px; }
.badge-admin {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  background: #fef3c7;
  color: #854d0e;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge-manager {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  background: #dbeafe;
  color: #1e3a8a;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tr.onboard-pending td { background: #fff7ed; }
tr.maintenance-row td { background: #fef2f2; border-left: 3px solid #dc2626; }
tr.maintenance-row td:first-child { border-left: 3px solid #dc2626; }
.onboard-folder-list { margin: 0; padding-left: 16px; font-size: 12px; color: #555; }
.onboard-folder-list li { margin: 2px 0; }
.cmd-copy {
  display: inline-block;
  padding: 3px 8px;
  background: #f0f0f0;
  border: 1px dashed #bbb;
  border-radius: 4px;
  font-size: 12px;
  user-select: all;
  cursor: pointer;
}
.cmd-copy:hover { background: #e6e6e6; }

nav.tabs { display: flex; gap: 4px; }
nav.tabs a {
  padding: 6px 14px;
  border-radius: 6px;
  color: #555;
  font-weight: 500;
  font-size: 14px;
}
nav.tabs a:hover { background: #eee; text-decoration: none; }

.btn {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 6px;
  background: #0366d6;
  color: #fff !important;
  font-weight: 500;
  font-size: 14px;
}
.btn:hover { background: #0350a0; text-decoration: none; }

.btn-link {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}
.btn-link:hover { color: #555; text-decoration: underline; }

.row-actions { display: inline-flex; gap: 10px; align-items: center; }
.row-actions form { margin: 0; }

.fleet-overview {
  display: flex;
  gap: 32px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 14px 22px;
  margin-bottom: 24px;
}
.fleet-block { display: flex; flex-direction: column; gap: 2px; }
.fleet-num { font-size: 22px; font-weight: 600; color: #222; }
.fleet-num a { color: inherit; }
.fleet-num-sub { color: #999; font-weight: 400; font-size: 16px; }
.fleet-label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.06em; }
.fleet-free-high { color: #16a34a; }
.fleet-free-medium { color: #ca8a04; }
.fleet-free-low { color: #dc2626; }
.fleet-free-none { color: #999; }

.gpu-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.gpu-badge-high { background: #dcfce7; color: #166534; }
.gpu-badge-medium { background: #fef3c7; color: #854d0e; }
.gpu-badge-low { background: #fee2e2; color: #991b1b; }
.gpu-badge-none { background: #f4f4f4; color: #777; }
.gpu-extra { color: #888; margin-left: 6px; }

.summary { background: #fff; padding: 12px 16px; border-radius: 6px; border: 1px solid #eee; }
.summary p { margin: 0; font-size: 16px; }
.cmdline { font-size: 11px; word-break: break-all; }

.reservation-form { display: flex; flex-direction: column; gap: 12px; padding: 12px 0; }
.reservation-form .row { display: flex; gap: 16px; align-items: end; flex-wrap: wrap; }
.reservation-form .submit-row { justify-content: flex-start; padding-top: 4px; }
.reservation-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #555; }
.reservation-form input, .reservation-form select {
  padding: 6px 8px; border: 1px solid #ddd; border-radius: 4px;
  font-size: 14px; background: #fff; min-width: 160px;
}
.reservation-form .note-field { flex: 1; }
.reservation-form .note-field input { width: 100%; min-width: 0; }
.reservation-form .quick { display: flex; gap: 4px; padding-bottom: 1px; }

.checkbox-group-label { flex: 1; }
.gpu-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 6px 0;
}
.gpu-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  flex-direction: row;
}
.gpu-checkbox input[type="checkbox"] {
  margin: 0;
  min-width: 0;
  cursor: pointer;
}
.gpu-checkbox:hover { background: #f7f7f7; }
.gpu-checkbox:has(input:checked) {
  border-color: #0366d6;
  background: #f0f7ff;
}
.gpu-name { color: #888; font-size: 11px; }
.btn-light {
  background: #f0f0f0; border: 1px solid #ddd; padding: 4px 10px;
  border-radius: 4px; font-size: 13px; cursor: pointer; color: #555;
}
.btn-light:hover { background: #e6e6e6; }

/* Gantt-style timeline on /reservations */
.timeline {
  position: relative;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 0;
  overflow: hidden;
}
.tl-axis, .tl-row { display: flex; align-items: stretch; }
.tl-axis { border-bottom: 1px solid #eee; height: 32px; }
.tl-row { border-bottom: 1px solid #f4f4f4; height: 30px; }
.tl-row:last-child { border-bottom: none; }
.tl-label-col {
  flex: 0 0 200px; padding: 0 10px; display: flex; align-items: center;
  border-right: 1px solid #eee; background: #fafafa;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl-label-col small { color: #444; font-size: 12px; }
.tl-bar-col { flex: 1; position: relative; min-height: 100%; }
.tl-axis-ticks { position: absolute; inset: 0; }
.tl-tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid #e8e8e8; }
.tl-tick.day { border-left: 1px solid #c8c8c8; }
.tl-tick span {
  position: absolute; top: 6px; left: 4px; font-size: 11px;
  color: #888; background: rgba(255,255,255,0.85); padding: 0 3px;
}
.tl-tick.day span { color: #555; font-weight: 500; }
.tl-track { position: absolute; inset: 4px 0; }
.tl-block {
  position: absolute; top: 0; bottom: 0;
  border-radius: 3px; padding: 0 6px;
  display: flex; align-items: center;
  opacity: 0.55; min-width: 4px;
  overflow: hidden; cursor: default;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.tl-block.active { opacity: 0.85; }
.tl-block:hover { opacity: 1; }
.tl-block-label { color: #fff; font-size: 11px; font-weight: 500; white-space: nowrap; }
.tl-now-marker {
  position: absolute; top: 32px; bottom: 0; width: 2px;
  background: #ef4444; pointer-events: none;
  margin-left: 200px;  /* offset past label column */
}
.tl-now-marker::before {
  content: "now"; position: absolute; top: -16px; left: 4px;
  font-size: 10px; color: #ef4444; font-weight: 600;
}

h2 { margin-top: 0; }
h3 { margin-bottom: 8px; }

section { margin-bottom: 24px; }

.meta { color: #666; font-size: 14px; }

code { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; background: #f0f0f0; padding: 1px 5px; border-radius: 3px; }

table { width: 100%; border-collapse: collapse; background: #fff; }
table th, table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid #eee; }
table th { background: #f5f5f5; font-weight: 600; font-size: 13px; color: #555; text-transform: uppercase; letter-spacing: 0.04em; }
table tr:last-child td { border-bottom: none; }

.dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.dot.status-online { background: #22c55e; }
.dot.status-lagging { background: #eab308; }
.dot.status-offline { background: #ef4444; }

.status-text.status-online { color: #16a34a; font-weight: 600; }
.status-text.status-lagging { color: #ca8a04; font-weight: 600; }
.status-text.status-offline { color: #dc2626; font-weight: 600; }

.load { font-variant-numeric: tabular-nums; font-weight: 500; }
.load-low { color: #16a34a; }
.load-medium { color: #ca8a04; }
.load-high { color: #dc2626; font-weight: 700; }
.load-unknown { color: #999; }

.empty { color: #666; }

tr.user-folder-only td { background: #fafafa; color: #777; }
tr.user-folder-only td strong { color: #555; font-weight: 500; }

pre {
  background: #f5f5f5;
  padding: 12px;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.4;
}

details { margin-top: 16px; }
details summary { cursor: pointer; color: #555; }

.combobox { position: relative; display: block; }
.combobox > input { width: 100%; }
.combobox-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}
.combobox-list li {
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
}
.combobox-list li:hover { background: #f0f7ff; }
.combobox-list li[hidden] { display: none; }
