:root {
  color-scheme: light;
  --background: #fafafa;
  --surface: #ffffff;
  --surface-soft: #fafafa;
  --foreground: #18181b;
  --muted: #71717a;
  --border: #e4e4e7;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-soft: #ecfdf5;
  --blue: #104e8b;
  --blue-soft: #eff6ff;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 8px 24px rgba(0, 0, 0, .035);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden], .hidden { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--background); color: var(--foreground); }
button, input { font: inherit; }
svg { width: 18px; height: 18px; stroke-width: 2; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(228, 228, 231, .8);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(1280px, 100%);
  min-height: 64px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-block, .back-link, .module-badge, .metric-card, .actions, .download, button, .status {
  display: flex;
  align-items: center;
}

.brand-block { min-width: 0; gap: 12px; }
.back-link {
  min-height: 36px;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 11px;
  background: #fff;
  color: #3f3f46;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.back-link:hover { background: #fafafa; }
.back-link svg { width: 16px; height: 16px; }
.header-divider { width: 1px; height: 32px; background: var(--border); }
.module-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--blue-soft);
  color: var(--blue);
}
.module-mark svg { width: 19px; height: 19px; }
.brand-copy { min-width: 0; }
.brand-copy p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.brand-copy h1 { margin: 1px 0 0; font-size: 18px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.module-badge {
  min-height: 34px;
  gap: 7px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 0 11px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.module-badge svg { width: 15px; height: 15px; }

.page-shell { width: min(1280px, 100%); margin: 0 auto; padding: 32px 24px 48px; }
.page-intro { margin-bottom: 24px; }
.eyebrow, .panel-kicker {
  margin: 0;
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.page-intro h2 { margin: 4px 0 0; font-size: clamp(25px, 3vw, 30px); font-weight: 600; letter-spacing: -.03em; }
.page-intro > p:last-child { max-width: 720px; margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.metric-card {
  min-height: 112px;
  gap: 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.metric-icon, .heading-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
}
.metric-icon { width: 42px; height: 42px; }
.metric-icon-blue { background: var(--blue-soft); color: var(--blue); }
.metric-icon-green { background: var(--primary-soft); color: var(--primary); }
.metric-icon-amber { background: var(--amber-soft); color: var(--amber); }
.metric-card div { display: flex; flex-direction: column; gap: 4px; }
.metric-card small { color: var(--muted); font-size: 12px; font-weight: 500; }
.metric-card strong { font-size: 25px; font-weight: 600; letter-spacing: -.03em; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 18px; align-items: start; }
.panel { border: 1px solid var(--border); border-radius: 16px; padding: 22px; background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.panel-heading.compact { margin-bottom: 16px; }
.panel-heading h2 { margin: 4px 0 0; font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.panel-heading p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.heading-icon { width: 40px; height: 40px; background: var(--primary-soft); color: var(--primary); }
.heading-icon.neutral { background: #f4f4f5; color: #52525b; }

.dropzone {
  min-height: 270px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px dashed #a1a1aa;
  border-radius: 14px;
  padding: 28px;
  background: var(--surface-soft);
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--primary); background: var(--primary-soft); }
.dropzone.dragging { transform: scale(.997); }
.dropzone input { display: none; }
.drop-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px; background: var(--blue); color: #fff; margin-bottom: 4px; box-shadow: 0 8px 18px rgba(16, 78, 139, .16); }
.drop-icon svg { width: 24px; height: 24px; }
.dropzone strong { font-size: 15px; font-weight: 600; }
.dropzone small { color: var(--muted); font-size: 12px; }
.file-types { margin-top: 7px; border: 1px solid var(--border); border-radius: 999px; padding: 5px 9px; background: #fff; color: #52525b; font-size: 10px; font-weight: 600; letter-spacing: .06em; }

.actions { gap: 10px; margin-top: 16px; flex-wrap: wrap; }
button, .download {
  min-height: 42px;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 600;
}
button { border: 1px solid var(--primary); background: var(--primary); color: #fff; cursor: pointer; }
button:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); }
button:disabled { border-color: #e4e4e7; background: #e4e4e7; color: #a1a1aa; cursor: not-allowed; }
.download { border: 1px solid #16a34a; background: #22c55e; color: #fff; text-decoration: none; }
.download:hover { background: #16a34a; }
.actions svg { width: 16px; height: 16px; }

.status { min-height: 42px; gap: 9px; margin-top: 14px; border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; background: #fafafa; color: var(--muted); font-size: 12px; line-height: 1.4; }
.status svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--blue); }

.fileList { max-height: 410px; overflow: auto; list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.fileList li { position: relative; border: 1px solid var(--border); border-radius: 9px; padding: 11px 12px 11px 38px; background: #fafafa; color: #3f3f46; font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.fileList li::before { content: ""; position: absolute; left: 13px; top: 50%; width: 14px; height: 17px; transform: translateY(-50%); border: 1.5px solid var(--blue); border-radius: 2px; background: var(--blue-soft); }
.fileList li::after { content: ""; position: absolute; left: 17px; top: calc(50% - 2px); width: 6px; height: 1.5px; background: var(--blue); box-shadow: 0 4px 0 var(--blue); }

@media (max-width: 850px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .metric-card { min-height: 90px; }
}

@media (max-width: 640px) {
  .header-inner { padding: 12px 16px; }
  .header-divider, .module-badge { display: none; }
  .back-link span { display: none; }
  .brand-copy h1 { font-size: 15px; }
  .page-shell { padding: 24px 16px 38px; }
  .panel { padding: 18px; }
  .dropzone { min-height: 230px; padding: 22px 16px; }
  .actions { flex-direction: column; align-items: stretch; }
  button, .download { width: 100%; }
}
