:root {
  --accent: #2d9a60;
  --accent-dark: #217849;
  --ink: #25313b;
  --muted: #687783;
  --line: #d9e0e5;
  --surface: #ffffff;
  --canvas: #f3f5f6;
  --sidebar: #202932;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
button, input { font: inherit; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20; width: 230px;
  display: flex; flex-direction: column; background: var(--sidebar); color: #fff;
}
.sidebar-brand {
  min-height: 75px; padding: 14px 19px; display: flex; align-items: center;
  color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.08);
}
.default-brand { display: flex; align-items: center; gap: 11px; }
.default-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.default-brand b { font-size: 15px; }
.default-brand small { margin-top: 3px; color: #aeb8bf; font-size: 10px; text-transform: uppercase; }
.brand-badge {
  width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 800;
}
.hail-brand { display: none; width: 198px; height: 66px; object-fit: cover; object-position: center; }
.sidebar nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar nav a {
  min-height: 42px; padding: 10px 18px; display: flex; align-items: center; gap: 11px;
  color: #c5cdd3; text-decoration: none; font-size: 13px; border-left: 3px solid transparent;
}
.sidebar nav a:hover, .sidebar nav a.active { color: #fff; background: rgba(255,255,255,.07); border-left-color: var(--accent); }
.sidebar nav i { width: 17px; text-align: center; }
.nav-label { display: block; padding: 14px 20px 6px; color: #7e8a93; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.sidebar-footer { padding: 15px 19px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-footer span { display: block; margin-bottom: 9px; color: #9eabb4; font-size: 11px; overflow-wrap: anywhere; }
.sidebar-footer a { display: flex; align-items: center; gap: 9px; color: #d2d8dc; text-decoration: none; font-size: 12px; }
main { min-height: 100vh; margin-left: 230px; }
.topbar {
  height: 58px; padding: 0 28px; display: flex; align-items: center; gap: 14px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.topbar-brand { flex: 0 0 auto; color: var(--ink); text-decoration: none; }
.topbar-default-brand { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.topbar-badge { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: #fff; background: var(--accent); font-size: 10px; font-weight: 800; }
.topbar-hail-brand { display: none; width: 154px; height: 48px; object-fit: cover; object-position: center; background: #315f36; border-radius: 4px; }
.breadcrumb { flex: 1; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb b { color: var(--ink); font-weight: 650; }
.topbar > span { color: var(--muted); font-size: 12px; }
.workspace { max-width: 1120px; margin: 0 auto; padding: 34px 38px 60px; }
.workflow-section { padding: 0 0 34px; margin-bottom: 32px; border-bottom: 1px solid var(--line); }
.workflow-section:last-child { border-bottom: 0; }
.workflow-section.disabled { opacity: .55; }
.step-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.step-number {
  width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center;
  border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 800;
}
.step-heading h2 { margin: 0; font-size: 17px; }
.step-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.source-mode-row {
  min-height: 54px; margin-bottom: 14px; padding: 8px 0; display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
.source-mode-row > div { display: flex; flex-direction: column; gap: 3px; }
.source-mode-row b { font-size: 12px; }
.source-mode-row small { color: var(--muted); font-size: 11px; }
.paper-switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.paper-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mode-option { color: #89959e; font-size: 11px; font-weight: 700; transition: color .2s; }
.mode-option.active { color: var(--ink); }
.switch-track {
  position: relative; width: 52px; height: 28px; flex: 0 0 52px; overflow: hidden;
  border: 1px solid #aab5bd; border-radius: 14px; background: #dfe5e8; transition: border-color .25s, background .25s;
}
.switch-track::before {
  content: ""; position: absolute; width: 58px; height: 58px; left: -31px; top: -16px;
  border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .28s ease-out;
}
.switch-track > span {
  position: absolute; z-index: 1; width: 22px; height: 22px; left: 2px; top: 2px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(22,35,43,.28); transition: transform .24s ease;
}
.paper-switch input:checked + .switch-track { border-color: var(--accent); background: var(--accent); }
.paper-switch input:checked + .switch-track::before { transform: scale(1.5); }
.paper-switch input:checked + .switch-track > span { transform: translateX(24px); }
.paper-switch input:focus-visible + .switch-track { outline: 3px solid rgba(45,154,96,.2); outline-offset: 2px; }
.dropzone {
  width: 100%; min-height: 118px; padding: 22px; display: flex; align-items: center; justify-content: center; gap: 15px;
  border: 1.5px dashed #9ba8b1; border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--accent); background: #f5fbf7; }
.dropzone > i { color: var(--accent); font-size: 27px; }
.dropzone > span { display: flex; flex-direction: column; text-align: left; }
.dropzone b { font-size: 14px; }
.dropzone small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.selected-files { margin-top: 10px; border-top: 1px solid var(--line); }
.selected-file-row {
  min-height: 44px; padding: 7px 4px; display: grid; grid-template-columns: 24px minmax(0, 1fr) 32px; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--line);
}
.selected-file-row > i { color: var(--accent); text-align: center; }
.selected-file-row > span { min-width: 0; display: flex; flex-direction: column; }
.selected-file-row b { font-size: 11px; overflow-wrap: anywhere; }
.selected-file-row small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.remove-file { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; }
.remove-file:hover { color: #a9292e; background: #fff1f2; }
.status { min-height: 20px; margin-top: 9px; color: var(--muted); font-size: 12px; }
.status.error { color: #a9292e; }
.status.success { color: var(--accent-dark); }
.hidden { display: none !important; }
.site-list { margin-top: 14px; background: #fff; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { padding: 9px 12px; color: #53616c; background: #f6f8f9; font-size: 10px; text-align: left; text-transform: uppercase; }
td { padding: 10px 12px; border-top: 1px solid #e6ebee; font-size: 12px; vertical-align: middle; overflow-wrap: anywhere; }
th:first-child { width: 30%; } th:nth-child(2) { width: 28%; } th:nth-child(3) { width: 13%; } th:last-child { width: 29%; }
.report-name { width: 100%; min-width: 150px; padding: 7px 8px; border: 1px solid #cbd4da; border-radius: 5px; color: var(--ink); background: #fff; }
.source-file { display: block; font-weight: 600; }
.source-layer { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.file-errors { padding: 9px 12px; color: #a9292e; background: #fff7f7; border-top: 1px solid #f0d3d5; font-size: 11px; }
.file-errors p { margin: 3px 0; }
.report-options { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; color:var(--muted); font-size:12px; font-weight:700; }
.orientation-seg { display:inline-flex; gap:3px; padding:3px; border:1px solid var(--line); border-radius:8px; background:#eef2f5; }
.orientation-seg button { padding:6px 12px; border:0; border-radius:6px; color:var(--muted); background:transparent; font:inherit; font-size:11px; font-weight:700; cursor:pointer; }
.orientation-seg button.active { color:#fff; background:var(--accent); }
.output-row { display: grid; grid-template-columns: auto minmax(180px, 1fr) auto; align-items: center; gap: 12px; }
.button {
  min-height: 38px; padding: 8px 13px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 700;
}
.button:disabled { opacity: .45; cursor: default; }
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--accent-dark); }
.button.secondary { border-color: #c8d1d7; color: var(--ink); background: #fff; }
.output-location { min-width: 0; padding: 9px 11px; color: var(--muted); background: #e9edef; border-radius: 5px; font-size: 12px; overflow-wrap: anywhere; }
.progress-list { margin-top: 13px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.progress-row { min-height: 43px; padding: 8px 12px; display: grid; grid-template-columns: 24px minmax(0,1fr) auto; align-items: center; gap: 9px; border-bottom: 1px solid #e7ecef; }
.progress-row:last-child { border-bottom: 0; }
.progress-row i { color: var(--muted); text-align: center; }
.progress-row.running i { color: #b36b16; }
.progress-row.done i { color: var(--accent); }
.progress-row.failed i { color: #a9292e; }
.progress-row b { font-size: 12px; overflow-wrap: anywhere; }
.progress-row span { color: var(--muted); font-size: 11px; }
html[data-association="hail"] { --accent: #4d873f; --accent-dark: #315f36; }
html[data-association="hail"] .default-brand { display: none; }
html[data-association="hail"] .hail-brand { display: block; }
html[data-association="hail"] .topbar-default-brand { display: none; }
html[data-association="hail"] .topbar-hail-brand { display: block; }
@media (max-width: 760px) {
  .sidebar { display: none; }
  main { margin-left: 0; }
  .topbar { padding: 0 14px; }
  .topbar > span { display: none; }
  .workspace { padding: 24px 15px 40px; }
  .source-mode-row { align-items: flex-start; flex-direction: column; }
  .output-row { grid-template-columns: 1fr; }
  .button { width: 100%; }
  th:nth-child(3), td:nth-child(3), th:nth-child(4), td:nth-child(4) { display: none; }
  th:first-child { width: 48%; } th:nth-child(2) { width: 52%; }
}
@media (max-width: 520px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .topbar-hail-brand { width: 118px; }
  .breadcrumb { min-width: 0; gap: 4px; font-size: 11px; }
  .breadcrumb b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
