:root {
  --gh-olive: #585828;
  --gh-cream: #F8F8E8;
  --gh-olive-muted: #809060;
  --gh-sage: #D8E0C0;
  --gh-sky: #D8F0F8;
  --gh-white: #FFFFFF;
  --gh-font: 'Chapeau', 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --gh-text: var(--gh-olive);
  --gh-bg: var(--gh-cream);
  --gh-surface: var(--gh-sage);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--gh-bg);
  color: var(--gh-text);
  font-family: var(--gh-font);
  font-weight: 400;
  font-size: 15px;
}

h1, h2, h3 { font-family: var(--gh-font); font-weight: 700; margin: 0; }

.gh-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  background: var(--gh-olive);
  color: var(--gh-cream);
}
.gh-brand { display: flex; align-items: center; gap: 14px; }
.gh-logo { width: 34px; height: 34px; color: var(--gh-cream); flex-shrink: 0; }
.gh-header h1 { font-size: 22px; color: var(--gh-cream); }
.gh-subtitle { margin: 2px 0 0; font-size: 12px; opacity: 0.8; }
.gh-header-right { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.gh-last-refreshed { opacity: 0.85; }

.gh-btn-ghost {
  background: transparent;
  border: 1px solid var(--gh-cream);
  color: var(--gh-cream);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: var(--gh-font);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}
.gh-btn-ghost:hover { background: rgba(248, 248, 232, 0.15); }

.gh-btn-primary {
  background: var(--gh-olive);
  color: var(--gh-cream);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-family: var(--gh-font);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.gh-btn-primary:hover { background: var(--gh-olive-muted); }

.gh-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 32px 0;
  border-bottom: 2px solid var(--gh-sage);
}
.gh-tab {
  background: transparent;
  border: none;
  color: var(--gh-olive-muted);
  font-family: var(--gh-font);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
}
.gh-tab.active { color: var(--gh-olive); background: var(--gh-sage); }

.gh-filters {
  display: flex;
  gap: 24px;
  padding: 16px 32px;
  align-items: flex-end;
}
.gh-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gh-olive-muted);
}
.gh-filters select,
.gh-filters input[type="text"] {
  font-family: var(--gh-font);
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--gh-sage);
  background: var(--gh-white);
  color: var(--gh-text);
  min-width: 220px;
}
.gh-clear {
  font-size: 12px;
  font-weight: 600;
  color: var(--gh-olive-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 7px 0;
}

.gh-main { padding: 0 32px 40px; }
.gh-loading { color: var(--gh-olive-muted); }

table.gh-table { border-collapse: collapse; width: 100%; background: var(--gh-white); border-radius: 12px; overflow: hidden; }
table.gh-table th {
  background: var(--gh-olive);
  color: var(--gh-cream);
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  position: sticky;
  top: 0;
}
table.gh-table td { padding: 8px 12px; font-size: 13px; border-bottom: 1px solid var(--gh-sage); white-space: nowrap; }
table.gh-table tr:nth-child(even) td { background: rgba(216, 224, 192, 0.35); }
.gh-table-wrap { max-height: 65vh; overflow: auto; border-radius: 12px; box-shadow: 0 1px 3px rgba(88,88,40,0.15); scrollbar-width: auto; }
.gh-table-wrap::-webkit-scrollbar { height: 12px; width: 12px; }
.gh-table-wrap::-webkit-scrollbar-thumb { background: var(--gh-olive-muted); border-radius: 8px; }

th.gh-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.gh-sortable:hover { background: var(--gh-olive-muted); }

.gh-num { text-align: right; font-variant-numeric: tabular-nums; }
.gh-total { font-weight: 700; }

.bom-level-1 { background: #585828; color: var(--gh-cream); }
.bom-level-2 { background: #6E7238; color: var(--gh-cream); }
.bom-level-3 { background: #809060; color: var(--gh-cream); }
.bom-level-4 { background: #A3AF82; }
.bom-level-5 { background: #C6D0A9; }
.bom-level-6 { background: #E4EAD3; }
.bom-level-7 { background: var(--gh-white); }

.gh-modal { position: fixed; inset: 0; background: rgba(88,88,40,0.4); display: flex; align-items: center; justify-content: center; }
.gh-modal.hidden { display: none; }
.gh-modal-card { background: var(--gh-white); border-radius: 14px; padding: 24px; width: 640px; max-width: 90vw; max-height: 80vh; overflow: auto; }
.gh-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.gh-modal-header .gh-btn-ghost { border-color: var(--gh-olive); color: var(--gh-olive); }

.status-pill { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-success { background: var(--gh-sage); color: var(--gh-olive); }
.status-error { background: #E8C9B0; color: #7A3B1E; }
.status-running { background: var(--gh-sky); color: var(--gh-olive); }

.gh-modal-hint { font-size: 13px; color: var(--gh-olive-muted); margin: 0 0 16px; line-height: 1.5; }

.gh-dropzone {
  border: 2px dashed var(--gh-sage);
  border-radius: 12px;
  padding: 32px 16px;
  text-align: center;
  color: var(--gh-olive-muted);
  font-size: 14px;
  cursor: pointer;
  background: var(--gh-bg);
}
.gh-dropzone:hover { border-color: var(--gh-olive-muted); }
.gh-dropzone.dragover { border-color: var(--gh-olive); background: var(--gh-sage); color: var(--gh-olive); }
.gh-dropzone p { margin: 0; }

.gh-filelist { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gh-filelist li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--gh-bg);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}
.gh-filelist .gh-file-remove {
  background: none;
  border: none;
  color: var(--gh-olive-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
}
.gh-filelist .gh-file-remove:hover { color: var(--gh-olive); }

.gh-sync-status { margin-top: 14px; font-size: 13px; line-height: 1.5; }
.gh-sync-status.gh-sync-error { color: #7A3B1E; }
.gh-sync-status.gh-sync-success { color: var(--gh-olive); }

.gh-modal-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.gh-btn-primary:disabled { background: var(--gh-sage); color: var(--gh-olive-muted); cursor: not-allowed; }
