/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f0f7f2; color: #1e3a2a; min-height: 100vh; }

/* ── Layout ───────────────────────────────────────────────── */
.container { max-width: 720px; margin: 0 auto; padding: 2rem 1.5rem; }
.container.wide { max-width: 1200px; }

header { margin-bottom: 2rem; }
header h1 { font-size: 1.8rem; color: #1a3d28; }
.subtitle { color: #5a8a6a; margin-top: 0.25rem; font-size: 0.95rem; }
.header-row { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 1rem; }
.header-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }

footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid #c3deca; color: #7aaa88; font-size: 0.85rem; text-align: center; }

/* ── Hero Illustration ───────────────────────────────────── */
.hero-illustration {
  margin-bottom: 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(46,158,88,0.12);
}
.hero-illustration svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ── Dropzone ─────────────────────────────────────────────── */
.dropzone {
  border: 2px dashed #a8d4b4;
  border-radius: 12px;
  background: #ffffff;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: #3a9e60;
  background: #eaf7ee;
}
.drop-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.drop-text { font-size: 1.1rem; font-weight: 600; color: #1e3a2a; }
.drop-hint { font-size: 0.88rem; color: #5a8a6a; margin-top: 0.35rem; }
.file-input { display: none; }

.file-info { margin-top: 0.75rem; padding: 0.6rem 1rem; background: #e2f4e9; border-radius: 8px; color: #2e7d4f; font-size: 0.95rem; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
  display: inline-block; margin-top: 1rem; padding: 0.7rem 1.8rem;
  background: #2e9e58; color: #fff; border: none; border-radius: 8px;
  font-size: 1rem; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: background 0.2s;
}
.btn-primary:hover:not(:disabled) { background: #247a45; }
.btn-primary:disabled { background: #a8d4b4; cursor: not-allowed; }
.btn-secondary {
  display: inline-block; padding: 0.7rem 1.4rem;
  background: #dff0e5; color: #1e3a2a; border: none; border-radius: 8px;
  font-size: 0.95rem; cursor: pointer; text-decoration: none; transition: background 0.2s;
}
.btn-secondary:hover { background: #c3deca; }

/* ── Status Banner ───────────────────────────────────────── */
.status-banner {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.5rem; border-radius: 10px; margin-bottom: 2rem; font-size: 1.05rem;
}
.status-emoji { font-size: 2rem; }
.status-counts { display: block; font-size: 0.88rem; margin-top: 0.2rem; opacity: 0.85; }
.status-legend { display: block; font-size: 0.78rem; margin-top: 0.25rem; opacity: 0.7; font-style: italic; }
.status-green  { background: #d5f5e3; border-left: 5px solid #27ae60; color: #1e6e3e; }
.status-yellow { background: #fef9e7; border-left: 5px solid #f1c40f; color: #9a7d0a; }
.status-red    { background: #fce4e4; border-left: 5px solid #e74c3c; color: #922b21; }
.status-gray   { background: #ecf0f1; border-left: 5px solid #95a5a6; color: #616a6b; }

/* ── Sections ────────────────────────────────────────────── */
section { margin-bottom: 2.5rem; }
section h2 { font-size: 1.2rem; margin-bottom: 1rem; color: #1a3d28; border-bottom: 2px solid #b2dfc0; padding-bottom: 0.4rem; }

/* ── Metrics Table ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.metrics-table {
  width: 100%; border-collapse: collapse; font-size: 0.88rem; background: #fff;
  box-shadow: 0 1px 6px rgba(46,158,88,0.1); border-radius: 8px; overflow: hidden;
}
.metrics-table th {
  background: #2e6e44; color: #fff; padding: 0.6rem 0.5rem;
  text-align: center; font-weight: 600; white-space: nowrap;
}
.metrics-table th small { font-weight: 400; opacity: 0.8; }
.metrics-table td { padding: 0.5rem; border-bottom: 1px solid #e5f2ea; }
.metrics-table tr:last-child td { border-bottom: none; }
.metrics-table tr:hover td { background: #f2faf5; }
.cell-center { text-align: center; }
.cell-num { text-align: right; font-variant-numeric: tabular-nums; font-family: 'Consolas', monospace; }

.cell-pr-green  { background: #d5f5e3 !important; color: #1e6e3e; font-weight: 600; }
.cell-pr-yellow { background: #fef9e7 !important; color: #9a7d0a; font-weight: 600; }
.cell-pr-red    { background: #fce4e4 !important; color: #922b21; font-weight: 600; }
.cell-pr-gray   { background: #ecf0f1 !important; }

.row-green td { background: #f0fdf4; }
.row-yellow td { background: #fefce8; }
.row-red td { background: #fff5f5; }
.metrics-table tr.row-green:hover td { background: #dcfce7; }
.metrics-table tr.row-yellow:hover td { background: #fef9c3; }
.metrics-table tr.row-red:hover td { background: #fee2e2; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 0.2rem 0.55rem; border-radius: 12px;
  font-size: 0.78rem; font-weight: 600; white-space: nowrap;
}
.badge-green  { background: #d5f5e3; color: #1e6e3e; }
.badge-yellow { background: #fef9e7; color: #9a7d0a; }
.badge-red    { background: #fce4e4; color: #922b21; }
.badge-gray   { background: #ecf0f1; color: #616a6b; }

/* ── Charts Grid ─────────────────────────────────────────── */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 800px) { .charts-grid { grid-template-columns: 1fr; } }
.chart-box { background: #fff; border-radius: 10px; padding: 0.75rem; box-shadow: 0 1px 6px rgba(46,158,88,0.1); border: 1px solid #d4ecdc; }

/* ── Interpretation Cards ────────────────────────────────── */
.interp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.interp-card {
  background: #fff; border-radius: 10px; padding: 1rem 1.2rem;
  box-shadow: 0 1px 6px rgba(46,158,88,0.08); border-left: 4px solid #a8d4b4;
}
.interp-green  { border-left-color: #27ae60; }
.interp-yellow { border-left-color: #f1c40f; }
.interp-red    { border-left-color: #e74c3c; }
.interp-header { display: flex; justify-content: space-between; margin-bottom: 0.4rem; }
.interp-title { font-weight: 700; font-size: 1rem; color: #1a3d28; }
.interp-date { font-size: 0.82rem; color: #7aaa88; }
.interp-status { font-weight: 600; margin-bottom: 0.35rem; font-size: 0.95rem; }
.interp-metrics { font-family: 'Consolas', monospace; font-size: 0.85rem; color: #3a6e50; margin-bottom: 0.3rem; }
.interp-rec { font-size: 0.85rem; color: #1e3a2a; margin-bottom: 0.2rem; }
.interp-ad { font-size: 0.82rem; color: #7aaa88; font-style: italic; }

/* ── Loading ─────────────────────────────────────────────── */
.loading { text-align: center; padding: 2rem; color: #5a8a6a; }
.spinner {
  width: 40px; height: 40px; margin: 0 auto 1rem;
  border: 4px solid #c3deca; border-top-color: #2e9e58;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error Box ───────────────────────────────────────────── */
.error-box {
  margin-top: 1rem; padding: 0.75rem 1rem;
  background: #fce4e4; border-radius: 8px; color: #922b21;
}

/* ── Protocol Cards ──────────────────────────────────────── */
.protocols-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.proto-card {
  background: #fff;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  box-shadow: 0 1px 6px rgba(46,158,88,0.08);
  border-left: 4px solid #a8d4b4;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.proto-green  { border-left-color: #27ae60; }
.proto-yellow { border-left-color: #f1c40f; }
.proto-red    { border-left-color: #e74c3c; }
.proto-header { display: flex; justify-content: space-between; align-items: baseline; }
.proto-title  { font-weight: 700; font-size: 1rem; color: #1a3d28; }
.proto-date   { font-size: 0.82rem; color: #7aaa88; }
.proto-status { font-size: 0.88rem; font-weight: 600; color: #1e3a2a; }
.proto-error  { font-size: 0.82rem; color: #922b21; }
.btn-proto {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.45rem 1rem;
  background: #dff0e5;
  color: #1e3a2a;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
  text-align: center;
}
.btn-proto:hover { background: #c3deca; }

/* ── Utilities ───────────────────────────────────────────── */
.hidden { display: none !important; }
