/* AES Modelling Schedule Generator — shares look & feel with the Site Builder. */
:root {
  --bg: #f2f2f2;
  --surface: #fff;
  --text: #1a1a1a;
  --muted: #666;
  --border: #e0e0e0;
  --border-light: #eeeeee;
  --accent: #009B8D;
  --accent-light: #e0f5f3;
  --accent-hover: #007a6e;
  --brand-green: #8DC63F;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --red: #c0392b;
  --red-bg: #fee2e2;
  --blue: #0077B6;
  --blue-bg: #e0f0fb;
  --pass: #16a34a;
  --pass-bg: #dcfce7;
  --radius: 8px;
  --radius-sm: 5px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
.mono { font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace; }

.topbar {
  background: #fff;
  height: 68px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--border);
  border-bottom: 3px solid var(--brand-green);
}
.topbar .brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
}
.topbar .brand img { height: 40px; width: auto; display: block; }
.topbar .tagline {
  font-size: 12px;
  color: var(--muted);
  border-left: 1px solid var(--border);
  padding-left: 16px;
  margin-left: 4px;
}
.topbar .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
.status-pill {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--border-light);
  color: var(--muted);
}
.status-pill.ready { background: var(--accent-light); color: var(--accent); }
.status-pill.busy { background: var(--amber-bg); color: var(--amber); }
.status-pill.error { background: var(--red-bg); color: var(--red); }
.status-pill.build-pill {
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  letter-spacing: 0;
  cursor: help;
  background: transparent;
  color: #999;
  border: 1px solid var(--border);
}

main { padding: 24px; max-width: 1200px; margin: 0 auto; }
h2 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  border-top: 3px solid var(--brand-green);
}

.row { display: flex; flex-wrap: wrap; gap: 16px; }
.row > * { flex: 1; min-width: 200px; }

label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
}
input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 9px 16px;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
.btn-secondary:hover:not(:disabled) { background: var(--accent-light); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-lg { font-size: 14px; padding: 11px 22px; }
.btn-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}
.drop-zone.active {
  border-color: var(--accent);
  background: var(--accent-light);
}
.drop-zone-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.drop-zone-sub { font-size: 13px; color: var(--muted); }

.uploaded-files {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.uploaded-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.uploaded-file .name { flex: 1; font-family: 'IBM Plex Mono', monospace; }
.uploaded-file .meta { color: var(--muted); }
.uploaded-file .pill {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.stat .num { font-size: 24px; font-weight: 700; color: var(--accent); line-height: 1; }
.stat .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-top: 6px; }

/* EPC band horizontal stacked bar — sits below the summary tiles. */
.epc-bar-wrap {
  grid-column: 1 / -1;   /* span full width of the summary grid */
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.epc-bar-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 600;
}
.epc-bar {
  display: flex;
  width: 100%;
  height: 28px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.epc-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #1a1a1a;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
  gap: 4px;
}
.epc-seg .epc-count {
  font-weight: 500;
  font-size: 11px;
  opacity: 0.85;
}
.epc-seg.epc-unknown {
  background: repeating-linear-gradient(45deg, #ddd, #ddd 6px, #eee 6px, #eee 12px);
  color: #555;
}

.msg {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
}
.msg.info { background: var(--blue-bg); color: var(--blue); }
.msg.warn { background: var(--amber-bg); color: var(--amber); }
.msg.error { background: var(--red-bg); color: var(--red); }
.msg.ok { background: var(--pass-bg); color: var(--pass); }

.warnings-list {
  margin-top: 8px;
  font-size: 12px;
  color: var(--amber);
  font-family: 'IBM Plex Mono', monospace;
  max-height: 180px;
  overflow-y: auto;
}
.warnings-list div { padding: 2px 0; }

.progress {
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  font-size: 11px;
  background: #1a1a1a;
  color: #e5e5e5;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
  margin-top: 12px;
}

.hidden { display: none !important; }
.small-muted { font-size: 11px; color: var(--muted); }
.spacer { flex: 1; }
