:root {
  --teal: #1D9E75; --teal-light: #E1F5EE; --teal-dark: #0F6E56;
  --blue: #185FA5; --blue-light: #E6F1FB;
  --amber: #EF9F27; --amber-light: #FAEEDA;
  --red: #E24B4A; --red-light: #FCEBEB;
  --purple: #534AB7; --purple-light: #EEEDFE;
  --surface-0: #f4f4f2; --surface-1: #f9f9f8; --surface-2: #ffffff;
  --text-primary: #1a1a18; --text-secondary: #555550; --text-muted: #8a8a84;
  --border: rgba(0,0,0,0.08); --border-strong: rgba(0,0,0,0.14);
  --radius: 8px; --radius-lg: 12px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--surface-0); color: var(--text-primary); line-height: 1.6; font-size: 15px; }

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* NAV */
.nav { background: var(--surface-2); border-bottom: 0.5px solid var(--border); padding: 0 24px; display: flex; align-items: center; justify-content: space-between; height: 52px; position: sticky; top: 0; z-index: 100; }
.nav-logo { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--text-primary); text-decoration: none; }
.nav-logo-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--teal); display: flex; align-items: center; justify-content: center; }
.nav-logo-mark svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2; }
.nav-links { display: flex; gap: 4px; }
.nav-link { padding: 6px 12px; font-size: 13px; color: var(--text-secondary); border-radius: var(--radius); text-decoration: none; transition: background 0.12s; }
.nav-link:hover { background: var(--surface-1); color: var(--text-primary); text-decoration: none; }
.nav-link.active { color: var(--teal); font-weight: 500; }
.nav-right { display: flex; gap: 8px; align-items: center; }
.lang-btn { font-size: 12px; font-weight: 500; padding: 5px 12px; border-radius: var(--radius); border: 0.5px solid var(--border-strong); color: var(--text-secondary); background: transparent; cursor: pointer; transition: all 0.12s; }
.lang-btn:hover { background: var(--surface-1); }

/* LAYOUT */
.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }
.section-title { font-size: 22px; font-weight: 500; color: var(--text-primary); margin-bottom: 6px; }
.section-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 32px; }

/* CARDS */
.card { background: var(--surface-2); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 1rem; }
.card-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card-icon svg { width: 20px; height: 20px; }
.card-title { font-size: 15px; font-weight: 500; color: var(--text-primary); }
.card-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* FORM */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.field-wrap { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.field-wrap input, .field-wrap select {
  width: 100%; padding: 9px 12px; font-size: 14px;
  border: 0.5px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text-primary);
  transition: border-color 0.12s;
}
.field-wrap input:focus, .field-wrap select:focus { outline: none; border-color: var(--teal); }
.field-wrap input.field-error, .field-wrap select.field-error { border-color: var(--red); }
.field-error-msg { font-size: 11px; color: var(--red); min-height: 16px; }
.field-unit { font-size: 12px; color: var(--text-muted); position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.field-inner { position: relative; }
.field-inner input { padding-right: 40px; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: var(--radius); font-size: 13px; font-weight: 500; cursor: pointer; border: 0.5px solid var(--border-strong); background: transparent; color: var(--text-primary); transition: all 0.12s; }
.btn:hover { background: var(--surface-1); }
.btn-primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn-primary:hover { background: var(--teal-dark); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-pdf { background: #FCEBEB; color: #A32D2D; border-color: #F09595; }
.btn-excel { background: #EAF3DE; color: #27500A; border-color: #C0DD97; }
.btn-csv { background: var(--blue-light); color: #0C447C; border-color: #B5D4F4; }

/* METRICS GRID */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 1.5rem; }
.metric-card { background: var(--surface-1); border-radius: var(--radius); padding: 12px; }
.metric-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.metric-value { font-size: 22px; font-weight: 500; color: var(--text-primary); line-height: 1; }
.metric-unit { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* SCORE RING */
.score-wrap { display: flex; flex-direction: column; align-items: center; }
.score-ring { position: relative; width: 80px; height: 80px; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 500; }
.score-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* PROGRESS BAR */
.progress-wrap { margin-bottom: 8px; }
.progress-header { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.progress-bar { height: 6px; border-radius: 3px; background: var(--surface-0); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: var(--teal); transition: width 0.4s ease; }

/* TABS */
.tabs { display: flex; gap: 0; border-bottom: 0.5px solid var(--border); margin-bottom: 1.5rem; }
.tab { padding: 10px 16px; font-size: 13px; font-weight: 500; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; background: none; border-top: none; border-left: none; border-right: none; }
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--teal); border-bottom-color: var(--teal); }

/* BADGE */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.badge-teal { background: var(--teal-light); color: var(--teal-dark); }
.badge-amber { background: var(--amber-light); color: #633806; }
.badge-red { background: var(--red-light); color: #791F1F; }
.badge-gray { background: #f1efea; color: #5f5e5a; }

/* UPLOAD ZONE */
.upload-zone { border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 24px; text-align: center; cursor: pointer; transition: border-color 0.12s; }
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--teal); background: var(--teal-light); }
.upload-zone-icon { font-size: 28px; color: var(--text-muted); margin-bottom: 8px; }
.upload-zone-text { font-size: 13px; color: var(--text-secondary); }
.upload-zone-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* RESULTS SECTION */
.results-section { margin-top: 1.5rem; }
.results-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.divider { height: 0.5px; background: var(--border); margin: 1rem 0; }

/* CHART CONTAINER */
.chart-container { position: relative; height: 240px; margin-bottom: 1rem; }

/* FOOTER */
.footer { background: var(--surface-2); border-top: 0.5px solid var(--border); padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; margin-top: 48px; }
.footer-left { font-size: 12px; color: var(--text-muted); }
.footer-privacy { font-size: 12px; color: var(--teal); display: flex; align-items: center; gap: 5px; }

/* PAGE HEADER */
.page-header { background: var(--surface-2); border-bottom: 0.5px solid var(--border); padding: 28px 24px; margin-bottom: 24px; }
.page-header-inner { max-width: 960px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.page-header-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.page-header-title { font-size: 22px; font-weight: 500; color: var(--text-primary); margin-bottom: 2px; }
.page-header-sub { font-size: 13px; color: var(--text-muted); }
.back-link { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; margin-bottom: 12px; text-decoration: none; }
.back-link:hover { color: var(--text-primary); }

/* RESPONSIVE */
@media (max-width: 600px) {
  .nav-links { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .container { padding: 0 16px; }
}
