/* ============================================================
   ZYT.ESG — Shared design system
   Import in every screen: <link rel="stylesheet" href="/css/zyt.css">
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Lora:ital,wght@0,400;0,600;1,400&family=DM+Mono:wght@400;500&display=swap');

/* ── Tokens ── */
:root {
  --bg:           #F7F6F2;
  --surface:      #FFFFFF;
  --surface2:     #F0EFE9;
  --border:       #E2E0D8;
  --text:         #1A1917;
  --text-muted:   #6B6860;
  --text-light:   #9B9890;

  /* Accent — green (ZYT brand) */
  --accent:       #2D5F3F;
  --accent-light: #E6F0EA;
  --accent-mid:   #B8D5C4;

  /* Pillar colours */
  --s1:           #C75B2E;  /* Scope 1 — amber-red */
  --s1-light:     #FDF0EB;
  --s2:           #1D6FA4;  /* Scope 2 — blue */
  --s2-light:     #EBF4FB;
  --s3:           #4A8C3F;  /* Scope 3 — green */
  --s3-light:     #ECF5EB;
  --pillar-s:     #1D6FA4;  /* Social */
  --pillar-s-l:   #EBF4FB;
  --pillar-g:     #4A3F8C;  /* Governance */
  --pillar-g-l:   #F0EEFA;

  /* Status */
  --green:        #1A7A4A;
  --green-light:  #E6F5ED;
  --amber:        #B45309;
  --amber-light:  #FEF3C7;
  --red:          #B91C1C;
  --red-light:    #FEE2E2;

  /* Spacing & shape */
  --radius:       10px;
  --radius-sm:    6px;
  --shadow:       0 1px 3px rgba(0,0,0,0.07);
  --shadow-md:    0 4px 14px rgba(0,0,0,0.09);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Top nav ── */
.zyt-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.zyt-nav-left  { display: flex; align-items: center; gap: 12px; }
.zyt-nav-right { display: flex; align-items: center; gap: 10px; }
.zyt-logo { font-size: 15px; font-weight: 600; letter-spacing: -0.3px; color: var(--text); }
.zyt-logo span { color: var(--accent); }
.nav-divider { width: 1px; height: 20px; background: var(--border); }
.nav-crumb { font-size: 13px; color: var(--text-muted); }
.nav-crumb strong { color: var(--text); font-weight: 500; }
.save-indicator { font-size: 12px; color: var(--text-light); display: flex; align-items: center; gap: 5px; }
.save-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ── Page wrap ── */
.page-wrap { max-width: 860px; margin: 0 auto; padding: 32px 24px 80px; }

/* ── Buttons ── */
.btn {
  height: 38px; padding: 0 18px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 500;
  cursor: pointer; border: none;
  transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary { background: var(--accent-light); color: var(--accent); border: 1px solid var(--accent-mid); }
.btn-secondary:hover { background: #D0E8D8; }
.btn-ghost     { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-danger    { background: var(--red-light); color: var(--red); border: 1px solid #FCA5A5; }
.btn-sm        { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn-lg        { height: 48px; padding: 0 24px; font-size: 15px; border-radius: var(--radius); }

/* ── Cards / sections ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card + .card { margin-top: 14px; }
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 14px; font-weight: 600; }
.card-sub   { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.card-body  { padding: 20px; }

/* Collapsible section */
.section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.section-header { padding: 15px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; }
.section-header:hover { background: var(--bg); }
.section.collapsed .section-header { border-bottom: none; }
.section.collapsed .section-body  { display: none; }
.section-body { padding: 20px; }
.sh-left  { display: flex; align-items: center; gap: 12px; }
.sh-right { display: flex; align-items: center; gap: 10px; }
.sh-num   { width: 26px; height: 26px; background: var(--accent-light); color: var(--accent); border-radius: 50%; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sh-title { font-size: 14.5px; font-weight: 600; }
.sh-sub   { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.chevron  { font-size: 13px; color: var(--text-light); transition: transform 0.2s; }
.section.collapsed .chevron { transform: rotate(-90deg); }

/* ── Badges / tags ── */
.badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; display: inline-block; }
.badge-required  { background: var(--amber-light); color: var(--amber); }
.badge-optional  { background: var(--surface2); color: var(--text-light); }
.badge-complete  { background: var(--green-light); color: var(--green); }
.badge-auto      { background: var(--accent-light); color: var(--accent); border: 1px solid var(--accent-mid); }
.badge-s1        { background: var(--s1-light); color: var(--s1); }
.badge-s2        { background: var(--s2-light); color: var(--s2); }
.badge-s3        { background: var(--s3-light); color: var(--s3); }

/* ── Form elements ── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label  { font-size: 12.5px; font-weight: 500; color: var(--text); }
.field-hint   { font-size: 11.5px; color: var(--text-muted); }
.required-star { color: var(--red); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45,95,63,0.1);
}
input[readonly], select[readonly], textarea[readonly] {
  background: var(--surface2);
  color: var(--text-muted);
  cursor: default;
}
textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239B9890' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.input-unit-wrap { position: relative; }
.input-unit-wrap input { padding-right: 52px; }
.input-unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--text-muted); font-family: 'DM Mono', monospace; pointer-events: none; }

.form-grid   { display: grid; gap: 14px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
@media (max-width: 640px) {
  .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
}

/* ── Info / note boxes ── */
.info-box {
  display: flex; gap: 10px;
  background: var(--accent-light);
  border: 1px solid var(--accent-mid);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px; color: #1A3A28;
  margin-bottom: 16px;
}
.info-box-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.note-box  { background: var(--amber-light); border: 1px solid #FDE68A; border-radius: var(--radius-sm); padding: 11px 13px; font-size: 12.5px; color: #92400E; }
.error-box { background: var(--red-light); border: 1px solid #FCA5A5; border-radius: var(--radius-sm); padding: 11px 13px; font-size: 12.5px; color: var(--red); }

/* ── Dividers ── */
.form-divider       { height: 1px; background: var(--border); margin: 16px 0; }
.form-divider-label { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; color: var(--text-muted); font-size: 12.5px; font-weight: 500; }
.form-divider-label::before, .form-divider-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Toggle switch ── */
.toggle-switch { position: relative; display: inline-flex; width: 40px; height: 22px; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track  { position: absolute; inset: 0; background: var(--border); border-radius: 11px; transition: background 0.2s; }
.toggle-thumb  { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle-switch input:checked ~ .toggle-track { background: var(--accent); }
.toggle-switch input:checked ~ .toggle-thumb { transform: translateX(18px); }

/* ── Optional section toggle ── */
.opt-toggle { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; cursor: pointer; }
.opt-toggle input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.opt-toggle label { font-size: 13px; color: var(--text-muted); cursor: pointer; }
.opt-toggle label strong { color: var(--text); }
.opt-section { display: none; padding-top: 8px; }
.opt-section.visible { display: block; }

/* ── Action bar (fixed bottom) ── */
.action-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 14px 24px;
  display: flex; justify-content: space-between; align-items: center;
  z-index: 90;
}
.action-bar-left  { font-size: 13px; color: var(--text-muted); }
.action-bar-right { display: flex; gap: 10px; }

/* ── Spinner ── */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Scope pills (used in tables/lists) ── */
.scope-pill { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 3px; display: inline-block; }
.sp-1 { background: var(--s1-light); color: var(--s1); }
.sp-2 { background: var(--s2-light); color: var(--s2); }
.sp-3 { background: var(--s3-light); color: var(--s3); }

/* ── Accuracy tags (for emission entry screens) ── */
.accuracy-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; display: inline-flex; align-items: center; gap: 3px; }
.acc-measured  { background: #DCFCE7; color: #166534; }
.acc-estimated { background: var(--amber-light); color: var(--amber); }
.acc-calculated{ background: var(--accent-light); color: var(--accent); }

/* ── Utilities ── */
.mono { font-family: 'DM Mono', monospace; }
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.text-accent{ color: var(--accent); }
.fw-600 { font-weight: 600; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }

/* ── SGX / framework footer strip ── */
.framework-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  display: flex; gap: 18px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-muted);
  margin-top: 16px;
}
.framework-strip span { color: var(--text); font-weight: 500; }

/* ── Print styles ── */
@media print {
  .zyt-nav, .action-bar, .btn-edit { display: none !important; }
  body { background: white; }
  .page-wrap { padding: 0; max-width: 100%; }
}
